mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-21 16:32:39 +00:00
fix application directory
This commit is contained in:
8 files changed
+136
-1
No files matched your search
@@ -61,6 +61,15 @@ class GeometryDashActivity : ComponentActivity(), Cocos2dxHelper.Cocos2dxHelperL
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
try {
|
||||
// fixes bugs specific to the new app directory, such as package name
|
||||
LauncherFix.loadLibrary()
|
||||
LauncherFix.setOriginalDataPath(GJConstants.GJ_DATA_DIR)
|
||||
LauncherFix.setDataPath(filesDir.path)
|
||||
} catch (e: UnsatisfiedLinkError) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
System.load("$gdNativeLibraryPath/lib${GJConstants.FMOD_LIB_NAME}.so")
|
||||
System.load("$gdNativeLibraryPath/lib${GJConstants.COCOS_LIB_NAME}.so")
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package dev.xyze.geodelauncher
|
||||
|
||||
import dev.xyze.geodelauncher.utils.GJConstants
|
||||
|
||||
object LauncherFix {
|
||||
fun loadLibrary() {
|
||||
System.loadLibrary(GJConstants.LAUNCHER_FIX_LIB_NAME)
|
||||
}
|
||||
|
||||
external fun setDataPath(dataPath: String);
|
||||
|
||||
external fun setOriginalDataPath(dataPath: String);
|
||||
}
|
||||
@@ -6,4 +6,8 @@ object GJConstants {
|
||||
const val COCOS_LIB_NAME = "cocos2dcpp"
|
||||
const val FMOD_LIB_NAME = "fmod"
|
||||
const val MOD_CORE_LIB_NAME = "geode"
|
||||
const val LAUNCHER_FIX_LIB_NAME = "launcherfix"
|
||||
|
||||
// this value is hardcoded into GD
|
||||
const val GJ_DATA_DIR = "/data/data/${PACKAGE_NAME}"
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import java.util.*
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.ceil
|
||||
|
||||
@Suppress("KotlinJniMissingFunction")
|
||||
object Cocos2dxBitmap {
|
||||
private lateinit var sContext: WeakReference<Context>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.opengl.GLSurfaceView
|
||||
import javax.microedition.khronos.egl.EGLConfig
|
||||
import javax.microedition.khronos.opengles.GL10
|
||||
|
||||
@Suppress("unused")
|
||||
@Suppress("unused", "KotlinJniMissingFunction")
|
||||
class Cocos2dxRenderer : GLSurfaceView.Renderer {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
|
||||
Reference in new issue
Block a user