1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 07:43:00 +08:00

Fix version fallback logic

This commit is contained in:
Dean Herbert 2019-09-24 18:12:04 +09:00
parent 1c474de0ed
commit 07ec163daa

View File

@ -4,6 +4,7 @@
using System;
using Android.App;
using osu.Game;
using osu.Game.Updater;
namespace osu.Android
{
@ -13,10 +14,11 @@ namespace osu.Android
{
get
{
string versionName = Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Application.Context.ApplicationContext.PackageName, 0).VersionCode.ToString();
var packageInfo = Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Application.Context.ApplicationContext.PackageName, 0);
try
{
string versionName = packageInfo.VersionCode.ToString();
// undo play store version garbling
return new Version(int.Parse(versionName.Substring(0, 4)), int.Parse(versionName.Substring(4, 4)), int.Parse(versionName.Substring(8, 1)));
}
@ -24,8 +26,15 @@ namespace osu.Android
{
}
return new Version(versionName);
return new Version(packageInfo.VersionName);
}
}
protected override void LoadComplete()
{
base.LoadComplete();
Add(new SimpleUpdateManager());
}
}
}