This commit is contained in:
qimiko committed 2024-01-18 13:52:00 -07:00
1 parent 53d19aaf16
commit e469948c4d
4 files changed
+13 -17

No files matched your search

@@ -129,7 +129,7 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
// might be split apks, select the best path for the library
val sourceDirs = applicationInfo.splitSourceDirs
val architecture = LaunchUtils.getApplicationArchitecture()
val architecture = LaunchUtils.applicationArchitecture
if (!sourceDirs.isNullOrEmpty()) {
val configAbi = architecture.replace("-", "_")
@@ -156,7 +156,7 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
return true
} catch (e: UnsatisfiedLinkError) {
// but users may prefer it stored with data
val geodeFilename = LaunchUtils.getGeodeFilename()
val geodeFilename = LaunchUtils.geodeFilename
val geodePath = File(filesDir.path, "launcher/$geodeFilename")
if (geodePath.exists()) {
System.load(geodePath.path)
@@ -44,9 +44,7 @@ class Release(
fun getAndroidDownload(): Asset? {
// try to find an asset that matches the architecture first
val architecture = LaunchUtils.getApplicationArchitecture()
val platform = if (architecture == "arm64-v8a")
"android64" else "android32"
val platform = LaunchUtils.platformName
val releaseSuffix = "$platform.zip"
return assets.find {
@@ -33,20 +33,18 @@ object LaunchUtils {
return game.versionName
}
fun getApplicationArchitecture(): String {
// supposedly CPU_ABI returns the current arch for the running application
// despite being deprecated, this is also one of the few ways to get this information
@Suppress("DEPRECATION")
return Build.CPU_ABI
}
// supposedly CPU_ABI returns the current arch for the running application
// despite being deprecated, this is also one of the few ways to get this information
@Suppress("DEPRECATION")
val applicationArchitecture: String = Build.CPU_ABI
fun getGeodeFilename(): String {
val abi = getApplicationArchitecture()
return "Geode.$abi.so"
}
val platformName: String = if (applicationArchitecture == "arm64-v8a")
"android64" else "android32"
val geodeFilename: String = "Geode.$platformName.so"
fun getInstalledGeodePath(context: Context): File? {
val geodeName = getGeodeFilename()
val geodeName = geodeFilename
val internalGeodePath = File(context.filesDir, "launcher/$geodeName")
if (internalGeodePath.exists()) {
@@ -211,7 +211,7 @@ class ReleaseManager private constructor(
}
private fun getGeodeOutputPath(): File {
val geodeName = LaunchUtils.getGeodeFilename()
val geodeName = LaunchUtils.geodeFilename
val geodeDirectory = LaunchUtils.getBaseDirectory(applicationContext)
return File(geodeDirectory, geodeName)