Make it more compatible(?)

This commit is contained in:
Li 2024-04-26 00:25:39 +12:00
parent 1bd7d90db8
commit e56db07fd7
7 changed files with 14 additions and 12 deletions

View File

@ -218,8 +218,8 @@ public class NoPsmDrmInstaller extends AsyncTask<Void, Void, Void> {
}
// unpack the library files ...
unpackResourceToLocationRoot(R.raw.libdefault, libDefaultFile, 755, "system");
unpackResourceToLocationRoot(R.raw.libpsmkdc_jni, libPsmKdcFile, 755, "system");
unpackResourceToLocationRoot(R.raw.libdefault, libDefaultFile, 755, "1000");
unpackResourceToLocationRoot(R.raw.libpsmkdc_jni, libPsmKdcFile, 755, "1000");
}
private void installDatabase() throws Exception {
String databasesFolder = new File(getPsmApp().dataDir, "databases").getAbsolutePath();

View File

@ -30,29 +30,31 @@ public class Root {
Log.i("ROOT", "TarRoot: " + src + " : "+ dst);
int res = Shell.Pool.SU.run(new String[]{busyboxBinary + " tar c '" + src + "' -f '" + dst +"'"});
if (res != 0) {
Log.e("ROOT", "error (" + String.valueOf(res) +")");
throw new IOException("Failed to tar " + src);
}
}
public static void remountRo(String foldername) throws IOException, Shell.ShellDiedException {
Log.i("ROOT", "Remounting as RO: " + foldername);
int res = Shell.Pool.SU.run(new String[] { busyboxBinary +" mount -o ro,remount '"+foldername+"'"}
);
int res = Shell.Pool.SU.run(new String[] { busyboxBinary +" mount -o ro,remount '"+foldername+"'"});
if(res != 0){
throw new IOException("Failed to remmount as RO: "+foldername);
Log.e("ROOT", "error (" + String.valueOf(res) +")");
throw new IOException("Failed to remmount: "+foldername + " ("+String.valueOf(res)+")");
}
}
public static void remountRw(String foldername) throws IOException, Shell.ShellDiedException {
Log.i("ROOT", "Remounting as RW: " + foldername);
int res = Shell.Pool.SU.run(new String[] { busyboxBinary +" mount -o rw,remount '"+foldername+"'"}
);
int res = Shell.Pool.SU.run(new String[] { busyboxBinary +" mount -o rw,remount '"+foldername+"'"});
if(res != 0){
throw new IOException("Failed to remmount as RW: "+foldername);
Log.e("ROOT", "error (" + String.valueOf(res) +")");
throw new IOException("Failed to remmount: "+foldername + " ("+String.valueOf(res)+")");
}
}
public static void moveFileRoot(String filename, String destFilename) throws IOException, Shell.ShellDiedException {
Log.i("ROOT", "MoveRoot: " + filename + " : "+ destFilename);
int res = Shell.Pool.SU.run(new String[] { busyboxBinary +" mv '"+ filename + "' '" +destFilename +"'"});
if(res != 0){
Log.e("ROOT", "error (" + String.valueOf(res) +")");
throw new IOException("Failed to rename "+filename+" to "+ destFilename);
}
}
@ -73,6 +75,7 @@ public class Root {
});
if(res != 0){
Log.e("ROOT", "error (" + String.valueOf(res) +")");
throw new IOException("Failed to copy & change mode.");
}
}

View File

@ -42,7 +42,6 @@ public class Startup extends AsyncTask<Void, Void, Void> {
wasError = true;
errorMsg = "No SD Card inserted.";
}
Root.setContext(ctx);
} catch (Exception e) {
wasError = true;

View File

@ -25,7 +25,7 @@ public class PsCertificatesInstaller extends AsyncTask<Void, Void, Void> {
private ProgressDialog dialog = null;
private boolean wasError = false;
private String errorMsg = "";
Context ctx = null;
private Context ctx = null;
public void installPlaystationCertification() throws IOException, Shell.ShellDiedException {
// remount /system as read-write
@ -34,8 +34,8 @@ public class PsCertificatesInstaller extends AsyncTask<Void, Void, Void> {
String psCertifiedPermissionFile = "/system/etc/permissions/com.playstation.playstationcertified.xml";
String psCertifiedJarFile = "/system/framework/com.playstation.playstationcertified.jar";
unpackResourceToLocationRoot(R.raw.ps_certified_permission, psCertifiedPermissionFile, 644, "root");
unpackResourceToLocationRoot(R.raw.ps_certified_jar, psCertifiedJarFile, 644, "root");
unpackResourceToLocationRoot(R.raw.ps_certified_permission, psCertifiedPermissionFile, 644, "0");
unpackResourceToLocationRoot(R.raw.ps_certified_jar, psCertifiedJarFile, 644, "0");
// make it read-only again.
remountRo("/system");

Binary file not shown.

Binary file not shown.