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:
parent
1c474de0ed
commit
07ec163daa
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user