mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-08-14 05:47:27 +00:00
Compare commits
34 Commits
manager-v5
...
manager-v5
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c840a30c30 | ||
![]() |
ae5277a898 | ||
![]() |
bffa837825 | ||
![]() |
b9e7d0faea | ||
![]() |
860b08d9ed | ||
![]() |
691dc1d49e | ||
![]() |
9d6886d367 | ||
![]() |
9589b68f5a | ||
![]() |
28d88af1af | ||
![]() |
8b5acd1849 | ||
![]() |
33dc63a7fd | ||
![]() |
d0a86385b7 | ||
![]() |
50a49e2c8c | ||
![]() |
c60adb113e | ||
![]() |
aee015e8f6 | ||
![]() |
bf6af29205 | ||
![]() |
329905d472 | ||
![]() |
00d450d262 | ||
![]() |
2365d1bd20 | ||
![]() |
5b385c18e5 | ||
![]() |
98c0434ec0 | ||
![]() |
f318d0a3bc | ||
![]() |
27f5b410c0 | ||
![]() |
3f55be9676 | ||
![]() |
b05d2d3a2d | ||
![]() |
19af5f9e0b | ||
![]() |
f37f330670 | ||
![]() |
40082d4571 | ||
![]() |
00d655f346 | ||
![]() |
821726e7c0 | ||
![]() |
759e905c3c | ||
![]() |
8bf7e42913 | ||
![]() |
0dcd073554 | ||
![]() |
2fe35d578d |
16
build.gradle
16
build.gradle
@@ -8,12 +8,8 @@ android {
|
||||
applicationId "com.topjohnwu.magisk"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 27
|
||||
versionCode 90
|
||||
versionName "5.5.4"
|
||||
ndk {
|
||||
moduleName 'zipadjust'
|
||||
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
|
||||
}
|
||||
versionCode 100
|
||||
versionName "5.6.0"
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
argument('butterknife.debuggable', 'false')
|
||||
@@ -36,11 +32,6 @@ android {
|
||||
preDexLibraries true
|
||||
javaMaxHeapSize "2g"
|
||||
}
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path 'src/main/jni/CMakeLists.txt'
|
||||
}
|
||||
}
|
||||
lintOptions {
|
||||
disable 'MissingTranslation'
|
||||
}
|
||||
@@ -54,7 +45,8 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation project(':crypto')
|
||||
implementation project(':utils')
|
||||
implementation 'com.github.topjohnwu:libsu:1.1.0'
|
||||
implementation 'com.android.support:recyclerview-v7:27.0.2'
|
||||
implementation 'com.android.support:cardview-v7:27.0.2'
|
||||
implementation 'com.android.support:design:27.0.2'
|
||||
|
4
proguard-rules.pro
vendored
4
proguard-rules.pro
vendored
@@ -20,7 +20,9 @@
|
||||
-keepnames class ** { *; }
|
||||
|
||||
# BouncyCastle
|
||||
-keep class org.bouncycastle.jcajce.provider.** { *; }
|
||||
-keep class org.bouncycastle.jcajce.provider.asymmetric.rsa.**SHA1** { *; }
|
||||
-keep class org.bouncycastle.jcajce.provider.asymmetric.RSA** { *; }
|
||||
-keep class org.bouncycastle.jcajce.provider.digest.SHA1** { *; }
|
||||
-dontwarn javax.naming.**
|
||||
|
||||
# Gson
|
||||
|
@@ -13,7 +13,7 @@
|
||||
|
||||
<application
|
||||
android:name=".MagiskManager"
|
||||
android:allowBackup="true"
|
||||
android:allowBackup="false"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:label="@string/app_name"
|
||||
|
@@ -1,3 +1,5 @@
|
||||
### v5.5.4
|
||||
- Fix on-boot dtbo detection
|
||||
- Add fingerprint authentication for Superuser requests
|
||||
### v5.6.0
|
||||
- Remove JNI requirement, Magisk Manager is now pure Java
|
||||
- Update the method of handling su database, may fix the issue that root requests won't save
|
||||
- Add the option to restore Magisk Manager after repackaging with random package name
|
||||
- Massive under-the-hood optimizations
|
||||
|
@@ -16,9 +16,9 @@ import android.widget.Toast;
|
||||
import com.topjohnwu.magisk.asyncs.FlashZip;
|
||||
import com.topjohnwu.magisk.asyncs.InstallMagisk;
|
||||
import com.topjohnwu.magisk.components.Activity;
|
||||
import com.topjohnwu.magisk.container.CallbackList;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.superuser.CallbackList;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
@@ -49,7 +49,7 @@ public class FlashActivity extends Activity {
|
||||
|
||||
@OnClick(R.id.reboot)
|
||||
void reboot() {
|
||||
Shell.su_raw("/system/bin/reboot");
|
||||
Shell.Async.su("/system/bin/reboot");
|
||||
}
|
||||
|
||||
@OnClick(R.id.save_logs)
|
||||
@@ -96,10 +96,10 @@ public class FlashActivity extends Activity {
|
||||
reboot.setVisibility(View.GONE);
|
||||
|
||||
logs = new ArrayList<>();
|
||||
List<String> console = new CallbackList<String>() {
|
||||
CallbackList<String> console = new CallbackList<String>(new ArrayList<>()) {
|
||||
@Override
|
||||
public synchronized void onAddElement(String e) {
|
||||
logs.add(e);
|
||||
public void onAddElement(String s) {
|
||||
logs.add(s);
|
||||
flashLogs.setText(TextUtils.join("\n", this));
|
||||
sv.postDelayed(() -> sv.fullScroll(ScrollView.FOCUS_DOWN), 10);
|
||||
}
|
||||
|
@@ -22,10 +22,10 @@ import com.topjohnwu.magisk.asyncs.CheckUpdates;
|
||||
import com.topjohnwu.magisk.components.AlertDialogBuilder;
|
||||
import com.topjohnwu.magisk.components.ExpandableView;
|
||||
import com.topjohnwu.magisk.components.Fragment;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.ShowUI;
|
||||
import com.topjohnwu.magisk.utils.Topic;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
import butterknife.BindColor;
|
||||
import butterknife.BindView;
|
||||
|
@@ -21,8 +21,9 @@ import com.topjohnwu.magisk.asyncs.ParallelTask;
|
||||
import com.topjohnwu.magisk.components.Fragment;
|
||||
import com.topjohnwu.magisk.components.SnackbarMaker;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.CallbackList;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
@@ -113,12 +114,18 @@ public class MagiskLogFragment extends Fragment {
|
||||
mode = (int) params[0];
|
||||
switch (mode) {
|
||||
case 0:
|
||||
StringBuildingList logList = new StringBuildingList();
|
||||
Shell.su(logList, "cat " + Const.MAGISK_LOG + " | tail -n 5000");
|
||||
return logList.getCharSequence();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
CallbackList<String> logs = new CallbackList<String>() {
|
||||
@Override
|
||||
public void onAddElement(String s) {
|
||||
builder.append(s).append('\n');
|
||||
}
|
||||
};
|
||||
Shell.Sync.su(logs, "cat " + Const.MAGISK_LOG + " | tail -n 5000");
|
||||
return builder;
|
||||
|
||||
case 1:
|
||||
Shell.su_raw("echo -n > " + Const.MAGISK_LOG);
|
||||
Shell.Async.su("echo -n > " + Const.MAGISK_LOG);
|
||||
SnackbarMaker.make(txtLog, R.string.logs_cleared, Snackbar.LENGTH_SHORT).show();
|
||||
return "";
|
||||
|
||||
@@ -138,8 +145,16 @@ public class MagiskLogFragment extends Fragment {
|
||||
}
|
||||
|
||||
try (FileWriter out = new FileWriter(targetFile)) {
|
||||
FileWritingList fileWritingList = new FileWritingList(out);
|
||||
Shell.su(fileWritingList, "cat " + Const.MAGISK_LOG);
|
||||
CallbackList<String> list = new CallbackList<String>() {
|
||||
@Override
|
||||
public void onAddElement(String s) {
|
||||
try {
|
||||
out.write(s);
|
||||
out.write("\n");
|
||||
} catch (IOException ignored) {}
|
||||
}
|
||||
};
|
||||
Shell.Sync.su(list, "cat " + Const.MAGISK_LOG);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
@@ -187,41 +202,4 @@ public class MagiskLogFragment extends Fragment {
|
||||
exec(2);
|
||||
}
|
||||
}
|
||||
|
||||
private static class StringBuildingList extends Shell.AbstractList<String> {
|
||||
|
||||
StringBuilder builder;
|
||||
|
||||
StringBuildingList() {
|
||||
builder = new StringBuilder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(String s) {
|
||||
builder.append(s).append("\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
public CharSequence getCharSequence() {
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
|
||||
private static class FileWritingList extends Shell.AbstractList<String> {
|
||||
|
||||
private FileWriter writer;
|
||||
|
||||
FileWritingList(FileWriter out) {
|
||||
writer = out;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(String s) {
|
||||
try {
|
||||
writer.write(s + "\n");
|
||||
} catch (IOException ignored) {}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.topjohnwu.magisk;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
@@ -8,22 +7,28 @@ import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Handler;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.topjohnwu.magisk.container.Module;
|
||||
import com.topjohnwu.magisk.database.RepoDatabaseHelper;
|
||||
import com.topjohnwu.magisk.database.SuDatabaseHelper;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Topic;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.BusyBox;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
public class MagiskManager extends Application {
|
||||
public class MagiskManager extends Shell.ContainerApp {
|
||||
|
||||
// Global weak reference to self
|
||||
private static WeakReference<MagiskManager> weakSelf;
|
||||
@@ -78,7 +83,6 @@ public class MagiskManager extends Application {
|
||||
public SharedPreferences prefs;
|
||||
public SuDatabaseHelper suDB;
|
||||
public RepoDatabaseHelper repoDB;
|
||||
public Shell shell;
|
||||
public Runnable permissionGrantCallback = null;
|
||||
|
||||
private static Handler mHandler = new Handler();
|
||||
@@ -90,6 +94,24 @@ public class MagiskManager extends Application {
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
Shell.setFlags(Shell.FLAG_MOUNT_MASTER);
|
||||
Shell.verboseLogging(BuildConfig.DEBUG);
|
||||
BusyBox.BB_PATH = new File(Const.BUSYBOX_PATH);
|
||||
Shell.setInitializer(new Shell.Initializer() {
|
||||
@Override
|
||||
public void onRootShellInit(@NonNull Shell shell) {
|
||||
try (InputStream in = MagiskManager.get().getAssets().open(Const.UTIL_FUNCTIONS)) {
|
||||
shell.loadInputStream(null, null, in);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
shell.run(null, null,
|
||||
"mount_partitions",
|
||||
"run_migrations");
|
||||
}
|
||||
});
|
||||
|
||||
prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
||||
// Handle duplicate package
|
||||
@@ -103,7 +125,15 @@ public class MagiskManager extends Application {
|
||||
} catch (PackageManager.NameNotFoundException ignored) { /* Expected */ }
|
||||
}
|
||||
|
||||
suDB = SuDatabaseHelper.getSuDB(false);
|
||||
suDB = SuDatabaseHelper.getInstance(this);
|
||||
|
||||
String pkg = suDB.getStrings(Const.Key.SU_REQUESTER, Const.ORIG_PKG_NAME);
|
||||
if (getPackageName().equals(Const.ORIG_PKG_NAME) && !pkg.equals(Const.ORIG_PKG_NAME)) {
|
||||
suDB.setStrings(Const.Key.SU_REQUESTER, null);
|
||||
Utils.uninstallPkg(pkg);
|
||||
suDB = SuDatabaseHelper.getInstance(this);
|
||||
}
|
||||
|
||||
repoDB = new RepoDatabaseHelper(this);
|
||||
defaultLocale = Locale.getDefault();
|
||||
setLocale();
|
||||
@@ -147,8 +177,8 @@ public class MagiskManager extends Application {
|
||||
prefs.edit()
|
||||
.putBoolean(Const.Key.DARK_THEME, isDarkTheme)
|
||||
.putBoolean(Const.Key.MAGISKHIDE, magiskHide)
|
||||
.putBoolean(Const.Key.HOSTS, Utils.itemExist(Const.MAGISK_HOST_FILE()))
|
||||
.putBoolean(Const.Key.COREONLY, Utils.itemExist(Const.MAGISK_DISABLE_FILE))
|
||||
.putBoolean(Const.Key.HOSTS, Const.MAGISK_HOST_FILE().exists())
|
||||
.putBoolean(Const.Key.COREONLY, Const.MAGISK_DISABLE_FILE.exists())
|
||||
.putString(Const.Key.SU_REQUEST_TIMEOUT, String.valueOf(suRequestTimeout))
|
||||
.putString(Const.Key.SU_AUTO_RESPONSE, String.valueOf(suResponseType))
|
||||
.putString(Const.Key.SU_NOTIFICATION, String.valueOf(suNotificationType))
|
||||
@@ -172,69 +202,22 @@ public class MagiskManager extends Application {
|
||||
}
|
||||
|
||||
public void loadMagiskInfo() {
|
||||
List<String> ret;
|
||||
ret = Shell.sh("magisk -v");
|
||||
if (!Utils.isValidShellResponse(ret)) {
|
||||
ret = Shell.sh("getprop magisk.version");
|
||||
if (Utils.isValidShellResponse(ret)) {
|
||||
try {
|
||||
magiskVersionString = ret.get(0);
|
||||
magiskVersionCode = (int) Double.parseDouble(ret.get(0)) * 10;
|
||||
} catch (NumberFormatException ignored) {}
|
||||
}
|
||||
} else {
|
||||
magiskVersionString = ret.get(0).split(":")[0];
|
||||
ret = Shell.sh("magisk -V");
|
||||
try {
|
||||
magiskVersionCode = Integer.parseInt(ret.get(0));
|
||||
} catch (NumberFormatException ignored) {}
|
||||
}
|
||||
if (magiskVersionCode > 1435) {
|
||||
ret = Shell.su("resetprop -p " + Const.MAGISKHIDE_PROP);
|
||||
} else {
|
||||
ret = Shell.sh("getprop " + Const.MAGISKHIDE_PROP);
|
||||
}
|
||||
try {
|
||||
magiskHide = !Utils.isValidShellResponse(ret) || Integer.parseInt(ret.get(0)) != 0;
|
||||
} catch (NumberFormatException e) {
|
||||
magiskHide = true;
|
||||
}
|
||||
magiskVersionString = Utils.cmd("magisk -v").split(":")[0];
|
||||
magiskVersionCode = Integer.parseInt(Utils.cmd("magisk -V"));
|
||||
String s = Utils.cmd((magiskVersionCode > 1435 ? "resetprop -p " : "getprop ") + Const.MAGISKHIDE_PROP);
|
||||
magiskHide = s == null || Integer.parseInt(s) != 0;
|
||||
} catch (Exception ignored) {}
|
||||
|
||||
ret = Shell.su("echo \"$BOOTIMAGE\"");
|
||||
if (Utils.isValidShellResponse(ret))
|
||||
bootBlock = ret.get(0);
|
||||
|
||||
if (suDB != null && !SuDatabaseHelper.verified) {
|
||||
suDB.close();
|
||||
suDB = SuDatabaseHelper.getSuDB(true);
|
||||
}
|
||||
bootBlock = Utils.cmd("echo \"$BOOTIMAGE\"");
|
||||
}
|
||||
|
||||
public void getDefaultInstallFlags() {
|
||||
List<String> ret;
|
||||
ret = Shell.su("echo \"$DTBOIMAGE\"");
|
||||
if (Utils.isValidShellResponse(ret))
|
||||
keepVerity = true;
|
||||
keepVerity = Boolean.parseBoolean(Utils.cmd("getvar KEEPVERITY; echo $KEEPVERITY")) ||
|
||||
Utils.cmd("echo \"$DTBOIMAGE\"") != null;
|
||||
|
||||
ret = Shell.su(
|
||||
"getvar KEEPVERITY",
|
||||
"echo $KEEPVERITY");
|
||||
try {
|
||||
if (Utils.isValidShellResponse(ret))
|
||||
keepVerity = Boolean.parseBoolean(ret.get(0));
|
||||
} catch (NumberFormatException ignored) {}
|
||||
|
||||
ret = Shell.sh("getprop ro.crypto.state");
|
||||
if (Utils.isValidShellResponse(ret) && ret.get(0).equals("encrypted"))
|
||||
keepEnc = true;
|
||||
|
||||
ret = Shell.su(
|
||||
"getvar KEEPFORCEENCRYPT",
|
||||
"echo $KEEPFORCEENCRYPT");
|
||||
try {
|
||||
if (Utils.isValidShellResponse(ret))
|
||||
keepEnc = Boolean.parseBoolean(ret.get(0));
|
||||
} catch (NumberFormatException ignored) {}
|
||||
keepEnc = Boolean.parseBoolean(Utils.cmd("getvar KEEPFORCEENCRYPT; echo $KEEPFORCEENCRYPT")) ||
|
||||
TextUtils.equals("encrypted", Utils.cmd("getprop ro.crypto.state"));
|
||||
}
|
||||
|
||||
public void setPermissionGrantCallback(Runnable callback) {
|
||||
|
@@ -19,9 +19,9 @@ import android.view.View;
|
||||
import com.topjohnwu.magisk.asyncs.MarkDownWindow;
|
||||
import com.topjohnwu.magisk.components.Activity;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Topic;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@@ -20,9 +20,9 @@ import com.topjohnwu.magisk.asyncs.LoadModules;
|
||||
import com.topjohnwu.magisk.components.Fragment;
|
||||
import com.topjohnwu.magisk.container.Module;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Topic;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -113,16 +113,16 @@ public class ModulesFragment extends Fragment implements Topic.Subscriber {
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.reboot:
|
||||
Shell.su_raw("/system/bin/reboot");
|
||||
Shell.Async.su("/system/bin/reboot");
|
||||
return true;
|
||||
case R.id.reboot_recovery:
|
||||
Shell.su_raw("/system/bin/reboot recovery");
|
||||
Shell.Async.su("/system/bin/reboot recovery");
|
||||
return true;
|
||||
case R.id.reboot_bootloader:
|
||||
Shell.su_raw("/system/bin/reboot bootloader");
|
||||
Shell.Async.su("/system/bin/reboot bootloader");
|
||||
return true;
|
||||
case R.id.reboot_download:
|
||||
Shell.su_raw("/system/bin/reboot download");
|
||||
Shell.Async.su("/system/bin/reboot download");
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.topjohnwu.magisk;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@@ -21,12 +22,14 @@ import android.widget.Toast;
|
||||
import com.topjohnwu.magisk.asyncs.CheckUpdates;
|
||||
import com.topjohnwu.magisk.asyncs.HideManager;
|
||||
import com.topjohnwu.magisk.components.Activity;
|
||||
import com.topjohnwu.magisk.receivers.ManagerUpdate;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.FingerprintHelper;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Topic;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Locale;
|
||||
|
||||
import butterknife.BindView;
|
||||
@@ -98,6 +101,7 @@ public class SettingsActivity extends Activity implements Topic.Subscriber {
|
||||
PreferenceCategory magiskCategory = (PreferenceCategory) findPreference("magisk");
|
||||
PreferenceCategory suCategory = (PreferenceCategory) findPreference("superuser");
|
||||
Preference hideManager = findPreference("hide");
|
||||
Preference restoreManager = findPreference("restore");
|
||||
findPreference("clear").setOnPreferenceClickListener((pref) -> {
|
||||
prefs.edit().remove(Const.Key.ETAG_KEY).apply();
|
||||
mm.repoDB.clearRepo();
|
||||
@@ -151,6 +155,38 @@ public class SettingsActivity extends Activity implements Topic.Subscriber {
|
||||
suCategory.removePreference(fingerprint);
|
||||
}
|
||||
|
||||
if (mm.magiskVersionCode >= 1440) {
|
||||
if (mm.getPackageName().equals(Const.ORIG_PKG_NAME)) {
|
||||
hideManager.setOnPreferenceClickListener((pref) -> {
|
||||
Utils.runWithPermission(getActivity(),
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
() -> new HideManager(getActivity()).exec());
|
||||
return true;
|
||||
});
|
||||
generalCatagory.removePreference(restoreManager);
|
||||
} else {
|
||||
if (Utils.checkNetworkStatus()) {
|
||||
restoreManager.setOnPreferenceClickListener((pref) -> {
|
||||
Utils.runWithPermission(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE, () -> {
|
||||
Intent intent = new Intent(mm, ManagerUpdate.class);
|
||||
intent.putExtra(Const.Key.INTENT_SET_LINK, mm.managerLink);
|
||||
intent.putExtra(Const.Key.INTENT_SET_FILENAME,
|
||||
Utils.fmt("MagiskManager-v%s(%d).apk",
|
||||
mm.remoteManagerVersionString, mm.remoteManagerVersionCode));
|
||||
mm.sendBroadcast(intent);
|
||||
});
|
||||
return true;
|
||||
});
|
||||
} else {
|
||||
generalCatagory.removePreference(restoreManager);
|
||||
}
|
||||
generalCatagory.removePreference(hideManager);
|
||||
}
|
||||
} else {
|
||||
generalCatagory.removePreference(restoreManager);
|
||||
generalCatagory.removePreference(hideManager);
|
||||
}
|
||||
|
||||
if (mm.getPackageName().equals(Const.ORIG_PKG_NAME) && mm.magiskVersionCode >= 1440) {
|
||||
hideManager.setOnPreferenceClickListener((pref) -> {
|
||||
Utils.runWithPermission(getActivity(),
|
||||
@@ -158,6 +194,7 @@ public class SettingsActivity extends Activity implements Topic.Subscriber {
|
||||
() -> new HideManager(getActivity()).exec());
|
||||
return true;
|
||||
});
|
||||
generalCatagory.removePreference(restoreManager);
|
||||
} else {
|
||||
generalCatagory.removePreference(hideManager);
|
||||
}
|
||||
@@ -223,26 +260,28 @@ public class SettingsActivity extends Activity implements Topic.Subscriber {
|
||||
break;
|
||||
case Const.Key.COREONLY:
|
||||
if (prefs.getBoolean(key, false)) {
|
||||
Utils.createFile(Const.MAGISK_DISABLE_FILE);
|
||||
try {
|
||||
Const.MAGISK_DISABLE_FILE.createNewFile();
|
||||
} catch (IOException ignored) {}
|
||||
} else {
|
||||
Utils.removeItem(Const.MAGISK_DISABLE_FILE);
|
||||
Const.MAGISK_DISABLE_FILE.delete();
|
||||
}
|
||||
Toast.makeText(getActivity(), R.string.settings_reboot_toast, Toast.LENGTH_LONG).show();
|
||||
break;
|
||||
case Const.Key.MAGISKHIDE:
|
||||
if (prefs.getBoolean(key, false)) {
|
||||
Shell.su_raw("magiskhide --enable");
|
||||
Shell.Async.su("magiskhide --enable");
|
||||
} else {
|
||||
Shell.su_raw("magiskhide --disable");
|
||||
Shell.Async.su("magiskhide --disable");
|
||||
}
|
||||
break;
|
||||
case Const.Key.HOSTS:
|
||||
if (prefs.getBoolean(key, false)) {
|
||||
Shell.su_raw(
|
||||
Shell.Async.su(
|
||||
"cp -af /system/etc/hosts " + Const.MAGISK_HOST_FILE(),
|
||||
"mount -o bind " + Const.MAGISK_HOST_FILE() + " /system/etc/hosts");
|
||||
} else {
|
||||
Shell.su_raw(
|
||||
Shell.Async.su(
|
||||
"umount -l /system/etc/hosts",
|
||||
"rm -f " + Const.MAGISK_HOST_FILE());
|
||||
}
|
||||
|
@@ -17,8 +17,8 @@ import com.topjohnwu.magisk.asyncs.UpdateRepos;
|
||||
import com.topjohnwu.magisk.components.Activity;
|
||||
import com.topjohnwu.magisk.services.UpdateCheckService;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
public class SplashActivity extends Activity {
|
||||
|
||||
|
@@ -18,9 +18,9 @@ import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.asyncs.ParallelTask;
|
||||
import com.topjohnwu.magisk.components.SnackbarMaker;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Topic;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -81,10 +81,10 @@ public class ApplicationAdapter extends RecyclerView.Adapter<ApplicationAdapter.
|
||||
holder.checkBox.setChecked(mHideList.contains(info.packageName));
|
||||
holder.checkBox.setOnCheckedChangeListener((v, isChecked) -> {
|
||||
if (isChecked) {
|
||||
Shell.su_raw("magiskhide --add " + info.packageName);
|
||||
Shell.Async.su("magiskhide --add " + info.packageName);
|
||||
mHideList.add(info.packageName);
|
||||
} else {
|
||||
Shell.su_raw("magiskhide --rm " + info.packageName);
|
||||
Shell.Async.su("magiskhide --rm " + info.packageName);
|
||||
mHideList.remove(info.packageName);
|
||||
}
|
||||
});
|
||||
@@ -155,7 +155,7 @@ public class ApplicationAdapter extends RecyclerView.Adapter<ApplicationAdapter.
|
||||
}
|
||||
Collections.sort(mOriginalList, (a, b) -> a.loadLabel(pm).toString().toLowerCase()
|
||||
.compareTo(b.loadLabel(pm).toString().toLowerCase()));
|
||||
mHideList = Shell.su("magiskhide --ls");
|
||||
mHideList = Shell.Sync.su("magiskhide --ls");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@ import android.widget.TextView;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.components.SnackbarMaker;
|
||||
import com.topjohnwu.magisk.container.Module;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -4,9 +4,9 @@ import android.app.Activity;
|
||||
|
||||
import com.topjohnwu.magisk.MagiskManager;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.utils.WebService;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
@@ -32,13 +32,13 @@ public class CheckSafetyNet extends ParallelTask<Void, Void, Exception> {
|
||||
}
|
||||
|
||||
private void dlSnet() throws IOException {
|
||||
Shell.sh("rm -rf " + dexPath.getParent());
|
||||
Shell.Sync.sh("rm -rf " + dexPath.getParent());
|
||||
HttpURLConnection conn = WebService.request(Const.Url.SNET_URL, null);
|
||||
dexPath.getParentFile().mkdir();
|
||||
try (
|
||||
OutputStream out = new BufferedOutputStream(new FileOutputStream(dexPath));
|
||||
InputStream in = new BufferedInputStream(conn.getInputStream())) {
|
||||
Utils.inToOut(in, out);
|
||||
ShellUtils.pump(in, out);
|
||||
}
|
||||
conn.disconnect();
|
||||
}
|
||||
|
@@ -8,9 +8,10 @@ import android.view.View;
|
||||
import com.topjohnwu.magisk.FlashActivity;
|
||||
import com.topjohnwu.magisk.MagiskManager;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.utils.ZipUtils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
@@ -38,8 +39,8 @@ public class FlashZip extends ParallelTask<Void, Void, Integer> {
|
||||
|
||||
private boolean unzipAndCheck() throws Exception {
|
||||
ZipUtils.unzip(mCachedFile, mCachedFile.getParentFile(), "META-INF/com/google/android", true);
|
||||
List<String> ret = Utils.readFile(new File(mCachedFile.getParentFile(), "updater-script"));
|
||||
return Utils.isValidShellResponse(ret) && ret.get(0).contains("#MAGISK");
|
||||
String s = Utils.cmd("head -n 1 " + new File(mCachedFile.getParentFile(), "updater-script"));
|
||||
return s != null && s.contains("#MAGISK");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,7 +56,7 @@ public class FlashZip extends ParallelTask<Void, Void, Integer> {
|
||||
) {
|
||||
if (in == null) throw new FileNotFoundException();
|
||||
InputStream buf= new BufferedInputStream(in);
|
||||
Utils.inToOut(buf, out);
|
||||
ShellUtils.pump(buf, out);
|
||||
} catch (FileNotFoundException e) {
|
||||
console.add("! Invalid Uri");
|
||||
throw e;
|
||||
@@ -65,7 +66,7 @@ public class FlashZip extends ParallelTask<Void, Void, Integer> {
|
||||
}
|
||||
if (!unzipAndCheck()) return 0;
|
||||
console.add("- Installing " + Utils.getNameFromUri(mm, mUri));
|
||||
Shell.getShell().run(console, logs,
|
||||
Shell.Sync.su(console, logs,
|
||||
"cd " + mCachedFile.getParent(),
|
||||
"BOOTMODE=true sh update-binary dummy 1 " + mCachedFile + " || echo 'Failed!'"
|
||||
);
|
||||
@@ -85,7 +86,7 @@ public class FlashZip extends ParallelTask<Void, Void, Integer> {
|
||||
@Override
|
||||
protected void onPostExecute(Integer result) {
|
||||
FlashActivity activity = (FlashActivity) getActivity();
|
||||
Shell.su_raw(
|
||||
Shell.Async.su(
|
||||
"rm -rf " + mCachedFile.getParent(),
|
||||
"rm -rf " + Const.TMP_FOLDER_PATH
|
||||
);
|
||||
|
@@ -4,18 +4,18 @@ import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.topjohnwu.crypto.JarMap;
|
||||
import com.topjohnwu.magisk.MagiskManager;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.utils.ZipUtils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
import com.topjohnwu.utils.JarMap;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.List;
|
||||
import java.util.jar.JarEntry;
|
||||
|
||||
public class HideManager extends ParallelTask<Void, Void, Boolean> {
|
||||
@@ -123,20 +123,20 @@ public class HideManager extends ParallelTask<Void, Void, Boolean> {
|
||||
apk.getOutputStream(je).write(xml);
|
||||
|
||||
// Sign the APK
|
||||
ZipUtils.signZip(apk, repack, false);
|
||||
ZipUtils.signZip(apk, repack);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Install the application
|
||||
|
||||
List<String> ret = Shell.su(Utils.fmt("pm install %s >/dev/null && echo true || echo false", repack));
|
||||
repack.delete();
|
||||
if (!Utils.isValidShellResponse(ret) || !Boolean.parseBoolean(ret.get(0)))
|
||||
if (!ShellUtils.fastCmdResult(Shell.getShell(), "pm install " + repack))
|
||||
return false;
|
||||
|
||||
repack.delete();
|
||||
|
||||
mm.suDB.setStrings(Const.Key.SU_REQUESTER, pkg);
|
||||
mm.suDB.flush();
|
||||
Utils.dumpPrefs();
|
||||
Utils.uninstallPkg(Const.ORIG_PKG_NAME);
|
||||
|
||||
|
@@ -1,20 +1,22 @@
|
||||
package com.topjohnwu.magisk.asyncs;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.res.AssetManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import com.topjohnwu.crypto.SignBoot;
|
||||
import com.topjohnwu.magisk.FlashActivity;
|
||||
import com.topjohnwu.magisk.MagiskManager;
|
||||
import com.topjohnwu.magisk.container.TarEntry;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.utils.ZipUtils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
import com.topjohnwu.superuser.io.SuFile;
|
||||
import com.topjohnwu.superuser.io.SuFileInputStream;
|
||||
import com.topjohnwu.utils.SignBoot;
|
||||
|
||||
import org.kamranzafar.jtar.TarInputStream;
|
||||
import org.kamranzafar.jtar.TarOutputStream;
|
||||
@@ -28,7 +30,6 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -70,7 +71,7 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
|
||||
mm.createDeviceProtectedStorageContext() :
|
||||
mm).getFilesDir().getParent()
|
||||
, "install");
|
||||
Shell.sh_raw("rm -rf " + install);
|
||||
Shell.Sync.sh("rm -rf " + install);
|
||||
|
||||
List<String> abis = Arrays.asList(Build.SUPPORTED_ABIS);
|
||||
String arch;
|
||||
@@ -102,17 +103,15 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
|
||||
console.add("! Cannot unzip zip");
|
||||
throw e;
|
||||
}
|
||||
Shell.sh("chmod 755 " + install + "/*");
|
||||
Shell.Sync.sh("chmod 755 " + install + "/*");
|
||||
|
||||
File boot = new File(install, "boot.img");
|
||||
boolean highCompression = false;
|
||||
switch (mode) {
|
||||
case PATCH_MODE:
|
||||
console.add("- Use boot image: " + boot);
|
||||
// Copy boot image to local
|
||||
try (
|
||||
InputStream in = mm.getContentResolver().openInputStream(mBootImg);
|
||||
OutputStream out = new FileOutputStream(boot)
|
||||
try (InputStream in = mm.getContentResolver().openInputStream(mBootImg);
|
||||
OutputStream out = new FileOutputStream(boot)
|
||||
) {
|
||||
InputStream source;
|
||||
if (in == null) throw new FileNotFoundException();
|
||||
@@ -130,7 +129,7 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
|
||||
// Direct copy raw image
|
||||
source = new BufferedInputStream(in);
|
||||
}
|
||||
Utils.inToOut(source, out);
|
||||
ShellUtils.pump(source, out);
|
||||
} catch (FileNotFoundException e) {
|
||||
console.add("! Invalid Uri");
|
||||
throw e;
|
||||
@@ -140,21 +139,16 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
|
||||
}
|
||||
break;
|
||||
case DIRECT_MODE:
|
||||
console.add("- Use boot image: " + mBootLocation);
|
||||
console.add("- Patch boot/ramdisk image: " + mBootLocation);
|
||||
if (mm.remoteMagiskVersionCode >= 1463) {
|
||||
List<String> ret = new ArrayList<>();
|
||||
Shell.getShell().run(ret, logs,
|
||||
install + "/magiskboot --parse " + mBootLocation,
|
||||
"echo $?"
|
||||
);
|
||||
if (Utils.isValidShellResponse(ret)) {
|
||||
highCompression = Integer.parseInt(ret.get(ret.size() - 1)) == 2;
|
||||
if (highCompression)
|
||||
console.add("! Insufficient boot partition size detected");
|
||||
}
|
||||
highCompression = Integer.parseInt(Utils.cmd(Utils.fmt(
|
||||
"%s/magiskboot --parse %s; echo $?",
|
||||
install, mBootLocation))) == 2;
|
||||
if (highCompression)
|
||||
console.add("! Insufficient boot partition size detected");
|
||||
}
|
||||
if (boot.createNewFile()) {
|
||||
Shell.su("cat " + mBootLocation + " > " + boot);
|
||||
Shell.Sync.su("cat " + mBootLocation + " > " + boot);
|
||||
} else {
|
||||
console.add("! Dump boot image failed");
|
||||
return false;
|
||||
@@ -168,22 +162,15 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
|
||||
try (InputStream in = new FileInputStream(boot)) {
|
||||
isSigned = SignBoot.verifySignature(in, null);
|
||||
if (isSigned) {
|
||||
console.add("- Signed boot image detected");
|
||||
console.add("- Boot image is signed with AVB 1.0");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
console.add("! Unable to check signature");
|
||||
throw e;
|
||||
}
|
||||
|
||||
// Force non-root shell
|
||||
Shell shell;
|
||||
if (Shell.rootAccess())
|
||||
shell = new Shell("sh");
|
||||
else
|
||||
shell = Shell.getShell();
|
||||
|
||||
// Patch boot image
|
||||
shell.run(console, logs,
|
||||
Shell.Sync.sh(console, logs,
|
||||
"cd " + install,
|
||||
Utils.fmt("KEEPFORCEENCRYPT=%b KEEPVERITY=%b HIGHCOMP=%b " +
|
||||
"sh update-binary indep boot_patch.sh %s || echo 'Failed!'",
|
||||
@@ -192,27 +179,22 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
|
||||
if (TextUtils.equals(console.get(console.size() - 1), "Failed!"))
|
||||
return false;
|
||||
|
||||
shell.run(null, null,
|
||||
"mv -f new-boot.img ../",
|
||||
Shell.Sync.sh("mv -f new-boot.img ../",
|
||||
"mv bin/busybox busybox",
|
||||
"rm -rf bin *.img update-binary",
|
||||
"cd /");
|
||||
|
||||
File patched_boot = new File(install.getParent(), "new-boot.img");
|
||||
SuFile patched_boot = new SuFile(install.getParent(), "new-boot.img");
|
||||
|
||||
if (isSigned) {
|
||||
console.add("- Signing boot image");
|
||||
console.add("- Signing boot image with test keys");
|
||||
File signed = new File(install.getParent(), "signed.img");
|
||||
AssetManager assets = mm.getAssets();
|
||||
try (
|
||||
InputStream in = new FileInputStream(patched_boot);
|
||||
OutputStream out = new BufferedOutputStream(new FileOutputStream(signed));
|
||||
InputStream keyIn = assets.open(Const.PRIVATE_KEY_NAME);
|
||||
InputStream certIn = assets.open(Const.PUBLIC_KEY_NAME)
|
||||
try (InputStream in = new SuFileInputStream(patched_boot);
|
||||
OutputStream out = new BufferedOutputStream(new FileOutputStream(signed))
|
||||
) {
|
||||
SignBoot.doSignature("/boot", in, out, keyIn, certIn);
|
||||
SignBoot.doSignature("/boot", in, out, null, null);
|
||||
}
|
||||
shell.run_raw(false, false, "mv -f " + signed + " " + patched_boot);
|
||||
Shell.Sync.sh("mv -f " + signed + " " + patched_boot);
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
@@ -230,8 +212,8 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
|
||||
out = new BufferedOutputStream(new FileOutputStream(dest));
|
||||
break;
|
||||
}
|
||||
try (InputStream in = new BufferedInputStream(new FileInputStream(patched_boot))) {
|
||||
Utils.inToOut(in, out);
|
||||
try (InputStream in = new SuFileInputStream(patched_boot)) {
|
||||
ShellUtils.pump(in, out);
|
||||
out.close();
|
||||
}
|
||||
console.add("");
|
||||
@@ -242,7 +224,7 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
|
||||
break;
|
||||
case DIRECT_MODE:
|
||||
String binPath = mm.remoteMagiskVersionCode >= 1464 ? "/data/adb/magisk" : "/data/magisk";
|
||||
Shell.getShell().run(console, logs,
|
||||
Shell.Sync.su(console, logs,
|
||||
Utils.fmt("rm -rf %s/*; mkdir -p %s; chmod 700 /data/adb", binPath, binPath),
|
||||
Utils.fmt("cp -af %s/* %s; rm -rf %s", install, binPath, install),
|
||||
Utils.fmt("flash_boot_image %s %s", patched_boot, mBootLocation),
|
||||
|
@@ -4,7 +4,7 @@ import com.topjohnwu.magisk.MagiskManager;
|
||||
import com.topjohnwu.magisk.container.Module;
|
||||
import com.topjohnwu.magisk.container.ValueSortedMap;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -12,7 +12,7 @@ public class LoadModules extends ParallelTask<Void, Void, Void> {
|
||||
|
||||
private List<String> getModList() {
|
||||
String command = "ls -d " + Const.MAGISK_PATH() + "/* | grep -v lost+found";
|
||||
return Shell.su(command);
|
||||
return Shell.Sync.su(command);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -6,8 +6,8 @@ import android.webkit.WebView;
|
||||
|
||||
import com.topjohnwu.magisk.MagiskManager;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.utils.WebService;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
|
||||
import org.commonmark.node.Node;
|
||||
import org.commonmark.parser.Parser;
|
||||
@@ -44,7 +44,7 @@ public class MarkDownWindow extends ParallelTask<Void, Void, String> {
|
||||
md = WebService.getString(mUrl);
|
||||
} else {
|
||||
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
|
||||
Utils.inToOut(is, out);
|
||||
ShellUtils.pump(is, out);
|
||||
md = out.toString();
|
||||
is.close();
|
||||
} catch (IOException e) {
|
||||
@@ -57,7 +57,7 @@ public class MarkDownWindow extends ParallelTask<Void, Void, String> {
|
||||
InputStream in = mm.getAssets().open(mm.isDarkTheme ? "dark.css" : "light.css");
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream()
|
||||
) {
|
||||
Utils.inToOut(in, out);
|
||||
ShellUtils.pump(in, out);
|
||||
css = out.toString();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
@@ -13,10 +13,11 @@ import com.topjohnwu.magisk.FlashActivity;
|
||||
import com.topjohnwu.magisk.MagiskManager;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.utils.WebService;
|
||||
import com.topjohnwu.magisk.utils.ZipUtils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
@@ -68,7 +69,7 @@ public class ProcessRepoZip extends ParallelTask<Void, Object, Boolean> {
|
||||
continue;
|
||||
}
|
||||
out.putNextEntry(new JarEntry(path));
|
||||
Utils.inToOut(in, out);
|
||||
ShellUtils.pump(in, out);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,7 +108,7 @@ public class ProcessRepoZip extends ParallelTask<Void, Object, Boolean> {
|
||||
InputStream in = new BufferedInputStream(new ProgressInputStream(conn.getInputStream()));
|
||||
OutputStream out = new BufferedOutputStream(new FileOutputStream(temp1))
|
||||
) {
|
||||
Utils.inToOut(in, out);
|
||||
ShellUtils.pump(in, out);
|
||||
in.close();
|
||||
}
|
||||
conn.disconnect();
|
||||
@@ -120,14 +121,8 @@ public class ProcessRepoZip extends ParallelTask<Void, Object, Boolean> {
|
||||
// First remove top folder in Github source zip, temp1 -> temp2
|
||||
removeTopFolder(temp1, temp2);
|
||||
|
||||
// Then sign the zip for the first time, temp2 -> temp1
|
||||
ZipUtils.signZip(temp2, temp1, false);
|
||||
|
||||
// Adjust the zip to prevent unzip issues, temp1 -> temp2
|
||||
ZipUtils.zipAdjust(temp1.getPath(), temp2.getPath());
|
||||
|
||||
// Finally, sign the whole zip file again, temp2 -> target
|
||||
ZipUtils.signZip(temp2, mFile, true);
|
||||
// Then sign the zip
|
||||
ZipUtils.signZip(temp2, mFile);
|
||||
|
||||
// Delete temp files
|
||||
temp1.delete();
|
||||
|
@@ -4,29 +4,24 @@ import android.widget.Toast;
|
||||
|
||||
import com.topjohnwu.magisk.MagiskManager;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
|
||||
import java.util.List;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
|
||||
public class RestoreImages extends ParallelTask<Void, Void, Boolean> {
|
||||
|
||||
@Override
|
||||
protected Boolean doInBackground(Void... voids) {
|
||||
String sha1;
|
||||
List<String> ret = Utils.readFile("/.backup/.sha1");
|
||||
if (Utils.isValidShellResponse(ret)) {
|
||||
sha1 = ret.get(0);
|
||||
} else {
|
||||
ret = Shell.su("cat /init.magisk.rc | grep STOCKSHA1");
|
||||
if (!Utils.isValidShellResponse(ret))
|
||||
sha1 = Utils.cmd("cat /.backup/.sha1");
|
||||
if (sha1 == null) {
|
||||
sha1 = Utils.cmd("cat /init.magisk.rc | grep STOCKSHA1");
|
||||
if (sha1 == null)
|
||||
return false;
|
||||
sha1 = ret.get(0).substring(ret.get(0).indexOf('=') + 1);
|
||||
sha1 = sha1.substring(sha1.indexOf('=') + 1);
|
||||
}
|
||||
|
||||
ret = Shell.su("restore_imgs " + sha1 + " && echo true || echo false");
|
||||
|
||||
return Utils.isValidShellResponse(ret) && Boolean.parseBoolean(ret.get(ret.size() - 1));
|
||||
return ShellUtils.fastCmdResult(Shell.getShell(), "restore_imgs " + sha1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,22 +0,0 @@
|
||||
package com.topjohnwu.magisk.container;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public abstract class CallbackList<E> extends ArrayList<E> {
|
||||
|
||||
private Handler handler;
|
||||
|
||||
protected CallbackList() {
|
||||
handler = new Handler();
|
||||
}
|
||||
|
||||
public abstract void onAddElement(E e);
|
||||
|
||||
public synchronized boolean add(E e) {
|
||||
boolean ret = super.add(e);
|
||||
handler.post(() -> onAddElement(e));
|
||||
return ret;
|
||||
}
|
||||
}
|
@@ -1,21 +1,24 @@
|
||||
package com.topjohnwu.magisk.container;
|
||||
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.io.SuFile;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Module extends BaseModule {
|
||||
|
||||
private String mRemoveFile, mDisableFile, mUpdateFile;
|
||||
private SuFile mRemoveFile, mDisableFile, mUpdateFile;
|
||||
private boolean mEnable, mRemove, mUpdated;
|
||||
|
||||
public Module(String path) {
|
||||
|
||||
try {
|
||||
parseProps(Utils.readFile(path + "/module.prop"));
|
||||
parseProps(Shell.Sync.su("cat " + path + "/module.prop"));
|
||||
} catch (NumberFormatException ignored) {}
|
||||
|
||||
mRemoveFile = path + "/remove";
|
||||
mDisableFile = path + "/disable";
|
||||
mUpdateFile = path + "/update";
|
||||
mRemoveFile = new SuFile(path + "/remove", true);
|
||||
mDisableFile = new SuFile(path + "/disable", true);
|
||||
mUpdateFile = new SuFile(path + "/update", true);
|
||||
|
||||
if (getId() == null) {
|
||||
int sep = path.lastIndexOf('/');
|
||||
@@ -26,19 +29,21 @@ public class Module extends BaseModule {
|
||||
setName(getId());
|
||||
}
|
||||
|
||||
mEnable = !Utils.itemExist(mDisableFile);
|
||||
mRemove = Utils.itemExist(mRemoveFile);
|
||||
mUpdated = Utils.itemExist(mUpdateFile);
|
||||
mEnable = !mDisableFile.exists();
|
||||
mRemove = mRemoveFile.exists();
|
||||
mUpdated = mUpdateFile.exists();
|
||||
}
|
||||
|
||||
public void createDisableFile() {
|
||||
mEnable = false;
|
||||
Utils.createFile(mDisableFile);
|
||||
try {
|
||||
mDisableFile.createNewFile();
|
||||
} catch (IOException ignored) {}
|
||||
}
|
||||
|
||||
public void removeDisableFile() {
|
||||
mEnable = true;
|
||||
Utils.removeItem(mDisableFile);
|
||||
mDisableFile.delete();
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
@@ -47,12 +52,14 @@ public class Module extends BaseModule {
|
||||
|
||||
public void createRemoveFile() {
|
||||
mRemove = true;
|
||||
Utils.createFile(mRemoveFile);
|
||||
try {
|
||||
mRemoveFile.createNewFile();
|
||||
} catch (IOException ignored) {}
|
||||
}
|
||||
|
||||
public void deleteRemoveFile() {
|
||||
mRemove = false;
|
||||
Utils.removeItem(mRemoveFile);
|
||||
mRemoveFile.delete();
|
||||
}
|
||||
|
||||
public boolean willBeRemoved() {
|
||||
|
@@ -5,8 +5,8 @@ import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.os.Build;
|
||||
import android.os.Process;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -15,8 +15,8 @@ import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.container.Policy;
|
||||
import com.topjohnwu.magisk.container.SuLogEntry;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DateFormat;
|
||||
@@ -25,142 +25,104 @@ import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class SuDatabaseHelper extends SQLiteOpenHelper {
|
||||
|
||||
public static final String DB_NAME = "su.db";
|
||||
public static boolean verified = false;
|
||||
public class SuDatabaseHelper {
|
||||
|
||||
private static final int DATABASE_VER = 5;
|
||||
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 final File GLOBAL_DB = new File("/data/adb/magisk.db");
|
||||
|
||||
private Context mContext;
|
||||
private PackageManager pm;
|
||||
private SQLiteDatabase mDb;
|
||||
private File DB_FILE;
|
||||
|
||||
private static void unmntDB() {
|
||||
Shell.su(Utils.fmt("umount -l /data/user*/*/%s/*/*.db", MagiskManager.get().getPackageName()));
|
||||
}
|
||||
|
||||
private static Context initDB(boolean verify) {
|
||||
Context context, de = null;
|
||||
MagiskManager ce = MagiskManager.get();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
de = ce.createDeviceProtectedStorageContext();
|
||||
File ceDB = Utils.getDB(ce, DB_NAME);
|
||||
if (ceDB.exists()) {
|
||||
context = ce;
|
||||
} else {
|
||||
context = de;
|
||||
}
|
||||
} else {
|
||||
context = ce;
|
||||
}
|
||||
|
||||
File db = Utils.getDB(context, DB_NAME);
|
||||
if (!verify) {
|
||||
if (db.exists() && db.length() == 0) {
|
||||
ce.loadMagiskInfo();
|
||||
// Continue verification
|
||||
} else {
|
||||
return context;
|
||||
}
|
||||
}
|
||||
|
||||
// Encryption storage
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
if (ce.magiskVersionCode < 1410) {
|
||||
if (context == de) {
|
||||
unmntDB();
|
||||
ce.moveDatabaseFrom(de, DB_NAME);
|
||||
context = ce;
|
||||
}
|
||||
} else {
|
||||
if (context == ce) {
|
||||
unmntDB();
|
||||
de.moveDatabaseFrom(ce, DB_NAME);
|
||||
context = de;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Context might be updated
|
||||
db = Utils.getDB(context, DB_NAME);
|
||||
|
||||
if (!Shell.rootAccess())
|
||||
return context;
|
||||
|
||||
// Verify the global db matches the local with the same inode
|
||||
if (ce.magiskVersionCode >= 1450 && ce.magiskVersionCode < 1460) {
|
||||
// v14.5 global su db
|
||||
File OLD_GLOBAL_DB = new File(context.getFilesDir().getParentFile().getParentFile(), "magisk.db");
|
||||
verified = TextUtils.equals(Utils.checkInode(OLD_GLOBAL_DB), Utils.checkInode(db));
|
||||
if (!verified) {
|
||||
context.deleteDatabase(DB_NAME);
|
||||
db.getParentFile().mkdirs();
|
||||
Shell.su(Utils.fmt("magisk --clone-attr %s %s; chmod 600 %s; ln %s %s",
|
||||
context.getFilesDir(), OLD_GLOBAL_DB, OLD_GLOBAL_DB, OLD_GLOBAL_DB, db));
|
||||
verified = TextUtils.equals(Utils.checkInode(OLD_GLOBAL_DB), Utils.checkInode(db));
|
||||
}
|
||||
} else if (ce.magiskVersionCode >= 1464) {
|
||||
// New global su db
|
||||
Shell.su(Utils.fmt("mkdir %s 2>/dev/null; chmod 700 %s", GLOBAL_DB.getParent(), GLOBAL_DB.getParent()));
|
||||
if (!Utils.itemExist(GLOBAL_DB)) {
|
||||
context.openOrCreateDatabase(DB_NAME, 0, null).close();
|
||||
Shell.su(Utils.fmt("cp -af %s %s; rm -f %s*", db, GLOBAL_DB, db));
|
||||
}
|
||||
verified = TextUtils.equals(Utils.checkInode(GLOBAL_DB), Utils.checkInode(db));
|
||||
if (!verified) {
|
||||
context.deleteDatabase(DB_NAME);
|
||||
Utils.javaCreateFile(db);
|
||||
Shell.su(Utils.fmt(
|
||||
"chown 0.0 %s; chmod 666 %s; chcon u:object_r:su_file:s0 %s;" +
|
||||
"mount -o bind %s %s",
|
||||
GLOBAL_DB, GLOBAL_DB, GLOBAL_DB, GLOBAL_DB, db));
|
||||
verified = TextUtils.equals(Utils.checkInode(GLOBAL_DB), Utils.checkInode(db));
|
||||
}
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
public static SuDatabaseHelper getSuDB(boolean verify) {
|
||||
public static SuDatabaseHelper getInstance(MagiskManager mm) {
|
||||
try {
|
||||
return new SuDatabaseHelper(initDB(verify));
|
||||
} catch(Exception e) {
|
||||
// Try to catch runtime exceptions and remove all db for retry
|
||||
unmntDB();
|
||||
Shell.su(Utils.fmt("rm -rf /data/user*/*/magisk.db /data/adb/magisk.db /data/user*/*/%s/databases",
|
||||
MagiskManager.get().getPackageName()));
|
||||
e.printStackTrace();
|
||||
return new SuDatabaseHelper(initDB(false));
|
||||
return new SuDatabaseHelper(mm);
|
||||
} catch (Exception e) {
|
||||
// Let's cleanup everything and try again
|
||||
cleanup("*");
|
||||
return new SuDatabaseHelper(mm);
|
||||
}
|
||||
}
|
||||
|
||||
private SuDatabaseHelper(Context context) {
|
||||
super(context, DB_NAME, null, DATABASE_VER);
|
||||
mContext = context;
|
||||
pm = context.getPackageManager();
|
||||
mDb = getWritableDatabase();
|
||||
cleanup();
|
||||
public static void cleanup() {
|
||||
cleanup(String.valueOf(Const.USER_ID));
|
||||
}
|
||||
|
||||
if (context.getPackageName().equals(Const.ORIG_PKG_NAME)) {
|
||||
String pkg = getStrings(Const.Key.SU_REQUESTER, null);
|
||||
if (pkg != null) {
|
||||
Utils.uninstallPkg(pkg);
|
||||
setStrings(Const.Key.SU_REQUESTER, null);
|
||||
public static void cleanup(String s) {
|
||||
Shell.Sync.su(
|
||||
"umount -l /data/user*/*/*/databases/su.db",
|
||||
"umount -l /sbin/.core/db-" + s + "/magisk.db",
|
||||
"rm -rf /sbin/.core/db-" + s);
|
||||
}
|
||||
|
||||
private SuDatabaseHelper(MagiskManager mm) {
|
||||
pm = mm.getPackageManager();
|
||||
mDb = openDatabase(mm);
|
||||
int version = mDb.getVersion();
|
||||
if (version < DATABASE_VER) {
|
||||
onUpgrade(mDb, version);
|
||||
} else if (version > DATABASE_VER) {
|
||||
onDowngrade(mDb);
|
||||
}
|
||||
mDb.setVersion(DATABASE_VER);
|
||||
clearOutdated();
|
||||
}
|
||||
|
||||
private SQLiteDatabase openDatabase(MagiskManager mm) {
|
||||
String GLOBAL_DB = "/data/adb/magisk.db";
|
||||
DB_FILE = new File(Utils.fmt("/sbin/.core/db-%d/magisk.db", Const.USER_ID));
|
||||
Context de = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N
|
||||
? mm.createDeviceProtectedStorageContext() : mm;
|
||||
if (!DB_FILE.exists()) {
|
||||
if (!Shell.rootAccess()) {
|
||||
// We don't want the app to crash, create a db and return
|
||||
DB_FILE = mm.getDatabasePath("su.db");
|
||||
return mm.openOrCreateDatabase("su.db", Context.MODE_PRIVATE, null);
|
||||
}
|
||||
mm.loadMagiskInfo();
|
||||
// Cleanup
|
||||
cleanup();
|
||||
if (mm.magiskVersionCode < 1410) {
|
||||
// Super old legacy mode
|
||||
DB_FILE = mm.getDatabasePath("su.db");
|
||||
return mm.openOrCreateDatabase("su.db", Context.MODE_PRIVATE, null);
|
||||
} else if (mm.magiskVersionCode < 1450) {
|
||||
// Legacy mode with FBE aware
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
de.moveDatabaseFrom(mm, "su.db");
|
||||
}
|
||||
DB_FILE = de.getDatabasePath("su.db");
|
||||
return de.openOrCreateDatabase("su.db", Context.MODE_PRIVATE, null);
|
||||
} else {
|
||||
mm.deleteDatabase("su.db");
|
||||
de.deleteDatabase("su.db");
|
||||
if (mm.magiskVersionCode < 1460) {
|
||||
// v14.5 global DB location
|
||||
GLOBAL_DB = new File(de.getFilesDir().getParentFile().getParentFile(),
|
||||
"magisk.db").getPath();
|
||||
// We need some additional policies on old versions
|
||||
Shell.Sync.su("magiskpolicy --live 'create su_file' 'allow * su_file file *'");
|
||||
}
|
||||
// Touch global DB and setup db in tmpfs
|
||||
Shell.Sync.su(Utils.fmt("touch %s; mkdir -p %s; touch %s; touch %s-journal;" +
|
||||
"mount -o bind %s %s;" +
|
||||
"chcon u:object_r:su_file:s0 %s/*; chown %d.%d %s;" +
|
||||
"chmod 666 %s/*; chmod 700 %s;",
|
||||
GLOBAL_DB, DB_FILE.getParent(), DB_FILE, DB_FILE,
|
||||
GLOBAL_DB, DB_FILE,
|
||||
DB_FILE.getParent(), Process.myUid(), Process.myUid(), DB_FILE.getParent(),
|
||||
DB_FILE.getParent(), DB_FILE.getParent()
|
||||
));
|
||||
}
|
||||
}
|
||||
// Not using legacy mode, open the mounted global DB
|
||||
return SQLiteDatabase.openOrCreateDatabase(DB_FILE, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
onUpgrade(db, 0, DATABASE_VER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion) {
|
||||
try {
|
||||
if (oldVersion == 0) {
|
||||
createTables(db);
|
||||
@@ -196,23 +158,18 @@ public class SuDatabaseHelper extends SQLiteOpenHelper {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
onDowngrade(db, DATABASE_VER, 0);
|
||||
onDowngrade(db);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
// Remove everything, we do not support downgrade
|
||||
public void onDowngrade(SQLiteDatabase db) {
|
||||
MagiskManager.toast(R.string.su_db_corrupt, Toast.LENGTH_LONG);
|
||||
// Remove everything, we do not support downgrade
|
||||
db.execSQL("DROP TABLE IF EXISTS " + POLICY_TABLE);
|
||||
db.execSQL("DROP TABLE IF EXISTS " + LOG_TABLE);
|
||||
db.execSQL("DROP TABLE IF EXISTS " + SETTINGS_TABLE);
|
||||
db.execSQL("DROP TABLE IF EXISTS " + STRINGS_TABLE);
|
||||
onUpgrade(db, 0, DATABASE_VER);
|
||||
}
|
||||
|
||||
public File getDbFile() {
|
||||
return mContext.getDatabasePath(DB_NAME);
|
||||
onUpgrade(db, 0);
|
||||
}
|
||||
|
||||
private void createTables(SQLiteDatabase db) {
|
||||
@@ -235,7 +192,7 @@ public class SuDatabaseHelper extends SQLiteOpenHelper {
|
||||
"(key TEXT, value INT, PRIMARY KEY(key))");
|
||||
}
|
||||
|
||||
public void cleanup() {
|
||||
public void clearOutdated() {
|
||||
// Clear outdated policies
|
||||
mDb.delete(POLICY_TABLE, Utils.fmt("until > 0 AND until < %d", System.currentTimeMillis() / 1000), null);
|
||||
// Clear outdated logs
|
||||
@@ -363,4 +320,9 @@ public class SuDatabaseHelper extends SQLiteOpenHelper {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public void flush() {
|
||||
mDb.close();
|
||||
mDb = SQLiteDatabase.openOrCreateDatabase(DB_FILE, null);
|
||||
}
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ public class ManagerUpdate extends BroadcastReceiver {
|
||||
}
|
||||
},
|
||||
intent.getStringExtra(Const.Key.INTENT_SET_LINK),
|
||||
Utils.fmt("MagiskManager-v%s.apk", intent.getStringExtra(Const.Key.INTENT_SET_VERSION))
|
||||
intent.getStringExtra(Const.Key.INTENT_SET_FILENAME)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -6,8 +6,8 @@ import android.content.Intent;
|
||||
|
||||
import com.topjohnwu.magisk.MagiskManager;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
public class PackageReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
@@ -25,7 +25,7 @@ public class PackageReceiver extends BroadcastReceiver {
|
||||
break;
|
||||
case Intent.ACTION_PACKAGE_FULLY_REMOVED:
|
||||
mm.suDB.deletePolicy(pkg);
|
||||
Shell.su_raw("magiskhide --rm " + pkg);
|
||||
Shell.Async.su("magiskhide --rm " + pkg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -4,11 +4,11 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
public class RebootReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Shell.su_raw("/system/bin/reboot");
|
||||
Shell.Async.su("/system/bin/reboot");
|
||||
}
|
||||
}
|
||||
|
@@ -8,8 +8,8 @@ import android.support.v4.app.NotificationCompat;
|
||||
import com.topjohnwu.magisk.MagiskManager;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.utils.Const;
|
||||
import com.topjohnwu.magisk.utils.Shell;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
public class OnBootIntentService extends IntentService {
|
||||
|
||||
|
@@ -68,7 +68,7 @@ public class RequestActivity extends Activity {
|
||||
|
||||
pm = getPackageManager();
|
||||
mm = Utils.getMagiskManager(this);
|
||||
mm.suDB.cleanup();
|
||||
mm.suDB.clearOutdated();
|
||||
|
||||
Intent intent = getIntent();
|
||||
socketPath = intent.getStringExtra("socket");
|
||||
|
@@ -2,12 +2,10 @@ package com.topjohnwu.magisk.utils;
|
||||
|
||||
import android.support.annotation.Keep;
|
||||
|
||||
import com.topjohnwu.crypto.SignBoot;
|
||||
import com.topjohnwu.utils.SignBoot;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
public class BootSigner {
|
||||
|
||||
@@ -15,30 +13,23 @@ public class BootSigner {
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (args.length > 0 && "-verify".equals(args[0])) {
|
||||
String certPath = "";
|
||||
if (args.length >= 3 && "-certificate".equals(args[1])) {
|
||||
/* args[2] is the path to a public key certificate */
|
||||
certPath = args[2];
|
||||
if (args.length >= 2) {
|
||||
/* args[1] is the path to a public key certificate */
|
||||
certPath = args[1];
|
||||
}
|
||||
/* args[1] is the path to a signed boot image */
|
||||
boolean signed = SignBoot.verifySignature(System.in,
|
||||
certPath.isEmpty() ? null : new FileInputStream(certPath));
|
||||
System.exit(signed ? 0 : 1);
|
||||
} else if (args.length > 0 && "-sign".equals(args[0])) {
|
||||
InputStream keyIn, certIn;
|
||||
if (args.length >= 3) {
|
||||
keyIn = new FileInputStream(args[1]);
|
||||
certIn = new FileInputStream(args[2]);
|
||||
} else {
|
||||
/* Use internal test keys */
|
||||
JarFile apk = new JarFile(System.getProperty("java.class.path"));
|
||||
JarEntry keyEntry = apk.getJarEntry("assets/" + Const.PRIVATE_KEY_NAME);
|
||||
JarEntry sigEntry = apk.getJarEntry("assets/" + Const.PUBLIC_KEY_NAME);
|
||||
InputStream cert = null;
|
||||
InputStream key = null;
|
||||
|
||||
keyIn = apk.getInputStream(keyEntry);
|
||||
certIn = apk.getInputStream(sigEntry);
|
||||
if (args.length >= 3) {
|
||||
cert = new FileInputStream(args[1]);
|
||||
key = new FileInputStream(args[2]);
|
||||
}
|
||||
|
||||
boolean success = SignBoot.doSignature("/boot", System.in, System.out, keyIn, certIn);
|
||||
boolean success = SignBoot.doSignature("/boot", System.in, System.out, cert, key);
|
||||
System.exit(success ? 0 : 1);
|
||||
} else {
|
||||
System.err.println(
|
||||
@@ -48,8 +39,8 @@ public class BootSigner {
|
||||
"Actions:\n" +
|
||||
" -verify [x509.pem]\n" +
|
||||
" verify image, cert is optional\n" +
|
||||
" -sign [pk8] [x509.pem]\n" +
|
||||
" sign image, key and cert are optional\n"
|
||||
" -sign [x509.pem] [pk8]\n" +
|
||||
" sign image, cert and key pair is optional\n"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@ import android.os.Environment;
|
||||
import android.os.Process;
|
||||
|
||||
import com.topjohnwu.magisk.MagiskManager;
|
||||
import com.topjohnwu.superuser.io.SuFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
@@ -17,8 +18,6 @@ public class Const {
|
||||
public static final String MAGISKHIDE_PROP = "persist.magisk.hide";
|
||||
|
||||
// APK content
|
||||
public static final String PUBLIC_KEY_NAME = "public.certificate.x509.pem";
|
||||
public static final String PRIVATE_KEY_NAME = "private.key.pk8";
|
||||
public static final String UNINSTALLER = "magisk_uninstaller.sh";
|
||||
public static final String UTIL_FUNCTIONS= "util_functions.sh";
|
||||
public static final String ANDROID_MANIFEST = "AndroidManifest.xml";
|
||||
@@ -26,7 +25,9 @@ public class Const {
|
||||
public static final String SU_KEYSTORE_KEY = "su_key";
|
||||
|
||||
// Paths
|
||||
public static final String MAGISK_DISABLE_FILE = "/cache/.disable_magisk";
|
||||
private static SuFile MAGISK_PATH = null;
|
||||
public static final SuFile MAGISK_DISABLE_FILE = new SuFile("/cache/.disable_magisk", true);
|
||||
public static final String BUSYBOX_PATH = "/sbin/.core/busybox";
|
||||
public static final String TMP_FOLDER_PATH = "/dev/tmp";
|
||||
public static final String MAGISK_LOG = "/cache/magisk.log";
|
||||
public static final File EXTERNAL_PATH = new File(Environment.getExternalStorageDirectory(), "MagiskManager");
|
||||
@@ -37,26 +38,23 @@ public class Const {
|
||||
public static final int SNET_VER = 7;
|
||||
public static final int MIN_MODULE_VER = 1400;
|
||||
|
||||
public static String BUSYBOX_PATH() {
|
||||
if (Utils.itemExist("/sbin/.core/busybox/busybox")) {
|
||||
return "/sbin/.core/busybox";
|
||||
} else {
|
||||
return "/dev/magisk/bin";
|
||||
public synchronized static SuFile MAGISK_PATH() {
|
||||
SuFile file;
|
||||
if (MAGISK_PATH == null) {
|
||||
file = new SuFile("/sbin/.core/img", true);
|
||||
if (file.exists()) {
|
||||
MAGISK_PATH = file;
|
||||
} else if ((file = new SuFile("/dev/magisk/img", true)).exists()) {
|
||||
MAGISK_PATH = file;
|
||||
} else {
|
||||
MAGISK_PATH = new SuFile("/magisk", true);
|
||||
}
|
||||
}
|
||||
return MAGISK_PATH;
|
||||
}
|
||||
|
||||
public static String MAGISK_PATH() {
|
||||
if (Utils.itemExist("/sbin/.core/img")) {
|
||||
return "/sbin/.core/img";
|
||||
} else if (Utils.itemExist("/dev/magisk/img")) {
|
||||
return "/dev/magisk/img";
|
||||
} else {
|
||||
return "/magisk";
|
||||
}
|
||||
}
|
||||
|
||||
public static String MAGISK_HOST_FILE() {
|
||||
return MAGISK_PATH() + "/.core/hosts";
|
||||
public static SuFile MAGISK_HOST_FILE() {
|
||||
return new SuFile(MAGISK_PATH() + "/.core/hosts");
|
||||
}
|
||||
|
||||
/* A list of apps that should not be shown as hide-able */
|
||||
@@ -115,7 +113,7 @@ public class Const {
|
||||
|
||||
// intents
|
||||
public static final String OPEN_SECTION = "section";
|
||||
public static final String INTENT_SET_VERSION = "version";
|
||||
public static final String INTENT_SET_FILENAME = "filename";
|
||||
public static final String INTENT_SET_LINK = "link";
|
||||
public static final String INTENT_PERM = "perm_dialog";
|
||||
public static final String FLASH_ACTION = "action";
|
||||
|
@@ -18,7 +18,7 @@ import javax.crypto.KeyGenerator;
|
||||
import javax.crypto.SecretKey;
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.M)
|
||||
public abstract class FingerprintHelper extends FingerprintManager.AuthenticationCallback {
|
||||
public abstract class FingerprintHelper {
|
||||
|
||||
private FingerprintManager manager;
|
||||
private Cipher cipher;
|
||||
@@ -30,7 +30,7 @@ public abstract class FingerprintHelper extends FingerprintManager.Authenticatio
|
||||
MagiskManager mm = MagiskManager.get();
|
||||
KeyguardManager km = mm.getSystemService(KeyguardManager.class);
|
||||
FingerprintManager fm = mm.getSystemService(FingerprintManager.class);
|
||||
return km.isKeyguardSecure() && fm.isHardwareDetected() && fm.hasEnrolledFingerprints();
|
||||
return km.isKeyguardSecure() && fm != null && fm.isHardwareDetected() && fm.hasEnrolledFingerprints();
|
||||
}
|
||||
|
||||
protected FingerprintHelper() throws Exception {
|
||||
@@ -54,10 +54,38 @@ public abstract class FingerprintHelper extends FingerprintManager.Authenticatio
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void onAuthenticationError(int errorCode, CharSequence errString);
|
||||
|
||||
public abstract void onAuthenticationHelp(int helpCode, CharSequence helpString);
|
||||
|
||||
public abstract void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result);
|
||||
|
||||
public abstract void onAuthenticationFailed();
|
||||
|
||||
public void startAuth() {
|
||||
cancel = new CancellationSignal();
|
||||
FingerprintManager.CryptoObject cryptoObject = new FingerprintManager.CryptoObject(cipher);
|
||||
manager.authenticate(cryptoObject, cancel, 0, this, null);
|
||||
manager.authenticate(cryptoObject, cancel, 0, new FingerprintManager.AuthenticationCallback() {
|
||||
@Override
|
||||
public void onAuthenticationError(int errorCode, CharSequence errString) {
|
||||
FingerprintHelper.this.onAuthenticationError(errorCode, errString);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationHelp(int helpCode, CharSequence helpString) {
|
||||
FingerprintHelper.this.onAuthenticationHelp(helpCode, helpString);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
|
||||
FingerprintHelper.this.onAuthenticationSucceeded(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationFailed() {
|
||||
FingerprintHelper.this.onAuthenticationFailed();
|
||||
}
|
||||
}, null);
|
||||
}
|
||||
|
||||
public void cancel() {
|
||||
|
@@ -1,207 +0,0 @@
|
||||
package com.topjohnwu.magisk.utils;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.topjohnwu.magisk.MagiskManager;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Modified by topjohnwu, based on Chainfire's libsuperuser
|
||||
*/
|
||||
|
||||
public class Shell {
|
||||
|
||||
// -2 = not initialized; -1 = no shell; 0 = non root shell; 1 = root shell
|
||||
public static int status = -2;
|
||||
|
||||
private final Process process;
|
||||
private final OutputStream STDIN;
|
||||
private final InputStream STDOUT;
|
||||
private final InputStream STDERR;
|
||||
|
||||
private static void testRootShell(Shell shell) throws IOException {
|
||||
shell.STDIN.write(("id\n").getBytes("UTF-8"));
|
||||
shell.STDIN.flush();
|
||||
String s = new BufferedReader(new InputStreamReader(shell.STDOUT)).readLine();
|
||||
if (TextUtils.isEmpty(s) || !s.contains("uid=0")) {
|
||||
shell.STDIN.close();
|
||||
shell.STDIN.close();
|
||||
throw new IOException();
|
||||
}
|
||||
}
|
||||
|
||||
public Shell(String command) throws IOException {
|
||||
process = Runtime.getRuntime().exec(command);
|
||||
STDIN = process.getOutputStream();
|
||||
STDOUT = process.getInputStream();
|
||||
STDERR = process.getErrorStream();
|
||||
}
|
||||
|
||||
public static Shell getShell() {
|
||||
MagiskManager mm = MagiskManager.get();
|
||||
boolean needNewShell = mm.shell == null;
|
||||
|
||||
if (!needNewShell) {
|
||||
try {
|
||||
mm.shell.process.exitValue();
|
||||
// The process is dead
|
||||
needNewShell = true;
|
||||
} catch (IllegalThreadStateException ignored) {
|
||||
// This should be the expected result
|
||||
}
|
||||
}
|
||||
|
||||
if (needNewShell) {
|
||||
status = 1;
|
||||
try {
|
||||
mm.shell = new Shell("su --mount-master");
|
||||
testRootShell(mm.shell);
|
||||
} catch (IOException e) {
|
||||
// Mount master not implemented
|
||||
try {
|
||||
mm.shell = new Shell("su");
|
||||
testRootShell(mm.shell);
|
||||
} catch (IOException e1) {
|
||||
// No root exists
|
||||
status = 0;
|
||||
try {
|
||||
mm.shell = new Shell("sh");
|
||||
} catch (IOException e2) {
|
||||
status = -1;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rootAccess()) {
|
||||
// Load utility shell scripts
|
||||
try (InputStream in = mm.getAssets().open(Const.UTIL_FUNCTIONS)) {
|
||||
mm.shell.loadInputStream(in);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Root shell initialization
|
||||
mm.shell.run_raw(false, false,
|
||||
"export PATH=" + Const.BUSYBOX_PATH() + ":$PATH",
|
||||
"mount_partitions",
|
||||
"run_migrations");
|
||||
}
|
||||
}
|
||||
|
||||
return mm.shell;
|
||||
}
|
||||
|
||||
public static boolean rootAccess() {
|
||||
if (status == -2) getShell();
|
||||
return status > 0;
|
||||
}
|
||||
|
||||
public void run(Collection<String> output, Collection<String> error, String... commands) {
|
||||
StreamGobbler out, err;
|
||||
synchronized (process) {
|
||||
try {
|
||||
out = new StreamGobbler(STDOUT, output);
|
||||
err = new StreamGobbler(STDERR, error);
|
||||
out.start();
|
||||
err.start();
|
||||
run_raw(output != null, error != null, commands);
|
||||
STDIN.write("echo \'-shell-done-\'\necho \'-shell-done-\' >&2\n".getBytes("UTF-8"));
|
||||
STDIN.flush();
|
||||
try {
|
||||
out.join();
|
||||
err.join();
|
||||
} catch (InterruptedException ignored) {}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
process.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void run_raw(boolean stdout, boolean stderr, String... commands) {
|
||||
String suffix = "\n";
|
||||
if (!stderr) suffix = " 2>/dev/null" + suffix;
|
||||
if (!stdout) suffix = " >/dev/null" + suffix;
|
||||
synchronized (process) {
|
||||
try {
|
||||
for (String command : commands) {
|
||||
Logger.shell(true, command);
|
||||
STDIN.write((command + suffix).getBytes("UTF-8"));
|
||||
STDIN.flush();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
process.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void loadInputStream(InputStream in) {
|
||||
synchronized (process) {
|
||||
try {
|
||||
Utils.inToOut(in, STDIN);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static List<String> sh(String... commands) {
|
||||
List<String> res = new ArrayList<>();
|
||||
sh(res, commands);
|
||||
return res;
|
||||
}
|
||||
|
||||
public static void sh(Collection<String> output, String... commands) {
|
||||
Shell shell = getShell();
|
||||
if (shell == null)
|
||||
return;
|
||||
shell.run(output, null, commands);
|
||||
}
|
||||
|
||||
public static void sh_raw(String... commands) {
|
||||
Shell shell = getShell();
|
||||
if (shell == null)
|
||||
return;
|
||||
shell.run_raw(false, false, commands);
|
||||
}
|
||||
|
||||
public static List<String> su(String... commands) {
|
||||
if (!rootAccess()) return sh();
|
||||
return sh(commands);
|
||||
}
|
||||
|
||||
public static void su(Collection<String> output, String... commands) {
|
||||
if (!rootAccess()) return;
|
||||
sh(output, commands);
|
||||
}
|
||||
|
||||
public static void su_raw(String... commands) {
|
||||
if (!rootAccess()) return;
|
||||
sh_raw(commands);
|
||||
}
|
||||
|
||||
public static abstract class AbstractList<E> extends java.util.AbstractList<E> {
|
||||
|
||||
@Override
|
||||
public abstract boolean add(E e);
|
||||
|
||||
@Override
|
||||
public E get(int i) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
@@ -22,6 +22,8 @@ import com.topjohnwu.magisk.components.AlertDialogBuilder;
|
||||
import com.topjohnwu.magisk.receivers.DownloadReceiver;
|
||||
import com.topjohnwu.magisk.receivers.ManagerUpdate;
|
||||
import com.topjohnwu.magisk.receivers.RebootReceiver;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
@@ -57,10 +59,12 @@ public class ShowUI {
|
||||
|
||||
public static void managerUpdateNotification() {
|
||||
MagiskManager mm = MagiskManager.get();
|
||||
String filename = Utils.fmt("MagiskManager-v%s(%d).apk",
|
||||
mm.remoteManagerVersionString, mm.remoteManagerVersionCode);
|
||||
|
||||
Intent intent = new Intent(mm, ManagerUpdate.class);
|
||||
intent.putExtra(Const.Key.INTENT_SET_LINK, mm.managerLink);
|
||||
intent.putExtra(Const.Key.INTENT_SET_VERSION, mm.remoteManagerVersionString);
|
||||
intent.putExtra(Const.Key.INTENT_SET_FILENAME, filename);
|
||||
PendingIntent pendingIntent = PendingIntent.getBroadcast(mm,
|
||||
Const.ID.APK_UPDATE_NOTIFICATION_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
||||
@@ -98,7 +102,8 @@ public class ShowUI {
|
||||
|
||||
public static void magiskInstallDialog(Activity activity) {
|
||||
MagiskManager mm = Utils.getMagiskManager(activity);
|
||||
String filename = Utils.fmt("Magisk-v%s.zip", mm.remoteMagiskVersionString);
|
||||
String filename = Utils.fmt("Magisk-v%s(%d).zip",
|
||||
mm.remoteMagiskVersionString, mm.remoteMagiskVersionCode);
|
||||
new AlertDialogBuilder(activity)
|
||||
.setTitle(mm.getString(R.string.repo_install_title, mm.getString(R.string.magisk)))
|
||||
.setMessage(mm.getString(R.string.repo_install_msg, filename))
|
||||
@@ -110,11 +115,11 @@ public class ShowUI {
|
||||
if (Shell.rootAccess()) {
|
||||
options.add(mm.getString(R.string.direct_install));
|
||||
}
|
||||
List<String> res = Shell.su("echo $SLOT");
|
||||
if (Utils.isValidShellResponse(res)) {
|
||||
String s = Utils.cmd("echo $SLOT");
|
||||
if (s != null) {
|
||||
options.add(mm.getString(R.string.install_second_slot));
|
||||
}
|
||||
char[] slot = Utils.isValidShellResponse(res) ? res.get(0).toCharArray() : null;
|
||||
char[] slot = s == null ? null : s.toCharArray();
|
||||
new AlertDialog.Builder(activity)
|
||||
.setTitle(R.string.select_method)
|
||||
.setItems(
|
||||
@@ -184,13 +189,12 @@ public class ShowUI {
|
||||
if (slot[1] == 'a') slot[1] = 'b';
|
||||
else slot[1] = 'a';
|
||||
// Then find the boot image again
|
||||
List<String> ret = Shell.su(
|
||||
"SLOT=" + String.valueOf(slot),
|
||||
"find_boot_image",
|
||||
boot = Utils.cmd(
|
||||
"SLOT=" + String.valueOf(slot) +
|
||||
"; find_boot_image;" +
|
||||
"echo \"$BOOTIMAGE\""
|
||||
);
|
||||
boot = Utils.isValidShellResponse(ret) ? ret.get(ret.size() - 1) : null;
|
||||
Shell.su_raw("mount_partitions");
|
||||
Shell.Async.su("mount_partitions");
|
||||
if (boot == null)
|
||||
return;
|
||||
receiver = new DownloadReceiver() {
|
||||
@@ -205,12 +209,7 @@ public class ShowUI {
|
||||
};
|
||||
default:
|
||||
}
|
||||
Utils.dlAndReceive(
|
||||
activity,
|
||||
receiver,
|
||||
mm.magiskLink,
|
||||
filename
|
||||
);
|
||||
Utils.dlAndReceive(activity, receiver, mm.magiskLink, filename);
|
||||
}
|
||||
).show();
|
||||
})
|
||||
@@ -227,16 +226,17 @@ public class ShowUI {
|
||||
|
||||
public static void managerInstallDialog(Activity activity) {
|
||||
MagiskManager mm = Utils.getMagiskManager(activity);
|
||||
String filename = Utils.fmt("MagiskManager-v%s(%d).apk",
|
||||
mm.remoteManagerVersionString, mm.remoteManagerVersionCode);
|
||||
new AlertDialogBuilder(activity)
|
||||
.setTitle(mm.getString(R.string.repo_install_title, mm.getString(R.string.app_name)))
|
||||
.setMessage(mm.getString(R.string.repo_install_msg,
|
||||
Utils.fmt("MagiskManager-v%s.apk", mm.remoteManagerVersionString)))
|
||||
.setMessage(mm.getString(R.string.repo_install_msg, filename))
|
||||
.setCancelable(true)
|
||||
.setPositiveButton(R.string.install, (d, i) -> {
|
||||
Utils.runWithPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE, () -> {
|
||||
Intent intent = new Intent(mm, ManagerUpdate.class);
|
||||
intent.putExtra(Const.Key.INTENT_SET_LINK, mm.managerLink);
|
||||
intent.putExtra(Const.Key.INTENT_SET_VERSION, mm.remoteManagerVersionString);
|
||||
intent.putExtra(Const.Key.INTENT_SET_FILENAME, filename);
|
||||
mm.sendBroadcast(intent);
|
||||
});
|
||||
})
|
||||
@@ -252,20 +252,20 @@ public class ShowUI {
|
||||
.setPositiveButton(R.string.complete_uninstall, (d, i) -> {
|
||||
ByteArrayOutputStream uninstaller = new ByteArrayOutputStream();
|
||||
try (InputStream in = mm.getAssets().open(Const.UNINSTALLER)) {
|
||||
Utils.inToOut(in, uninstaller);
|
||||
ShellUtils.pump(in, uninstaller);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
ByteArrayOutputStream utils = new ByteArrayOutputStream();
|
||||
try (InputStream in = mm.getAssets().open(Const.UTIL_FUNCTIONS)) {
|
||||
Utils.inToOut(in, utils);
|
||||
ShellUtils.pump(in, utils);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
Shell.su(
|
||||
Shell.Sync.su(
|
||||
Utils.fmt("echo '%s' > /cache/%s", uninstaller.toString().replace("'", "'\\''"), Const.UNINSTALLER),
|
||||
Utils.fmt("echo '%s' > %s/%s", utils.toString().replace("'", "'\\''"),
|
||||
mm.magiskVersionCode >= 1464 ? "/data/adb/magisk" : "/data/magisk", Const.UTIL_FUNCTIONS)
|
||||
|
@@ -1,63 +0,0 @@
|
||||
package com.topjohnwu.magisk.utils;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* Modified by topjohnwu, based on Chainfire's libsuperuser
|
||||
*/
|
||||
|
||||
public class StreamGobbler extends Thread {
|
||||
|
||||
private BufferedReader reader;
|
||||
private Collection<String> writer;
|
||||
|
||||
/**
|
||||
* <p>StreamGobbler constructor</p>
|
||||
*
|
||||
* <p>We use this class because sh STDOUT and STDERR should be read as quickly as
|
||||
* possible to prevent a deadlock from occurring, or Process.waitFor() never
|
||||
* returning (as the buffer is full, pausing the native process)</p>
|
||||
*
|
||||
* @param in InputStream to read from
|
||||
* @param out {@literal List<String>} to write to, or null
|
||||
*/
|
||||
public StreamGobbler(InputStream in, Collection<String> out) {
|
||||
try {
|
||||
while (in.available() != 0) {
|
||||
in.skip(in.available());
|
||||
}
|
||||
} catch (IOException ignored) {}
|
||||
reader = new BufferedReader(new InputStreamReader(in));
|
||||
writer = out == null ? null : Collections.synchronizedCollection(out);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// keep reading the InputStream until it ends (or an error occurs)
|
||||
try {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
if (TextUtils.equals(line, "-shell-done-"))
|
||||
return;
|
||||
if (writer != null) writer.add(line);
|
||||
Logger.shell(false, line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// reader probably closed, expected exit condition
|
||||
}
|
||||
|
||||
// make sure our stream is closed and resources will be freed
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
// read already closed
|
||||
}
|
||||
}
|
||||
}
|
@@ -19,7 +19,6 @@ import android.support.annotation.StringRes;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
@@ -28,12 +27,13 @@ import com.topjohnwu.magisk.MagiskManager;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.SplashActivity;
|
||||
import com.topjohnwu.magisk.components.SnackbarMaker;
|
||||
import com.topjohnwu.magisk.database.SuDatabaseHelper;
|
||||
import com.topjohnwu.magisk.receivers.DownloadReceiver;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
import com.topjohnwu.superuser.io.SuFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@@ -45,41 +45,13 @@ public class Utils {
|
||||
|
||||
public static boolean isDownloading = false;
|
||||
|
||||
public static boolean itemExist(Object path) {
|
||||
List<String> ret = Shell.su(fmt("[ -e %s ] && echo true || echo false", path));
|
||||
return isValidShellResponse(ret) && Boolean.parseBoolean(ret.get(0));
|
||||
}
|
||||
|
||||
public static void createFile(Object path) {
|
||||
Shell.su_raw(fmt("mkdir -p `dirname '%s'` 2>/dev/null; touch '%s' 2>/dev/null", path, path));
|
||||
}
|
||||
|
||||
public static boolean javaCreateFile(File path) {
|
||||
path.getParentFile().mkdirs();
|
||||
try {
|
||||
path.createNewFile();
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeItem(Object path) {
|
||||
Shell.su_raw(fmt("rm -rf %s 2>/dev/null", path));
|
||||
}
|
||||
|
||||
public static List<String> readFile(Object path) {
|
||||
return Shell.su(fmt("cat %s | sed '$a\\ ' | sed '$d'", path));
|
||||
}
|
||||
|
||||
public static String checkInode(Object path) {
|
||||
List<String> ret = Shell.su(fmt("ls -i %s", path));
|
||||
return isValidShellResponse(ret) ? ret.get(0).trim().split("\\s+")[0] : path.toString();
|
||||
public static String cmd(String cmd) {
|
||||
return ShellUtils.fastCmd(Shell.getShell(), cmd);
|
||||
}
|
||||
|
||||
public static void uninstallPkg(String pkg) {
|
||||
Shell.su(fmt("umount -l /data/user*/*/%s/*/*.db 2>/dev/null; pm uninstall %s", pkg, pkg));
|
||||
SuDatabaseHelper.cleanup();
|
||||
Shell.Sync.su("pm uninstall " + pkg);
|
||||
}
|
||||
|
||||
public static void dlAndReceive(Context context, DownloadReceiver receiver, String link, String filename) {
|
||||
@@ -110,18 +82,8 @@ public class Utils {
|
||||
|
||||
public static String getLegalFilename(CharSequence filename) {
|
||||
return filename.toString().replace(" ", "_").replace("'", "").replace("\"", "")
|
||||
.replace("$", "").replace("`", "").replace("(", "").replace(")", "")
|
||||
.replace("#", "").replace("@", "").replace("*", "");
|
||||
}
|
||||
|
||||
public static boolean isValidShellResponse(List<String> list) {
|
||||
if (list != null && list.size() != 0) {
|
||||
// Check if all empty
|
||||
for (String res : list) {
|
||||
if (!TextUtils.isEmpty(res)) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
.replace("$", "").replace("`", "").replace("*", "").replace("/", "_")
|
||||
.replace("#", "").replace("@", "").replace("\\", "_");
|
||||
}
|
||||
|
||||
public static int getPrefsInt(SharedPreferences prefs, String key, int def) {
|
||||
@@ -226,14 +188,6 @@ public class Utils {
|
||||
}
|
||||
}
|
||||
|
||||
public static File getDB(String dbName) {
|
||||
return getDB(MagiskManager.get(), dbName);
|
||||
}
|
||||
|
||||
public static File getDB(Context context, String dbName) {
|
||||
return new File(context.getFilesDir().getParent() + "/databases", dbName);
|
||||
}
|
||||
|
||||
public static AssetManager getAssets(String apk) {
|
||||
try {
|
||||
AssetManager asset = AssetManager.class.newInstance();
|
||||
@@ -245,22 +199,10 @@ public class Utils {
|
||||
}
|
||||
}
|
||||
|
||||
public static int inToOut(InputStream in, OutputStream out) throws IOException {
|
||||
int read, total = 0;
|
||||
byte buffer[] = new byte[4096];
|
||||
while ((read = in.read(buffer)) > 0) {
|
||||
out.write(buffer, 0, read);
|
||||
total += read;
|
||||
}
|
||||
out.flush();
|
||||
return total;
|
||||
}
|
||||
|
||||
public static void patchDTBO() {
|
||||
MagiskManager mm = MagiskManager.get();
|
||||
if (mm.magiskVersionCode >= 1446 && !mm.keepVerity) {
|
||||
List<String> ret = Shell.su("patch_dtbo_image && echo true || echo false");
|
||||
if (Utils.isValidShellResponse(ret) && Boolean.parseBoolean(ret.get(ret.size() - 1))) {
|
||||
if (ShellUtils.fastCmdResult(Shell.getShell(), "patch_dtbo_image")) {
|
||||
ShowUI.dtboPatchedNotification();
|
||||
}
|
||||
}
|
||||
@@ -277,13 +219,13 @@ public class Utils {
|
||||
Map<String, ?> prefs = MagiskManager.get().prefs.getAll();
|
||||
prefs.remove("App Restrictions");
|
||||
String json = gson.toJson(prefs, new TypeToken<Map<String, ?>>(){}.getType());
|
||||
Shell.su(fmt("for usr in /data/user/*; do echo '%s' > ${usr}/%s; done", json, Const.MANAGER_CONFIGS));
|
||||
Shell.Sync.su(fmt("for usr in /data/user/*; do echo '%s' > ${usr}/%s; done", json, Const.MANAGER_CONFIGS));
|
||||
}
|
||||
|
||||
public static void loadPrefs() {
|
||||
String config = fmt("/data/user/%d/%s", Const.USER_ID, Const.MANAGER_CONFIGS);
|
||||
List<String> ret = readFile(config);
|
||||
if (isValidShellResponse(ret)) {
|
||||
SuFile config = new SuFile(fmt("/data/user/%d/%s", Const.USER_ID, Const.MANAGER_CONFIGS), true);
|
||||
List<String> ret = Shell.Sync.su("cat " + config);
|
||||
if (ShellUtils.isValidOutput(ret)) {
|
||||
SharedPreferences.Editor editor = MagiskManager.get().prefs.edit();
|
||||
String json = ret.get(0);
|
||||
Gson gson = new Gson();
|
||||
@@ -302,7 +244,7 @@ public class Utils {
|
||||
editor.remove(Const.Key.ETAG_KEY);
|
||||
editor.apply();
|
||||
MagiskManager.get().loadConfig();
|
||||
removeItem(config);
|
||||
config.delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,27 +1,21 @@
|
||||
package com.topjohnwu.magisk.utils;
|
||||
|
||||
import android.content.res.AssetManager;
|
||||
|
||||
import com.topjohnwu.crypto.JarMap;
|
||||
import com.topjohnwu.crypto.SignAPK;
|
||||
import com.topjohnwu.magisk.MagiskManager;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
import com.topjohnwu.utils.JarMap;
|
||||
import com.topjohnwu.utils.SignAPK;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
public class ZipUtils {
|
||||
|
||||
static {
|
||||
System.loadLibrary("zipadjust");
|
||||
}
|
||||
|
||||
public native static void zipAdjust(String filenameIn, String filenameOut);
|
||||
|
||||
public static void unzip(File zip, File folder, String path, boolean junkPath) throws Exception {
|
||||
InputStream in = new BufferedInputStream(new FileInputStream(zip));
|
||||
unzip(in, folder, path, junkPath);
|
||||
@@ -46,7 +40,7 @@ public class ZipUtils {
|
||||
File dest = new File(folder, name);
|
||||
dest.getParentFile().mkdirs();
|
||||
try (FileOutputStream out = new FileOutputStream(dest)) {
|
||||
Utils.inToOut(zipfile, out);
|
||||
ShellUtils.pump(zipfile, out);
|
||||
}
|
||||
}
|
||||
} catch(Exception e) {
|
||||
@@ -55,18 +49,25 @@ public class ZipUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void signZip(InputStream is, File output, boolean minSign) throws Exception {
|
||||
signZip(new JarMap(is, false), output, minSign);
|
||||
public static void signZip(InputStream is, File output) throws Exception {
|
||||
try (JarMap map = new JarMap(is, false)) {
|
||||
signZip(map, output);
|
||||
}
|
||||
}
|
||||
|
||||
public static void signZip(File input, File output, boolean minSign) throws Exception {
|
||||
signZip(new JarMap(input, false), output, minSign);
|
||||
public static void signZip(File input, File output) throws Exception {
|
||||
try (JarMap map = new JarMap(input, false)) {
|
||||
signZip(map, output);
|
||||
}
|
||||
}
|
||||
|
||||
public static void signZip(JarMap input, File output, boolean minSign) throws Exception {
|
||||
AssetManager assets = MagiskManager.get().getAssets();
|
||||
SignAPK.signZip(
|
||||
assets.open(Const.PUBLIC_KEY_NAME), assets.open(Const.PRIVATE_KEY_NAME),
|
||||
input, output, minSign);
|
||||
public static void signZip(JarMap input, File output) throws Exception {
|
||||
try (BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(output))) {
|
||||
signZip(input, out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void signZip(JarMap input, OutputStream output) throws Exception {
|
||||
SignAPK.signZip(null, null, input, output);
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.6)
|
||||
add_library(zipadjust SHARED
|
||||
jni_glue.c
|
||||
zipadjust.c)
|
||||
find_library(libz z)
|
||||
find_library(liblog log)
|
||||
target_link_libraries(zipadjust ${libz} ${liblog})
|
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// Java entry point
|
||||
//
|
||||
|
||||
#include <jni.h>
|
||||
#include "zipadjust.h"
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_topjohnwu_magisk_utils_ZipUtils_zipAdjust(JNIEnv *env, jclass type, jstring filenameIn_,
|
||||
jstring filenameOut_) {
|
||||
const char *filenameIn = (*env)->GetStringUTFChars(env, filenameIn_, 0);
|
||||
const char *filenameOut = (*env)->GetStringUTFChars(env, filenameOut_, 0);
|
||||
|
||||
// TODO
|
||||
zipadjust(filenameIn, filenameOut, 0);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, filenameIn_, filenameIn);
|
||||
(*env)->ReleaseStringUTFChars(env, filenameOut_, filenameOut);
|
||||
}
|
@@ -1,297 +0,0 @@
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <zlib.h>
|
||||
#include <unistd.h>
|
||||
#include "zipadjust.h"
|
||||
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
#define O_TEXT 0
|
||||
#endif
|
||||
|
||||
#pragma pack(1)
|
||||
struct local_header_struct {
|
||||
uint32_t signature;
|
||||
uint16_t extract_version;
|
||||
uint16_t flags;
|
||||
uint16_t compression_method;
|
||||
uint16_t last_modified_time;
|
||||
uint16_t last_modified_date;
|
||||
uint32_t crc32;
|
||||
uint32_t size_compressed;
|
||||
uint32_t size_uncompressed;
|
||||
uint16_t length_filename;
|
||||
uint16_t length_extra;
|
||||
// filename
|
||||
// extra
|
||||
};
|
||||
typedef struct local_header_struct local_header_t;
|
||||
|
||||
#pragma pack(1)
|
||||
struct data_descriptor_struct {
|
||||
uint32_t signature;
|
||||
uint32_t crc32;
|
||||
uint32_t size_compressed;
|
||||
uint32_t size_uncompressed;
|
||||
};
|
||||
typedef struct data_descriptor_struct data_descriptor_t;
|
||||
|
||||
#pragma pack(1)
|
||||
struct central_header_struct {
|
||||
uint32_t signature;
|
||||
uint16_t version_made;
|
||||
uint16_t version_needed;
|
||||
uint16_t flags;
|
||||
uint16_t compression_method;
|
||||
uint16_t last_modified_time;
|
||||
uint16_t last_modified_date;
|
||||
uint32_t crc32;
|
||||
uint32_t size_compressed;
|
||||
uint32_t size_uncompressed;
|
||||
uint16_t length_filename;
|
||||
uint16_t length_extra;
|
||||
uint16_t length_comment;
|
||||
uint16_t disk_start;
|
||||
uint16_t attr_internal;
|
||||
uint32_t attr_external;
|
||||
uint32_t offset;
|
||||
// filename
|
||||
// extra
|
||||
// comment
|
||||
};
|
||||
typedef struct central_header_struct central_header_t;
|
||||
|
||||
#pragma pack(1)
|
||||
struct central_footer_struct {
|
||||
uint32_t signature;
|
||||
uint16_t disk_number;
|
||||
uint16_t disk_number_central_directory;
|
||||
uint16_t central_directory_entries_this_disk;
|
||||
uint16_t central_directory_entries_total;
|
||||
uint32_t central_directory_size;
|
||||
uint32_t central_directory_offset;
|
||||
uint16_t length_comment;
|
||||
// comment
|
||||
};
|
||||
typedef struct central_footer_struct central_footer_t;
|
||||
|
||||
#define MAGIC_LOCAL_HEADER 0x04034b50
|
||||
#define MAGIC_DATA_DESCRIPTOR 0x08074b50
|
||||
#define MAGIC_CENTRAL_HEADER 0x02014b50
|
||||
#define MAGIC_CENTRAL_FOOTER 0x06054b50
|
||||
|
||||
static int xerror(char* message) {
|
||||
LOGE("%s\n", message);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xseekread(int fd, off_t offset, void* buf, size_t bytes) {
|
||||
if (lseek(fd, offset, SEEK_SET) == (off_t)-1) return xerror("Seek failed");
|
||||
if (read(fd, buf, bytes) != bytes) return xerror("Read failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int xseekwrite(int fd, off_t offset, void* buf, size_t bytes) {
|
||||
if (lseek(fd, offset, SEEK_SET) == (off_t)-1) return xerror("Seek failed");
|
||||
if (write(fd, buf, bytes) != bytes) return xerror("Write failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int xfilecopy(int fdIn, int fdOut, off_t offsetIn, off_t offsetOut, size_t bytes) {
|
||||
if ((offsetIn != (off_t)-1) && (lseek(fdIn, offsetIn, SEEK_SET) == (off_t)-1)) return xerror("Seek failed");
|
||||
if ((offsetOut != (off_t)-1) && (lseek(fdOut, offsetOut, SEEK_SET) == (off_t)-1)) return xerror("Seek failed");
|
||||
|
||||
int CHUNK = 256 * 1024;
|
||||
void* buf = malloc(CHUNK);
|
||||
if (buf == NULL) return xerror("malloc failed");
|
||||
size_t left = bytes;
|
||||
while (left > 0) {
|
||||
size_t wanted = (left < CHUNK) ? left : CHUNK;
|
||||
size_t r = read(fdIn, buf, wanted);
|
||||
if (r <= 0) return xerror("Read failed");
|
||||
if (write(fdOut, buf, r) != r) return xerror("Write failed");
|
||||
left -= r;
|
||||
}
|
||||
free(buf);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int xdecompress(int fdIn, int fdOut, off_t offsetIn, off_t offsetOut, size_t bytes) {
|
||||
if ((offsetIn != (off_t)-1) && (lseek(fdIn, offsetIn, SEEK_SET) == (off_t)-1)) return xerror("Seek failed");
|
||||
if ((offsetOut != (off_t)-1) && (lseek(fdOut, offsetOut, SEEK_SET) == (off_t)-1)) return xerror("Seek failed");
|
||||
|
||||
int CHUNK = 256 * 1024;
|
||||
|
||||
int ret;
|
||||
unsigned have;
|
||||
z_stream strm;
|
||||
unsigned char in[CHUNK];
|
||||
unsigned char out[CHUNK];
|
||||
|
||||
strm.zalloc = Z_NULL;
|
||||
strm.zfree = Z_NULL;
|
||||
strm.opaque = Z_NULL;
|
||||
strm.avail_in = 0;
|
||||
strm.next_in = Z_NULL;
|
||||
ret = inflateInit2(&strm, -15);
|
||||
if (ret != Z_OK) return xerror("ret != Z_OK");
|
||||
|
||||
do {
|
||||
strm.avail_in = read(fdIn, in, CHUNK);
|
||||
if (strm.avail_in == 0) break;
|
||||
strm.next_in = in;
|
||||
|
||||
do {
|
||||
strm.avail_out = CHUNK;
|
||||
strm.next_out = out;
|
||||
|
||||
ret = inflate(&strm, Z_NO_FLUSH);
|
||||
if (ret == Z_STREAM_ERROR) return xerror("Stream error");
|
||||
switch (ret) {
|
||||
case Z_NEED_DICT:
|
||||
ret = Z_DATA_ERROR;
|
||||
case Z_DATA_ERROR:
|
||||
case Z_MEM_ERROR:
|
||||
(void)inflateEnd(&strm);
|
||||
return xerror("DICT/DATA/MEM error");
|
||||
}
|
||||
|
||||
have = CHUNK - strm.avail_out;
|
||||
if (write(fdOut, out, have) != have) {
|
||||
(void)inflateEnd(&strm);
|
||||
return xerror("Write failed");
|
||||
}
|
||||
} while (strm.avail_out == 0);
|
||||
} while (ret != Z_STREAM_END);
|
||||
(void)inflateEnd(&strm);
|
||||
|
||||
return ret == Z_STREAM_END ? 1 : 0;
|
||||
}
|
||||
|
||||
int zipadjust(const char* filenameIn, const char* filenameOut, int decompress) {
|
||||
int ok = 0;
|
||||
|
||||
int fin = open(filenameIn, O_RDONLY | O_BINARY);
|
||||
if (fin > 0) {
|
||||
unsigned int size = lseek(fin, 0, SEEK_END);
|
||||
lseek(fin, 0, SEEK_SET);
|
||||
LOGD("%d bytes\n", size);
|
||||
|
||||
char filename[1024];
|
||||
|
||||
central_footer_t central_footer;
|
||||
uint32_t central_directory_in_position = 0;
|
||||
uint32_t central_directory_in_size = 0;
|
||||
uint32_t central_directory_out_size = 0;
|
||||
|
||||
int i;
|
||||
for (i = size - 4; i >= 0; i--) {
|
||||
uint32_t magic = 0;
|
||||
if (!xseekread(fin, i, &magic, sizeof(uint32_t))) return 0;
|
||||
if (magic == MAGIC_CENTRAL_FOOTER) {
|
||||
LOGD("central footer @ %08X\n", i);
|
||||
if (!xseekread(fin, i, ¢ral_footer, sizeof(central_footer_t))) return 0;
|
||||
|
||||
central_header_t central_header;
|
||||
if (!xseekread(fin, central_footer.central_directory_offset, ¢ral_header, sizeof(central_header_t))) return 0;
|
||||
if ( central_header.signature == MAGIC_CENTRAL_HEADER ) {
|
||||
central_directory_in_position = central_footer.central_directory_offset;
|
||||
central_directory_in_size = size - central_footer.central_directory_offset;
|
||||
LOGD("central header @ %08X (%d)\n", central_footer.central_directory_offset, central_footer.central_directory_size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (central_directory_in_position == 0) return 0;
|
||||
|
||||
unsigned char* central_directory_in = (unsigned char*)malloc(central_directory_in_size);
|
||||
unsigned char* central_directory_out = (unsigned char*)malloc(central_directory_in_size);
|
||||
if (!xseekread(fin, central_directory_in_position, central_directory_in, central_directory_in_size)) return 0;
|
||||
memset(central_directory_out, 0, central_directory_in_size);
|
||||
|
||||
unlink(filenameOut);
|
||||
int fout = open(filenameOut, O_CREAT | O_WRONLY | O_BINARY, 0644);
|
||||
if (fout > 0) {
|
||||
|
||||
uintptr_t central_directory_in_index = 0;
|
||||
uintptr_t central_directory_out_index = 0;
|
||||
|
||||
central_header_t* central_header = NULL;
|
||||
|
||||
uint32_t out_index = 0;
|
||||
|
||||
while (1) {
|
||||
central_header = (central_header_t*)¢ral_directory_in[central_directory_in_index];
|
||||
if (central_header->signature != MAGIC_CENTRAL_HEADER) break;
|
||||
|
||||
filename[central_header->length_filename] = (char)0;
|
||||
memcpy(filename, ¢ral_directory_in[central_directory_in_index + sizeof(central_header_t)], central_header->length_filename);
|
||||
LOGD("%s (%d --> %d) [%08X] (%d)\n", filename, central_header->size_uncompressed, central_header->size_compressed, central_header->crc32, central_header->length_extra + central_header->length_comment);
|
||||
|
||||
local_header_t local_header;
|
||||
if (!xseekread(fin, central_header->offset, &local_header, sizeof(local_header_t))) return 0;
|
||||
|
||||
// save and update to next index before we clobber the data
|
||||
uint16_t compression_method_old = central_header->compression_method;
|
||||
uint32_t size_compressed_old = central_header->size_compressed;
|
||||
uint32_t offset_old = central_header->offset;
|
||||
uint32_t length_extra_old = central_header->length_extra;
|
||||
central_directory_in_index += sizeof(central_header_t) + central_header->length_filename + central_header->length_extra + central_header->length_comment;
|
||||
|
||||
// copying, rewriting, and correcting local and central headers so all the information matches, and no data descriptors are necessary
|
||||
central_header->offset = out_index;
|
||||
central_header->flags = central_header->flags & !8;
|
||||
if (decompress && (compression_method_old == 8)) {
|
||||
central_header->compression_method = 0;
|
||||
central_header->size_compressed = central_header->size_uncompressed;
|
||||
}
|
||||
central_header->length_extra = 0;
|
||||
central_header->length_comment = 0;
|
||||
local_header.compression_method = central_header->compression_method;
|
||||
local_header.flags = central_header->flags;
|
||||
local_header.crc32 = central_header->crc32;
|
||||
local_header.size_uncompressed = central_header->size_uncompressed;
|
||||
local_header.size_compressed = central_header->size_compressed;
|
||||
local_header.length_extra = 0;
|
||||
|
||||
if (!xseekwrite(fout, out_index, &local_header, sizeof(local_header_t))) return 0;
|
||||
out_index += sizeof(local_header_t);
|
||||
if (!xseekwrite(fout, out_index, &filename[0], central_header->length_filename)) return 0;
|
||||
out_index += central_header->length_filename;
|
||||
|
||||
if (decompress && (compression_method_old == 8)) {
|
||||
if (!xdecompress(fin, fout, offset_old + sizeof(local_header_t) + central_header->length_filename + length_extra_old, out_index, size_compressed_old)) return 0;
|
||||
} else {
|
||||
if (!xfilecopy(fin, fout, offset_old + sizeof(local_header_t) + central_header->length_filename + length_extra_old, out_index, size_compressed_old)) return 0;
|
||||
}
|
||||
out_index += local_header.size_compressed;
|
||||
|
||||
memcpy(¢ral_directory_out[central_directory_out_index], central_header, sizeof(central_header_t) + central_header->length_filename);
|
||||
central_directory_out_index += sizeof(central_header_t) + central_header->length_filename;
|
||||
}
|
||||
|
||||
central_directory_out_size = central_directory_out_index;
|
||||
central_footer.central_directory_size = central_directory_out_size;
|
||||
central_footer.central_directory_offset = out_index;
|
||||
central_footer.length_comment = 0;
|
||||
if (!xseekwrite(fout, out_index, central_directory_out, central_directory_out_size)) return 0;
|
||||
out_index += central_directory_out_size;
|
||||
if (!xseekwrite(fout, out_index, ¢ral_footer, sizeof(central_footer_t))) return 0;
|
||||
|
||||
LOGD("central header @ %08X (%d)\n", central_footer.central_directory_offset, central_footer.central_directory_size);
|
||||
LOGD("central footer @ %08X\n", out_index);
|
||||
|
||||
close(fout);
|
||||
ok = 1;
|
||||
}
|
||||
|
||||
free(central_directory_in);
|
||||
free(central_directory_out);
|
||||
close(fin);
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
#ifndef MAGISKMANAGER_ZIPADJUST_H_H
|
||||
#define MAGISKMANAGER_ZIPADJUST_H_H
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
int zipadjust(const char* filenameIn, const char* filenameOut, int decompress);
|
||||
|
||||
#define LOG_TAG "zipadjust"
|
||||
|
||||
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
|
||||
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
|
||||
|
||||
#endif //MAGISKMANAGER_ZIPADJUST_H_H
|
@@ -166,6 +166,8 @@
|
||||
<string name="request_timeout_summary">%1$s Sekunden</string>
|
||||
<string name="settings_su_reauth_title">Nach Aktualisierung erneut authentifizieren</string>
|
||||
<string name="settings_su_reauth_summary">Superuser-Zugriff nach App-Aktualisierung erneut abfragen</string>
|
||||
<string name="settings_su_fingerprint_title">Aktiviere Authentifizierung durch Fingerabdruck</string>
|
||||
<string name="settings_su_fingerprint_summary">Fingerabdrucksensor benutzen um Superuser-Anfragen zu erlauben</string>
|
||||
|
||||
<string name="multiuser_mode">Mehrbenutzermodus</string>
|
||||
<string name="settings_owner_only">Nur der Gerätebesitzer</string>
|
||||
@@ -212,6 +214,7 @@
|
||||
<string name="su_revoke_msg">Möchtest du die Rechte für %1$s entziehen?</string>
|
||||
<string name="toast">Popup</string>
|
||||
<string name="none">Keine</string>
|
||||
<string name="auth_fail">Authentifizierung fehlgeschlagen</string>
|
||||
|
||||
<!--Superuser logs-->
|
||||
<string name="pid">PID:\u0020</string>
|
||||
|
@@ -163,7 +163,10 @@
|
||||
<string name="request_timeout_summary">%1$s segundos</string>
|
||||
<string name="settings_su_reauth_title">Re-autenticación</string>
|
||||
<string name="settings_su_reauth_summary">Pedir permisos de superusuario nuevamente si una aplicación es actualizada o reinstalada</string>
|
||||
|
||||
<string name="settings_su_fingerprint_title">Habilitar la autenticación de huellas digitales</string>
|
||||
<string name="settings_su_fingerprint_summary">Utilice el escáner de huellas digitales para permitir las solicitudes de superusuario</string>
|
||||
|
||||
|
||||
<string name="multiuser_mode">Modo MultiUsuario</string>
|
||||
<string name="settings_owner_only">Sólo Administrador del Dispositivo</string>
|
||||
<string name="settings_owner_manage">Administrador del Dispositivo</string>
|
||||
@@ -209,6 +212,7 @@
|
||||
<string name="su_revoke_msg">¿Confirmar para revocar derechos de %1$s?</string>
|
||||
<string name="toast">Aviso</string>
|
||||
<string name="none">Nada</string>
|
||||
<string name="auth_fail">Autenticación fallida</string>
|
||||
|
||||
<!--Superuser logs-->
|
||||
<string name="pid">PID:\u0020</string>
|
||||
|
@@ -50,6 +50,10 @@
|
||||
<string name="update_available">Uuendus saadaval</string>
|
||||
<string name="installed">Installitud</string>
|
||||
<string name="not_installed">Pole installitud</string>
|
||||
<string name="updated_on">Uuendatud: %1$s</string>
|
||||
<string name="sorting_order">Sorteerimisjärjekord</string>
|
||||
<string name="sort_by_name">Sorteeri nime järgi</string>
|
||||
<string name="sort_by_update">Sorteeri viimase uuenduse järgi</string>
|
||||
|
||||
<!--Log Fragment-->
|
||||
<string name="menuSaveLog">Salvesta logi</string>
|
||||
@@ -85,9 +89,11 @@
|
||||
<string name="settings_reboot_toast">Taaskäivita seadete rakendamiseks</string>
|
||||
<string name="release_notes">Väljalaskemärkmed</string>
|
||||
<string name="repo_cache_cleared">Hoidla vahemälu tühjendatud</string>
|
||||
<string name="safetyNet_hide_notice">See rakendus kasutab SafetyNet\'i\nJuba vaikimisi hallatud MagiskHide poolt</string>
|
||||
<string name="safetyNet_hide_notice">See rakendus kasutab SafetyNet\'i\n
|
||||
Juba vaikimisi hallatud MagiskHide poolt</string>
|
||||
<string name="process_error">Protsessi viga</string>
|
||||
<string name="internal_storage">ZIP on salvestatud:\n[Sisemälu]%1$s</string>
|
||||
<string name="internal_storage">ZIP on salvestatud:\n
|
||||
[Sisemälu]%1$s</string>
|
||||
<string name="zip_download_title">Laadin alla</string>
|
||||
<string name="zip_download_msg">Laadin ZIP-faili alla (%1$d%%)...</string>
|
||||
<string name="zip_process_title">Töötlen</string>
|
||||
@@ -95,11 +101,11 @@
|
||||
<string name="manager_update_title">Magisk Manager\'ile on uuendus saadaval!</string>
|
||||
<string name="manager_download_install">Vajuta allalaadimiseks ja installimiseks</string>
|
||||
<string name="dtbo_patched_title">DTBO sai paigatud!</string>
|
||||
<string name="dtbo_patched_reboot">Magisk Manager on paiganud dtbo.img, palun taaskäivita</string>
|
||||
<string name="dtbo_patched_reboot">Magisk Manager on paiganud dtbo.img, palun taaskäivita</string>
|
||||
<string name="magisk_updates">Magisk\'i uuendused</string>
|
||||
<string name="flashing">Välgutamine</string>
|
||||
<string name="hide_manager_toast">Peidan Magisk Manager\'i...</string>
|
||||
<string name="hide_manager_toast2">See võib aega võtta...</string>
|
||||
<string name="hide_manager_toast2">See võib aega võtta...</string>
|
||||
<string name="hide_manager_fail_toast">Magisk Manager\'i peitmine ebaõnnestus...</string>
|
||||
<string name="download_zip_only">Laadi ainult ZIP alla</string>
|
||||
<string name="patch_boot_file">Paika käivituspildi fail</string>
|
||||
@@ -115,9 +121,11 @@
|
||||
<string name="restore_fail">Originaalne varundus puudub!</string>
|
||||
<string name="uninstall_toast">Eemaldan Magisk Manager\'i 5 sekundi pärast, palun tee peale seda käsitsi taaskäivitus</string>
|
||||
<string name="proprietary_title">Laadi alla suletud koodi</string>
|
||||
<string name="proprietary_notice">Magisk Manager on vaba ja avatud lähtekoodiga, seega ei sisalda Google\'i suletud SafetyNet\'i API koodi.\n\nKas lubad Magisk Manager\'il SafetyNet\'i kontrollide jaoks laadida alla laiendus (sisaldab GoogleApiClient\'i)?</string>
|
||||
<string name="su_db_corrupt">Superkasutaja andmebaas on korrumpteerunud, loon uue andmebaasi</string>
|
||||
|
||||
<string name="proprietary_notice">Magisk Manager on vaba ja avatud lähtekoodiga, mis ei sisalda Google\'i suletud SafetyNet\'i API koodi.\n
|
||||
\n
|
||||
Kas lubad Magisk Manager\'il SafetyNet\'i kontrollide jaoks laadida alla laiendus (sisaldab GoogleApiClient\'i)?</string>
|
||||
<string name="su_db_corrupt">Superkasutaja andmebaas on korrumpteerunud, loon uue andmebaasi</string>
|
||||
|
||||
<!--Settings Activity -->
|
||||
<string name="settings_general_category">Üldine</string>
|
||||
<string name="settings_dark_theme_title">Tume teema</string>
|
||||
@@ -127,20 +135,20 @@
|
||||
<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_hide_manager_title">Peida Magisk Manager</string>
|
||||
<string name="settings_hide_manager_summary">Taaspaki Magisk Manager juhusliku nimega</string>
|
||||
<string name="settings_hide_manager_summary">Taaspaki Magisk Manager juhusliku nimega</string>
|
||||
<string name="language">Keel</string>
|
||||
<string name="system_default">(Süsteemi vaikesäte)</string>
|
||||
<string name="settings_update">Uuenda seadeid</string>
|
||||
<string name="settings_update_channel_title">Uuenduste kanal</string>
|
||||
<string name="settings_update_stable">Stabiilne</string>
|
||||
<string name="settings_update_beta">Beeta</string>
|
||||
<string name="settings_update_custom">Kohandatud</string>
|
||||
<string name="settings_update_custom_msg">Sisesta kohandatud URL</string>
|
||||
<string name="settings_update_custom">Kohandatud</string>
|
||||
<string name="settings_update_custom_msg">Sisesta kohandatud URL</string>
|
||||
<string name="settings_boot_format_title">Paigatud käivitusväljundi vorming</string>
|
||||
<string name="settings_boot_format_summary">Vali väljutatava paigatud käivituspildi vorming.\nVali .img, mida välgutada fastboot/allalaadimisrežiimi kaudu; vali .img.tar, mida välgutada ODIN\'i kaudu.</string>
|
||||
|
||||
<string name="settings_boot_format_summary">Vali väljutatava paigatud käivituspildi vorming.\n
|
||||
Vali .img, mida välgutada fastboot/allalaadimisrežiimi kaudu; vali .img.tar, mida välgutada ODIN\'i kaudu.</string>
|
||||
<string name="settings_core_only_title">Magisk\'i ainult tuuma režiim</string>
|
||||
<string name="settings_core_only_summary">Luba ainult põhifunktsioonid, kõiki mooduleid ei laadita. MagiskSU, MagiskHide ja süsteemivaba hosts siiski lubatakse</string>
|
||||
<string name="settings_core_only_summary">Luba ainult põhifunktsioonid. MagiskSU, MagiskHide ja süsteemivaba hosts siiski lubatakse, ent mooduleid ei laadita.</string>
|
||||
<string name="settings_magiskhide_summary">Peida Magisk erinevate tuvastuste eest</string>
|
||||
<string name="settings_hosts_title">Süsteemivaba hosts</string>
|
||||
<string name="settings_hosts_summary">Süsteemivaba hosts-tugi reklaamiblokeerijatest rakendustele</string>
|
||||
@@ -160,6 +168,8 @@
|
||||
<string name="request_timeout_summary">%1$s sekundit</string>
|
||||
<string name="settings_su_reauth_title">Taas-autendi peale uuendust</string>
|
||||
<string name="settings_su_reauth_summary">Taas-autendi superkasutaja õigused peale rakenduse uuendust</string>
|
||||
<string name="settings_su_fingerprint_title">Luba sõrmejäljega autentimine</string>
|
||||
<string name="settings_su_fingerprint_summary">Kasuta sõrmejäljelugejat superkasutaja taotluste lubamiseks</string>
|
||||
|
||||
<string name="multiuser_mode">Mitmikkasutaja režiim</string>
|
||||
<string name="settings_owner_only">Ainult seadme omanik</string>
|
||||
@@ -168,7 +178,7 @@
|
||||
<string name="owner_only_summary">Ainult omanikul on juurkasutaja õigused</string>
|
||||
<string name="owner_manage_summary">Ainult omanik saab hallata juurkasutaja ligipääsu ja saada taotlusküsimusi</string>
|
||||
<string name="user_indepenent_summary">Igal kasutajal on oma isiklikud juurkasutaja reeglid</string>
|
||||
<string name="multiuser_hint_owner_request">Taotlus on saadetud seadme omanikule. Palun lülitu omanikule ja anna luba</string>
|
||||
<string name="multiuser_hint_owner_request">Taotlus on saadetud seadme omanikule. Palun lülitu omanikule ja anna vajalikud load</string>
|
||||
|
||||
<string name="mount_namespace_mode">Nimeruumi monteerimisrežiim</string>
|
||||
<string name="settings_ns_global">Globaalne nimeruum</string>
|
||||
@@ -185,7 +195,8 @@
|
||||
<string name="deny">Keela</string>
|
||||
<string name="prompt">Küsi</string>
|
||||
<string name="grant">Luba</string>
|
||||
<string name="su_warning">Annab täieliku ligipääsu sinu seadmele.\nKeela, kui sa pole kindel!</string>
|
||||
<string name="su_warning">Annab täieliku ligipääsu sinu seadmele.\n
|
||||
Keela, kui sa pole kindel!</string>
|
||||
<string name="forever">Igavesti</string>
|
||||
<string name="once">Üks kord</string>
|
||||
<string name="tenmin">10 min</string>
|
||||
@@ -195,17 +206,18 @@
|
||||
<string name="su_allow_toast">Rakendusele %1$s anti superkasutaja õigused</string>
|
||||
<string name="su_deny_toast">Rakendusel %1$s keelati superkasutaja õigused</string>
|
||||
<string name="no_apps_found">Rakendusi ei leitud</string>
|
||||
<string name="su_snack_grant">Rakenduse %1$s superkasutaja õigused on antud</string>
|
||||
<string name="su_snack_deny">Rakenduse %1$s superkasutaja õigused on keelatud</string>
|
||||
<string name="su_snack_notif_on">Rakenduse %1$s teated on lubatud</string>
|
||||
<string name="su_snack_notif_off">Rakenduse %1$s teated on keelatud</string>
|
||||
<string name="su_snack_log_on">Rakenduse %1$s logimine on lubatud</string>
|
||||
<string name="su_snack_log_off">Rakenduse %1$s logimine on keelatud</string>
|
||||
<string name="su_snack_grant">Superkasutaja õigused antud rakendusele %1$s</string>
|
||||
<string name="su_snack_deny">Superkasutaja õigused keelatud rakendusele %1$s</string>
|
||||
<string name="su_snack_notif_on">Teated lubatud rakendusele %1$s</string>
|
||||
<string name="su_snack_notif_off">Teated keelatud rakendusele %1$s</string>
|
||||
<string name="su_snack_log_on">Logimine lubatud rakendusele %1$s</string>
|
||||
<string name="su_snack_log_off">Logimine keelatud rakendusele %1$s</string>
|
||||
<string name="su_snack_revoke">Rakenduse %1$s õigused on eemaldatud</string>
|
||||
<string name="su_revoke_title">Eemaldad?</string>
|
||||
<string name="su_revoke_msg">Kinnitad rakenduse %1$s õiguste eemaldamise?</string>
|
||||
<string name="toast">Hüpik</string>
|
||||
<string name="none">Puudub</string>
|
||||
<string name="auth_fail">Autentimine ebaõnnestus</string>
|
||||
|
||||
<!--Superuser logs-->
|
||||
<string name="pid">PID:\\u0020</string>
|
||||
|
@@ -143,6 +143,7 @@
|
||||
<string name="settings_boot_format_summary">Sélectionner le format de l\'image boot patchée finale.\nChoisir .img pour flasher via fastboot/mode download ; choisir .img.tar pour flasher via ODIN.</string>
|
||||
<string name="settings_su_reauth_title">Ré-authentifier après mise à jour</string>
|
||||
<string name="settings_su_reauth_summary">Ré-authentifier les permissions superuser après les mises à jour d\'une application</string>
|
||||
<string name="settings_su_fingerprint_title">Activer l\'authentification par empreinte</string>
|
||||
<string name="multiuser_mode">Mode multi-utilisateurs</string>
|
||||
<string name="settings_owner_only">Appareil du propriétaire uniquement</string>
|
||||
<string name="settings_owner_manage">Appareil du propriétaire géré</string>
|
||||
@@ -164,7 +165,7 @@
|
||||
<string name="deny">Refuser</string>
|
||||
<string name="prompt">Demander</string>
|
||||
<string name="grant">Accepter</string>
|
||||
<string name="su_warning">Accepter un accès complet à votre appareil.\nRefuser si vous n\'êtes pas sûr!</string>
|
||||
<string name="su_warning">Accepter un accès complet à votre appareil.\nRefuser si vous n\'êtes pas sûr !</string>
|
||||
<string name="forever">Toujours</string>
|
||||
<string name="once">Une fois</string>
|
||||
<string name="tenmin">10 min</string>
|
||||
@@ -173,7 +174,7 @@
|
||||
<string name="sixtymin">60 min</string>
|
||||
<string name="su_allow_toast">%1$s a obtenu les droits Superuser</string>
|
||||
<string name="su_deny_toast">%1$s n\'a pas obtenu les droits Superuser</string>
|
||||
<string name="no_apps_found">Aucun application trouvée</string>
|
||||
<string name="no_apps_found">Aucune application trouvée</string>
|
||||
<string name="su_snack_grant">Les droits Superuser de %1$s sont accordés</string>
|
||||
<string name="su_snack_deny">Les droits Superuser de %1$s sont refusés</string>
|
||||
<string name="su_snack_notif_on">Les notifications pour %1$s sont activées</string>
|
||||
|
@@ -24,8 +24,8 @@
|
||||
|
||||
<!--Install Fragment-->
|
||||
<string name="advanced_settings_title">Pengaturan Lanjutan</string>
|
||||
<string name="keep_force_encryption">Biarkan enkripsi paksa</string>
|
||||
<string name="keep_dm_verity">Biarkan AVB 2.0/dm-verity</string>
|
||||
<string name="keep_force_encryption">Pertahankan enkripsi paksa</string>
|
||||
<string name="keep_dm_verity">Pertahankan AVB 2.0/dm-verity</string>
|
||||
<string name="current_magisk_title">Versi yang Terpasang: %1$s</string>
|
||||
<string name="install_magisk_title">Versi Terbaru: %1$s</string>
|
||||
<string name="uninstall">Copot</string>
|
||||
@@ -42,11 +42,18 @@
|
||||
<string name="disable_file_created">Modul akan dinonaktifkan pada reboot berikutnya</string>
|
||||
<string name="disable_file_removed">Modul akan diaktifkan pada reboot berikutnya</string>
|
||||
<string name="author">Dibuat oleh %1$s</string>
|
||||
<string name="reboot_recovery">Reboot ke Recovery</string>
|
||||
<string name="reboot_bootloader">Reboot ke Bootloader</string>
|
||||
<string name="reboot_download">Reboot ke Download</string>
|
||||
|
||||
<!--Repo Fragment-->
|
||||
<string name="update_available">Pembaruan Tersedia</string>
|
||||
<string name="installed">Terpasang</string>
|
||||
<string name="not_installed">Tidak Terpasang</string>
|
||||
<string name="updated_on">Diperbarui pada: %1$s</string>
|
||||
<string name="sorting_order">Urutkan Susunan</string>
|
||||
<string name="sort_by_name">Urut berdasarkan nama</string>
|
||||
<string name="sort_by_update">Urut berdasarkan pembaruan terakhir</string>
|
||||
|
||||
<!--Log Fragment-->
|
||||
<string name="menuSaveLog">Simpan log</string>
|
||||
@@ -58,12 +65,12 @@
|
||||
|
||||
<!--About Activity-->
|
||||
<string name="about">Tentang</string>
|
||||
<string name="app_changelog">Log pembaruan apl</string>
|
||||
<string name="app_changelog">Log pembaruan</string>
|
||||
<string name="translators"><![CDATA[<a href="https://github.com/krasCGQ">Albert I (krasCGQ)</a>]]></string>
|
||||
<string name="app_version">Versi apl</string>
|
||||
<string name="app_version">Versi</string>
|
||||
<string name="app_source_code">Kode sumber</string>
|
||||
<string name="donation">Donasi</string>
|
||||
<string name="app_translators">Penerjemah apl</string>
|
||||
<string name="app_translators">Penerjemah</string>
|
||||
<string name="support_thread">Thread dukungan</string>
|
||||
|
||||
<!--Toasts, Dialogs-->
|
||||
@@ -100,17 +107,19 @@
|
||||
<string name="hide_manager_fail_toast">Kesalahan menyembunyikan Magisk Manager…</string>
|
||||
<string name="download_zip_only">Unduh Zip Saja</string>
|
||||
<string name="patch_boot_file">Tambal File Boot Image</string>
|
||||
<string name="direct_install">Pasang Langsung (Rekomendasikan)</string>
|
||||
<string name="direct_install">Pasang Langsung (Direkomendasikan)</string>
|
||||
<string name="install_second_slot">Pasang ke Slot Kedua (Setelah OTA)</string>
|
||||
<string name="select_method">Pilih Metode</string>
|
||||
<string name="no_boot_file_patch_support">Versi target Magisk tidak mendukung penambalan file boot image</string>
|
||||
<string name="boot_file_patch_msg">Pilih stock boot image dump dalam format .img atau .img.tar</string>
|
||||
<string name="restore_img">Pulihkan Image</string>
|
||||
<string name="uninstall_app">Copot Apl</string>
|
||||
<string name="complete_uninstall">Copot Total</string>
|
||||
<string name="restore_done">Pemulihan selesai!</string>
|
||||
<string name="restore_fail">Cadangan stock tidak ada!</string>
|
||||
<string name="uninstall_toast">Mencopot Magisk Manager dalam 5 detik, silahkan reboot secara manual setelahnya</string>
|
||||
<string name="proprietary_title">Unduh Kode Proprieter</string>
|
||||
<string name="proprietary_notice">Magisk Manager adalah aplikasi FOSS sehingga tidak menyertakan kode API proprieter Google SafetyNet.\n\nApakah Anda mengizinkan Magisk Manager untuk mengunduh sebuah ekstensi (berisi GoogleApiClient) untuk pemeriksaan SafetyNet?</string>
|
||||
<string name="proprietary_notice">Magisk Manager adalah aplikasi FOSS, yang tidak menyertakan kode API proprieter Google SafetyNet.\n\nApakah Anda mengizinkan Magisk Manager untuk mengunduh sebuah ekstensi (berisi GoogleApiClient) untuk pemeriksaan SafetyNet?</string>
|
||||
<string name="su_db_corrupt">Database SU rusak, akan membuat db baru</string>
|
||||
|
||||
<!--Settings Activity -->
|
||||
@@ -134,7 +143,7 @@
|
||||
<string name="settings_boot_format_title">Format Keluaran Boot yang Ditambal</string>
|
||||
<string name="settings_boot_format_summary">Pilih format keluaran boot image yang ditambal.\nPilih .img untuk flash melalui mode recovery/download; pilih .img.tar untuk flash melalui ODIN.</string>
|
||||
<string name="settings_core_only_title">Magisk Mode Inti Saja</string>
|
||||
<string name="settings_core_only_summary">Aktifkan fitur inti saja, semua modul tidak akan dimuat. MagiskSU, MagiskHide, dan host tanpa sistem akan tetap diaktifkan</string>
|
||||
<string name="settings_core_only_summary">Aktifkan fitur inti saja. MagiskSU, MagiskHide, dan host tanpa sistem akan tetap diaktifkan</string>
|
||||
<string name="settings_magiskhide_summary">Sembunyikan Magisk dari berbagai pendeteksian</string>
|
||||
<string name="settings_hosts_title">Host tanpa sistem</string>
|
||||
<string name="settings_hosts_summary">Dukungan host tanpa sistem untuk apl pemblokir iklan</string>
|
||||
@@ -154,6 +163,8 @@
|
||||
<string name="request_timeout_summary">%1$s detik</string>
|
||||
<string name="settings_su_reauth_title">Otentikasi ulang setelah pembaruan</string>
|
||||
<string name="settings_su_reauth_summary">Otentikasi ulang izin superuser setelah pembaruan sebuah aplikasi</string>
|
||||
<string name="settings_su_fingerprint_title">Aktifkan Otentikasi Sidik Jari</string>
|
||||
<string name="settings_su_fingerprint_summary">Gunakan pemindai sidik jari untuk mengizinkan permintaan superuser</string>
|
||||
|
||||
<string name="multiuser_mode">Mode Multipengguna</string>
|
||||
<string name="settings_owner_only">Pemilik Perangkat Saja</string>
|
||||
@@ -162,7 +173,7 @@
|
||||
<string name="owner_only_summary">Hanya pemilik yang memiliki akses root</string>
|
||||
<string name="owner_manage_summary">Hanya pemilik yang dapat mengelola akses root dan menerima permintaan</string>
|
||||
<string name="user_indepenent_summary">Setiap pengguna memiliki aturan root tersendiri</string>
|
||||
<string name="multiuser_hint_owner_request">Permintaan telah dikirim kepada pemilik perangkat. Silakan beralih ke pemilik dan berikan izin</string>
|
||||
<string name="multiuser_hint_owner_request">Permintaan telah dikirim kepada pemilik perangkat. Silakan beralih ke pemilik dan berikan izin yang diperlukan</string>
|
||||
|
||||
<string name="mount_namespace_mode">Mode Mount Ruang Nama</string>
|
||||
<string name="settings_ns_global">Ruang Nama Global</string>
|
||||
@@ -171,6 +182,7 @@
|
||||
<string name="global_summary">Semua sesi root menggunakan mount ruang nama global</string>
|
||||
<string name="requester_summary">Sesi root akan mewarisi ruang nama pemintanya</string>
|
||||
<string name="isolate_summary">Setiap sesi root akan memiliki ruang nama tersendiri</string>
|
||||
<string name="android_o_not_support">Tidak mendukung Android 8.0+</string>
|
||||
|
||||
<!--Superuser-->
|
||||
<string name="su_request_title">Permintaan Superuser</string>
|
||||
@@ -199,6 +211,7 @@
|
||||
<string name="su_revoke_msg">Konfirmasi untuk mencabut akses %1$s?</string>
|
||||
<string name="toast">Toast</string>
|
||||
<string name="none">Tidak ada</string>
|
||||
<string name="auth_fail">Otentikasi Gagal</string>
|
||||
|
||||
<!--Superuser logs-->
|
||||
<string name="pid">PID:\u0020</string>
|
||||
|
@@ -163,6 +163,8 @@
|
||||
<string name="request_timeout_summary">%1$s secondi</string>
|
||||
<string name="settings_su_reauth_title">Ri-autentica dopo aggiornamento</string>
|
||||
<string name="settings_su_reauth_summary">Ri-autentica i permessi Superuser dopo un aggiornamento dell\'app</string>
|
||||
<string name="settings_su_fingerprint_title">Abilita autenticazione impronta</string>
|
||||
<string name="settings_su_fingerprint_summary">Utilizza il sensore di impronte per accettare le richieste Superuser</string>
|
||||
|
||||
<string name="multiuser_mode">Modalità multiutente</string>
|
||||
<string name="settings_owner_only">Solo proprietario del dispositivo</string>
|
||||
@@ -209,6 +211,7 @@
|
||||
<string name="su_revoke_msg">Confermi la revoca dei diritti di %1$s?</string>
|
||||
<string name="toast">Toast</string>
|
||||
<string name="none">Nessuno</string>
|
||||
<string name="auth_fail">Autenticatione fallita</string>
|
||||
|
||||
<!--Superuser logs-->
|
||||
<string name="pid">PID:\u0020</string>
|
||||
|
@@ -163,6 +163,8 @@
|
||||
<string name="request_timeout_summary">%1$s秒</string>
|
||||
<string name="settings_su_reauth_title">アップグレード後の再認証</string>
|
||||
<string name="settings_su_reauth_summary">アプリのアップグレード後にスーパーユーザー権限を再認証します</string>
|
||||
<string name="settings_su_fingerprint_title">指紋認証の有効化</string>
|
||||
<string name="settings_su_fingerprint_summary">スーパーユーザー権限のリクエストの許可に指紋認証を使います</string>
|
||||
|
||||
<string name="multiuser_mode">マルチユーザーモード</string>
|
||||
<string name="settings_owner_only">端末の管理者のみ</string>
|
||||
@@ -206,9 +208,10 @@
|
||||
<string name="su_snack_log_off">%1$s のログは無効です</string>
|
||||
<string name="su_snack_revoke">%1$s の権限は取り消されました</string>
|
||||
<string name="su_revoke_title">確認</string>
|
||||
<string name="su_revoke_msg">%1$s の権限を取り消すことを承認しますか?</string>
|
||||
<string name="su_revoke_msg">%1$s の権限を取り消しますか?</string>
|
||||
<string name="toast">トースト通知</string>
|
||||
<string name="none">なし</string>
|
||||
<string name="auth_fail">認証に失敗しました</string>
|
||||
|
||||
<!--Superuser logs-->
|
||||
<string name="pid">PID:\u0020</string>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<resources>
|
||||
<!--Universal-->
|
||||
|
||||
|
||||
<!--Welcome Activity-->
|
||||
<string name="modules">Moduliai</string>
|
||||
<string name="downloads">Atsisiuntimai</string>
|
||||
@@ -44,13 +44,17 @@
|
||||
<string name="author">Sukūrė %1$s</string>
|
||||
<string name="reboot_recovery">Perkrauti į Recovery</string>
|
||||
<string name="reboot_bootloader">Perkrauti į Bootloader</string>
|
||||
<string name="reboot_download">Perkraukite, kad atsisiųstumėte</string>
|
||||
<string name="reboot_download">Perkraukite, į Download režimą</string>
|
||||
|
||||
<!--Repo Fragment-->
|
||||
<string name="update_available">Galimas atnaujinimas</string>
|
||||
<string name="installed">Instaliuota</string>
|
||||
<string name="not_installed">Ne instaliuota</string>
|
||||
|
||||
<string name="updated_on">Atnaujinta: %1$s</string>
|
||||
<string name="sorting_order">Išdėliojimo tvarka</string>
|
||||
<string name="sort_by_name">Išdėlioti pagal pavadinimą</string>
|
||||
<string name="sort_by_update">Išdėlioti pagal paskutinį atnaujinimą</string>
|
||||
|
||||
<!--Log Fragment-->
|
||||
<string name="menuSaveLog">Išsauguti surašymus (log)</string>
|
||||
<string name="menuReload">Iš naujo</string>
|
||||
@@ -62,12 +66,12 @@
|
||||
<!--About Activity-->
|
||||
<string name="about">Apie</string>
|
||||
<string name="app_changelog">Pakeitimų sąrašas</string>
|
||||
<string name="translators" />Vv2233Bb
|
||||
<string name="translators">Vv2233Bb</string>
|
||||
<string name="app_version">Versija</string>
|
||||
<string name="app_source_code">Pagrindinis kodas</string>
|
||||
<string name="app_source_code">Prisidėkite</string>
|
||||
<string name="donation">Auka</string>
|
||||
<string name="app_translators">Vertėjai</string>
|
||||
<string name="support_thread">Paremti mūsų XDA puslapį</string>
|
||||
<string name="support_thread">Mūsų XDA puslapis</string>
|
||||
|
||||
<!--Toasts, Dialogs-->
|
||||
<string name="permissionNotGranted">Ši įpatybė neveiks be prieigos prie saugyklos.</string>
|
||||
@@ -100,16 +104,16 @@
|
||||
<string name="flashing">Instaliuojama</string>
|
||||
<string name="hide_manager_toast">Magisk Manager paslėpiamas…</string>
|
||||
<string name="hide_manager_toast2">Tai užtruks sekundėlę…</string>
|
||||
<string name="hide_manager_fail_toast">Magisk Manager paslėpimas nepavyko…</string>
|
||||
<string name="hide_manager_fail_toast">Magisk Manager paslėpimas žlugo…</string>
|
||||
<string name="download_zip_only">Atsisiųsti zip failą</string>
|
||||
<string name="patch_boot_file">Ištaisyti įsijungimo failą</string>
|
||||
<string name="patch_boot_file">Ištaisyti boot failą</string>
|
||||
<string name="direct_install">Tiesioginis atsisiuntimas (Rekomenduojamas)</string>
|
||||
<string name="install_second_slot">Instaliuoti į antrą vietą (Po OTA)</string>
|
||||
<string name="select_method">Pasirinkite metodą</string>
|
||||
<string name="no_boot_file_patch_support">Pasirinkta Magisk versija nepalaiko pakeitimų įjungimo faile.</string>
|
||||
<string name="boot_file_patch_msg">Pasirinkti įsijungimo failą .img ar .img.tar formate.</string>
|
||||
<string name="no_boot_file_patch_support">Pasirinkta Magisk versija nepalaiko pakeitimų boot faile.</string>
|
||||
<string name="boot_file_patch_msg">Pasirinkti boot failą .img ar .img.tar formate.</string>
|
||||
<string name="complete_uninstall">Pilnas pašalinimas</string>
|
||||
<string name="restore_img">Atstatyti įsijungimo failą.</string>
|
||||
<string name="restore_img">Atstatyti boot failą.</string>
|
||||
<string name="uninstall_app">Ištrinti programėlę</string>
|
||||
<string name="restore_done">Atstatymas įvykdytas!</string>
|
||||
<string name="restore_fail">Gamyklinis atstatymo failas neegzistuoja!</string>
|
||||
@@ -124,22 +128,22 @@
|
||||
<string name="settings_dark_theme_summary">Įjungti tamsią temą</string>
|
||||
<string name="settings_notification_title">Pranešimai atsiradus atnaujinimui</string>
|
||||
<string name="settings_notification_summary">Parodyti pranešmus atsiradus naujai versijai</string>
|
||||
<string name="settings_clear_cache_title">Išvalyti saugyklos nereikalingus failus</string>
|
||||
<string name="settings_clear_cache_title">Išvalyti nereikalingus saugyklos failus</string>
|
||||
<string name="settings_clear_cache_summary">Išvalyti patalpintą informaciją talpykloms internete, priverčia perkrauti inerneto jungtį</string>
|
||||
<string name="settings_hide_manager_title">Paslėpti Magisk Manager</string>
|
||||
<string name="settings_hide_manager_summary">Perpakuoti Magisk Manager su atsitiktiniu pakuotės pavadinimu</string>
|
||||
<string name="language">Kalbas</string>
|
||||
<string name="language">Kalba</string>
|
||||
<string name="system_default">(Sistemos)</string>
|
||||
<string name="settings_update">Atnaujinimų nustatymai</string>
|
||||
<string name="settings_update_channel_title">Atnaujinimų tipai</string>
|
||||
<string name="settings_update_stable">Stabilūs</string>
|
||||
<string name="settings_update_beta"> Esantys Beta versijoje</string>
|
||||
<string name="settings_update_beta">Beta</string>
|
||||
<string name="settings_update_custom">Pasirinktiniai</string>
|
||||
<string name="settings_update_custom_msg">Įvesti pasirinktinį URL</string>
|
||||
<string name="settings_boot_format_title">Įsijungimo failo formatas</string>
|
||||
<string name="settings_boot_format_summary">Pasirinkite įsijungimo failo formatą.\nPasirinkite .img įdiegimui per fastboot/download; Pasirinkite .img.tar įdiegimui per ODIN.</string>
|
||||
<string name="settings_boot_format_title">Boot failo formatas</string>
|
||||
<string name="settings_boot_format_summary">Pasirinkite boot failo formatą.\nPasirinkite .img įdiegimui per fastboot/download; Pasirinkite .img.tar įdiegimui per ODIN.</string>
|
||||
<string name="settings_core_only_title">Magisk Pagrindinis režimas</string>
|
||||
<string name="settings_core_only_summary">Įgalinkite tik pagrindines funkcijas, visi moduliai bus išjungti. MagiskSU, MagiskHide, ir Sistemos pedejėjai liks įgalinti</string>
|
||||
<string name="settings_core_only_summary">Įgalintos bus tik pagrindines funkcijos, visi moduliai bus išjungti. MagiskSU, Magisk Hide ir Sistemos pedejėjai liks įgalinti</string>
|
||||
<string name="settings_magiskhide_summary">Paslėpti Magisk nuo įvairių susekimų</string>
|
||||
<string name="settings_hosts_title">Sistemos padejėjai</string>
|
||||
<string name="settings_hosts_summary">Sistemų padejėjų įgalinimas Adblock programėlėms</string>
|
||||
@@ -158,8 +162,10 @@
|
||||
<string name="superuser_notification">Supervartotojo pranešimai</string>
|
||||
<string name="request_timeout_summary">%1$s sekundžių</string>
|
||||
<string name="settings_su_reauth_title">Pakartotinai patvirtinti po atnaujinimo</string>
|
||||
<string name="settings_su_reauth_summary">Pakartotinai patvirtint supervartotojo leidimus po programėlės atnaujinimo</string>
|
||||
|
||||
<string name="settings_su_reauth_summary">Pakartotinai patvirtinti supervartotojo leidimus po programėlės atnaujinimo</string>
|
||||
<string name="settings_su_fingerprint_title">Įgalinti patvirtinimą piršto antspaudu</string>
|
||||
<string name="settings_su_fingerprint_summary">Naudoti piršto antspaudą supervartotojo leidimo prašymų atsakymui</string>
|
||||
|
||||
<string name="multiuser_mode">Daugialypio vartotojo režimas</string>
|
||||
<string name="settings_owner_only">Tik įrenginio savininkas</string>
|
||||
<string name="settings_owner_manage">Įrenginio savininko valdomas</string>
|
||||
@@ -183,7 +189,7 @@
|
||||
<string name="deny_with_str">Atmesti%1$s</string>
|
||||
<string name="deny">Atmesti</string>
|
||||
<string name="prompt">Klausti</string>
|
||||
<string name="grant">Suteikti</string>
|
||||
<string name="grant">Suteikti(a)</string>
|
||||
<string name="su_warning">Suteikia pilną prieigą prie jūsų įrenginio\nAtmeskite jei neesate tikri dėl programėlės šaltinio!</string>
|
||||
<string name="forever">Visados</string>
|
||||
<string name="once">Vieną kartą</string>
|
||||
@@ -205,7 +211,8 @@
|
||||
<string name="su_revoke_msg">Atšaukti %1$s teisių?</string>
|
||||
<string name="toast">Išmesti</string>
|
||||
<string name="none">Nėra</string>
|
||||
|
||||
<string name="auth_fail">Patvirtinimas žlugo</string>
|
||||
|
||||
<!--Superuser logs-->
|
||||
<string name="pid">PID:\u0020</string>
|
||||
<string name="target_uid">Target UID:\u0020</string>
|
||||
|
@@ -166,8 +166,10 @@
|
||||
<string name="request_timeout_summary">%1$s sekund</string>
|
||||
<string name="settings_su_reauth_title">Ponowienie uwierzytelnienia po aktualizacji</string>
|
||||
<string name="settings_su_reauth_summary">Ponowne uwierzytelnianie uprawnienia superużytkownika po aktualizacji aplikacji</string>
|
||||
<string name="settings_su_fingerprint_title">Włącz Uwierzytelnienie Odciskiem Palca</string>
|
||||
<string name="settings_su_fingerprint_summary">Użyj skanera linii papilarnych, aby zezwolić na żądania supersu</string>
|
||||
|
||||
<string name="multiuser_mode">Tryb Multiusera</string>
|
||||
<string name="multiuser_mode">Tryb Multiusera</string>
|
||||
<string name="settings_owner_only">Tylko Właściciel Urządzenia</string>
|
||||
<string name="settings_owner_manage">Zarządzanie Właścicielami Urządzenia</string>
|
||||
<string name="settings_user_independent">Niezależny Użytkownik</string>
|
||||
@@ -212,6 +214,7 @@
|
||||
<string name="su_revoke_msg">Potwierdzasz odwołanie uprawnień %1$s?</string>
|
||||
<string name="toast">Powiadomienie</string>
|
||||
<string name="none">Brak</string>
|
||||
<string name="auth_fail">Uwierzytelnienie Nieudane</string>
|
||||
|
||||
<!--Superuser logs-->
|
||||
<string name="pid">PID:\u0020</string>
|
||||
|
@@ -45,12 +45,19 @@
|
||||
<string name="disable_file_created">Módulo será desativado na próxima reinicialização</string>
|
||||
<string name="disable_file_removed">Módulo será ativado na próxima reinicialização</string>
|
||||
<string name="author">Criado por %1$s</string>
|
||||
<string name="reboot_recovery">Reiniciar no Recovery</string>
|
||||
<string name="reboot_bootloader">Reiniciar no Bootloader</string>
|
||||
<string name="reboot_download">Reiniciar no Download</string>
|
||||
|
||||
<!--Repo Fragment-->
|
||||
<string name="update_available">Atualização disponível</string>
|
||||
<string name="installed">Instalado</string>
|
||||
<string name="not_installed">Não Instalado</string>
|
||||
|
||||
<string name="updated_on">Atualizado em: %1$s</string>
|
||||
<string name="sorting_order">Ordem de classificação</string>
|
||||
<string name="sort_by_name">Classificar por nome</string>
|
||||
<string name="sort_by_update">Classificar por última atualização</string>
|
||||
|
||||
<!--Log Fragment-->
|
||||
<string name="menuSaveLog">Salvar registro</string>
|
||||
<string name="menuReload">Recarregar</string>
|
||||
@@ -94,23 +101,29 @@
|
||||
<string name="zip_process_msg">Processando arquivo zip …</string>
|
||||
<string name="manager_update_title">Nova atualização do Magisk Manager disponível!</string>
|
||||
<string name="manager_download_install">Pressione para baixar e instalar</string>
|
||||
<string name="dtbo_patched_title">Patch no DTBO instalado!</string>
|
||||
<string name="dtbo_patched_reboot">Magisk Manager instalou um patch no dtbo.img, por favor reinicie</string>
|
||||
<string name="magisk_updates">Atualizações do Magisk</string>
|
||||
<string name="flashing">Flasheando</string>
|
||||
<string name="hide_manager_toast">Ocultando Magisk Manager…</string>
|
||||
<string name="hide_manager_toast2">Isso pode demorar um pouco…</string>
|
||||
<string name="hide_manager_fail_toast">Falha ao ocultar o Magisk Manager…</string>
|
||||
<string name="download_zip_only">Baixar somente o zip</string>
|
||||
<string name="patch_boot_file">Arquivo Patch Boot Image</string>
|
||||
<string name="patch_boot_file">Patchear um arquivo Boot Image</string>
|
||||
<string name="direct_install">Instalação Direta (Recomendado)</string>
|
||||
<string name="install_second_slot">Instalação no segundo Slot (Depois do OTA)</string>
|
||||
<string name="select_method">Selecionar Método</string>
|
||||
<string name="no_boot_file_patch_support">Versão do Magisk escolhida não suporta arquivo de patch boot image</string>
|
||||
<string name="boot_file_patch_msg">Selecione a stock boot image despejada(dump) no formato .img ou img.tar</string>
|
||||
<string name="complete_uninstall">Desinstalação Completa</string>
|
||||
<string name="restore_img">Restaurar Images</string>
|
||||
<string name="uninstall_app">Desinstalar App</string>
|
||||
<string name="restore_done">Restauração Completa!</string>
|
||||
<string name="restore_fail">backup da Stock não existe!</string>
|
||||
<string name="uninstall_toast">Desinstalando o Magisk Manager em 5 segundos, por favor reinicie manualmente depois</string>
|
||||
<string name="proprietary_title">Baixar Código do Proprietário</string>
|
||||
<string name="proprietary_notice">Magisk Manager é FOSS então não contém o código proprietário da API SafetyNet do Google.\n\nVocê permite que o Magisk Manager baixe uma extensão (contém o GoogleApiClient) para verificações SafetyNet?</string>
|
||||
<string name="su_db_corrupt">O Banco de dados do SU está corrompido, criará novo db</string>
|
||||
|
||||
<!--Settings Fragment -->
|
||||
<string name="settings_general_category">Geral</string>
|
||||
@@ -121,15 +134,17 @@
|
||||
<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_hide_manager_title">Ocultar Magisk Manager</string>
|
||||
<string name="settings_hide_manager_summary">Criar um Magisk Manager com o nome do pacote aleatório</string>
|
||||
<string name="language">Linguagem</string>
|
||||
<string name="system_default">(Padrão do Sistema)</string>
|
||||
<string name="settings_update">Atualizar Configurações</string>
|
||||
<string name="settings_update_channel_title">Canal de atualizações</string>
|
||||
<string name="settings_update_stable">Estável</string>
|
||||
<string name="settings_update_beta">Beta</string>
|
||||
<string name="settings_boot_format_title">Formato de Saida do Boot Patcheado</string>
|
||||
<string name="settings_boot_format_summary">Selecione o formato de saida do Boot Image Patcheado.\nSelecione .img para flashear através do fastboot/modo de download; Selecione .img.tar para flashear com o ODIN.</string>
|
||||
|
||||
<string name="settings_update_custom">personalizado</string>
|
||||
<string name="settings_update_custom_msg">Insira um URL personalizado</string>
|
||||
<string name="settings_boot_format_title">Formato de Saida do Boot com patch instalado</string>
|
||||
<string name="settings_boot_format_summary">Selecione o formato de saida do Boot Image com patch instalado.\nSelecione .img para flashear através do fastboot/modo de download; Selecione .img.tar para flashear com o ODIN.</string>
|
||||
<string name="settings_core_only_title">Magisk modo somente Core</string>
|
||||
<string name="settings_core_only_summary">Ativar somente recursos principais, todos os módulos não serão carregados. MagiskSU, MagiskHide, e systemless hosts ainda estará ativado</string>
|
||||
<string name="settings_magiskhide_summary">Ocultar Magisk de várias detecções</string>
|
||||
@@ -151,6 +166,8 @@
|
||||
<string name="request_timeout_summary">%1$s segundos</string>
|
||||
<string name="settings_su_reauth_title">Re-autenticar após a atualização</string>
|
||||
<string name="settings_su_reauth_summary">Re-autenticar permissões de superusuário após as atualizações de um aplicativo</string>
|
||||
<string name="settings_su_fingerprint_title">Ativar autenticação de impressão digital</string>
|
||||
<string name="settings_su_fingerprint_summary">Use o scanner de impressão digital para permitir solicitações de superusuário</string>
|
||||
|
||||
<string name="multiuser_mode">Modo Multiusuário</string>
|
||||
<string name="settings_owner_only">Apenas Proprietário do Dispositivo</string>
|
||||
@@ -168,7 +185,8 @@
|
||||
<string name="global_summary">Todas as sessões raiz usam o namespace de montagem global</string>
|
||||
<string name="requester_summary">As sessões de raiz herdarão o namespace do seu solicitante</string>
|
||||
<string name="isolate_summary">Cada sessão raiz terá seu próprio namespace isolado</string>
|
||||
|
||||
<string name="android_o_not_support">Não suporta Android 8.0+</string>
|
||||
|
||||
<!--Superuser-->
|
||||
<string name="su_request_title">Solicitação de superusuário</string>
|
||||
<string name="deny_with_str">Negar%1$s</string>
|
||||
@@ -196,7 +214,8 @@
|
||||
<string name="su_revoke_msg">Revogar os diretos do %1$s, Confirmar?</string>
|
||||
<string name="toast">Notificação(Toast)</string>
|
||||
<string name="none">Nenhum</string>
|
||||
|
||||
<string name="auth_fail">Falha na autenticação</string>
|
||||
|
||||
<!--Superuser logs-->
|
||||
<string name="pid">PID:\u0020</string>
|
||||
<string name="target_uid">Alvo UID:\u0020</string>
|
||||
|
@@ -24,7 +24,7 @@
|
||||
<!--Install Fragment-->
|
||||
<string name="advanced_settings_title">Gelişmiş Ayarlar</string>
|
||||
<string name="keep_force_encryption">Şifrelemeyi zorlamayı sürdür</string>
|
||||
<string name="keep_dm_verity">AVB 2.0/dm-verity \'yi koru</string>
|
||||
<string name="keep_dm_verity">AVB 2.0/dm-verity\'yi koru</string>
|
||||
<string name="current_magisk_title">Yüklü Sürüm: %1$s</string>
|
||||
<string name="install_magisk_title">Yeni Sürüm: %1$s</string>
|
||||
<string name="uninstall">Kaldır</string>
|
||||
@@ -49,7 +49,7 @@
|
||||
<string name="update_available">Güncelleme Mevcut</string>
|
||||
<string name="installed">Yüklenmiş</string>
|
||||
<string name="not_installed">Yüklenmemiş</string>
|
||||
<string name="updated_on">Updated on: %1$s</string>
|
||||
<string name="updated_on">Güncelleme: %1$s</string>
|
||||
<string name="sorting_order">Sıralama Düzeni</string>
|
||||
<string name="sort_by_name">İsme göre sırala</string>
|
||||
<string name="sort_by_update">Son güncellemeye göre sırala</string>
|
||||
@@ -160,8 +160,10 @@
|
||||
<string name="request_timeout">İstek Zaman Aşımı</string>
|
||||
<string name="superuser_notification">Yetkili Kullanıcı Bildirimi</string>
|
||||
<string name="request_timeout_summary">%1$s saniye</string>
|
||||
<string name="settings_su_reauth_title">Yükseltmeden sonra yeniden kimlik doğrulaması yapın</string>
|
||||
<string name="settings_su_reauth_title">Yükseltmeden sonra yeniden kimlik doğrulama</string>
|
||||
<string name="settings_su_reauth_summary">Uygulama yükseltmeleri sonrasında yetkili kullanıcı izinlerini yeniden doğrulama</string>
|
||||
<string name="settings_su_fingerprint_title">Parmak İzi Kimlik Doğrulamayı Etkinleştir</string>
|
||||
<string name="settings_su_fingerprint_summary">Yetkili kullanıcı isteklerine izin vermek için parmak izi tarayıcısını kullan</string>
|
||||
|
||||
<string name="multiuser_mode">Çok Kullanıcılı Mod</string>
|
||||
<string name="settings_owner_only">Yalnızca Cihaz Sahibi</string>
|
||||
@@ -208,6 +210,7 @@
|
||||
<string name="su_revoke_msg">%1$s hakları geri alınsın mı?</string>
|
||||
<string name="toast">Pencere</string>
|
||||
<string name="none">Hiçbiri</string>
|
||||
<string name="auth_fail">Kimlik Doğrulama Başarısız</string>
|
||||
|
||||
<!--Superuser logs-->
|
||||
<string name="pid">PID:\u0020</string>
|
||||
|
@@ -10,12 +10,12 @@
|
||||
|
||||
<!--Status Fragment-->
|
||||
<string name="magisk_version_error">Magisk не встановлено</string>
|
||||
|
||||
<string name="checking_for_updates">Перевірка оновлень…</string>
|
||||
<string name="magisk_update_available">Доступно Magisk v%1$s!</string>
|
||||
<string name="invalid_update_channel">Неправильний канал оновлень</string>
|
||||
<string name="safetyNet_check_text">Перевірити статус SafetyNet</string>
|
||||
<string name="checking_safetyNet_status">Перевірка статусу SafetyNet…</string>
|
||||
<string name="safetyNet_check_success">Перевірку SafetyNet завершено</string>
|
||||
<string name="safetyNet_check_success">Результат перевірки SafetyNet</string>
|
||||
<string name="safetyNet_api_error">Помилка в API SafetyNet</string>
|
||||
<string name="safetyNet_network_loss">Підключення до інтернету втрачено</string>
|
||||
<string name="safetyNet_service_disconnected">Службу зупинено</string>
|
||||
@@ -41,11 +41,18 @@
|
||||
<string name="disable_file_created">Модуль вимкнеться при перезавантаженні</string>
|
||||
<string name="disable_file_removed">Модуль увімкнеться при перезавантаженні</string>
|
||||
<string name="author">Автор: %1$s</string>
|
||||
<string name="reboot_recovery">Перезавантаження в Recovery</string>
|
||||
<string name="reboot_bootloader">Перезавантаження в Bootloader</string>
|
||||
<string name="reboot_download">Перезавантаження в Download</string>
|
||||
|
||||
<!--Repo Fragment-->
|
||||
<string name="update_available">Доступне оновлення</string>
|
||||
<string name="installed">Встановлено</string>
|
||||
<string name="not_installed">Не встановлено</string>
|
||||
<string name="updated_on">Оновлено: %1$s</string>
|
||||
<string name="sorting_order">Порядок сортування</string>
|
||||
<string name="sort_by_name">Сортувати за ім'ям</string>
|
||||
<string name="sort_by_update">Сортувати за оновленням</string>
|
||||
|
||||
<!--Log Fragment-->
|
||||
<string name="menuSaveLog">Зберегти логи</string>
|
||||
@@ -90,6 +97,8 @@
|
||||
<string name="zip_process_msg">Опрацювання архіву …</string>
|
||||
<string name="manager_update_title">Доступне оновлення Magisk Manager!</string>
|
||||
<string name="manager_download_install">Натисніть, щоб завантажити і встановити</string>
|
||||
<string name="dtbo_patched_title">DTBO пропатчено!</string>
|
||||
<string name="dtbo_patched_reboot">Magisk Manager пропатчив dtbo.img, будь ласка, перезавантажте пристрій</string>
|
||||
<string name="magisk_updates">Оновлення Magisk</string>
|
||||
<string name="flashing">Прошивання</string>
|
||||
<string name="hide_manager_toast">Приховування Magisk Manager…</string>
|
||||
@@ -103,11 +112,14 @@
|
||||
<string name="no_boot_file_patch_support">Цільова версія Magisk не підтримує пропатчування boot образу</string>
|
||||
<string name="boot_file_patch_msg">Виберіть оригінальний дамп boot образу в форматі .img чи .img.tar</string>
|
||||
<string name="complete_uninstall">Видалення виконано</string>
|
||||
<string name="restore_img">Відновити образ</string>
|
||||
<string name="uninstall_app">Видалити додаток</string>
|
||||
<string name="restore_done">Відновлення завершено!</string>
|
||||
<string name="restore_fail">Немає резервної копії оригінального boot образу</string>
|
||||
<string name="uninstall_toast">Видалення Менеджера Magisk протягом 5 секунд, потім, будь ласка, вручну перезавантажте</string>
|
||||
<string name="uninstall_toast">Видалення Magisk Manager протягом 5 секунд, потім, будь ласка, вручну перезавантажте пристрій</string>
|
||||
<string name="proprietary_title">Завантажити пропрієтарний код</string>
|
||||
<string name="proprietary_notice">Менеджер Magisk - це безкоштовний додаток з відкритим вихідним кодом, тому він не містить пропрієтарний код API SafetyNet від компанії Google.\n\nДозволити Менеджеру Magisk завантажити розширення (яке містить GoogleApiClient) для перевірки SafetyNet?</string>
|
||||
<string name="proprietary_notice">Magisk Manager — це безкоштовний додаток з відкритим вихідним кодом, тому він не містить пропрієтарний код API SafetyNet від компанії Google.\n\nДозволити Magisk Manager завантажити розширення (яке містить GoogleApiClient) для перевірки SafetyNet?</string>
|
||||
<string name="su_db_corrupt">База даних SU пошкоджена, буде створено нову БД</string>
|
||||
|
||||
<!--Settings Activity -->
|
||||
<string name="settings_general_category">Основні</string>
|
||||
@@ -118,13 +130,15 @@
|
||||
<string name="settings_clear_cache_title">Очищення кешу</string>
|
||||
<string name="settings_clear_cache_summary">Очистити збережену інформацію про мережеві репозиторії, змушуючи програму примусово оновлюватися через Інтернет</string>
|
||||
<string name="settings_hide_manager_title">Приховати Magisk Manager</string>
|
||||
<string name="settings_hide_manager_summary">Перезібрати Менеджер Magisk з випадковим іменем пакету</string>
|
||||
<string name="settings_hide_manager_summary">Перезібрати Magisk Manager з випадковим іменем пакету</string>
|
||||
<string name="language">Мова</string>
|
||||
<string name="system_default">Стандартна (системна)</string>
|
||||
<string name="settings_update">Оновити налаштування</string>
|
||||
<string name="settings_update_channel_title">Канал оновлення</string>
|
||||
<string name="settings_update_stable">Стабільний реліз</string>
|
||||
<string name="settings_update_beta">Бета реліз</string>
|
||||
<string name="settings_update_custom">Власний</string>
|
||||
<string name="settings_update_custom_msg">Вставте власний URL</string>
|
||||
<string name="settings_boot_format_title">Формат пропатченого образу</string>
|
||||
<string name="settings_boot_format_summary">Виберіть формат вихідного пропатченого boot образу.\n.img - для прошивання через fastboot/download режим;\n.img.tar - для прошивання через ODIN.</string>
|
||||
<string name="settings_core_only_title">Режим ядра Magisk</string>
|
||||
@@ -148,6 +162,8 @@
|
||||
<string name="request_timeout_summary">%1$s сек.</string>
|
||||
<string name="settings_su_reauth_title">Повторна автентифікація</string>
|
||||
<string name="settings_su_reauth_summary">Перевидача прав суперкористувача після оновлення програм</string>
|
||||
<string name="settings_su_fingerprint_title">Увімкнути автентифікацію за відбитком</string>
|
||||
<string name="settings_su_fingerprint_summary">Використовувати сканер відбитків пальців, щоб надавати дозвіл суперкористувача</string>
|
||||
|
||||
<string name="multiuser_mode">Багатокористувацький режим</string>
|
||||
<string name="settings_owner_only">Тільки власник</string>
|
||||
@@ -165,6 +181,7 @@
|
||||
<string name="global_summary">Всі сеанси Суперкористувача використовують глобальний простір імен</string>
|
||||
<string name="requester_summary">Сеанси Суперкористувача наслідують простір імен запитувача</string>
|
||||
<string name="isolate_summary">Кожнен сеанс Суперкористувача має власний ізольований простір імен</string>
|
||||
<string name="android_o_not_support">Не підтримує Android 8.0+</string>
|
||||
|
||||
<!--Superuser-->
|
||||
<string name="su_request_title">Запит прав Суперкористувача</string>
|
||||
@@ -193,6 +210,7 @@
|
||||
<string name="su_revoke_msg">Підтвердити відкликання прав для %1$s?</string>
|
||||
<string name="toast">Спливаюче сповіщення</string>
|
||||
<string name="none">Нічого</string>
|
||||
<string name="auth_fail">Помилка автентифікації</string>
|
||||
|
||||
<!--Superuser logs-->
|
||||
<string name="pid">PID:\u0020</string>
|
||||
|
@@ -135,6 +135,8 @@
|
||||
<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_summary">Repackage Magisk Manager with random package name</string>
|
||||
<string name="settings_restore_manager_title">Restore Magisk Manager</string>
|
||||
<string name="settings_restore_manager_summary">Restore Magisk Manager with original package</string>
|
||||
<string name="language">Language</string>
|
||||
<string name="system_default">(System Default)</string>
|
||||
<string name="settings_update">Update Settings</string>
|
||||
|
@@ -20,6 +20,11 @@
|
||||
android:title="@string/settings_hide_manager_title"
|
||||
android:summary="@string/settings_hide_manager_summary" />
|
||||
|
||||
<Preference
|
||||
android:key="restore"
|
||||
android:summary="@string/settings_restore_manager_summary"
|
||||
android:title="@string/settings_restore_manager_title" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
|
Reference in New Issue
Block a user