final String remountCommand="mount -o remount,rw /system";
final String copyToSystemCommand="cp "+info.sourceDir+" /system/app/FonBot.apk";
final String chmodSystemCommand="chmod 644 /system/app/FonBot.apk";
+ final String rmSystemCommand="rm /system/app/FonBot.apk";
final String copyToUserCommand="cp "+info.sourceDir+" /data/app/FonBot.apk";
final String chmodUserCommand="chmod 644 /data/app/FonBot.apk";
- final String rmCommand="rm "+info.sourceDir;
+ final String rmUserCommand="rm "+info.sourceDir;
if(isChecked){
Runtime.getRuntime().exec(new String[]{
"su", "-c",
- remountCommand+';'+copyToSystemCommand+';'+chmodSystemCommand+';'+rmCommand
+ remountCommand+';'+copyToSystemCommand+';'+chmodSystemCommand+';'+rmUserCommand
}).waitFor();
Toast.makeText(FonBotPreferenceActivity.this,
} else {
Runtime.getRuntime().exec(new String[]{
"su", "-c",
- remountCommand+';'+copyToUserCommand+';'+chmodUserCommand+';'+rmCommand
+ remountCommand+';'+copyToUserCommand+';'+chmodUserCommand+';'+rmSystemCommand
}).waitFor();
-
Toast.makeText(FonBotPreferenceActivity.this,
"Reboot to make FonBot a non-system application", Toast.LENGTH_LONG).show();
}