mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 10:22:54 +08:00
Fix version fallback logic
This commit is contained in:
parent
1c474de0ed
commit
07ec163daa
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using Android.App;
|
using Android.App;
|
||||||
using osu.Game;
|
using osu.Game;
|
||||||
|
using osu.Game.Updater;
|
||||||
|
|
||||||
namespace osu.Android
|
namespace osu.Android
|
||||||
{
|
{
|
||||||
@ -13,10 +14,11 @@ namespace osu.Android
|
|||||||
{
|
{
|
||||||
get
|
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
|
try
|
||||||
{
|
{
|
||||||
|
string versionName = packageInfo.VersionCode.ToString();
|
||||||
// undo play store version garbling
|
// 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)));
|
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