mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-22 08:42:38 +00:00
hi mat
This commit is contained in:
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
|
// might be split apks, select the best path for the library
|
||||||
val sourceDirs = applicationInfo.splitSourceDirs
|
val sourceDirs = applicationInfo.splitSourceDirs
|
||||||
val architecture = LaunchUtils.getApplicationArchitecture()
|
val architecture = LaunchUtils.applicationArchitecture
|
||||||
|
|
||||||
if (!sourceDirs.isNullOrEmpty()) {
|
if (!sourceDirs.isNullOrEmpty()) {
|
||||||
val configAbi = architecture.replace("-", "_")
|
val configAbi = architecture.replace("-", "_")
|
||||||
@@ -156,7 +156,7 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
|
|||||||
return true
|
return true
|
||||||
} catch (e: UnsatisfiedLinkError) {
|
} catch (e: UnsatisfiedLinkError) {
|
||||||
// but users may prefer it stored with data
|
// but users may prefer it stored with data
|
||||||
val geodeFilename = LaunchUtils.getGeodeFilename()
|
val geodeFilename = LaunchUtils.geodeFilename
|
||||||
val geodePath = File(filesDir.path, "launcher/$geodeFilename")
|
val geodePath = File(filesDir.path, "launcher/$geodeFilename")
|
||||||
if (geodePath.exists()) {
|
if (geodePath.exists()) {
|
||||||
System.load(geodePath.path)
|
System.load(geodePath.path)
|
||||||
|
|||||||
@@ -44,9 +44,7 @@ class Release(
|
|||||||
|
|
||||||
fun getAndroidDownload(): Asset? {
|
fun getAndroidDownload(): Asset? {
|
||||||
// try to find an asset that matches the architecture first
|
// try to find an asset that matches the architecture first
|
||||||
val architecture = LaunchUtils.getApplicationArchitecture()
|
val platform = LaunchUtils.platformName
|
||||||
val platform = if (architecture == "arm64-v8a")
|
|
||||||
"android64" else "android32"
|
|
||||||
|
|
||||||
val releaseSuffix = "$platform.zip"
|
val releaseSuffix = "$platform.zip"
|
||||||
return assets.find {
|
return assets.find {
|
||||||
|
|||||||
@@ -33,20 +33,18 @@ object LaunchUtils {
|
|||||||
return game.versionName
|
return game.versionName
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getApplicationArchitecture(): String {
|
// supposedly CPU_ABI returns the current arch for the running application
|
||||||
// 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
|
||||||
// despite being deprecated, this is also one of the few ways to get this information
|
@Suppress("DEPRECATION")
|
||||||
@Suppress("DEPRECATION")
|
val applicationArchitecture: String = Build.CPU_ABI
|
||||||
return Build.CPU_ABI
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getGeodeFilename(): String {
|
val platformName: String = if (applicationArchitecture == "arm64-v8a")
|
||||||
val abi = getApplicationArchitecture()
|
"android64" else "android32"
|
||||||
return "Geode.$abi.so"
|
|
||||||
}
|
val geodeFilename: String = "Geode.$platformName.so"
|
||||||
|
|
||||||
fun getInstalledGeodePath(context: Context): File? {
|
fun getInstalledGeodePath(context: Context): File? {
|
||||||
val geodeName = getGeodeFilename()
|
val geodeName = geodeFilename
|
||||||
|
|
||||||
val internalGeodePath = File(context.filesDir, "launcher/$geodeName")
|
val internalGeodePath = File(context.filesDir, "launcher/$geodeName")
|
||||||
if (internalGeodePath.exists()) {
|
if (internalGeodePath.exists()) {
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ class ReleaseManager private constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getGeodeOutputPath(): File {
|
private fun getGeodeOutputPath(): File {
|
||||||
val geodeName = LaunchUtils.getGeodeFilename()
|
val geodeName = LaunchUtils.geodeFilename
|
||||||
val geodeDirectory = LaunchUtils.getBaseDirectory(applicationContext)
|
val geodeDirectory = LaunchUtils.getBaseDirectory(applicationContext)
|
||||||
|
|
||||||
return File(geodeDirectory, geodeName)
|
return File(geodeDirectory, geodeName)
|
||||||
|
|||||||
Reference in new issue
Block a user