From f5cc2af5d0c75c18cb8ab79c83f68622d0968a33 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sat, 21 Oct 2017 22:54:47 +0800 Subject: [PATCH] Repackage Magisk Manager for hiding --- app/build.gradle | 1 - .../com/topjohnwu/magisk/MagiskManager.java | 21 ++++ .../topjohnwu/magisk/SettingsActivity.java | 18 ++-- .../topjohnwu/magisk/asyncs/HideManager.java | 93 +++++++++--------- .../magisk/asyncs/ProcessRepoZip.java | 4 +- .../magisk/database/SuDatabaseHelper.java | 34 ++++++- .../magisk/receivers/ManagerUpdate.java | 2 +- .../com/topjohnwu/magisk/utils/ZipUtils.java | 14 +-- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin app/src/main/res/values-de/strings.xml | 1 - app/src/main/res/values-el/strings.xml | 1 - app/src/main/res/values-es/strings.xml | 1 - app/src/main/res/values-et/strings.xml | 2 - app/src/main/res/values-fr/strings.xml | 3 +- app/src/main/res/values-nl/strings.xml | 1 - app/src/main/res/values-pl/strings.xml | 1 - app/src/main/res/values-pt-rBR/strings.xml | 1 - app/src/main/res/values-ro/strings.xml | 1 - app/src/main/res/values-ru/strings.xml | 1 - app/src/main/res/values-tr/strings.xml | 1 - app/src/main/res/values-uk/strings.xml | 1 - app/src/main/res/values-zh-rCN/strings.xml | 1 - app/src/main/res/values-zh-rTW/strings.xml | 1 - app/src/main/res/values/strings.xml | 4 +- common/.gitignore | 1 - common/build.gradle | 23 ----- common/src/main/AndroidManifest.xml | 1 - jarsigner/build.gradle | 4 +- settings.gradle | 2 +- snet/build.gradle | 2 +- unhide/.gitignore | 1 - unhide/build.gradle | 25 ----- unhide/proguard-rules.pro | 25 ----- unhide/src/main/AndroidManifest.xml | 17 ---- .../com/topjohnwu/unhide/MainActivity.java | 33 ------- 39 files changed, 127 insertions(+), 215 deletions(-) rename {common => app}/src/main/res/mipmap-hdpi/ic_launcher.png (100%) rename {common => app}/src/main/res/mipmap-mdpi/ic_launcher.png (100%) rename {common => app}/src/main/res/mipmap-xhdpi/ic_launcher.png (100%) rename {common => app}/src/main/res/mipmap-xxhdpi/ic_launcher.png (100%) rename {common => app}/src/main/res/mipmap-xxxhdpi/ic_launcher.png (100%) delete mode 100644 common/.gitignore delete mode 100644 common/build.gradle delete mode 100644 common/src/main/AndroidManifest.xml delete mode 100644 unhide/.gitignore delete mode 100644 unhide/build.gradle delete mode 100644 unhide/proguard-rules.pro delete mode 100644 unhide/src/main/AndroidManifest.xml delete mode 100644 unhide/src/main/java/com/topjohnwu/unhide/MainActivity.java diff --git a/app/build.gradle b/app/build.gradle index 3851bbb2c..a9846fe8f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -53,7 +53,6 @@ repositories { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation project(':common') implementation project(':jarsigner') implementation 'com.android.support:recyclerview-v7:26.1.0' implementation 'com.android.support:cardview-v7:26.1.0' diff --git a/app/src/main/java/com/topjohnwu/magisk/MagiskManager.java b/app/src/main/java/com/topjohnwu/magisk/MagiskManager.java index 547eb3d9e..e085562c9 100644 --- a/app/src/main/java/com/topjohnwu/magisk/MagiskManager.java +++ b/app/src/main/java/com/topjohnwu/magisk/MagiskManager.java @@ -9,6 +9,7 @@ import android.app.job.JobScheduler; import android.content.ComponentName; import android.content.Context; import android.content.SharedPreferences; +import android.content.pm.PackageManager; import android.content.res.Configuration; import android.content.res.Resources; import android.os.Build; @@ -44,6 +45,7 @@ public class MagiskManager extends Application { // Global weak reference to self private static WeakReference 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_HOST_FILE = "/magisk/.core/hosts"; public static final String TMP_FOLDER_PATH = "/dev/tmp"; @@ -68,6 +70,7 @@ public class MagiskManager extends Application { public final Topic localeDone = new Topic(); // Info + public int userId; public String magiskVersionString; public int magiskVersionCode = -1; public String remoteMagiskVersionString; @@ -125,6 +128,7 @@ public class MagiskManager extends Application { public void onCreate() { super.onCreate(); prefs = PreferenceManager.getDefaultSharedPreferences(this); + userId = getApplicationInfo().uid / 100000; if (Utils.getDatabasePath(this, SuDatabaseHelper.DB_NAME).exists()) { // Don't migrate yet, wait and check Magisk version @@ -133,6 +137,15 @@ public class MagiskManager extends Application { 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); defaultLocale = Locale.getDefault(); setLocale(); @@ -258,6 +271,14 @@ public class MagiskManager extends Application { // Setup suDB 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 if (UPDATE_SERVICE_VER > updateServiceVersion) { ComponentName service = new ComponentName(this, UpdateCheckService.class); diff --git a/app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java b/app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java index 935c30952..31c88496d 100644 --- a/app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java +++ b/app/src/main/java/com/topjohnwu/magisk/SettingsActivity.java @@ -108,7 +108,7 @@ public class SettingsActivity extends Activity implements Topic.Subscriber { setSummary(); // Disable dangerous settings in user mode if selected owner manage - if (getActivity().getApplicationInfo().uid > 99999) { + if (mm.userId > 0) { suCategory.removePreference(multiuserMode); generalCatagory.removePreference(hideManager); } @@ -125,12 +125,16 @@ public class SettingsActivity extends Activity implements Topic.Subscriber { return true; }); - hideManager.setOnPreferenceClickListener((pref) -> { - Utils.runWithPermission(getActivity(), - Manifest.permission.WRITE_EXTERNAL_STORAGE, - () -> new HideManager().exec()); - return true; - }); + if (mm.getPackageName().equals(MagiskManager.ORIG_PKG_NAME)) { + hideManager.setOnPreferenceClickListener((pref) -> { + Utils.runWithPermission(getActivity(), + Manifest.permission.WRITE_EXTERNAL_STORAGE, + () -> new HideManager().exec()); + return true; + }); + } else { + generalCatagory.removePreference(hideManager); + } if (!Shell.rootAccess()) { prefScreen.removePreference(magiskCategory); diff --git a/app/src/main/java/com/topjohnwu/magisk/asyncs/HideManager.java b/app/src/main/java/com/topjohnwu/magisk/asyncs/HideManager.java index a83ada077..3c20fb8ba 100644 --- a/app/src/main/java/com/topjohnwu/magisk/asyncs/HideManager.java +++ b/app/src/main/java/com/topjohnwu/magisk/asyncs/HideManager.java @@ -1,27 +1,26 @@ package com.topjohnwu.magisk.asyncs; -import android.content.pm.PackageManager; import android.os.Environment; import android.widget.Toast; import com.topjohnwu.jarsigner.JarMap; import com.topjohnwu.magisk.MagiskManager; 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.Utils; import com.topjohnwu.magisk.utils.ZipUtils; import java.io.File; +import java.io.FileInputStream; import java.security.SecureRandom; import java.util.List; +import java.util.Locale; import java.util.jar.JarEntry; public class HideManager extends ParallelTask { - private static final String UNHIDE_APK = "unhide.apk"; 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) { StringBuilder builder = new StringBuilder(length); @@ -44,9 +43,33 @@ public class HideManager extends ParallelTask { 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 protected void onPreExecute() { MagiskManager.toast(R.string.hide_manager_toast, Toast.LENGTH_SHORT); + MagiskManager.toast(R.string.hide_manager_toast2, Toast.LENGTH_LONG); } @Override @@ -54,67 +77,43 @@ public class HideManager extends ParallelTask { MagiskManager mm = MagiskManager.get(); // Generate a new unhide app with random package name - File unhideAPK = new File(Environment.getExternalStorageDirectory() + "/MagiskManager", "unhide.apk"); - unhideAPK.getParentFile().mkdirs(); - String pkg; + File repack = new File(Environment.getExternalStorageDirectory() + "/MagiskManager", "repack.apk"); + repack.getParentFile().mkdirs(); + String pkg = genPackageName("com.", MagiskManager.ORIG_PKG_NAME.length()); 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); - byte xml[] = asset.getRawData(je); - int offset = -1; + byte xml[] = apk.getRawData(je); - // Linear search pattern offset - for (int i = 0; i < xml.length - UNHIDE_PKG_NAME.length; ++i) { - boolean match = true; - 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) + if (!findAndPatch(xml, MagiskManager.ORIG_PKG_NAME, pkg)) + return false; + if (!findAndPatch(xml, MagiskManager.ORIG_PKG_NAME + ".provider", pkg + ".provider")) return false; - // Patch binary XML with new package name - pkg = genPackageName("com.", UNHIDE_PKG_NAME.length - 1); - System.arraycopy(pkg.getBytes(), 0, xml, offset, pkg.length()); - asset.getOutputStream(je).write(xml); + // Write in changes + apk.getOutputStream(je).write(xml); // Sign the APK - ZipUtils.signZip(mm, asset, unhideAPK, false); + ZipUtils.signZip(apk, repack, false); } catch (Exception e) { e.printStackTrace(); return false; } // Install the application - List ret = Shell.su("pm install " + unhideAPK + ">/dev/null && echo true || echo false"); - unhideAPK.delete(); + + List 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))) return false; - try { - // Allow the application to gain root by default - 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; - } + mm.suDB.setStrings(SuDatabaseHelper.REQUESTER, pkg); + Shell.su_raw(String.format(Locale.US, "pm uninstall --user %d %s", mm.userId, mm.getPackageName())); - // Hide myself! - Shell.su_raw("pm hide " + mm.getPackageName()); return true; } diff --git a/app/src/main/java/com/topjohnwu/magisk/asyncs/ProcessRepoZip.java b/app/src/main/java/com/topjohnwu/magisk/asyncs/ProcessRepoZip.java index 2eba9eb10..ac4f60a8c 100644 --- a/app/src/main/java/com/topjohnwu/magisk/asyncs/ProcessRepoZip.java +++ b/app/src/main/java/com/topjohnwu/magisk/asyncs/ProcessRepoZip.java @@ -132,13 +132,13 @@ public class ProcessRepoZip extends ParallelTask { publishProgress(SHOW_PROCESSING); // 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 ZipUtils.zipAdjust(temp2.getPath(), temp1.getPath()); // 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 try (OutputStream out = new BufferedOutputStream(new FileOutputStream(mFile)); diff --git a/app/src/main/java/com/topjohnwu/magisk/database/SuDatabaseHelper.java b/app/src/main/java/com/topjohnwu/magisk/database/SuDatabaseHelper.java index 757072abf..61eafe555 100644 --- a/app/src/main/java/com/topjohnwu/magisk/database/SuDatabaseHelper.java +++ b/app/src/main/java/com/topjohnwu/magisk/database/SuDatabaseHelper.java @@ -41,11 +41,14 @@ public class SuDatabaseHelper extends SQLiteOpenHelper { public static final int NAMESPACE_MODE_REQUESTER = 1; public static final int NAMESPACE_MODE_ISOLATE = 2; + public static final String REQUESTER = "requester"; + 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 LOG_TABLE = "logs"; private static final String SETTINGS_TABLE = "settings"; + private static final String STRINGS_TABLE = "strings"; private static String GLOBAL_DB; @@ -130,7 +133,7 @@ public class SuDatabaseHelper extends SQLiteOpenHelper { public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { if (oldVersion == 0) { createTables(db); - oldVersion = 2; + oldVersion = 3; } if (oldVersion == 1) { // 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"); ++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)) { // Hard link our DB globally @@ -335,4 +344,25 @@ public class SuDatabaseHelper extends SQLiteOpenHelper { } 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; + } } diff --git a/app/src/main/java/com/topjohnwu/magisk/receivers/ManagerUpdate.java b/app/src/main/java/com/topjohnwu/magisk/receivers/ManagerUpdate.java index cb319d6b3..2bee64fb7 100644 --- a/app/src/main/java/com/topjohnwu/magisk/receivers/ManagerUpdate.java +++ b/app/src/main/java/com/topjohnwu/magisk/receivers/ManagerUpdate.java @@ -24,7 +24,7 @@ public class ManagerUpdate extends BroadcastReceiver { Intent install = new Intent(Intent.ACTION_INSTALL_PACKAGE); install.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); Uri content = FileProvider.getUriForFile(context, - "com.topjohnwu.magisk.provider", new File(uri.getPath())); + context.getPackageName() + ".provider", new File(uri.getPath())); install.setData(content); context.startActivity(install); } else { diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/ZipUtils.java b/app/src/main/java/com/topjohnwu/magisk/utils/ZipUtils.java index 1d2cbc631..aa97c0ca2 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/ZipUtils.java +++ b/app/src/main/java/com/topjohnwu/magisk/utils/ZipUtils.java @@ -1,10 +1,10 @@ package com.topjohnwu.magisk.utils; -import android.content.Context; import android.content.res.AssetManager; import com.topjohnwu.jarsigner.JarMap; import com.topjohnwu.jarsigner.SignAPK; +import com.topjohnwu.magisk.MagiskManager; import java.io.BufferedInputStream; 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 { - signZip(context, new JarMap(is, false), output, minSign); + public static void signZip(InputStream is, File output, boolean minSign) throws Exception { + signZip(new JarMap(is, false), output, minSign); } - public static void signZip(Context context, File input, File output, boolean minSign) throws Exception { - signZip(context, new JarMap(input, false), output, minSign); + public static void signZip(File input, File output, boolean minSign) throws Exception { + signZip(new JarMap(input, false), output, minSign); } - public static void signZip(Context context, JarMap input, File output, boolean minSign) throws Exception { - AssetManager assets = context.getAssets(); + public static void signZip(JarMap input, File output, boolean minSign) throws Exception { + AssetManager assets = MagiskManager.get().getAssets(); SignAPK.signZip( assets.open(PUBLIC_KEY_NAME), assets.open(PRIVATE_KEY_NAME), input, output, minSign); diff --git a/common/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from common/src/main/res/mipmap-hdpi/ic_launcher.png rename to app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/common/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from common/src/main/res/mipmap-mdpi/ic_launcher.png rename to app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/common/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from common/src/main/res/mipmap-xhdpi/ic_launcher.png rename to app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/common/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from common/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/common/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from common/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index c2e07a1c2..86b04a376 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -122,7 +122,6 @@ Repo-Cache löschen Löscht die zwischengespeicherten Informationen der Online-Repos. Erzwingt eine Aktualisierung Magisk Manager verbergen - Magisk Manager temporär verbergen.\nDies installiert eine neue App namens \"Unhide Magisk Manager\" Sprache (Systemstandard) Update-Einstellungen diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 3424990b7..52ac29a6b 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -115,7 +115,6 @@ Εκκαθάριση προσωρινής μνήμης αποθετηρίων Καθαρίζει τις κρυφές πληροφορίες για απευθείας συνδεδεμένα αποθετήρια, αναγκάζει την εφαρμογή να κάνει ανανέωση σε απευθείας σύνδεση Κρύψιμο Magisk Manager - Προσωρινό κρύψιμο του Magisk Manager.\nΑυτό θα εγκαταστήσει μια νέα εφαρμογή με το όνομα \"Unhide Magisk Manager\" Γλώσσα (Προεπιλογή Συστήματος) Ρυθμίσεις Ενημερώσεων diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index f90607f14..b62547b81 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -132,7 +132,6 @@ Limpiar caché del repositorio Limpiar la información en caché para los repositorios en línea, fuerza a la aplicación a actualizar en línea Ocultar Magisk Manager - Ocultar temporalmente Magisk Manager.\nEsto instalará una nueva aplicación llamada \"Unhide Magisk Manager\" Idioma (Idioma del sistema) Ajustes de Actualización diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml index 11b1aaa0d..c33a367ce 100644 --- a/app/src/main/res/values-et/strings.xml +++ b/app/src/main/res/values-et/strings.xml @@ -135,8 +135,6 @@ Tühjenda hoidla vahemälu Tühjenda võrgus olevate hoidlate vahemälus olev teave, sunnib rakendust võrgust värskendama Peida Magisk Manager - Peida ajutiselt Magisk Manager.\n - See installib uue rakenduse nimega \"Unhide Magisk Manager" Keel (Süsteemi vaikesäte) Uuenda seadeid diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index bbbccd341..be49cb8f4 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -133,8 +133,7 @@ Notification Superuser %1$s secondes Masquer Magisk Manager - Masquer temporairement Magisk Manager.\nCeci installera une nouvelle appli appelée \"Unhide Magisk Manager\" - Langue + Langue (Selon système) Paramètres de mises à jour Canal de mise à jour diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 4bc7b709d..89c2f0684 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -128,7 +128,6 @@ Opslagcache wissen Wis de gecachte informatie voor online opslagplaatsen. Dit dwingt de app om online te verversen Magisk Manager verbergen - Magisk Manager tijdelijk verbergen.\nDit installeert een nieuwe app genaamd \"Unhide Magisk Manager\" Taal (Systeem standaard) Instellingen bijwerken diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 2438d689a..8c1dab999 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -131,7 +131,6 @@ Wyczyść Pamięć Repozytorium Wymusza na aplikacji odświeżenie online repozytorium Ukryj Magisk Manager - Tymczasowo ukryj Magisk Manager.\nSpowoduje to zainstalowanie nowej aplikacji o nazwie \"Pokaż Magisk Manager\" Język (Domyślny Systemu) Aktualizacja Ustawień diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index ae2427210..ca25cc4f9 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -134,7 +134,6 @@ Limpar Repo Cache Limpe as informações armazenadas em cache para repos. online, forçando o aplicativo a atualizar online Ocultar Magisk Manager - Oculta temporariamente o Magisk Manager.\nIsso irá instalar um novo aplicativo chamado \"Unhide Magisk Manager\" Linguagem (Padrão do Sistema) Atualizar Configurações diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 560cb8d71..ff290e541 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -108,7 +108,6 @@ Eliminare cache Ștergeți informațiile memorate în cache, forțează actualizarea aplicației online Ascundeţi Magisk Manager - Ascundeţi temporar Magisk Manager.\nAceasta va instala o nouă aplicație numită \"Unhide Magisk Manager\" Limbă (Implicit) diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 4294a467a..5b22482e8 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -131,7 +131,6 @@ Очистка кеша Очистить сохранённую информацию о сетевых репозиториях, заставляя приложение принудительно обновляться через Интернете Скрыть Менеджер Magisk - Временно скрывает Менеджер Magisk.\nБудет установлено новое приложение, называется \"Unhide Magisk Manager\" Язык По умолчанию (системный) Настройки обновления diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 709192c02..163952ff4 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -125,7 +125,6 @@ Repo Önbelleğini Temizle Çevrimiçi repolar için önbellek bilgilerini temizle, uygulamayı çevrimiçi yenilemeye zorla Magisk Manager\'ı Gizle - Magisk Manager\'ı geçici olarak gizle.\nBu, \"Unhide Magisk Manager\" adlı yeni bir uygulama yükleyecektir. Dil (Sistem Varsayılanı) Güncelleme Ayarları diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 1b0d93fc5..50cf605be 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -127,7 +127,6 @@ Очищення кешу Очистити збережену інформацію про мережеві репозиторії, змушуючи програму примусово оновлюватися через Інтернет Приховати Magisk Manager - Тимчасово приховати Magisk Manager.\nЦя дія встановить новий додаток \"Unhide Magisk Manager\" Мова Стандартна (системна) Оновити налаштування diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 0cf0c3203..d44e58bd8 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -130,7 +130,6 @@ 清除仓库缓存 清除已缓存的在线仓库信息,强制刷新在线数据 隐藏 Magisk Manager - 暂时隐藏 Magisk Manager。\n这将会安装一个应用“Unhide Magisk Manager”用以恢复显示。 语言 (系统默认) 更新设定 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 7582a07b8..6e3c191dc 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -186,7 +186,6 @@ 正在隱藏 Magisk Manager… 隱藏 Magisk Manager 失敗 隱藏 Magisk Manager - 暫時隱藏 Magisk Manager。\n這會新增一個新的 app 叫做 Unhide Magisk Manager 更新頻道 穩定版 測試版 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6e76d27c0..d903127ab 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -109,6 +109,7 @@ Magisk Updates Flashing Hiding Magisk Manager… + This might take a while… Hide Magisk Manager failed… Download Zip Only Patch Boot Image File @@ -134,7 +135,7 @@ Clear Repo Cache Clear the cached information for online repos, forces the app to refresh online Hide Magisk Manager - Temporarily hide Magisk Manager.\nThis will install a new app called \"Unhide Magisk Manager\" + Repackage Magisk Manager with random package name Language (System Default) Update Settings @@ -143,7 +144,6 @@ Beta Patched Boot Output Format Select the format of the output patched boot image.\nChoose .img to flash through fastboot/download mode; choose .img.tar to flash with ODIN. - Magisk Core Only Mode Enable only core features, all modules will not be loaded. MagiskSU, MagiskHide, and systemless hosts will still be enabled Hide Magisk from various detections diff --git a/common/.gitignore b/common/.gitignore deleted file mode 100644 index 796b96d1c..000000000 --- a/common/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/common/build.gradle b/common/build.gradle deleted file mode 100644 index d5c3aef0d..000000000 --- a/common/build.gradle +++ /dev/null @@ -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']) -} diff --git a/common/src/main/AndroidManifest.xml b/common/src/main/AndroidManifest.xml deleted file mode 100644 index f3e0777e5..000000000 --- a/common/src/main/AndroidManifest.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/jarsigner/build.gradle b/jarsigner/build.gradle index 5a4870103..59afb7317 100644 --- a/jarsigner/build.gradle +++ b/jarsigner/build.gradle @@ -3,8 +3,8 @@ apply plugin: 'java-library' apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'java' -sourceCompatibility = "1.7" -targetCompatibility = "1.7" +sourceCompatibility = "1.8" +targetCompatibility = "1.8" jar { manifest { diff --git a/settings.gradle b/settings.gradle index f03a99df7..f255cbc46 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':app', ':unhide', ':common', ':snet', ':jarsigner' \ No newline at end of file +include ':app', ':snet', ':jarsigner' \ No newline at end of file diff --git a/snet/build.gradle b/snet/build.gradle index e41372b04..98f4fcd19 100644 --- a/snet/build.gradle +++ b/snet/build.gradle @@ -5,7 +5,7 @@ android { buildToolsVersion "26.0.2" defaultConfig { - applicationId "com.topjohnwu.sn" + applicationId "com.topjohnwu.snet" minSdkVersion 21 targetSdkVersion 26 versionCode 1 diff --git a/unhide/.gitignore b/unhide/.gitignore deleted file mode 100644 index 796b96d1c..000000000 --- a/unhide/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/unhide/build.gradle b/unhide/build.gradle deleted file mode 100644 index 67f7a0b06..000000000 --- a/unhide/build.gradle +++ /dev/null @@ -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') -} diff --git a/unhide/proguard-rules.pro b/unhide/proguard-rules.pro deleted file mode 100644 index 71961146f..000000000 --- a/unhide/proguard-rules.pro +++ /dev/null @@ -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 diff --git a/unhide/src/main/AndroidManifest.xml b/unhide/src/main/AndroidManifest.xml deleted file mode 100644 index 65f25fcd1..000000000 --- a/unhide/src/main/AndroidManifest.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/unhide/src/main/java/com/topjohnwu/unhide/MainActivity.java b/unhide/src/main/java/com/topjohnwu/unhide/MainActivity.java deleted file mode 100644 index a63604a8b..000000000 --- a/unhide/src/main/java/com/topjohnwu/unhide/MainActivity.java +++ /dev/null @@ -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(); - } -}