move custom code out of non custom package

This commit is contained in:
qimiko committed 2022-05-27 18:06:33 -07:00
1 parent 96b22906f9
commit 332069bc92
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)
}
}