From b919736ce18be1662378f3df0182863541522251 Mon Sep 17 00:00:00 2001 From: qimiko <25387744+qimiko@users.noreply.github.com> Date: Sun, 9 Jun 2024 21:23:20 -0700 Subject: [PATCH] store the current game version --- .../main/java/com/geode/launcher/GeometryDashActivity.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/com/geode/launcher/GeometryDashActivity.kt b/app/src/main/java/com/geode/launcher/GeometryDashActivity.kt index 47c2c2a0..bbe92357 100644 --- a/app/src/main/java/com/geode/launcher/GeometryDashActivity.kt +++ b/app/src/main/java/com/geode/launcher/GeometryDashActivity.kt @@ -73,6 +73,7 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL } try { + createVersionFile() tryLoadGame() } catch (e: UnsatisfiedLinkError) { Log.e("GeodeLauncher", "Library linkage failure", e) @@ -104,6 +105,13 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL } } + private fun createVersionFile() { + val versionPath = File(filesDir, "game_version.txt") + val gameVersion = GamePackageUtils.getGameVersionCode(packageManager) + + versionPath.writeText("$gameVersion") + } + private fun returnToMain( error: LaunchUtils.LauncherError? = null, returnMessage: String? = null,