From 07ec163daa856235a5046d2428b2a924c41478bd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Sep 2019 18:12:04 +0900 Subject: [PATCH] Fix version fallback logic --- osu.Android/OsuGameAndroid.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/osu.Android/OsuGameAndroid.cs b/osu.Android/OsuGameAndroid.cs index aca36b59aa..a91c010809 100644 --- a/osu.Android/OsuGameAndroid.cs +++ b/osu.Android/OsuGameAndroid.cs @@ -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()); + } } } \ No newline at end of file