Compare commits
2 Commits
0dc733ac8d
...
7420b7b661
Author | SHA1 | Date |
---|---|---|
Li | 7420b7b661 | |
Li | e56db07fd7 |
|
@ -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();
|
||||
|
|
|
@ -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.");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
Binary file not shown.
Loading…
Reference in New Issue