@@ -241,7 +241,7 @@ public void run() {
241241 });
242242 }
243243
244- public int patch (String apkPath , String baseApkPath , String persistentPath , String obbPath , String baseObbPath , String backupPath , int apkModifyModel , boolean persistentSupport , boolean obbSupport ){
244+ public int patch (String apkPath , String baseApkPath , String persistentPath , String obbPath , String baseObbPath , String backupPath , int apkModifyModel , boolean persistentSupport , boolean obbSupport ){
245245 if (apkModifyModel == HomeFragment .APK_MODIFY_MODEL_ROOT ){
246246 if (!Shell .rootAccess ()){
247247 return ModUtils .RESULT_STATE_ROOT_ERROR ;
@@ -252,7 +252,7 @@ public int patch(String apkPath, String baseApkPath, String persistentPath, Stri
252252 try {
253253 Log .d (MainApplication .LOG_TAG , "patch: apkPath=" + apkPath + ", baseApkPath=" + baseApkPath + ", apkModifyModel=" + apkModifyModel );
254254 List <Mod > mods = adapter .getMods ();
255- File fusionFile = new File (getBase ().getCacheDir ().getAbsolutePath () + "/fusion" );
255+ File fusionFile = new File (getBase ().getFilesDir ().getAbsolutePath () + "/fusion" );
256256 try {
257257 FileUtils .deleteDirectory (fusionFile );
258258 } catch (IOException e ) {
@@ -300,7 +300,7 @@ public int patch(String apkPath, String baseApkPath, String persistentPath, Stri
300300 e .printStackTrace ();
301301 }
302302 }
303- if (apkModifyModel != HomeFragment .APK_MODIFY_MODEL_NONE ){
303+ if (apkModifyModel == HomeFragment .APK_MODIFY_MODEL_VIRTUAL || apkModifyModel == HomeFragment . APK_MODIFY_MODEL_ROOT ){
304304 int result = NativeUtils .PatchApk (baseApkPath , apkPath , fusionFile .getAbsolutePath ());
305305 if (result != NativeUtils .RESULT_STATE_OK ){
306306 Log .d (MainApplication .LOG_TAG , "Patch APK File Failed: " + result + ",apkPath:" + apkPath + ",baseApkPath:" + baseApkPath );
0 commit comments