mirror of
https://github.com/osukey/osukey.git
synced 2025-05-17 11:37:32 +09:00
Read build from VersionCode
This commit is contained in:
parent
315dcc8158
commit
c6fe8587e3
@ -9,6 +9,23 @@ namespace osu.Android
|
|||||||
{
|
{
|
||||||
public class OsuGameAndroid : OsuGame
|
public class OsuGameAndroid : OsuGame
|
||||||
{
|
{
|
||||||
public override Version AssemblyVersion => new Version(Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Application.Context.ApplicationContext.PackageName, 0).VersionName);
|
public override Version AssemblyVersion
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string versionName = Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Application.Context.ApplicationContext.PackageName, 0).VersionCode.ToString();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 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)));
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Version(versionName);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user