forked from geode-sdk/android-launcher
Move gd save files to external at files/save
This commit is contained in:
1 parent
c44a4f0be9
commit
20a3b640ce
1 file changed
+17
-8
@@ -64,14 +64,7 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
|
|||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
fixLauncherPath()
|
||||||
// fixes bugs specific to the new app directory, such as package name
|
|
||||||
LauncherFix.loadLibrary()
|
|
||||||
LauncherFix.setOriginalDataPath(Constants.GJ_DATA_DIR)
|
|
||||||
LauncherFix.setDataPath(filesDir.path)
|
|
||||||
} catch (e: UnsatisfiedLinkError) {
|
|
||||||
e.printStackTrace()
|
|
||||||
}
|
|
||||||
|
|
||||||
Cocos2dxHelper.init(this, this)
|
Cocos2dxHelper.init(this, this)
|
||||||
|
|
||||||
@@ -103,6 +96,22 @@ class GeometryDashActivity : AppCompatActivity(), Cocos2dxHelper.Cocos2dxHelperL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun fixLauncherPath() {
|
||||||
|
try {
|
||||||
|
// fixes bugs specific to the new app directory, such as package name
|
||||||
|
LauncherFix.loadLibrary()
|
||||||
|
getExternalFilesDir(null)?.let { dir ->
|
||||||
|
val externalPath = dir.path + File.separator + "save"
|
||||||
|
|
||||||
|
LauncherFix.setOriginalDataPath(Constants.GJ_DATA_DIR)
|
||||||
|
LauncherFix.setDataPath(externalPath)
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (e: UnsatisfiedLinkError) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressLint("UnsafeDynamicallyLoadedCode")
|
@SuppressLint("UnsafeDynamicallyLoadedCode")
|
||||||
private fun loadGeodeLibrary(): Boolean {
|
private fun loadGeodeLibrary(): Boolean {
|
||||||
// Load Geode if exists
|
// Load Geode if exists
|
||||||
|
|||||||
Reference in new issue
Block a user