change code to be better

This commit is contained in:
Li 2024-04-22 13:38:21 +12:00
parent b80248c069
commit b6025df2ae
2 changed files with 5 additions and 0 deletions

View File

@ -224,6 +224,7 @@ public class NoPsmDrmInstaller extends AsyncTask<Void, Void, Void> {
try { try {
Root.setContext(ctx); Root.setContext(ctx);
killApplication("com.playstation.psstore");
if (isPsmInstalled()) { if (isPsmInstalled()) {
backupPsm(); backupPsm();

View File

@ -16,6 +16,10 @@ public class Root {
private static String busyboxBinary = null; private static String busyboxBinary = null;
private static Context ctx = null; private static Context ctx = null;
public static void killApplication(String processName) throws Shell.ShellDiedException {
Log.i("ROOT", "Killing process: " + processName);
Shell.Pool.SU.run(new String[] { busyboxBinary + " pkill '" + processName +"'" });
}
public static boolean fileExistRoot(String filename) throws Shell.ShellDiedException { public static boolean fileExistRoot(String filename) throws Shell.ShellDiedException {
Log.i("ROOT", "FileExistRoot: " + filename); Log.i("ROOT", "FileExistRoot: " + filename);
int res = Shell.Pool.SU.run(new String[] { busyboxBinary + " stat '" + filename +"'" }); int res = Shell.Pool.SU.run(new String[] { busyboxBinary + " stat '" + filename +"'" });