Compare commits
2 Commits
0ab7b80ab0
...
fb7d7d4acf
Author | SHA1 | Date |
---|---|---|
Li | fb7d7d4acf | |
Li | 1540612636 |
|
@ -15,4 +15,5 @@
|
|||
.cxx
|
||||
local.properties
|
||||
libsuperuser/build/*
|
||||
app/build/*
|
||||
app/build/*
|
||||
app/release/*
|
|
@ -4,6 +4,7 @@ plugins {
|
|||
|
||||
android {
|
||||
namespace 'com.psmreborn.nopsmdrm'
|
||||
//noinspection GradleDependency were targeting the xperia play
|
||||
compileSdk 10
|
||||
|
||||
defaultConfig {
|
||||
|
@ -11,8 +12,8 @@ android {
|
|||
minSdk 10
|
||||
//noinspection ExpiredTargetSdkVersion dont care about google play
|
||||
targetSdk 10
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
versionCode 4
|
||||
versionName "1.4"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
android:allowBackup="true"
|
||||
android:icon="@drawable/app_icon"
|
||||
android:label="@string/app_name"
|
||||
tools:targetApi="13">
|
||||
tools:targetApi="10">
|
||||
<activity android:name="com.psmreborn.nopsmdrm.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
|
|
@ -4,15 +4,28 @@ import android.content.Context;
|
|||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import eu.chainfire.libsuperuser.Shell;
|
||||
|
||||
public class Helper {
|
||||
|
||||
private static Context ctx;
|
||||
public static void setContext(Context context){
|
||||
ctx = context;
|
||||
}
|
||||
public static boolean isNoPsmDrmAlreadyInstalled() {
|
||||
try {
|
||||
if(new File(getPsmApp().nativeLibraryDir, "libdefault_real.so").exists()){
|
||||
return true;
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static boolean isPsmInstalled(){
|
||||
try {
|
||||
ctx.getPackageManager().getApplicationInfo("com.playstation.psstore", 0);
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.io.FileNotFoundException;
|
|||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Locale;
|
||||
|
||||
import eu.chainfire.libsuperuser.Shell;
|
||||
|
||||
|
@ -156,10 +157,44 @@ public class NoPsmDrmInstaller extends AsyncTask<Void, Void, Void> {
|
|||
String r_localLibrary = new File(sharedPrefsPath, "LocalLibrary.xml").getAbsolutePath();
|
||||
|
||||
// generate shared_prefs
|
||||
writeTxtFile(c_signinInfo, "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n<map>\n<string name=\"SignedInUsername\">"+emailAddress+"</string>\n<boolean name=\"PassSave\" value=\"true\" />\n<string name=\"Password\">"+password+"</string>\n<boolean name=\"AutoSignIn\" value=\"true\" />\n</map>\n");
|
||||
writeTxtFile(c_psstorePrefs, "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n<map>\n<boolean name=\"key_upgradeDownloadTableForNeedWifi\" value=\"true\" />\n<string name=\"last_signin_account_id\">"+accountId+"</string>\n<long name=\"last_signin_account_region\" value=\"2\" />\n<int name=\"key_psstore\" value=\"1\" />\n<int name=\"key_downloader\" value=\"1\" />\n<int name=\"psm_license_agree_version_code\" value=\"1170\" />\n<boolean name=\"key_notDisplayAgainEndOfSupportPreNavi\" value=\"true\" />\n<int name=\"key_xmlcache\" value=\"1\" />\n<string name=\"last_signin_account_country\">US</string>\n<boolean name=\"key_notDisplayAgainContentStartNavi\" value=\"true\" />\n<int name=\"key_startcontent\" value=\"1\" />\n<int name=\"key_nsxevent\" value=\"1\" />\n<boolean name=\"key_upgradeLibraryTableForLocationUseConfirmationDate\" value=\"true\" />\n<int name=\"key_install\" value=\"1\" />\n<string name=\"update_md5\">387ce7e424258aef426aaa5be8a1638a</string>\n<boolean name=\"psm_license_agree\" value=\"true\" />\n<int name=\"key_guestinfo\" value=\"1\" />\n<string name=\"last_signin_account_language\">en</string>\n<int name=\"key_cache\" value=\"2\" />\n<int name=\"key_signinfo\" value=\"2\" />\n</map>\n");
|
||||
writeTxtFile(c_runningContentInfo, "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n<map>\n<null name=\"title_id\" />\n<null name=\"next_title_id\" />\n</map>\n");
|
||||
writeTxtFile(c_localLibrary, "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n<map>\n<boolean name=\"notDisplayAgain\" value=\"true\" />\n<int name=\"sortType\" value=\"0\" />\n<boolean name=\"isList\" value=\"false\" />\n</map>\n");
|
||||
writeTxtFile(c_signinInfo, "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n" +
|
||||
"<map>\n<string name=\"SignedInUsername\">"+emailAddress+"</string>\n" +
|
||||
"<boolean name=\"PassSave\" value=\"true\" />\n" +
|
||||
"<string name=\"Password\">"+password+"</string>\n" +
|
||||
"<boolean name=\"AutoSignIn\" value=\"true\" />\n" +
|
||||
"</map>\n");
|
||||
|
||||
writeTxtFile(c_psstorePrefs, "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n" +
|
||||
"<map>\n" +
|
||||
"<boolean name=\"key_upgradeDownloadTableForNeedWifi\" value=\"true\" />\n" +
|
||||
"<string name=\"last_signin_account_id\">"+accountId+"</string>\n" +
|
||||
"<long name=\"last_signin_account_region\" value=\"2\" />\n" +
|
||||
"<int name=\"key_psstore\" value=\"1\" />\n" +
|
||||
"<int name=\"key_downloader\" value=\"1\" />\n" +
|
||||
"<int name=\"psm_license_agree_version_code\" value=\"1170\" />\n" +
|
||||
"<int name=\"key_xmlcache\" value=\"1\" />\n" +
|
||||
"<string name=\"last_signin_account_country\">US</string>\n" +
|
||||
"<int name=\"key_startcontent\" value=\"1\" />\n<int name=\"key_nsxevent\" value=\"1\" />\n" +
|
||||
"<boolean name=\"key_upgradeLibraryTableForLocationUseConfirmationDate\" value=\"true\" />\n" +
|
||||
"<int name=\"key_install\" value=\"1\" />\n" +
|
||||
"<string name=\"update_md5\">387ce7e424258aef426aaa5be8a1638a</string>\n" +
|
||||
"<boolean name=\"psm_license_agree\" value=\"true\" />\n" +
|
||||
"<int name=\"key_guestinfo\" value=\"1\" />\n" +
|
||||
"<string name=\"last_signin_account_language\">"+ Locale.getDefault().getLanguage()+"</string>\n" +
|
||||
"<int name=\"key_cache\" value=\"2\" />\n" +
|
||||
"<int name=\"key_signinfo\" value=\"2\" />\n" +
|
||||
"</map>\n");
|
||||
|
||||
writeTxtFile(c_runningContentInfo, "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n" +
|
||||
"<map>\n<null name=\"title_id\" />\n" +
|
||||
"<null name=\"next_title_id\" />\n" +
|
||||
"</map>\n");
|
||||
|
||||
writeTxtFile(c_localLibrary, "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n" +
|
||||
"<map>\n<boolean name=\"notDisplayAgain\" value=\"true\" />\n" +
|
||||
"<int name=\"sortType\" value=\"0\" />\n" +
|
||||
"<boolean name=\"isList\" value=\"false\" />\n" +
|
||||
"</map>\n");
|
||||
|
||||
// copy to the correct place and set permissions properly.
|
||||
copyChmodAndChown(c_signinInfo, r_signinInfo, 660, String.valueOf(stringEncryptor.getPsmUid()));
|
||||
|
|
|
@ -18,7 +18,7 @@ public class Root {
|
|||
|
||||
public static void killApplication(String processName) throws Shell.ShellDiedException {
|
||||
Log.i("ROOT", "Killing process: " + processName);
|
||||
Shell.Pool.SU.run(new String[] { busyboxBinary + " pkill '" + processName +"'" });
|
||||
Shell.Pool.SU.run(new String[] { busyboxBinary + " pkill -9 '" + processName +"'" });
|
||||
}
|
||||
public static boolean fileExistRoot(String filename) throws Shell.ShellDiedException {
|
||||
Log.i("ROOT", "FileExistRoot: " + filename);
|
||||
|
@ -117,7 +117,7 @@ public class Root {
|
|||
private static void setupBusyBox() throws IOException {
|
||||
Log.i("ROOT","Creating busybox binary");
|
||||
File tmpFile = new File(ctx.getCacheDir(), "busybox");
|
||||
if(!tmpFile.exists()){
|
||||
if(!tmpFile.exists()) {
|
||||
tmpFile.createNewFile();
|
||||
|
||||
if(tmpFile.setExecutable(true,false)) {
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.psmreborn.nopsmdrm;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Environment;
|
||||
import android.widget.Button;
|
||||
|
@ -10,6 +11,8 @@ import android.widget.TextView;
|
|||
import eu.chainfire.libsuperuser.Shell;
|
||||
import static com.psmreborn.nopsmdrm.Helper.*;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class Startup extends AsyncTask<Void, Void, Void> {
|
||||
private Context ctx;
|
||||
|
||||
|
@ -19,7 +22,6 @@ public class Startup extends AsyncTask<Void, Void, Void> {
|
|||
public Startup(Context context) {
|
||||
this.ctx = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
try {
|
||||
|
@ -40,6 +42,8 @@ public class Startup extends AsyncTask<Void, Void, Void> {
|
|||
wasError = true;
|
||||
errorMsg = "No SD Card inserted.";
|
||||
}
|
||||
Root.setContext(ctx);
|
||||
|
||||
} catch (Exception e) {
|
||||
wasError = true;
|
||||
errorMsg = e.getMessage();
|
||||
|
@ -49,13 +53,21 @@ public class Startup extends AsyncTask<Void, Void, Void> {
|
|||
|
||||
@Override
|
||||
protected void onPostExecute(Void result) {
|
||||
TextView statusTV = (TextView) ((Activity)ctx).findViewById(R.id.errorMsg);
|
||||
Button installButton = (Button) ((Activity)ctx).findViewById(R.id.installPsm);
|
||||
|
||||
if(!wasError) {
|
||||
Button installButton = (Button) ((Activity)ctx).findViewById(R.id.installPsm);
|
||||
statusTV.setText("");
|
||||
|
||||
if(isNoPsmDrmAlreadyInstalled()){
|
||||
installButton.setText("Update NoPsmDrm");
|
||||
};
|
||||
|
||||
installButton.setEnabled(true);
|
||||
|
||||
}
|
||||
else{
|
||||
TextView rootDetectedTV = (TextView) ((Activity)ctx).findViewById(R.id.errorMsg);
|
||||
rootDetectedTV.setText("Error: "+errorMsg);
|
||||
statusTV.setText("Error: "+errorMsg);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,30 +2,30 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingTop="15dp"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingBottom="15dp"
|
||||
android:keepScreenOn="true"
|
||||
android:noHistory="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/installPsm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
android:onClick="installStart"
|
||||
android:textSize="30sp"
|
||||
android:enabled="false"
|
||||
android:text="Install NoPsmDrm"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/errorMsg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
android:layout_below="@+id/installPsm"
|
||||
android:text=""/>
|
||||
android:text="Checking, Please wait ..."/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/installPsm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
android:onClick="installStart"
|
||||
android:textSize="30sp"
|
||||
android:enabled="false"
|
||||
android:layout_below="@+id/errorMsg"
|
||||
android:text="Install NoPsmDrm"/>
|
||||
</RelativeLayout>
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue