Repackage Magisk Manager for hiding
@ -53,7 +53,6 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
implementation project(':common')
|
|
||||||
implementation project(':jarsigner')
|
implementation project(':jarsigner')
|
||||||
implementation 'com.android.support:recyclerview-v7:26.1.0'
|
implementation 'com.android.support:recyclerview-v7:26.1.0'
|
||||||
implementation 'com.android.support:cardview-v7:26.1.0'
|
implementation 'com.android.support:cardview-v7:26.1.0'
|
||||||
|
@ -9,6 +9,7 @@ import android.app.job.JobScheduler;
|
|||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
@ -44,6 +45,7 @@ public class MagiskManager extends Application {
|
|||||||
// Global weak reference to self
|
// Global weak reference to self
|
||||||
private static WeakReference<MagiskManager> weakSelf;
|
private static WeakReference<MagiskManager> weakSelf;
|
||||||
|
|
||||||
|
public static final String ORIG_PKG_NAME = "com.topjohnwu.magisk";
|
||||||
public static final String MAGISK_DISABLE_FILE = "/cache/.disable_magisk";
|
public static final String MAGISK_DISABLE_FILE = "/cache/.disable_magisk";
|
||||||
public static final String MAGISK_HOST_FILE = "/magisk/.core/hosts";
|
public static final String MAGISK_HOST_FILE = "/magisk/.core/hosts";
|
||||||
public static final String TMP_FOLDER_PATH = "/dev/tmp";
|
public static final String TMP_FOLDER_PATH = "/dev/tmp";
|
||||||
@ -68,6 +70,7 @@ public class MagiskManager extends Application {
|
|||||||
public final Topic localeDone = new Topic();
|
public final Topic localeDone = new Topic();
|
||||||
|
|
||||||
// Info
|
// Info
|
||||||
|
public int userId;
|
||||||
public String magiskVersionString;
|
public String magiskVersionString;
|
||||||
public int magiskVersionCode = -1;
|
public int magiskVersionCode = -1;
|
||||||
public String remoteMagiskVersionString;
|
public String remoteMagiskVersionString;
|
||||||
@ -125,6 +128,7 @@ public class MagiskManager extends Application {
|
|||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
userId = getApplicationInfo().uid / 100000;
|
||||||
|
|
||||||
if (Utils.getDatabasePath(this, SuDatabaseHelper.DB_NAME).exists()) {
|
if (Utils.getDatabasePath(this, SuDatabaseHelper.DB_NAME).exists()) {
|
||||||
// Don't migrate yet, wait and check Magisk version
|
// Don't migrate yet, wait and check Magisk version
|
||||||
@ -133,6 +137,15 @@ public class MagiskManager extends Application {
|
|||||||
suDB = new SuDatabaseHelper();
|
suDB = new SuDatabaseHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If detect original package, self destruct!
|
||||||
|
if (!getPackageName().equals(ORIG_PKG_NAME)) {
|
||||||
|
try {
|
||||||
|
getPackageManager().getApplicationInfo(ORIG_PKG_NAME, 0);
|
||||||
|
Shell.su(String.format(Locale.US, "pm uninstall --user %d %s", userId, getPackageName()));
|
||||||
|
return;
|
||||||
|
} catch (PackageManager.NameNotFoundException ignored) { /* Expected*/ }
|
||||||
|
}
|
||||||
|
|
||||||
repoDB = new RepoDatabaseHelper(this);
|
repoDB = new RepoDatabaseHelper(this);
|
||||||
defaultLocale = Locale.getDefault();
|
defaultLocale = Locale.getDefault();
|
||||||
setLocale();
|
setLocale();
|
||||||
@ -258,6 +271,14 @@ public class MagiskManager extends Application {
|
|||||||
// Setup suDB
|
// Setup suDB
|
||||||
SuDatabaseHelper.setupSuDB();
|
SuDatabaseHelper.setupSuDB();
|
||||||
|
|
||||||
|
// Check alternative Magisk Manager
|
||||||
|
String pkg;
|
||||||
|
if (getPackageName().equals(ORIG_PKG_NAME) &&
|
||||||
|
(pkg = suDB.getStrings(SuDatabaseHelper.REQUESTER, null)) != null) {
|
||||||
|
Shell.su_raw("pm uninstall " + pkg);
|
||||||
|
suDB.setStrings(SuDatabaseHelper.REQUESTER, null);
|
||||||
|
}
|
||||||
|
|
||||||
// Add update checking service
|
// Add update checking service
|
||||||
if (UPDATE_SERVICE_VER > updateServiceVersion) {
|
if (UPDATE_SERVICE_VER > updateServiceVersion) {
|
||||||
ComponentName service = new ComponentName(this, UpdateCheckService.class);
|
ComponentName service = new ComponentName(this, UpdateCheckService.class);
|
||||||
|
@ -108,7 +108,7 @@ public class SettingsActivity extends Activity implements Topic.Subscriber {
|
|||||||
setSummary();
|
setSummary();
|
||||||
|
|
||||||
// Disable dangerous settings in user mode if selected owner manage
|
// Disable dangerous settings in user mode if selected owner manage
|
||||||
if (getActivity().getApplicationInfo().uid > 99999) {
|
if (mm.userId > 0) {
|
||||||
suCategory.removePreference(multiuserMode);
|
suCategory.removePreference(multiuserMode);
|
||||||
generalCatagory.removePreference(hideManager);
|
generalCatagory.removePreference(hideManager);
|
||||||
}
|
}
|
||||||
@ -125,12 +125,16 @@ public class SettingsActivity extends Activity implements Topic.Subscriber {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
hideManager.setOnPreferenceClickListener((pref) -> {
|
if (mm.getPackageName().equals(MagiskManager.ORIG_PKG_NAME)) {
|
||||||
Utils.runWithPermission(getActivity(),
|
hideManager.setOnPreferenceClickListener((pref) -> {
|
||||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
Utils.runWithPermission(getActivity(),
|
||||||
() -> new HideManager().exec());
|
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||||
return true;
|
() -> new HideManager().exec());
|
||||||
});
|
return true;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
generalCatagory.removePreference(hideManager);
|
||||||
|
}
|
||||||
|
|
||||||
if (!Shell.rootAccess()) {
|
if (!Shell.rootAccess()) {
|
||||||
prefScreen.removePreference(magiskCategory);
|
prefScreen.removePreference(magiskCategory);
|
||||||
|
@ -1,27 +1,26 @@
|
|||||||
package com.topjohnwu.magisk.asyncs;
|
package com.topjohnwu.magisk.asyncs;
|
||||||
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.topjohnwu.jarsigner.JarMap;
|
import com.topjohnwu.jarsigner.JarMap;
|
||||||
import com.topjohnwu.magisk.MagiskManager;
|
import com.topjohnwu.magisk.MagiskManager;
|
||||||
import com.topjohnwu.magisk.R;
|
import com.topjohnwu.magisk.R;
|
||||||
import com.topjohnwu.magisk.container.Policy;
|
import com.topjohnwu.magisk.database.SuDatabaseHelper;
|
||||||
import com.topjohnwu.magisk.utils.Shell;
|
import com.topjohnwu.magisk.utils.Shell;
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
import com.topjohnwu.magisk.utils.Utils;
|
||||||
import com.topjohnwu.magisk.utils.ZipUtils;
|
import com.topjohnwu.magisk.utils.ZipUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.jar.JarEntry;
|
import java.util.jar.JarEntry;
|
||||||
|
|
||||||
public class HideManager extends ParallelTask<Void, Void, Boolean> {
|
public class HideManager extends ParallelTask<Void, Void, Boolean> {
|
||||||
|
|
||||||
private static final String UNHIDE_APK = "unhide.apk";
|
|
||||||
private static final String ANDROID_MANIFEST = "AndroidManifest.xml";
|
private static final String ANDROID_MANIFEST = "AndroidManifest.xml";
|
||||||
private static final byte[] UNHIDE_PKG_NAME = "com.topjohnwu.unhide\0".getBytes();
|
|
||||||
|
|
||||||
private String genPackageName(String prefix, int length) {
|
private String genPackageName(String prefix, int length) {
|
||||||
StringBuilder builder = new StringBuilder(length);
|
StringBuilder builder = new StringBuilder(length);
|
||||||
@ -44,9 +43,33 @@ public class HideManager extends ParallelTask<Void, Void, Boolean> {
|
|||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean findAndPatch(byte xml[], String from, String to) {
|
||||||
|
int offset = -1;
|
||||||
|
byte target[] = (from + '\0').getBytes();
|
||||||
|
for (int i = 0; i < xml.length - target.length; ++i) {
|
||||||
|
boolean match = true;
|
||||||
|
for (int j = 0; j < target.length; ++j) {
|
||||||
|
if (xml[i + j] != target[j]) {
|
||||||
|
match = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (match) {
|
||||||
|
offset = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (offset < 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
System.arraycopy(to.getBytes(), 0, xml, offset, to.length());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPreExecute() {
|
protected void onPreExecute() {
|
||||||
MagiskManager.toast(R.string.hide_manager_toast, Toast.LENGTH_SHORT);
|
MagiskManager.toast(R.string.hide_manager_toast, Toast.LENGTH_SHORT);
|
||||||
|
MagiskManager.toast(R.string.hide_manager_toast2, Toast.LENGTH_LONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -54,67 +77,43 @@ public class HideManager extends ParallelTask<Void, Void, Boolean> {
|
|||||||
MagiskManager mm = MagiskManager.get();
|
MagiskManager mm = MagiskManager.get();
|
||||||
|
|
||||||
// Generate a new unhide app with random package name
|
// Generate a new unhide app with random package name
|
||||||
File unhideAPK = new File(Environment.getExternalStorageDirectory() + "/MagiskManager", "unhide.apk");
|
File repack = new File(Environment.getExternalStorageDirectory() + "/MagiskManager", "repack.apk");
|
||||||
unhideAPK.getParentFile().mkdirs();
|
repack.getParentFile().mkdirs();
|
||||||
String pkg;
|
String pkg = genPackageName("com.", MagiskManager.ORIG_PKG_NAME.length());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
JarMap asset = new JarMap(mm.getAssets().open(UNHIDE_APK));
|
// Read whole APK into memory
|
||||||
|
JarMap apk = new JarMap(new FileInputStream(mm.getPackageCodePath()));
|
||||||
JarEntry je = new JarEntry(ANDROID_MANIFEST);
|
JarEntry je = new JarEntry(ANDROID_MANIFEST);
|
||||||
byte xml[] = asset.getRawData(je);
|
byte xml[] = apk.getRawData(je);
|
||||||
int offset = -1;
|
|
||||||
|
|
||||||
// Linear search pattern offset
|
if (!findAndPatch(xml, MagiskManager.ORIG_PKG_NAME, pkg))
|
||||||
for (int i = 0; i < xml.length - UNHIDE_PKG_NAME.length; ++i) {
|
return false;
|
||||||
boolean match = true;
|
if (!findAndPatch(xml, MagiskManager.ORIG_PKG_NAME + ".provider", pkg + ".provider"))
|
||||||
for (int j = 0; j < UNHIDE_PKG_NAME.length; ++j) {
|
|
||||||
if (xml[i + j] != UNHIDE_PKG_NAME[j]) {
|
|
||||||
match = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (match) {
|
|
||||||
offset = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (offset < 0)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Patch binary XML with new package name
|
// Write in changes
|
||||||
pkg = genPackageName("com.", UNHIDE_PKG_NAME.length - 1);
|
apk.getOutputStream(je).write(xml);
|
||||||
System.arraycopy(pkg.getBytes(), 0, xml, offset, pkg.length());
|
|
||||||
asset.getOutputStream(je).write(xml);
|
|
||||||
|
|
||||||
// Sign the APK
|
// Sign the APK
|
||||||
ZipUtils.signZip(mm, asset, unhideAPK, false);
|
ZipUtils.signZip(apk, repack, false);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Install the application
|
// Install the application
|
||||||
List<String> ret = Shell.su("pm install " + unhideAPK + ">/dev/null && echo true || echo false");
|
|
||||||
unhideAPK.delete();
|
List<String> ret = Shell.su(String.format(Locale.US,
|
||||||
|
"pm install --user %d %s >/dev/null && echo true || echo false",
|
||||||
|
mm.userId, repack));
|
||||||
|
repack.delete();
|
||||||
if (!Utils.isValidShellResponse(ret) || !Boolean.parseBoolean(ret.get(0)))
|
if (!Utils.isValidShellResponse(ret) || !Boolean.parseBoolean(ret.get(0)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
try {
|
mm.suDB.setStrings(SuDatabaseHelper.REQUESTER, pkg);
|
||||||
// Allow the application to gain root by default
|
Shell.su_raw(String.format(Locale.US, "pm uninstall --user %d %s", mm.userId, mm.getPackageName()));
|
||||||
PackageManager pm = mm.getPackageManager();
|
|
||||||
int uid = pm.getApplicationInfo(pkg, 0).uid;
|
|
||||||
Policy policy = new Policy(uid, pm);
|
|
||||||
policy.policy = Policy.ALLOW;
|
|
||||||
policy.notification = false;
|
|
||||||
policy.logging = false;
|
|
||||||
mm.suDB.addPolicy(policy);
|
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hide myself!
|
|
||||||
Shell.su_raw("pm hide " + mm.getPackageName());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,13 +132,13 @@ public class ProcessRepoZip extends ParallelTask<Void, Object, Boolean> {
|
|||||||
publishProgress(SHOW_PROCESSING);
|
publishProgress(SHOW_PROCESSING);
|
||||||
|
|
||||||
// Then sign the zip for the first time, temp1 -> temp2
|
// Then sign the zip for the first time, temp1 -> temp2
|
||||||
ZipUtils.signZip(activity, temp1, temp2, false);
|
ZipUtils.signZip(temp1, temp2, false);
|
||||||
|
|
||||||
// Adjust the zip to prevent unzip issues, temp2 -> temp1
|
// Adjust the zip to prevent unzip issues, temp2 -> temp1
|
||||||
ZipUtils.zipAdjust(temp2.getPath(), temp1.getPath());
|
ZipUtils.zipAdjust(temp2.getPath(), temp1.getPath());
|
||||||
|
|
||||||
// Finally, sign the whole zip file again, temp1 -> temp2
|
// Finally, sign the whole zip file again, temp1 -> temp2
|
||||||
ZipUtils.signZip(activity, temp1, temp2, true);
|
ZipUtils.signZip(temp1, temp2, true);
|
||||||
|
|
||||||
// Write it to the target zip, temp2 -> file
|
// Write it to the target zip, temp2 -> file
|
||||||
try (OutputStream out = new BufferedOutputStream(new FileOutputStream(mFile));
|
try (OutputStream out = new BufferedOutputStream(new FileOutputStream(mFile));
|
||||||
|
@ -41,11 +41,14 @@ public class SuDatabaseHelper extends SQLiteOpenHelper {
|
|||||||
public static final int NAMESPACE_MODE_REQUESTER = 1;
|
public static final int NAMESPACE_MODE_REQUESTER = 1;
|
||||||
public static final int NAMESPACE_MODE_ISOLATE = 2;
|
public static final int NAMESPACE_MODE_ISOLATE = 2;
|
||||||
|
|
||||||
|
public static final String REQUESTER = "requester";
|
||||||
|
|
||||||
public static final String DB_NAME = "su.db";
|
public static final String DB_NAME = "su.db";
|
||||||
private static final int DATABASE_VER = 3;
|
private static final int DATABASE_VER = 4;
|
||||||
private static final String POLICY_TABLE = "policies";
|
private static final String POLICY_TABLE = "policies";
|
||||||
private static final String LOG_TABLE = "logs";
|
private static final String LOG_TABLE = "logs";
|
||||||
private static final String SETTINGS_TABLE = "settings";
|
private static final String SETTINGS_TABLE = "settings";
|
||||||
|
private static final String STRINGS_TABLE = "strings";
|
||||||
|
|
||||||
private static String GLOBAL_DB;
|
private static String GLOBAL_DB;
|
||||||
|
|
||||||
@ -130,7 +133,7 @@ public class SuDatabaseHelper extends SQLiteOpenHelper {
|
|||||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||||
if (oldVersion == 0) {
|
if (oldVersion == 0) {
|
||||||
createTables(db);
|
createTables(db);
|
||||||
oldVersion = 2;
|
oldVersion = 3;
|
||||||
}
|
}
|
||||||
if (oldVersion == 1) {
|
if (oldVersion == 1) {
|
||||||
// We're dropping column app_name, rename and re-construct table
|
// We're dropping column app_name, rename and re-construct table
|
||||||
@ -157,6 +160,12 @@ public class SuDatabaseHelper extends SQLiteOpenHelper {
|
|||||||
db.execSQL("UPDATE " + LOG_TABLE + " SET time=time*1000");
|
db.execSQL("UPDATE " + LOG_TABLE + " SET time=time*1000");
|
||||||
++oldVersion;
|
++oldVersion;
|
||||||
}
|
}
|
||||||
|
if (oldVersion == 3) {
|
||||||
|
db.execSQL(
|
||||||
|
"CREATE TABLE IF NOT EXISTS " + STRINGS_TABLE + " " +
|
||||||
|
"(key TEXT, value TEXT, PRIMARY KEY(key))");
|
||||||
|
++oldVersion;
|
||||||
|
}
|
||||||
|
|
||||||
if (!Utils.itemExist(GLOBAL_DB)) {
|
if (!Utils.itemExist(GLOBAL_DB)) {
|
||||||
// Hard link our DB globally
|
// Hard link our DB globally
|
||||||
@ -335,4 +344,25 @@ public class SuDatabaseHelper extends SQLiteOpenHelper {
|
|||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setStrings(String key, String value) {
|
||||||
|
if (value == null) {
|
||||||
|
mDb.delete(STRINGS_TABLE, "key=?", new String[] { key });
|
||||||
|
} else {
|
||||||
|
ContentValues data = new ContentValues();
|
||||||
|
data.put("key", key);
|
||||||
|
data.put("value", value);
|
||||||
|
mDb.replace(STRINGS_TABLE, null, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStrings(String key, String defaultValue) {
|
||||||
|
String value = defaultValue;
|
||||||
|
try (Cursor c = mDb.query(STRINGS_TABLE, null, "key=?",new String[] { key }, null, null, null)) {
|
||||||
|
if (c.moveToNext()) {
|
||||||
|
value = c.getString(c.getColumnIndex("value"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ public class ManagerUpdate extends BroadcastReceiver {
|
|||||||
Intent install = new Intent(Intent.ACTION_INSTALL_PACKAGE);
|
Intent install = new Intent(Intent.ACTION_INSTALL_PACKAGE);
|
||||||
install.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
install.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
Uri content = FileProvider.getUriForFile(context,
|
Uri content = FileProvider.getUriForFile(context,
|
||||||
"com.topjohnwu.magisk.provider", new File(uri.getPath()));
|
context.getPackageName() + ".provider", new File(uri.getPath()));
|
||||||
install.setData(content);
|
install.setData(content);
|
||||||
context.startActivity(install);
|
context.startActivity(install);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package com.topjohnwu.magisk.utils;
|
package com.topjohnwu.magisk.utils;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.res.AssetManager;
|
import android.content.res.AssetManager;
|
||||||
|
|
||||||
import com.topjohnwu.jarsigner.JarMap;
|
import com.topjohnwu.jarsigner.JarMap;
|
||||||
import com.topjohnwu.jarsigner.SignAPK;
|
import com.topjohnwu.jarsigner.SignAPK;
|
||||||
|
import com.topjohnwu.magisk.MagiskManager;
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -63,16 +63,16 @@ public class ZipUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void signZip(Context context, InputStream is, File output, boolean minSign) throws Exception {
|
public static void signZip(InputStream is, File output, boolean minSign) throws Exception {
|
||||||
signZip(context, new JarMap(is, false), output, minSign);
|
signZip(new JarMap(is, false), output, minSign);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void signZip(Context context, File input, File output, boolean minSign) throws Exception {
|
public static void signZip(File input, File output, boolean minSign) throws Exception {
|
||||||
signZip(context, new JarMap(input, false), output, minSign);
|
signZip(new JarMap(input, false), output, minSign);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void signZip(Context context, JarMap input, File output, boolean minSign) throws Exception {
|
public static void signZip(JarMap input, File output, boolean minSign) throws Exception {
|
||||||
AssetManager assets = context.getAssets();
|
AssetManager assets = MagiskManager.get().getAssets();
|
||||||
SignAPK.signZip(
|
SignAPK.signZip(
|
||||||
assets.open(PUBLIC_KEY_NAME), assets.open(PRIVATE_KEY_NAME),
|
assets.open(PUBLIC_KEY_NAME), assets.open(PRIVATE_KEY_NAME),
|
||||||
input, output, minSign);
|
input, output, minSign);
|
||||||
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
@ -122,7 +122,6 @@
|
|||||||
<string name="settings_clear_cache_title">Repo-Cache löschen</string>
|
<string name="settings_clear_cache_title">Repo-Cache löschen</string>
|
||||||
<string name="settings_clear_cache_summary">Löscht die zwischengespeicherten Informationen der Online-Repos. Erzwingt eine Aktualisierung</string>
|
<string name="settings_clear_cache_summary">Löscht die zwischengespeicherten Informationen der Online-Repos. Erzwingt eine Aktualisierung</string>
|
||||||
<string name="settings_hide_manager_title">Magisk Manager verbergen</string>
|
<string name="settings_hide_manager_title">Magisk Manager verbergen</string>
|
||||||
<string name="settings_hide_manager_summary">Magisk Manager temporär verbergen.\nDies installiert eine neue App namens \"Unhide Magisk Manager\"</string>
|
|
||||||
<string name="language">Sprache</string>
|
<string name="language">Sprache</string>
|
||||||
<string name="system_default">(Systemstandard)</string>
|
<string name="system_default">(Systemstandard)</string>
|
||||||
<string name="settings_update">Update-Einstellungen</string>
|
<string name="settings_update">Update-Einstellungen</string>
|
||||||
|
@ -115,7 +115,6 @@
|
|||||||
<string name="settings_clear_cache_title">Εκκαθάριση προσωρινής μνήμης αποθετηρίων</string>
|
<string name="settings_clear_cache_title">Εκκαθάριση προσωρινής μνήμης αποθετηρίων</string>
|
||||||
<string name="settings_clear_cache_summary">Καθαρίζει τις κρυφές πληροφορίες για απευθείας συνδεδεμένα αποθετήρια, αναγκάζει την εφαρμογή να κάνει ανανέωση σε απευθείας σύνδεση</string>
|
<string name="settings_clear_cache_summary">Καθαρίζει τις κρυφές πληροφορίες για απευθείας συνδεδεμένα αποθετήρια, αναγκάζει την εφαρμογή να κάνει ανανέωση σε απευθείας σύνδεση</string>
|
||||||
<string name="settings_hide_manager_title">Κρύψιμο Magisk Manager</string>
|
<string name="settings_hide_manager_title">Κρύψιμο Magisk Manager</string>
|
||||||
<string name="settings_hide_manager_summary">Προσωρινό κρύψιμο του Magisk Manager.\nΑυτό θα εγκαταστήσει μια νέα εφαρμογή με το όνομα \"Unhide Magisk Manager\"</string>
|
|
||||||
<string name="language">Γλώσσα</string>
|
<string name="language">Γλώσσα</string>
|
||||||
<string name="system_default">(Προεπιλογή Συστήματος)</string>
|
<string name="system_default">(Προεπιλογή Συστήματος)</string>
|
||||||
<string name="settings_update">Ρυθμίσεις Ενημερώσεων</string>
|
<string name="settings_update">Ρυθμίσεις Ενημερώσεων</string>
|
||||||
|
@ -132,7 +132,6 @@
|
|||||||
<string name="settings_clear_cache_title">Limpiar caché del repositorio</string>
|
<string name="settings_clear_cache_title">Limpiar caché del repositorio</string>
|
||||||
<string name="settings_clear_cache_summary">Limpiar la información en caché para los repositorios en línea, fuerza a la aplicación a actualizar en línea</string>
|
<string name="settings_clear_cache_summary">Limpiar la información en caché para los repositorios en línea, fuerza a la aplicación a actualizar en línea</string>
|
||||||
<string name="settings_hide_manager_title">Ocultar Magisk Manager</string>
|
<string name="settings_hide_manager_title">Ocultar Magisk Manager</string>
|
||||||
<string name="settings_hide_manager_summary">Ocultar temporalmente Magisk Manager.\nEsto instalará una nueva aplicación llamada \"Unhide Magisk Manager\"</string>
|
|
||||||
<string name="language">Idioma</string>
|
<string name="language">Idioma</string>
|
||||||
<string name="system_default">(Idioma del sistema)</string>
|
<string name="system_default">(Idioma del sistema)</string>
|
||||||
<string name="settings_update">Ajustes de Actualización</string>
|
<string name="settings_update">Ajustes de Actualización</string>
|
||||||
|
@ -135,8 +135,6 @@
|
|||||||
<string name="settings_clear_cache_title">Tühjenda hoidla vahemälu</string>
|
<string name="settings_clear_cache_title">Tühjenda hoidla vahemälu</string>
|
||||||
<string name="settings_clear_cache_summary">Tühjenda võrgus olevate hoidlate vahemälus olev teave, sunnib rakendust võrgust värskendama</string>
|
<string name="settings_clear_cache_summary">Tühjenda võrgus olevate hoidlate vahemälus olev teave, sunnib rakendust võrgust värskendama</string>
|
||||||
<string name="settings_hide_manager_title">Peida Magisk Manager</string>
|
<string name="settings_hide_manager_title">Peida Magisk Manager</string>
|
||||||
<string name="settings_hide_manager_summary">Peida ajutiselt Magisk Manager.\n
|
|
||||||
See installib uue rakenduse nimega \"Unhide Magisk Manager"</string>
|
|
||||||
<string name="language">Keel</string>
|
<string name="language">Keel</string>
|
||||||
<string name="system_default">(Süsteemi vaikesäte)</string>
|
<string name="system_default">(Süsteemi vaikesäte)</string>
|
||||||
<string name="settings_update">Uuenda seadeid</string>
|
<string name="settings_update">Uuenda seadeid</string>
|
||||||
|
@ -133,8 +133,7 @@
|
|||||||
<string name="superuser_notification">Notification Superuser</string>
|
<string name="superuser_notification">Notification Superuser</string>
|
||||||
<string name="request_timeout_summary">%1$s secondes</string>
|
<string name="request_timeout_summary">%1$s secondes</string>
|
||||||
<string name="settings_hide_manager_title">Masquer Magisk Manager</string>
|
<string name="settings_hide_manager_title">Masquer Magisk Manager</string>
|
||||||
<string name="settings_hide_manager_summary">Masquer temporairement Magisk Manager.\nCeci installera une nouvelle appli appelée \"Unhide Magisk Manager\"</string>
|
<string name="language">Langue</string>
|
||||||
<string name="language">Langue</string>
|
|
||||||
<string name="system_default">(Selon système)</string>
|
<string name="system_default">(Selon système)</string>
|
||||||
<string name="settings_update">Paramètres de mises à jour</string>
|
<string name="settings_update">Paramètres de mises à jour</string>
|
||||||
<string name="settings_update_channel_title">Canal de mise à jour</string>
|
<string name="settings_update_channel_title">Canal de mise à jour</string>
|
||||||
|
@ -128,7 +128,6 @@
|
|||||||
<string name="settings_clear_cache_title">Opslagcache wissen</string>
|
<string name="settings_clear_cache_title">Opslagcache wissen</string>
|
||||||
<string name="settings_clear_cache_summary">Wis de gecachte informatie voor online opslagplaatsen. Dit dwingt de app om online te verversen</string>
|
<string name="settings_clear_cache_summary">Wis de gecachte informatie voor online opslagplaatsen. Dit dwingt de app om online te verversen</string>
|
||||||
<string name="settings_hide_manager_title">Magisk Manager verbergen</string>
|
<string name="settings_hide_manager_title">Magisk Manager verbergen</string>
|
||||||
<string name="settings_hide_manager_summary">Magisk Manager tijdelijk verbergen.\nDit installeert een nieuwe app genaamd \"Unhide Magisk Manager\"</string>
|
|
||||||
<string name="language">Taal</string>
|
<string name="language">Taal</string>
|
||||||
<string name="system_default">(Systeem standaard)</string>
|
<string name="system_default">(Systeem standaard)</string>
|
||||||
<string name="settings_update">Instellingen bijwerken</string>
|
<string name="settings_update">Instellingen bijwerken</string>
|
||||||
|
@ -131,7 +131,6 @@
|
|||||||
<string name="settings_clear_cache_title">Wyczyść Pamięć Repozytorium</string>
|
<string name="settings_clear_cache_title">Wyczyść Pamięć Repozytorium</string>
|
||||||
<string name="settings_clear_cache_summary">Wymusza na aplikacji odświeżenie online repozytorium</string>
|
<string name="settings_clear_cache_summary">Wymusza na aplikacji odświeżenie online repozytorium</string>
|
||||||
<string name="settings_hide_manager_title">Ukryj Magisk Manager</string>
|
<string name="settings_hide_manager_title">Ukryj Magisk Manager</string>
|
||||||
<string name="settings_hide_manager_summary">Tymczasowo ukryj Magisk Manager.\nSpowoduje to zainstalowanie nowej aplikacji o nazwie \"Pokaż Magisk Manager\"</string>
|
|
||||||
<string name="language">Język</string>
|
<string name="language">Język</string>
|
||||||
<string name="system_default">(Domyślny Systemu)</string>
|
<string name="system_default">(Domyślny Systemu)</string>
|
||||||
<string name="settings_update">Aktualizacja Ustawień</string>
|
<string name="settings_update">Aktualizacja Ustawień</string>
|
||||||
|
@ -134,7 +134,6 @@
|
|||||||
<string name="settings_clear_cache_title">Limpar Repo Cache</string>
|
<string name="settings_clear_cache_title">Limpar Repo Cache</string>
|
||||||
<string name="settings_clear_cache_summary">Limpe as informações armazenadas em cache para repos. online, forçando o aplicativo a atualizar online</string>
|
<string name="settings_clear_cache_summary">Limpe as informações armazenadas em cache para repos. online, forçando o aplicativo a atualizar online</string>
|
||||||
<string name="settings_hide_manager_title">Ocultar Magisk Manager</string>
|
<string name="settings_hide_manager_title">Ocultar Magisk Manager</string>
|
||||||
<string name="settings_hide_manager_summary">Oculta temporariamente o Magisk Manager.\nIsso irá instalar um novo aplicativo chamado \"Unhide Magisk Manager\"</string>
|
|
||||||
<string name="language">Linguagem</string>
|
<string name="language">Linguagem</string>
|
||||||
<string name="system_default">(Padrão do Sistema)</string>
|
<string name="system_default">(Padrão do Sistema)</string>
|
||||||
<string name="settings_update">Atualizar Configurações</string>
|
<string name="settings_update">Atualizar Configurações</string>
|
||||||
|
@ -108,7 +108,6 @@
|
|||||||
<string name="settings_clear_cache_title">Eliminare cache</string>
|
<string name="settings_clear_cache_title">Eliminare cache</string>
|
||||||
<string name="settings_clear_cache_summary">Ștergeți informațiile memorate în cache, forțează actualizarea aplicației online</string>
|
<string name="settings_clear_cache_summary">Ștergeți informațiile memorate în cache, forțează actualizarea aplicației online</string>
|
||||||
<string name="settings_hide_manager_title">Ascundeţi Magisk Manager</string>
|
<string name="settings_hide_manager_title">Ascundeţi Magisk Manager</string>
|
||||||
<string name="settings_hide_manager_summary">Ascundeţi temporar Magisk Manager.\nAceasta va instala o nouă aplicație numită \"Unhide Magisk Manager\"</string>
|
|
||||||
<string name="language">Limbă</string>
|
<string name="language">Limbă</string>
|
||||||
<string name="system_default">(Implicit)</string>
|
<string name="system_default">(Implicit)</string>
|
||||||
|
|
||||||
|
@ -131,7 +131,6 @@
|
|||||||
<string name="settings_clear_cache_title">Очистка кеша</string>
|
<string name="settings_clear_cache_title">Очистка кеша</string>
|
||||||
<string name="settings_clear_cache_summary">Очистить сохранённую информацию о сетевых репозиториях, заставляя приложение принудительно обновляться через Интернете</string>
|
<string name="settings_clear_cache_summary">Очистить сохранённую информацию о сетевых репозиториях, заставляя приложение принудительно обновляться через Интернете</string>
|
||||||
<string name="settings_hide_manager_title">Скрыть Менеджер Magisk</string>
|
<string name="settings_hide_manager_title">Скрыть Менеджер Magisk</string>
|
||||||
<string name="settings_hide_manager_summary">Временно скрывает Менеджер Magisk.\nБудет установлено новое приложение, называется \"Unhide Magisk Manager\"</string>
|
|
||||||
<string name="language">Язык</string>
|
<string name="language">Язык</string>
|
||||||
<string name="system_default">По умолчанию (системный)</string>
|
<string name="system_default">По умолчанию (системный)</string>
|
||||||
<string name="settings_update">Настройки обновления</string>
|
<string name="settings_update">Настройки обновления</string>
|
||||||
|
@ -125,7 +125,6 @@
|
|||||||
<string name="settings_clear_cache_title">Repo Önbelleğini Temizle</string>
|
<string name="settings_clear_cache_title">Repo Önbelleğini Temizle</string>
|
||||||
<string name="settings_clear_cache_summary">Çevrimiçi repolar için önbellek bilgilerini temizle, uygulamayı çevrimiçi yenilemeye zorla</string>
|
<string name="settings_clear_cache_summary">Çevrimiçi repolar için önbellek bilgilerini temizle, uygulamayı çevrimiçi yenilemeye zorla</string>
|
||||||
<string name="settings_hide_manager_title">Magisk Manager\'ı Gizle</string>
|
<string name="settings_hide_manager_title">Magisk Manager\'ı Gizle</string>
|
||||||
<string name="settings_hide_manager_summary">Magisk Manager\'ı geçici olarak gizle.\nBu, \"Unhide Magisk Manager\" adlı yeni bir uygulama yükleyecektir.</string>
|
|
||||||
<string name="language">Dil</string>
|
<string name="language">Dil</string>
|
||||||
<string name="system_default">(Sistem Varsayılanı)</string>
|
<string name="system_default">(Sistem Varsayılanı)</string>
|
||||||
<string name="settings_update">Güncelleme Ayarları</string>
|
<string name="settings_update">Güncelleme Ayarları</string>
|
||||||
|
@ -127,7 +127,6 @@
|
|||||||
<string name="settings_clear_cache_title">Очищення кешу</string>
|
<string name="settings_clear_cache_title">Очищення кешу</string>
|
||||||
<string name="settings_clear_cache_summary">Очистити збережену інформацію про мережеві репозиторії, змушуючи програму примусово оновлюватися через Інтернет</string>
|
<string name="settings_clear_cache_summary">Очистити збережену інформацію про мережеві репозиторії, змушуючи програму примусово оновлюватися через Інтернет</string>
|
||||||
<string name="settings_hide_manager_title">Приховати Magisk Manager</string>
|
<string name="settings_hide_manager_title">Приховати Magisk Manager</string>
|
||||||
<string name="settings_hide_manager_summary">Тимчасово приховати Magisk Manager.\nЦя дія встановить новий додаток \"Unhide Magisk Manager\"</string>
|
|
||||||
<string name="language">Мова</string>
|
<string name="language">Мова</string>
|
||||||
<string name="system_default">Стандартна (системна)</string>
|
<string name="system_default">Стандартна (системна)</string>
|
||||||
<string name="settings_update">Оновити налаштування</string>
|
<string name="settings_update">Оновити налаштування</string>
|
||||||
|
@ -130,7 +130,6 @@
|
|||||||
<string name="settings_clear_cache_title">清除仓库缓存</string>
|
<string name="settings_clear_cache_title">清除仓库缓存</string>
|
||||||
<string name="settings_clear_cache_summary">清除已缓存的在线仓库信息,强制刷新在线数据</string>
|
<string name="settings_clear_cache_summary">清除已缓存的在线仓库信息,强制刷新在线数据</string>
|
||||||
<string name="settings_hide_manager_title">隐藏 Magisk Manager</string>
|
<string name="settings_hide_manager_title">隐藏 Magisk Manager</string>
|
||||||
<string name="settings_hide_manager_summary">暂时隐藏 Magisk Manager。\n这将会安装一个应用“Unhide Magisk Manager”用以恢复显示。</string>
|
|
||||||
<string name="language">语言</string>
|
<string name="language">语言</string>
|
||||||
<string name="system_default">(系统默认)</string>
|
<string name="system_default">(系统默认)</string>
|
||||||
<string name="settings_update">更新设定</string>
|
<string name="settings_update">更新设定</string>
|
||||||
|
@ -186,7 +186,6 @@
|
|||||||
<string name="hide_manager_toast">正在隱藏 Magisk Manager…</string>
|
<string name="hide_manager_toast">正在隱藏 Magisk Manager…</string>
|
||||||
<string name="hide_manager_fail_toast">隱藏 Magisk Manager 失敗</string>
|
<string name="hide_manager_fail_toast">隱藏 Magisk Manager 失敗</string>
|
||||||
<string name="settings_hide_manager_title">隱藏 Magisk Manager</string>
|
<string name="settings_hide_manager_title">隱藏 Magisk Manager</string>
|
||||||
<string name="settings_hide_manager_summary">暫時隱藏 Magisk Manager。\n這會新增一個新的 app 叫做 Unhide Magisk Manager</string>
|
|
||||||
<string name="settings_update_channel_title">更新頻道</string>
|
<string name="settings_update_channel_title">更新頻道</string>
|
||||||
<string name="settings_update_stable">穩定版</string>
|
<string name="settings_update_stable">穩定版</string>
|
||||||
<string name="settings_update_beta">測試版</string>
|
<string name="settings_update_beta">測試版</string>
|
||||||
|
@ -109,6 +109,7 @@
|
|||||||
<string name="magisk_updates">Magisk Updates</string>
|
<string name="magisk_updates">Magisk Updates</string>
|
||||||
<string name="flashing">Flashing</string>
|
<string name="flashing">Flashing</string>
|
||||||
<string name="hide_manager_toast">Hiding Magisk Manager…</string>
|
<string name="hide_manager_toast">Hiding Magisk Manager…</string>
|
||||||
|
<string name="hide_manager_toast2">This might take a while…</string>
|
||||||
<string name="hide_manager_fail_toast">Hide Magisk Manager failed…</string>
|
<string name="hide_manager_fail_toast">Hide Magisk Manager failed…</string>
|
||||||
<string name="download_zip_only">Download Zip Only</string>
|
<string name="download_zip_only">Download Zip Only</string>
|
||||||
<string name="patch_boot_file">Patch Boot Image File</string>
|
<string name="patch_boot_file">Patch Boot Image File</string>
|
||||||
@ -134,7 +135,7 @@
|
|||||||
<string name="settings_clear_cache_title">Clear Repo Cache</string>
|
<string name="settings_clear_cache_title">Clear Repo Cache</string>
|
||||||
<string name="settings_clear_cache_summary">Clear the cached information for online repos, forces the app to refresh online</string>
|
<string name="settings_clear_cache_summary">Clear the cached information for online repos, forces the app to refresh online</string>
|
||||||
<string name="settings_hide_manager_title">Hide Magisk Manager</string>
|
<string name="settings_hide_manager_title">Hide Magisk Manager</string>
|
||||||
<string name="settings_hide_manager_summary">Temporarily hide Magisk Manager.\nThis will install a new app called \"Unhide Magisk Manager\"</string>
|
<string name="settings_hide_manager_summary">Repackage Magisk Manager with random package name</string>
|
||||||
<string name="language">Language</string>
|
<string name="language">Language</string>
|
||||||
<string name="system_default">(System Default)</string>
|
<string name="system_default">(System Default)</string>
|
||||||
<string name="settings_update">Update Settings</string>
|
<string name="settings_update">Update Settings</string>
|
||||||
@ -143,7 +144,6 @@
|
|||||||
<string name="settings_update_beta">Beta</string>
|
<string name="settings_update_beta">Beta</string>
|
||||||
<string name="settings_boot_format_title">Patched Boot Output Format</string>
|
<string name="settings_boot_format_title">Patched Boot Output Format</string>
|
||||||
<string name="settings_boot_format_summary">Select the format of the output patched boot image.\nChoose .img to flash through fastboot/download mode; choose .img.tar to flash with ODIN.</string>
|
<string name="settings_boot_format_summary">Select the format of the output patched boot image.\nChoose .img to flash through fastboot/download mode; choose .img.tar to flash with ODIN.</string>
|
||||||
|
|
||||||
<string name="settings_core_only_title">Magisk Core Only Mode</string>
|
<string name="settings_core_only_title">Magisk Core Only Mode</string>
|
||||||
<string name="settings_core_only_summary">Enable only core features, all modules will not be loaded. MagiskSU, MagiskHide, and systemless hosts will still be enabled</string>
|
<string name="settings_core_only_summary">Enable only core features, all modules will not be loaded. MagiskSU, MagiskHide, and systemless hosts will still be enabled</string>
|
||||||
<string name="settings_magiskhide_summary">Hide Magisk from various detections</string>
|
<string name="settings_magiskhide_summary">Hide Magisk from various detections</string>
|
||||||
|
1
common/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/build
|
|
@ -1,23 +0,0 @@
|
|||||||
apply plugin: 'com.android.library'
|
|
||||||
|
|
||||||
android {
|
|
||||||
compileSdkVersion 26
|
|
||||||
buildToolsVersion "26.0.2"
|
|
||||||
defaultConfig {
|
|
||||||
minSdkVersion 21
|
|
||||||
targetSdkVersion 26
|
|
||||||
versionCode 1
|
|
||||||
versionName "1.0"
|
|
||||||
|
|
||||||
}
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
minifyEnabled true
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
<manifest package="com.topjohnwu.resource" />
|
|
@ -3,8 +3,8 @@ apply plugin: 'java-library'
|
|||||||
apply plugin: 'com.github.johnrengelman.shadow'
|
apply plugin: 'com.github.johnrengelman.shadow'
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
|
||||||
sourceCompatibility = "1.7"
|
sourceCompatibility = "1.8"
|
||||||
targetCompatibility = "1.7"
|
targetCompatibility = "1.8"
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
|
@ -1 +1 @@
|
|||||||
include ':app', ':unhide', ':common', ':snet', ':jarsigner'
|
include ':app', ':snet', ':jarsigner'
|
@ -5,7 +5,7 @@ android {
|
|||||||
buildToolsVersion "26.0.2"
|
buildToolsVersion "26.0.2"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.topjohnwu.sn"
|
applicationId "com.topjohnwu.snet"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 26
|
targetSdkVersion 26
|
||||||
versionCode 1
|
versionCode 1
|
||||||
|
1
unhide/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/build
|
|
@ -1,25 +0,0 @@
|
|||||||
apply plugin: 'com.android.application'
|
|
||||||
|
|
||||||
android {
|
|
||||||
compileSdkVersion 26
|
|
||||||
buildToolsVersion "26.0.2"
|
|
||||||
defaultConfig {
|
|
||||||
applicationId "com.topjohnwu.unhide"
|
|
||||||
minSdkVersion 21
|
|
||||||
targetSdkVersion 26
|
|
||||||
versionCode 1
|
|
||||||
versionName "1.0"
|
|
||||||
}
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
shrinkResources true
|
|
||||||
minifyEnabled true
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
||||||
implementation project(':common')
|
|
||||||
}
|
|
25
unhide/proguard-rules.pro
vendored
@ -1,25 +0,0 @@
|
|||||||
# Add project specific ProGuard rules here.
|
|
||||||
# By default, the flags in this file are appended to flags specified
|
|
||||||
# in /Users/topjohnwu/Library/Android/sdk/tools/proguard/proguard-android.txt
|
|
||||||
# You can edit the include path and order by changing the proguardFiles
|
|
||||||
# directive in build.gradle.
|
|
||||||
#
|
|
||||||
# For more details, see
|
|
||||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
||||||
|
|
||||||
# Add any project specific keep options here:
|
|
||||||
|
|
||||||
# If your project uses WebView with JS, uncomment the following
|
|
||||||
# and specify the fully qualified class name to the JavaScript interface
|
|
||||||
# class:
|
|
||||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
||||||
# public *;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# Uncomment this to preserve the line number information for
|
|
||||||
# debugging stack traces.
|
|
||||||
#-keepattributes SourceFile,LineNumberTable
|
|
||||||
|
|
||||||
# If you keep the line number information, uncomment this to
|
|
||||||
# hide the original source file name.
|
|
||||||
#-renamesourcefileattribute SourceFile
|
|
@ -1,17 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.topjohnwu.unhide">
|
|
||||||
|
|
||||||
<application
|
|
||||||
android:icon="@mipmap/ic_launcher"
|
|
||||||
android:label="Unhide Magisk Manager"
|
|
||||||
android:theme="@android:style/Theme.NoDisplay">
|
|
||||||
<activity android:name=".MainActivity">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
</application>
|
|
||||||
|
|
||||||
</manifest>
|
|
@ -1,33 +0,0 @@
|
|||||||
package com.topjohnwu.unhide;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
public class MainActivity extends Activity {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
String command = String.format(
|
|
||||||
"pm unhide com.topjohnwu.magisk\n" +
|
|
||||||
"am start -n com.topjohnwu.magisk/.SplashActivity\n" +
|
|
||||||
"pm uninstall %s\n" +
|
|
||||||
"exit\n",
|
|
||||||
getApplicationInfo().packageName);
|
|
||||||
Process process;
|
|
||||||
try {
|
|
||||||
process = Runtime.getRuntime().exec("su");
|
|
||||||
OutputStream in = process.getOutputStream();
|
|
||||||
in.write(command.getBytes("UTF-8"));
|
|
||||||
in.flush();
|
|
||||||
process.waitFor();
|
|
||||||
} catch (IOException | InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
|