mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Merge pull request #9761 from peppy/fix-android-version-hash
Add fallback hash generation to fix android startup crash
This commit is contained in:
@ -36,6 +36,7 @@ using osu.Game.Rulesets.Mods;
|
|||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
|
using RuntimeInfo = osu.Framework.RuntimeInfo;
|
||||||
|
|
||||||
namespace osu.Game
|
namespace osu.Game
|
||||||
{
|
{
|
||||||
@ -134,8 +135,17 @@ namespace osu.Game
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
using (var str = File.OpenRead(typeof(OsuGameBase).Assembly.Location))
|
try
|
||||||
VersionHash = str.ComputeMD5Hash();
|
{
|
||||||
|
using (var str = File.OpenRead(typeof(OsuGameBase).Assembly.Location))
|
||||||
|
VersionHash = str.ComputeMD5Hash();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
// special case for android builds, which can't read DLLs from a packed apk.
|
||||||
|
// should eventually be handled in a better way.
|
||||||
|
VersionHash = $"{Version}-{RuntimeInfo.OS}".ComputeMD5Hash();
|
||||||
|
}
|
||||||
|
|
||||||
Resources.AddStore(new DllResourceStore(OsuResources.ResourceAssembly));
|
Resources.AddStore(new DllResourceStore(OsuResources.ResourceAssembly));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user