mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-22 00:42:38 +00:00
move custom code out of non custom package
This commit is contained in:
4 files changed
+5
-5
No files matched your search
@@ -1,9 +0,0 @@
|
||||
package com.robtopx.geometryjump
|
||||
|
||||
object GJConstants {
|
||||
const val PACKAGE_NAME = "com.robtopx.geometryjump"
|
||||
|
||||
const val COCOS_LIB_NAME = "cocos2dcpp"
|
||||
const val FMOD_LIB_NAME = "fmod"
|
||||
const val MOD_CORE_LIB_NAME = "geode"
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.robtopx.geometryjump
|
||||
|
||||
import android.content.pm.PackageInfo
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.res.AssetManager
|
||||
|
||||
object LaunchUtils {
|
||||
fun isGeometryDashInstalled(packageManager: PackageManager): Boolean {
|
||||
return try {
|
||||
packageManager.getPackageInfo(GJConstants.PACKAGE_NAME, 0)
|
||||
true
|
||||
} catch (e: PackageManager.NameNotFoundException) {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
fun addAssetsFromPackage(assetManager: AssetManager, packageInfo: PackageInfo) {
|
||||
// this method is officially marked as deprecated but it is the only method we are allowed to reflect
|
||||
// (the source recommends replacing with AssetManager.setApkAssets(ApkAssets[], boolean) lol)
|
||||
val clazz = assetManager.javaClass
|
||||
val aspMethod = clazz.getDeclaredMethod("addAssetPath", String::class.java)
|
||||
aspMethod.invoke(assetManager, packageInfo.applicationInfo.sourceDir)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user