mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-08-14 15:27:25 +00:00
Compare commits
103 Commits
manager-v7
...
manager-v7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4040a0242f | ||
![]() |
781ec810d9 | ||
![]() |
9e90a71c04 | ||
![]() |
5571714b26 | ||
![]() |
e0d1f02ef5 | ||
![]() |
1b729e5ff2 | ||
![]() |
51e587d4e8 | ||
![]() |
ac9c55dbc1 | ||
![]() |
0893ac3141 | ||
![]() |
fb40e96917 | ||
![]() |
4ca25f74c6 | ||
![]() |
7fda917b86 | ||
![]() |
e6bd5f2c40 | ||
![]() |
8a904ee384 | ||
![]() |
00a9f18a1e | ||
![]() |
8d68ebb074 | ||
![]() |
5f53cfb4a9 | ||
![]() |
a2fa8d8be1 | ||
![]() |
70a3c78ebb | ||
![]() |
54d1207f92 | ||
![]() |
003e44fb84 | ||
![]() |
515f346dcc | ||
![]() |
6050c4e8ba | ||
![]() |
158af8819a | ||
![]() |
7787bb31fa | ||
![]() |
a1fe3e7ccd | ||
![]() |
4316028b23 | ||
![]() |
f2b52755d6 | ||
![]() |
f315c4416b | ||
![]() |
4e7dafb0e4 | ||
![]() |
a6395d35db | ||
![]() |
a028cd5cec | ||
![]() |
540000d26e | ||
![]() |
888c656aa8 | ||
![]() |
8d4c407201 | ||
![]() |
fdeede23f7 | ||
![]() |
53c5ca59b6 | ||
![]() |
679db97209 | ||
![]() |
fbdd72273e | ||
![]() |
0165602515 | ||
![]() |
96127f8bd1 | ||
![]() |
0dbdf336d6 | ||
![]() |
48879df2da | ||
![]() |
b067a5bb13 | ||
![]() |
4b54cf1288 | ||
![]() |
6128c24f96 | ||
![]() |
d9c58f307f | ||
![]() |
b521fbeeda | ||
![]() |
d00a3b89f2 | ||
![]() |
3d15518191 | ||
![]() |
9b6535fdf5 | ||
![]() |
e0424fdba3 | ||
![]() |
7481c53451 | ||
![]() |
7219947237 | ||
![]() |
b72004e9cc | ||
![]() |
f187213568 | ||
![]() |
fc0df84edd | ||
![]() |
f24df4f43d | ||
![]() |
dab32e1599 | ||
![]() |
bc286fd4d3 | ||
![]() |
befe1a83b5 | ||
![]() |
82ea9db9fd | ||
![]() |
c5758b3f2d | ||
![]() |
ace3708c9c | ||
![]() |
fc5026d268 | ||
![]() |
77fd0e54be | ||
![]() |
24490e0ff5 | ||
![]() |
da3937ff4e | ||
![]() |
ebe1ab982e | ||
![]() |
98590cb00d | ||
![]() |
ff95f634f0 | ||
![]() |
ced9b4a8ee | ||
![]() |
7af7910e78 | ||
![]() |
a4f5d47e72 | ||
![]() |
6953cc2411 | ||
![]() |
6a0b2ddee9 | ||
![]() |
24f5bc98d8 | ||
![]() |
5203886f0b | ||
![]() |
c10b376575 | ||
![]() |
ceb21ced2b | ||
![]() |
86789a8694 | ||
![]() |
ca2235aee7 | ||
![]() |
a385e5cd92 | ||
![]() |
0c7a95bdf6 | ||
![]() |
036b5acf42 | ||
![]() |
056dafc59f | ||
![]() |
a9c90718d6 | ||
![]() |
cc77a24502 | ||
![]() |
71a91ac7a7 | ||
![]() |
08a70f033a | ||
![]() |
1b0c36dbd5 | ||
![]() |
91da1cf817 | ||
![]() |
c577a9525d | ||
![]() |
0149b1368d | ||
![]() |
cd6bcb97ef | ||
![]() |
df4161ffcc | ||
![]() |
7a133eaf03 | ||
![]() |
1cd45b53b1 | ||
![]() |
5b30c77403 | ||
![]() |
8248480d56 | ||
![]() |
345d992d39 | ||
![]() |
a7f6afa4bc | ||
![]() |
d22c7de79a |
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -16,3 +16,4 @@ chromeos/** binary
|
||||
*.exe binary
|
||||
*.apk binary
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
|
21
README.MD
21
README.MD
@@ -38,6 +38,27 @@ Default string resources for Magisk Manager are scattered throughout
|
||||
|
||||
Translate each and place them in the respective locations (`<module>/src/main/res/values-<lang>/strings.xml`).
|
||||
|
||||
## Signature Verification
|
||||
|
||||
Official release zips and APKs are signed with my personal private key. You can verify the key certificate to make sure the binaries you downloaded are not manipulated in anyway.
|
||||
|
||||
``` bash
|
||||
# Use the keytool command from JDK to print certificates
|
||||
keytool -printcert -jarfile <APK or Magisk zip>
|
||||
|
||||
# The output should contain the following signature
|
||||
Owner: CN=John Wu, L=Taipei, C=TW
|
||||
Issuer: CN=John Wu, L=Taipei, C=TW
|
||||
Serial number: 50514879
|
||||
Valid from: Sun Aug 14 13:23:44 EDT 2016 until: Tue Jul 21 13:23:44 EDT 2116
|
||||
Certificate fingerprints:
|
||||
MD5: CE:DA:68:C1:E1:74:71:0A:EF:58:89:7D:AE:6E:AB:4F
|
||||
SHA1: DC:0F:2B:61:CB:D7:E9:D3:DB:BE:06:0B:2B:87:0D:46:BB:06:02:11
|
||||
SHA256: B4:CB:83:B4:DA:D9:9F:99:7D:BE:87:2F:01:3A:A1:6C:14:EE:C4:1D:16:70:21:F3:71:F7:E1:33:0F:27:3E:E6
|
||||
Signature algorithm name: SHA256withRSA
|
||||
Version: 3
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Magisk, including all git submodules are free software:
|
||||
|
@@ -1,11 +1,23 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
|
||||
kapt {
|
||||
correctErrorTypes = true
|
||||
useBuildCache = true
|
||||
mapDiagnosticLocations = true
|
||||
javacOptions {
|
||||
option("-Xmaxerrs", 1000)
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
applicationId 'com.topjohnwu.magisk'
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
versionName rootProject.ext.configProps['appVersion']
|
||||
versionCode rootProject.ext.configProps['appVersionCode'] as Integer
|
||||
versionName configProps['appVersion']
|
||||
versionCode configProps['appVersionCode'] as Integer
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
argument('butterknife.debuggable', 'false')
|
||||
@@ -25,12 +37,15 @@ dependencies {
|
||||
implementation project(':net')
|
||||
implementation project(':shared')
|
||||
implementation project(':signing')
|
||||
implementation 'ru.noties:markwon:2.0.1'
|
||||
implementation 'com.caverock:androidsvg-aar:1.3'
|
||||
implementation 'org.kamranzafar:jtar:2.3'
|
||||
implementation 'com.github.topjohnwu:jtar:1.0.0'
|
||||
implementation 'net.sourceforge.streamsupport:android-retrostreams:1.7.0'
|
||||
implementation 'com.github.sevar83:indeterminate-checkbox:1.0.5'
|
||||
|
||||
def markwonVersion = '3.0.0'
|
||||
implementation "ru.noties.markwon:core:${markwonVersion}"
|
||||
implementation "ru.noties.markwon:html:${markwonVersion}"
|
||||
implementation "ru.noties.markwon:image-svg:${markwonVersion}"
|
||||
|
||||
def androidXVersion = "1.0.0"
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.appcompat:appcompat:1.0.2'
|
||||
@@ -38,14 +53,14 @@ dependencies {
|
||||
implementation "androidx.recyclerview:recyclerview:${androidXVersion}"
|
||||
implementation "androidx.cardview:cardview:${androidXVersion}"
|
||||
implementation "com.google.android.material:material:${androidXVersion}"
|
||||
implementation 'androidx.work:work-runtime:2.0.0'
|
||||
implementation 'androidx.transition:transition:1.1.0-alpha02'
|
||||
implementation 'androidx.work:work-runtime:2.0.1'
|
||||
implementation 'androidx.transition:transition:1.1.0-beta01'
|
||||
|
||||
def libsuVersion = '2.3.2'
|
||||
def libsuVersion = '2.5.0'
|
||||
implementation "com.github.topjohnwu.libsu:core:${libsuVersion}"
|
||||
implementation "com.github.topjohnwu.libsu:io:${libsuVersion}"
|
||||
|
||||
def butterKnifeVersion = '10.1.0'
|
||||
implementation "com.jakewharton:butterknife-runtime:${butterKnifeVersion}"
|
||||
annotationProcessor "com.jakewharton:butterknife-compiler:${butterKnifeVersion}"
|
||||
kapt "com.jakewharton:butterknife-compiler:${butterKnifeVersion}"
|
||||
}
|
||||
|
9
app/proguard-rules.pro
vendored
9
app/proguard-rules.pro
vendored
@@ -29,6 +29,9 @@
|
||||
void onResponse(int);
|
||||
}
|
||||
|
||||
# DelegateWorker
|
||||
-keep,allowobfuscation class * extends com.topjohnwu.magisk.model.worker.DelegateWorker
|
||||
|
||||
# BootSigner
|
||||
-keepclassmembers class com.topjohnwu.signing.BootSigner { *; }
|
||||
|
||||
@@ -46,4 +49,8 @@
|
||||
# Excessive obfuscation
|
||||
-repackageclasses 'a'
|
||||
-allowaccessmodification
|
||||
-optimizationpasses 6
|
||||
|
||||
# QOL
|
||||
-dontnote **
|
||||
-dontwarn com.caverock.androidsvg.**
|
||||
-dontwarn ru.noties.markwon.**
|
||||
|
@@ -41,10 +41,9 @@
|
||||
|
||||
<activity
|
||||
android:name="a.m"
|
||||
android:exported="false"
|
||||
android:directBootAware="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:launchMode="singleTask"
|
||||
android:taskAffinity="a.m"
|
||||
android:theme="@style/SuRequest" />
|
||||
|
||||
<!-- Receiver -->
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package a;
|
||||
|
||||
import com.topjohnwu.magisk.MainActivity;
|
||||
import com.topjohnwu.magisk.ui.MainActivity;
|
||||
|
||||
public class b extends MainActivity {
|
||||
/* stub */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package a;
|
||||
|
||||
import com.topjohnwu.magisk.SplashActivity;
|
||||
import com.topjohnwu.magisk.ui.SplashActivity;
|
||||
|
||||
public class c extends SplashActivity {
|
||||
/* stub */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package a;
|
||||
|
||||
import com.topjohnwu.magisk.FlashActivity;
|
||||
import com.topjohnwu.magisk.ui.flash.FlashActivity;
|
||||
|
||||
public class f extends FlashActivity {
|
||||
/* stub */
|
||||
|
@@ -2,7 +2,7 @@ package a;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.topjohnwu.magisk.components.UpdateCheckService;
|
||||
import com.topjohnwu.magisk.model.update.UpdateCheckService;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.work.WorkerParameters;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package a;
|
||||
|
||||
import com.topjohnwu.magisk.components.GeneralReceiver;
|
||||
import com.topjohnwu.magisk.model.receiver.GeneralReceiver;
|
||||
|
||||
public class h extends GeneralReceiver {
|
||||
/* stub */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package a;
|
||||
|
||||
import com.topjohnwu.magisk.components.DownloadModuleService;
|
||||
import com.topjohnwu.magisk.model.download.DownloadModuleService;
|
||||
|
||||
public class j extends DownloadModuleService {
|
||||
/* stub */
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package a;
|
||||
|
||||
import com.topjohnwu.magisk.SuRequestActivity;
|
||||
import com.topjohnwu.magisk.ui.surequest.SuRequestActivity;
|
||||
|
||||
public class m extends SuRequestActivity {
|
||||
/* stub */
|
||||
|
@@ -2,7 +2,7 @@ package a;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.topjohnwu.magisk.components.DelegateWorker;
|
||||
import com.topjohnwu.magisk.model.worker.DelegateWorker;
|
||||
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
|
||||
|
@@ -1,15 +1,22 @@
|
||||
package com.topjohnwu.magisk;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import com.topjohnwu.magisk.database.MagiskDB;
|
||||
import com.topjohnwu.magisk.database.RepoDatabaseHelper;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
|
||||
import com.topjohnwu.magisk.data.database.MagiskDB;
|
||||
import com.topjohnwu.magisk.data.database.RepoDatabaseHelper;
|
||||
import com.topjohnwu.magisk.ui.base.BaseActivity;
|
||||
import com.topjohnwu.magisk.utils.LocaleManager;
|
||||
import com.topjohnwu.magisk.utils.RootUtils;
|
||||
import com.topjohnwu.net.Networking;
|
||||
@@ -17,7 +24,7 @@ import com.topjohnwu.superuser.Shell;
|
||||
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
public class App extends Application {
|
||||
public class App extends Application implements Application.ActivityLifecycleCallbacks {
|
||||
|
||||
public static App self;
|
||||
public static Context deContext;
|
||||
@@ -27,8 +34,10 @@ public class App extends Application {
|
||||
public SharedPreferences prefs;
|
||||
public MagiskDB mDB;
|
||||
public RepoDatabaseHelper repoDB;
|
||||
private volatile BaseActivity foreground;
|
||||
|
||||
static {
|
||||
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
|
||||
Shell.Config.setFlags(Shell.FLAG_MOUNT_MASTER | Shell.FLAG_USE_MAGISK_BUSYBOX);
|
||||
Shell.Config.verboseLogging(BuildConfig.DEBUG);
|
||||
Shell.Config.addInitializers(RootUtils.class);
|
||||
@@ -41,6 +50,7 @@ public class App extends Application {
|
||||
super.attachBaseContext(base);
|
||||
self = this;
|
||||
deContext = base;
|
||||
registerActivityLifecycleCallbacks(this);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
deContext = base.createDeviceProtectedStorageContext();
|
||||
@@ -55,8 +65,37 @@ public class App extends Application {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
LocaleManager.setLocale(this);
|
||||
}
|
||||
|
||||
public static BaseActivity foreground() {
|
||||
return self.foreground;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle bundle) {}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(@NonNull Activity activity) {}
|
||||
|
||||
@Override
|
||||
public synchronized void onActivityResumed(@NonNull Activity activity) {
|
||||
foreground = (BaseActivity) activity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void onActivityPaused(@NonNull Activity activity) {
|
||||
foreground = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(@NonNull Activity activity) {}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle bundle) {}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(@NonNull Activity activity) {}
|
||||
}
|
||||
|
@@ -1,8 +1,12 @@
|
||||
package com.topjohnwu.magisk;
|
||||
|
||||
import com.topjohnwu.magisk.components.DownloadModuleService;
|
||||
import com.topjohnwu.magisk.components.GeneralReceiver;
|
||||
import com.topjohnwu.magisk.components.UpdateCheckService;
|
||||
import com.topjohnwu.magisk.model.download.DownloadModuleService;
|
||||
import com.topjohnwu.magisk.model.receiver.GeneralReceiver;
|
||||
import com.topjohnwu.magisk.model.update.UpdateCheckService;
|
||||
import com.topjohnwu.magisk.ui.MainActivity;
|
||||
import com.topjohnwu.magisk.ui.SplashActivity;
|
||||
import com.topjohnwu.magisk.ui.flash.FlashActivity;
|
||||
import com.topjohnwu.magisk.ui.surequest.SuRequestActivity;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@@ -59,7 +59,6 @@ public class Config {
|
||||
public static final String CHECK_UPDATES = "check_update";
|
||||
public static final String UPDATE_CHANNEL = "update_channel";
|
||||
public static final String CUSTOM_CHANNEL = "custom_channel";
|
||||
public static final String BOOT_FORMAT = "boot_format";
|
||||
public static final String LOCALE = "locale";
|
||||
public static final String DARK_THEME = "dark_theme";
|
||||
public static final String ETAG_KEY = "ETag";
|
||||
@@ -73,6 +72,7 @@ public class Config {
|
||||
}
|
||||
|
||||
public static class Value {
|
||||
public static final int DEFAULT_CHANNEL = -1;
|
||||
public static final int STABLE_CHANNEL = 0;
|
||||
public static final int BETA_CHANNEL = 1;
|
||||
public static final int CUSTOM_CHANNEL = 2;
|
||||
@@ -118,7 +118,7 @@ public class Config {
|
||||
public static void initialize() {
|
||||
SharedPreferences pref = App.self.prefs;
|
||||
SharedPreferences.Editor editor = pref.edit();
|
||||
SuFile config = new SuFile("/data/adb/" + Const.MANAGER_CONFIGS);
|
||||
File config = SuFile.open("/data/adb", Const.MANAGER_CONFIGS);
|
||||
if (config.exists()) {
|
||||
try {
|
||||
SuFileInputStream is = new SuFileInputStream(config);
|
||||
@@ -213,7 +213,6 @@ public class Config {
|
||||
return PREF_BOOL;
|
||||
|
||||
case Key.CUSTOM_CHANNEL:
|
||||
case Key.BOOT_FORMAT:
|
||||
case Key.LOCALE:
|
||||
case Key.ETAG_KEY:
|
||||
return PREF_STR;
|
||||
@@ -316,7 +315,7 @@ public class Config {
|
||||
defs.put(Key.SU_AUTO_RESPONSE, Value.SU_PROMPT);
|
||||
defs.put(Key.SU_NOTIFICATION, Value.NOTIFICATION_TOAST);
|
||||
defs.put(Key.UPDATE_CHANNEL, Utils.isCanary() ?
|
||||
Value.CANARY_DEBUG_CHANNEL : Value.STABLE_CHANNEL);
|
||||
Value.CANARY_DEBUG_CHANNEL : Value.DEFAULT_CHANNEL);
|
||||
|
||||
// prefs bool
|
||||
defs.put(Key.CHECK_UPDATES, true);
|
||||
@@ -326,7 +325,6 @@ public class Config {
|
||||
|
||||
// prefs string
|
||||
defs.put(Key.CUSTOM_CHANNEL, "");
|
||||
defs.put(Key.BOOT_FORMAT, ".img");
|
||||
defs.put(Key.LOCALE, "");
|
||||
//defs.put(Key.ETAG_KEY, null);
|
||||
|
||||
|
@@ -25,14 +25,12 @@ public class Const {
|
||||
EXTERNAL_PATH.mkdirs();
|
||||
}
|
||||
|
||||
public static final String BUSYBOX_PATH = "/sbin/.magisk/busybox";
|
||||
public static final String TMP_FOLDER_PATH = "/dev/tmp";
|
||||
public static final String MAGISK_LOG = "/cache/magisk.log";
|
||||
public static final String MANAGER_CONFIGS = ".tmp.magisk.config";
|
||||
|
||||
// Versions
|
||||
public static final int UPDATE_SERVICE_VER = 1;
|
||||
public static final int MIN_MODULE_VER = 1500;
|
||||
public static final int SNET_EXT_VER = 12;
|
||||
|
||||
public static final int USER_ID = Process.myUid() / 100000;
|
||||
@@ -42,10 +40,8 @@ public class Const {
|
||||
}
|
||||
|
||||
public static class ID {
|
||||
public static final int UPDATE_SERVICE_ID = 1;
|
||||
public static final int FETCH_ZIP = 2;
|
||||
public static final int SELECT_BOOT = 3;
|
||||
public static final int ONBOOT_SERVICE_ID = 6;
|
||||
|
||||
// notifications
|
||||
public static final int MAGISK_UPDATE_NOTIFICATION_ID = 4;
|
||||
@@ -83,19 +79,17 @@ public class Const {
|
||||
public static final String LINK_KEY = "Link";
|
||||
public static final String IF_NONE_MATCH = "If-None-Match";
|
||||
// intents
|
||||
public static final String FROM_SPLASH = "splash";
|
||||
public static final String OPEN_SECTION = "section";
|
||||
public static final String INTENT_SET_NAME = "filename";
|
||||
public static final String INTENT_SET_LINK = "link";
|
||||
public static final String FLASH_ACTION = "action";
|
||||
public static final String FLASH_SET_BOOT = "boot";
|
||||
public static final String BROADCAST_MANAGER_UPDATE = "manager_update";
|
||||
public static final String BROADCAST_REBOOT = "reboot";
|
||||
}
|
||||
|
||||
public static class Value {
|
||||
public static final String FLASH_ZIP = "flash";
|
||||
public static final String PATCH_BOOT = "patch";
|
||||
public static final String PATCH_FILE = "patch";
|
||||
public static final String FLASH_MAGISK = "magisk";
|
||||
public static final String FLASH_INACTIVE_SLOT = "slot";
|
||||
public static final String UNINSTALL = "uninstall";
|
||||
|
@@ -1,229 +0,0 @@
|
||||
package com.topjohnwu.magisk;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.hardware.fingerprint.FingerprintManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
|
||||
import com.topjohnwu.magisk.components.BaseActivity;
|
||||
import com.topjohnwu.magisk.container.Policy;
|
||||
import com.topjohnwu.magisk.utils.FingerprintHelper;
|
||||
import com.topjohnwu.magisk.utils.SuConnector;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import butterknife.BindView;
|
||||
|
||||
public class SuRequestActivity extends BaseActivity {
|
||||
@BindView(R.id.su_popup) LinearLayout suPopup;
|
||||
@BindView(R.id.timeout) Spinner timeout;
|
||||
@BindView(R.id.app_icon) ImageView appIcon;
|
||||
@BindView(R.id.app_name) TextView appNameView;
|
||||
@BindView(R.id.package_name) TextView packageNameView;
|
||||
@BindView(R.id.grant_btn) Button grant_btn;
|
||||
@BindView(R.id.deny_btn) Button deny_btn;
|
||||
@BindView(R.id.fingerprint) ImageView fingerprintImg;
|
||||
@BindView(R.id.warning) TextView warning;
|
||||
|
||||
private SuConnector connector;
|
||||
private Policy policy;
|
||||
private CountDownTimer timer;
|
||||
private FingerprintHelper fingerprintHelper;
|
||||
private SharedPreferences timeoutPrefs;
|
||||
|
||||
@Override
|
||||
public int getDarkTheme() {
|
||||
return R.style.SuRequest_Dark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finish() {
|
||||
if (timer != null)
|
||||
timer.cancel();
|
||||
if (fingerprintHelper != null)
|
||||
fingerprintHelper.cancel();
|
||||
super.finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (policy != null) {
|
||||
handleAction(Policy.DENY);
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
|
||||
PackageManager pm = getPackageManager();
|
||||
app.mDB.clearOutdated();
|
||||
timeoutPrefs = App.deContext.getSharedPreferences("su_timeout", 0);
|
||||
|
||||
// Get policy
|
||||
Intent intent = getIntent();
|
||||
try {
|
||||
String socketName = intent.getStringExtra("socket");
|
||||
connector = new SuConnector(socketName) {
|
||||
@Override
|
||||
protected void onResponse() throws IOException {
|
||||
out.writeInt(policy.policy);
|
||||
}
|
||||
};
|
||||
Bundle bundle = connector.readSocketInput();
|
||||
int uid = Integer.parseInt(bundle.getString("uid"));
|
||||
policy = app.mDB.getPolicy(uid);
|
||||
if (policy == null) {
|
||||
policy = new Policy(uid, pm);
|
||||
}
|
||||
} catch (IOException | PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
// Never allow com.topjohnwu.magisk (could be malware)
|
||||
if (TextUtils.equals(policy.packageName, BuildConfig.APPLICATION_ID)) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
switch ((int) Config.get(Config.Key.SU_AUTO_RESPONSE)) {
|
||||
case Config.Value.SU_AUTO_DENY:
|
||||
handleAction(Policy.DENY, 0);
|
||||
return;
|
||||
case Config.Value.SU_AUTO_ALLOW:
|
||||
handleAction(Policy.ALLOW, 0);
|
||||
return;
|
||||
case Config.Value.SU_PROMPT:
|
||||
default:
|
||||
}
|
||||
|
||||
// If not interactive, response directly
|
||||
if (policy.policy != Policy.INTERACTIVE) {
|
||||
handleAction();
|
||||
return;
|
||||
}
|
||||
|
||||
setContentView(R.layout.activity_request);
|
||||
new SuRequestActivity_ViewBinding(this);
|
||||
|
||||
appIcon.setImageDrawable(policy.info.loadIcon(pm));
|
||||
appNameView.setText(policy.appName);
|
||||
packageNameView.setText(policy.packageName);
|
||||
warning.setCompoundDrawablesRelativeWithIntrinsicBounds(
|
||||
AppCompatResources.getDrawable(this, R.drawable.ic_warning), null, null, null);
|
||||
|
||||
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
|
||||
R.array.allow_timeout, android.R.layout.simple_spinner_item);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
timeout.setAdapter(adapter);
|
||||
timeout.setSelection(timeoutPrefs.getInt(policy.packageName, 0));
|
||||
|
||||
timer = new CountDownTimer((int) Config.get(Config.Key.SU_REQUEST_TIMEOUT) * 1000, 1000) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
deny_btn.setText(getString(R.string.deny_with_str, "(" + millisUntilFinished / 1000 + ")"));
|
||||
}
|
||||
@Override
|
||||
public void onFinish() {
|
||||
deny_btn.setText(getString(R.string.deny_with_str, "(0)"));
|
||||
handleAction(Policy.DENY);
|
||||
}
|
||||
};
|
||||
|
||||
boolean useFP = FingerprintHelper.useFingerprint();
|
||||
|
||||
if (useFP) {
|
||||
try {
|
||||
fingerprintHelper = new FingerprintHelper() {
|
||||
@Override
|
||||
public void onAuthenticationError(int errorCode, CharSequence errString) {
|
||||
warning.setText(errString);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationHelp(int helpCode, CharSequence helpString) {
|
||||
warning.setText(helpString);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
|
||||
handleAction(Policy.ALLOW);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationFailed() {
|
||||
warning.setText(R.string.auth_fail);
|
||||
}
|
||||
};
|
||||
fingerprintHelper.authenticate();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
useFP = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!useFP) {
|
||||
grant_btn.setOnClickListener(v -> {
|
||||
handleAction(Policy.ALLOW);
|
||||
timer.cancel();
|
||||
});
|
||||
grant_btn.requestFocus();
|
||||
}
|
||||
|
||||
grant_btn.setVisibility(useFP ? View.GONE : View.VISIBLE);
|
||||
fingerprintImg.setVisibility(useFP ? View.VISIBLE : View.GONE);
|
||||
|
||||
deny_btn.setOnClickListener(v -> {
|
||||
handleAction(Policy.DENY);
|
||||
timer.cancel();
|
||||
});
|
||||
suPopup.setOnClickListener(v -> cancelTimeout());
|
||||
timeout.setOnTouchListener((v, event) -> cancelTimeout());
|
||||
timer.start();
|
||||
}
|
||||
|
||||
private boolean cancelTimeout() {
|
||||
timer.cancel();
|
||||
deny_btn.setText(getString(R.string.deny));
|
||||
return false;
|
||||
}
|
||||
|
||||
private void handleAction() {
|
||||
connector.response();
|
||||
finish();
|
||||
}
|
||||
|
||||
private void handleAction(int action) {
|
||||
int pos = timeout.getSelectedItemPosition();
|
||||
timeoutPrefs.edit().putInt(policy.packageName, pos).apply();
|
||||
handleAction(action, Config.Value.TIMEOUT_LIST[pos]);
|
||||
}
|
||||
|
||||
private void handleAction(int action, int time) {
|
||||
policy.policy = action;
|
||||
if (time >= 0) {
|
||||
policy.until = (time == 0) ? 0 : (System.currentTimeMillis() / 1000 + time * 60);
|
||||
app.mDB.updatePolicy(policy);
|
||||
}
|
||||
handleAction();
|
||||
}
|
||||
}
|
@@ -1,120 +0,0 @@
|
||||
package com.topjohnwu.magisk.components;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.IBinder;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.FlashActivity;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.container.Repo;
|
||||
import com.topjohnwu.magisk.uicomponents.ProgressNotification;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
public class DownloadModuleService extends Service {
|
||||
|
||||
private boolean running = false;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
if (flags == 0 && running) {
|
||||
Utils.toast(R.string.dl_one_module, Toast.LENGTH_LONG);
|
||||
} else {
|
||||
running = true;
|
||||
Shell.EXECUTOR.execute(() -> {
|
||||
Repo repo = intent.getParcelableExtra("repo");
|
||||
boolean install = intent.getBooleanExtra("install", false);
|
||||
dlProcessInstall(repo, install);
|
||||
stopSelf();
|
||||
});
|
||||
}
|
||||
return START_REDELIVER_INTENT;
|
||||
}
|
||||
|
||||
private void dlProcessInstall(Repo repo, boolean install) {
|
||||
File output = new File(Const.EXTERNAL_PATH, repo.getDownloadFilename());
|
||||
ProgressNotification progress = new ProgressNotification(output.getName());
|
||||
startForeground(progress.hashCode(), progress.getNotification());
|
||||
try {
|
||||
InputStream in = Networking.get(repo.getZipUrl())
|
||||
.setDownloadProgressListener(progress)
|
||||
.execForInputStream().getResult();
|
||||
OutputStream out = new BufferedOutputStream(new FileOutputStream(output));
|
||||
processZip(in, out, repo.isNewInstaller());
|
||||
if (install) {
|
||||
progress.dismiss();
|
||||
Intent intent = new Intent(this, ClassMap.get(FlashActivity.class));
|
||||
intent.setData(Uri.fromFile(output))
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.putExtra(Const.Key.FLASH_ACTION, Const.Value.FLASH_ZIP);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
progress.dlDone();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
progress.dlFail();
|
||||
}
|
||||
}
|
||||
|
||||
private void processZip(InputStream in, OutputStream out, boolean inject)
|
||||
throws IOException {
|
||||
try (ZipInputStream zin = new ZipInputStream(in);
|
||||
ZipOutputStream zout = new ZipOutputStream(out)) {
|
||||
|
||||
if (inject) {
|
||||
// Inject latest module-installer.sh as update-binary
|
||||
zout.putNextEntry(new ZipEntry("META-INF/"));
|
||||
zout.putNextEntry(new ZipEntry("META-INF/com/"));
|
||||
zout.putNextEntry(new ZipEntry("META-INF/com/google/"));
|
||||
zout.putNextEntry(new ZipEntry("META-INF/com/google/android/"));
|
||||
zout.putNextEntry(new ZipEntry("META-INF/com/google/android/update-binary"));
|
||||
try (InputStream update_bin = Networking.get(Const.Url.MODULE_INSTALLER)
|
||||
.execForInputStream().getResult()) {
|
||||
ShellUtils.pump(update_bin, zout);
|
||||
}
|
||||
zout.putNextEntry(new ZipEntry("META-INF/com/google/android/updater-script"));
|
||||
zout.write("#MAGISK\n".getBytes("UTF-8"));
|
||||
}
|
||||
|
||||
int off = -1;
|
||||
ZipEntry entry;
|
||||
while ((entry = zin.getNextEntry()) != null) {
|
||||
if (off < 0)
|
||||
off = entry.getName().indexOf('/') + 1;
|
||||
String path = entry.getName().substring(off);
|
||||
if (path.isEmpty())
|
||||
continue;
|
||||
if (inject && path.startsWith("META-INF"))
|
||||
continue;
|
||||
zout.putNextEntry(new ZipEntry(path));
|
||||
if (!entry.isDirectory())
|
||||
ShellUtils.pump(zin, zout);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,64 +0,0 @@
|
||||
package com.topjohnwu.magisk.container;
|
||||
|
||||
import org.kamranzafar.jtar.TarHeader;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class TarEntry extends org.kamranzafar.jtar.TarEntry {
|
||||
|
||||
public TarEntry(File file, String entryName) {
|
||||
super(file, entryName);
|
||||
}
|
||||
|
||||
/*
|
||||
* Workaround missing java.nio.file.attribute.PosixFilePermission
|
||||
* Simply just assign a default permission to the file
|
||||
* */
|
||||
|
||||
@Override
|
||||
public void extractTarHeader(String entryName) {
|
||||
int permissions = file.isDirectory() ? 000755 : 000644;
|
||||
header = TarHeader.createHeader(entryName, file.length(), file.lastModified() / 1000, file.isDirectory(), permissions);
|
||||
header.userName = new StringBuffer("");
|
||||
header.groupName = header.userName;
|
||||
}
|
||||
|
||||
/*
|
||||
* Rewrite the header to GNU format
|
||||
* */
|
||||
|
||||
@Override
|
||||
public void writeEntryHeader(byte[] outbuf) {
|
||||
super.writeEntryHeader(outbuf);
|
||||
|
||||
System.arraycopy("ustar \0".getBytes(), 0, outbuf, 257, TarHeader.USTAR_MAGICLEN);
|
||||
getOctalBytes(header.mode, outbuf, 100, TarHeader.MODELEN);
|
||||
getOctalBytes(header.userId, outbuf, 108, TarHeader.UIDLEN);
|
||||
getOctalBytes(header.groupId, outbuf, 116, TarHeader.GIDLEN);
|
||||
getOctalBytes(header.size, outbuf, 124, TarHeader.SIZELEN);
|
||||
getOctalBytes(header.modTime, outbuf, 136, TarHeader.MODTIMELEN);
|
||||
Arrays.fill(outbuf, 148, 148 + TarHeader.CHKSUMLEN, (byte) ' ');
|
||||
Arrays.fill(outbuf, 329, 329 + TarHeader.USTAR_DEVLEN, (byte) '\0');
|
||||
Arrays.fill(outbuf, 337, 337 + TarHeader.USTAR_DEVLEN, (byte) '\0');
|
||||
|
||||
// Recalculate checksum
|
||||
getOctalBytes(computeCheckSum(outbuf), outbuf, 148, TarHeader.CHKSUMLEN);
|
||||
}
|
||||
|
||||
/*
|
||||
* Proper octal to ASCII conversion
|
||||
* */
|
||||
|
||||
private void getOctalBytes(long value, byte[] buf, int offset, int length) {
|
||||
int idx = length - 1;
|
||||
|
||||
buf[offset + idx] = 0;
|
||||
--idx;
|
||||
|
||||
for (long val = value; idx >= 0; --idx) {
|
||||
buf[offset + idx] = (byte) ((byte) '0' + (byte) (val & 7));
|
||||
val = val >> 3;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.database;
|
||||
package com.topjohnwu.magisk.data.database;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
@@ -7,8 +7,8 @@ import android.text.TextUtils;
|
||||
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.container.Policy;
|
||||
import com.topjohnwu.magisk.container.SuLogEntry;
|
||||
import com.topjohnwu.magisk.model.entity.Policy;
|
||||
import com.topjohnwu.magisk.model.entity.SuLogEntry;
|
||||
import com.topjohnwu.magisk.utils.LocaleManager;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.Shell;
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.database;
|
||||
package com.topjohnwu.magisk.data.database;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
@@ -6,15 +6,14 @@ import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.container.Repo;
|
||||
import com.topjohnwu.magisk.model.entity.Repo;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class RepoDatabaseHelper extends SQLiteOpenHelper {
|
||||
|
||||
private static final int DATABASE_VER = 4;
|
||||
private static final int DATABASE_VER = 5;
|
||||
private static final String TABLE_NAME = "repos";
|
||||
|
||||
private SQLiteDatabase mDb;
|
||||
@@ -22,9 +21,6 @@ public class RepoDatabaseHelper extends SQLiteOpenHelper {
|
||||
public RepoDatabaseHelper(Context context) {
|
||||
super(context, "repo.db", null, DATABASE_VER);
|
||||
mDb = getWritableDatabase();
|
||||
|
||||
// Remove outdated repos
|
||||
mDb.delete(TABLE_NAME, "minMagisk<?", new String[] { String.valueOf(Const.MIN_MODULE_VER) });
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -39,7 +35,7 @@ public class RepoDatabaseHelper extends SQLiteOpenHelper {
|
||||
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
|
||||
db.execSQL(
|
||||
"CREATE TABLE IF NOT EXISTS " + TABLE_NAME + " " +
|
||||
"(id TEXT, name TEXT, version TEXT, versionCode INT, minMagisk INT, " +
|
||||
"(id TEXT, name TEXT, version TEXT, versionCode INT, " +
|
||||
"author TEXT, description TEXT, last_update INT, PRIMARY KEY(id))");
|
||||
Config.remove(Config.Key.ETAG_KEY);
|
||||
}
|
||||
@@ -96,9 +92,7 @@ public class RepoDatabaseHelper extends SQLiteOpenHelper {
|
||||
case Config.Value.ORDER_DATE:
|
||||
orderBy = "last_update DESC";
|
||||
}
|
||||
return mDb.query(TABLE_NAME, null, "minMagisk<=? AND minMagisk>=?",
|
||||
new String[] { String.valueOf(Config.magiskVersionCode), String.valueOf(Const.MIN_MODULE_VER) },
|
||||
null, null, orderBy);
|
||||
return mDb.query(TABLE_NAME, null, null, null, null, null, orderBy);
|
||||
}
|
||||
|
||||
public Set<String> getRepoIDSet() {
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.adapters;
|
||||
package com.topjohnwu.magisk.model.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
@@ -23,10 +23,10 @@ import com.buildware.widget.indeterm.IndeterminateCheckBox;
|
||||
import com.topjohnwu.magisk.App;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.uicomponents.ArrowExpandable;
|
||||
import com.topjohnwu.magisk.uicomponents.Expandable;
|
||||
import com.topjohnwu.magisk.utils.Event;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.view.ArrowExpandable;
|
||||
import com.topjohnwu.magisk.view.Expandable;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.internal.UiThreadHandler;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.adapters;
|
||||
package com.topjohnwu.magisk.model.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
@@ -14,8 +14,8 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.container.Module;
|
||||
import com.topjohnwu.magisk.uicomponents.SnackbarMaker;
|
||||
import com.topjohnwu.magisk.model.entity.Module;
|
||||
import com.topjohnwu.magisk.view.SnackbarMaker;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
import java.util.List;
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.adapters;
|
||||
package com.topjohnwu.magisk.model.adapters;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.DialogInterface;
|
||||
@@ -15,15 +15,15 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.container.Policy;
|
||||
import com.topjohnwu.magisk.database.MagiskDB;
|
||||
import com.topjohnwu.magisk.dialogs.CustomAlertDialog;
|
||||
import com.topjohnwu.magisk.dialogs.FingerprintAuthDialog;
|
||||
import com.topjohnwu.magisk.uicomponents.ArrowExpandable;
|
||||
import com.topjohnwu.magisk.uicomponents.Expandable;
|
||||
import com.topjohnwu.magisk.uicomponents.ExpandableViewHolder;
|
||||
import com.topjohnwu.magisk.uicomponents.SnackbarMaker;
|
||||
import com.topjohnwu.magisk.data.database.MagiskDB;
|
||||
import com.topjohnwu.magisk.model.entity.Policy;
|
||||
import com.topjohnwu.magisk.utils.FingerprintHelper;
|
||||
import com.topjohnwu.magisk.view.ArrowExpandable;
|
||||
import com.topjohnwu.magisk.view.Expandable;
|
||||
import com.topjohnwu.magisk.view.ExpandableViewHolder;
|
||||
import com.topjohnwu.magisk.view.SnackbarMaker;
|
||||
import com.topjohnwu.magisk.view.dialogs.CustomAlertDialog;
|
||||
import com.topjohnwu.magisk.view.dialogs.FingerprintAuthDialog;
|
||||
|
||||
import java.util.List;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.adapters;
|
||||
package com.topjohnwu.magisk.model.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -18,14 +18,14 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.topjohnwu.magisk.App;
|
||||
import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.components.BaseActivity;
|
||||
import com.topjohnwu.magisk.components.DownloadModuleService;
|
||||
import com.topjohnwu.magisk.container.Module;
|
||||
import com.topjohnwu.magisk.container.Repo;
|
||||
import com.topjohnwu.magisk.database.RepoDatabaseHelper;
|
||||
import com.topjohnwu.magisk.dialogs.CustomAlertDialog;
|
||||
import com.topjohnwu.magisk.uicomponents.MarkDownWindow;
|
||||
import com.topjohnwu.magisk.data.database.RepoDatabaseHelper;
|
||||
import com.topjohnwu.magisk.model.download.DownloadModuleService;
|
||||
import com.topjohnwu.magisk.model.entity.Module;
|
||||
import com.topjohnwu.magisk.model.entity.Repo;
|
||||
import com.topjohnwu.magisk.ui.base.BaseActivity;
|
||||
import com.topjohnwu.magisk.utils.Event;
|
||||
import com.topjohnwu.magisk.view.MarkDownWindow;
|
||||
import com.topjohnwu.magisk.view.dialogs.CustomAlertDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.adapters;
|
||||
package com.topjohnwu.magisk.model.adapters;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.adapters;
|
||||
package com.topjohnwu.magisk.model.adapters;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.util.DisplayMetrics;
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.adapters;
|
||||
package com.topjohnwu.magisk.model.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -12,9 +12,9 @@ import android.widget.TextView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.container.SuLogEntry;
|
||||
import com.topjohnwu.magisk.database.MagiskDB;
|
||||
import com.topjohnwu.magisk.uicomponents.ExpandableViewHolder;
|
||||
import com.topjohnwu.magisk.data.database.MagiskDB;
|
||||
import com.topjohnwu.magisk.model.entity.SuLogEntry;
|
||||
import com.topjohnwu.magisk.view.ExpandableViewHolder;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.adapters;
|
||||
package com.topjohnwu.magisk.model.adapters;
|
||||
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
@@ -0,0 +1,156 @@
|
||||
package com.topjohnwu.magisk.model.download;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.IBinder;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.topjohnwu.magisk.App;
|
||||
import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.model.entity.Repo;
|
||||
import com.topjohnwu.magisk.ui.flash.FlashActivity;
|
||||
import com.topjohnwu.magisk.view.Notifications;
|
||||
import com.topjohnwu.magisk.view.ProgressNotification;
|
||||
import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
public class DownloadModuleService extends Service {
|
||||
|
||||
private List<ProgressNotification> notifications;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
notifications = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
Shell.EXECUTOR.execute(() -> {
|
||||
Repo repo = intent.getParcelableExtra("repo");
|
||||
boolean install = intent.getBooleanExtra("install", false);
|
||||
dlProcessInstall(repo, install);
|
||||
});
|
||||
return START_REDELIVER_INTENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void onTaskRemoved(Intent rootIntent) {
|
||||
for (ProgressNotification n : notifications) {
|
||||
Notifications.mgr.cancel(n.hashCode());
|
||||
}
|
||||
notifications.clear();
|
||||
}
|
||||
|
||||
private synchronized void addNotification(ProgressNotification n) {
|
||||
if (notifications.isEmpty()) {
|
||||
// Start foreground
|
||||
startForeground(n.hashCode(), n.getNotification());
|
||||
}
|
||||
notifications.add(n);
|
||||
}
|
||||
|
||||
private synchronized void removeNotification(ProgressNotification n) {
|
||||
notifications.remove(n);
|
||||
if (notifications.isEmpty()) {
|
||||
// No more tasks, stop service
|
||||
stopForeground(true);
|
||||
stopSelf();
|
||||
} else {
|
||||
// Pick another notification as our foreground notification
|
||||
n = notifications.get(0);
|
||||
startForeground(n.hashCode(), n.getNotification());
|
||||
}
|
||||
}
|
||||
|
||||
private void dlProcessInstall(Repo repo, boolean install) {
|
||||
File output = new File(Const.EXTERNAL_PATH, repo.getDownloadFilename());
|
||||
ProgressNotification progress = new ProgressNotification(output.getName());
|
||||
addNotification(progress);
|
||||
try {
|
||||
InputStream in = Networking.get(repo.getZipUrl())
|
||||
.setDownloadProgressListener(progress)
|
||||
.execForInputStream().getResult();
|
||||
OutputStream out = new BufferedOutputStream(new FileOutputStream(output));
|
||||
processZip(in, out);
|
||||
Intent intent = new Intent(this, ClassMap.get(FlashActivity.class));
|
||||
intent.setData(Uri.fromFile(output))
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.putExtra(Const.Key.FLASH_ACTION, Const.Value.FLASH_ZIP);
|
||||
synchronized (getApplication()) {
|
||||
if (install && App.foreground() != null &&
|
||||
!(App.foreground() instanceof FlashActivity)) {
|
||||
/* Only start flashing if there is a foreground activity and the
|
||||
* user is not also flashing another module at the same time */
|
||||
App.foreground().startActivity(intent);
|
||||
} else {
|
||||
/* Or else we preset a notification notifying that we are done */
|
||||
PendingIntent pi = PendingIntent.getActivity(this, progress.hashCode(), intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
progress.dlDone(pi);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
progress.dlFail();
|
||||
}
|
||||
removeNotification(progress);
|
||||
}
|
||||
|
||||
private void processZip(InputStream in, OutputStream out)
|
||||
throws IOException {
|
||||
try (ZipInputStream zin = new ZipInputStream(in);
|
||||
ZipOutputStream zout = new ZipOutputStream(out)) {
|
||||
|
||||
// Inject latest module-installer.sh as update-binary
|
||||
zout.putNextEntry(new ZipEntry("META-INF/"));
|
||||
zout.putNextEntry(new ZipEntry("META-INF/com/"));
|
||||
zout.putNextEntry(new ZipEntry("META-INF/com/google/"));
|
||||
zout.putNextEntry(new ZipEntry("META-INF/com/google/android/"));
|
||||
zout.putNextEntry(new ZipEntry("META-INF/com/google/android/update-binary"));
|
||||
try (InputStream update_bin = Networking.get(Const.Url.MODULE_INSTALLER)
|
||||
.execForInputStream().getResult()) {
|
||||
ShellUtils.pump(update_bin, zout);
|
||||
}
|
||||
zout.putNextEntry(new ZipEntry("META-INF/com/google/android/updater-script"));
|
||||
zout.write("#MAGISK\n".getBytes("UTF-8"));
|
||||
|
||||
int off = -1;
|
||||
ZipEntry entry;
|
||||
while ((entry = zin.getNextEntry()) != null) {
|
||||
if (off < 0)
|
||||
off = entry.getName().indexOf('/') + 1;
|
||||
String path = entry.getName().substring(off);
|
||||
if (path.isEmpty())
|
||||
continue;
|
||||
if (path.startsWith("META-INF"))
|
||||
continue;
|
||||
zout.putNextEntry(new ZipEntry(path));
|
||||
if (!entry.isDirectory())
|
||||
ShellUtils.pump(zin, zout);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.container;
|
||||
package com.topjohnwu.magisk.model.entity;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.database.Cursor;
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
||||
|
||||
private String mId, mName, mVersion, mAuthor, mDescription;
|
||||
private int mVersionCode = -1, minMagiskVersion = -1;
|
||||
private int mVersionCode = -1;
|
||||
|
||||
protected BaseModule() {
|
||||
mId = mName = mVersion = mAuthor = mDescription = "";
|
||||
@@ -25,7 +25,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
||||
mVersionCode = c.getInt(c.getColumnIndex("versionCode"));
|
||||
mAuthor = nonNull(c.getString(c.getColumnIndex("author")));
|
||||
mDescription = nonNull(c.getString(c.getColumnIndex("description")));
|
||||
minMagiskVersion = c.getInt(c.getColumnIndex("minMagisk"));
|
||||
}
|
||||
|
||||
protected BaseModule(Parcel p) {
|
||||
@@ -35,7 +34,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
||||
mAuthor = p.readString();
|
||||
mDescription = p.readString();
|
||||
mVersionCode = p.readInt();
|
||||
minMagiskVersion = p.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,7 +54,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
||||
dest.writeString(mAuthor);
|
||||
dest.writeString(mDescription);
|
||||
dest.writeInt(mVersionCode);
|
||||
dest.writeInt(minMagiskVersion);
|
||||
}
|
||||
|
||||
private String nonNull(String s) {
|
||||
@@ -71,7 +68,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
||||
values.put("versionCode", mVersionCode);
|
||||
values.put("author", mAuthor);
|
||||
values.put("description", mDescription);
|
||||
values.put("minMagisk", minMagiskVersion);
|
||||
return values;
|
||||
}
|
||||
|
||||
@@ -107,10 +103,6 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
||||
case "description":
|
||||
mDescription = value;
|
||||
break;
|
||||
case "minMagisk":
|
||||
case "template":
|
||||
minMagiskVersion = Integer.parseInt(value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -149,7 +141,4 @@ public abstract class BaseModule implements Comparable<BaseModule>, Parcelable {
|
||||
return mVersionCode;
|
||||
}
|
||||
|
||||
public int getMinMagiskVersion() {
|
||||
return minMagiskVersion;
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.container;
|
||||
package com.topjohnwu.magisk.model.entity;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
@@ -76,4 +76,4 @@ public class Module extends BaseModule {
|
||||
return mUpdated;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.container;
|
||||
package com.topjohnwu.magisk.model.entity;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.pm.ApplicationInfo;
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.container;
|
||||
package com.topjohnwu.magisk.model.entity;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.database.Cursor;
|
||||
@@ -6,10 +6,7 @@ import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.utils.Logger;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.net.Request;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
@@ -62,9 +59,6 @@ public class Repo extends BaseModule {
|
||||
if (getVersionCode() < 0) {
|
||||
throw new IllegalRepoException("Repo [" + getId() + "] does not contain versionCode");
|
||||
}
|
||||
if (getMinMagiskVersion() < Const.MIN_MODULE_VER) {
|
||||
Logger.debug("Repo [" + getId() + "] is outdated");
|
||||
}
|
||||
}
|
||||
|
||||
public void update(Date lastUpdate) throws IllegalRepoException {
|
||||
@@ -95,18 +89,6 @@ public class Repo extends BaseModule {
|
||||
return String.format(Const.Url.FILE_URL, getId(), file);
|
||||
}
|
||||
|
||||
public boolean isNewInstaller() {
|
||||
try (Request install = Networking.get(getFileUrl("install.sh"))) {
|
||||
if (install.connect().isSuccess()) {
|
||||
// Double check whether config.sh exists
|
||||
try (Request config = Networking.get(getFileUrl("config.sh"))) {
|
||||
return !config.connect().isSuccess();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public String getLastUpdateString() {
|
||||
return DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM).format(mLastUpdate);
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.container;
|
||||
package com.topjohnwu.magisk.model.entity;
|
||||
|
||||
import android.content.ContentValues;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.components;
|
||||
package com.topjohnwu.magisk.model.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -8,25 +8,15 @@ import com.topjohnwu.magisk.App;
|
||||
import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.SuRequestActivity;
|
||||
import com.topjohnwu.magisk.container.Policy;
|
||||
import com.topjohnwu.magisk.uicomponents.Notifications;
|
||||
import com.topjohnwu.magisk.uicomponents.Shortcuts;
|
||||
import com.topjohnwu.magisk.ui.surequest.SuRequestActivity;
|
||||
import com.topjohnwu.magisk.utils.DownloadApp;
|
||||
import com.topjohnwu.magisk.utils.SuLogger;
|
||||
import com.topjohnwu.magisk.view.Notifications;
|
||||
import com.topjohnwu.magisk.view.Shortcuts;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
public class GeneralReceiver extends BroadcastReceiver {
|
||||
|
||||
private static SuLogger SU_LOGGER = new SuLogger() {
|
||||
@Override
|
||||
public String getMessage(Policy policy) {
|
||||
return App.self.getString(policy.policy == Policy.ALLOW ?
|
||||
R.string.su_allow_toast : R.string.su_deny_toast, policy.appName);
|
||||
}
|
||||
};
|
||||
|
||||
private String getPkg(Intent i) {
|
||||
return i.getData() == null ? "" : i.getData().getEncodedSchemeSpecificPart();
|
||||
}
|
||||
@@ -42,35 +32,29 @@ public class GeneralReceiver extends BroadcastReceiver {
|
||||
switch (action) {
|
||||
case Intent.ACTION_REBOOT:
|
||||
case Intent.ACTION_BOOT_COMPLETED:
|
||||
String realAction = intent.getStringExtra("action");
|
||||
if (realAction == null)
|
||||
realAction = "boot_complete";
|
||||
switch (realAction) {
|
||||
case "request":
|
||||
action = intent.getStringExtra("action");
|
||||
if (action == null) {
|
||||
// Actual boot completed event
|
||||
Shell.su("mm_patch_dtbo").submit(result -> {
|
||||
if (result.isSuccess())
|
||||
Notifications.dtboPatched();
|
||||
});
|
||||
break;
|
||||
}
|
||||
switch (action) {
|
||||
case SuRequestActivity.REQUEST:
|
||||
Intent i = new Intent(app, ClassMap.get(SuRequestActivity.class))
|
||||
.setAction(action)
|
||||
.putExtra("socket", intent.getStringExtra("socket"))
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
app.startActivity(i);
|
||||
break;
|
||||
case "log":
|
||||
SU_LOGGER.handleLogs(intent);
|
||||
case SuRequestActivity.LOG:
|
||||
SuLogger.handleLogs(intent);
|
||||
break;
|
||||
case "notify":
|
||||
SU_LOGGER.handleNotify(intent);
|
||||
break;
|
||||
case "boot_complete":
|
||||
default:
|
||||
/* Devices with DTBO might want to patch dtbo.img.
|
||||
* However, that is not possible if Magisk is installed by
|
||||
* patching boot image with Magisk Manager and flashed via
|
||||
* fastboot, since at that time we do not have root.
|
||||
* Check for dtbo status every boot time, and prompt user
|
||||
* to reboot if dtbo wasn't patched and patched by Magisk Manager.
|
||||
* */
|
||||
Shell.su("mm_patch_dtbo").submit(result -> {
|
||||
if (result.isSuccess())
|
||||
Notifications.dtboPatched();
|
||||
});
|
||||
case SuRequestActivity.NOTIFY:
|
||||
SuLogger.handleNotify(intent);
|
||||
break;
|
||||
}
|
||||
break;
|
@@ -1,12 +1,14 @@
|
||||
package com.topjohnwu.magisk.components;
|
||||
package com.topjohnwu.magisk.model.update;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.work.ListenableWorker;
|
||||
|
||||
import com.topjohnwu.magisk.App;
|
||||
import com.topjohnwu.magisk.BuildConfig;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.model.worker.DelegateWorker;
|
||||
import com.topjohnwu.magisk.tasks.CheckUpdates;
|
||||
import com.topjohnwu.magisk.uicomponents.Notifications;
|
||||
import com.topjohnwu.magisk.view.Notifications;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
public class UpdateCheckService extends DelegateWorker {
|
||||
@@ -14,8 +16,10 @@ public class UpdateCheckService extends DelegateWorker {
|
||||
@NonNull
|
||||
@Override
|
||||
public ListenableWorker.Result doWork() {
|
||||
Shell.getShell();
|
||||
CheckUpdates.checkNow(this::onCheckDone);
|
||||
if (App.foreground() == null) {
|
||||
Shell.getShell();
|
||||
CheckUpdates.check(this::onCheckDone);
|
||||
}
|
||||
return ListenableWorker.Result.success();
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.components;
|
||||
package com.topjohnwu.magisk.model.worker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Network;
|
@@ -8,6 +8,7 @@ import com.topjohnwu.magisk.utils.Event;
|
||||
import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.net.Request;
|
||||
import com.topjohnwu.net.ResponseListener;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
import com.topjohnwu.superuser.internal.UiThreadHandler;
|
||||
|
||||
import org.json.JSONException;
|
||||
@@ -30,7 +31,6 @@ public class CheckUpdates {
|
||||
case Config.Value.CANARY_DEBUG_CHANNEL:
|
||||
url = Const.Url.CANARY_DEBUG_URL;
|
||||
break;
|
||||
case Config.Value.STABLE_CHANNEL:
|
||||
default:
|
||||
url = Const.Url.STABLE_URL;
|
||||
break;
|
||||
@@ -39,13 +39,19 @@ public class CheckUpdates {
|
||||
}
|
||||
|
||||
public static void check() {
|
||||
getRequest().getAsJSONObject(new UpdateListener(null));
|
||||
check(null);
|
||||
}
|
||||
|
||||
public static void checkNow(Runnable cb) {
|
||||
JSONObject json = getRequest().execForJSONObject().getResult();
|
||||
if (json != null)
|
||||
new UpdateListener(cb).onResponse(json);
|
||||
public static void check(Runnable cb) {
|
||||
Request request = getRequest();
|
||||
UpdateListener listener = new UpdateListener(cb);
|
||||
if (ShellUtils.onMainThread()) {
|
||||
request.getAsJSONObject(listener);
|
||||
} else {
|
||||
JSONObject json = request.execForJSONObject().getResult();
|
||||
if (json != null)
|
||||
listener.onResponse(json);
|
||||
}
|
||||
}
|
||||
|
||||
private static class UpdateListener implements ResponseListener<JSONObject> {
|
||||
@@ -89,8 +95,20 @@ public class CheckUpdates {
|
||||
@Override
|
||||
public void onResponse(JSONObject json) {
|
||||
JSONObject magisk = getJson(json, "magisk");
|
||||
Config.remoteMagiskVersionString = getString(magisk, "version", null);
|
||||
Config.remoteMagiskVersionCode = getInt(magisk, "versionCode", -1);
|
||||
|
||||
if ((int) Config.get(Config.Key.UPDATE_CHANNEL) == Config.Value.DEFAULT_CHANNEL) {
|
||||
if (Config.magiskVersionCode > Config.remoteMagiskVersionCode) {
|
||||
// If we are newer than current stable channel, switch to beta
|
||||
Config.set(Config.Key.UPDATE_CHANNEL, Config.Value.BETA_CHANNEL);
|
||||
check(cb);
|
||||
return;
|
||||
} else {
|
||||
Config.set(Config.Key.UPDATE_CHANNEL, Config.Value.STABLE_CHANNEL);
|
||||
}
|
||||
}
|
||||
|
||||
Config.remoteMagiskVersionString = getString(magisk, "version", null);
|
||||
Config.magiskLink = getString(magisk, "link", null);
|
||||
Config.magiskNoteLink = getString(magisk, "note", null);
|
||||
Config.magiskMD5 = getString(magisk, "md5", null);
|
||||
|
@@ -10,7 +10,6 @@ import androidx.annotation.WorkerThread;
|
||||
import com.topjohnwu.magisk.App;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.container.TarEntry;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.net.DownloadProgressListener;
|
||||
import com.topjohnwu.net.Networking;
|
||||
@@ -23,6 +22,8 @@ import com.topjohnwu.superuser.io.SuFile;
|
||||
import com.topjohnwu.superuser.io.SuFileInputStream;
|
||||
import com.topjohnwu.superuser.io.SuFileOutputStream;
|
||||
|
||||
import org.kamranzafar.jtar.TarEntry;
|
||||
import org.kamranzafar.jtar.TarHeader;
|
||||
import org.kamranzafar.jtar.TarInputStream;
|
||||
import org.kamranzafar.jtar.TarOutputStream;
|
||||
|
||||
@@ -30,11 +31,11 @@ import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
@@ -42,10 +43,13 @@ import java.util.zip.ZipInputStream;
|
||||
|
||||
public abstract class MagiskInstaller {
|
||||
|
||||
private List<String> console, logs;
|
||||
protected String srcBoot;
|
||||
protected File destFile;
|
||||
protected File installDir;
|
||||
|
||||
private List<String> console, logs;
|
||||
private boolean isTar = false;
|
||||
|
||||
private class ProgressLog implements DownloadProgressListener {
|
||||
|
||||
private int prev = -1;
|
||||
@@ -79,12 +83,12 @@ public abstract class MagiskInstaller {
|
||||
}
|
||||
|
||||
protected boolean findImage() {
|
||||
console.add("- Detecting target image");
|
||||
srcBoot = ShellUtils.fastCmd("find_boot_image", "echo \"$BOOTIMAGE\"");
|
||||
if (srcBoot.isEmpty()) {
|
||||
console.add("! Unable to detect target image");
|
||||
return false;
|
||||
}
|
||||
console.add("- Target image: " + srcBoot);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -92,7 +96,6 @@ public abstract class MagiskInstaller {
|
||||
String slot = ShellUtils.fastCmd("echo $SLOT");
|
||||
String target = (TextUtils.equals(slot, "_a") ? "_b" : "_a");
|
||||
console.add("- Target slot: " + target);
|
||||
console.add("- Detecting target image");
|
||||
srcBoot = ShellUtils.fastCmd(
|
||||
"SLOT=" + target,
|
||||
"find_boot_image",
|
||||
@@ -103,6 +106,7 @@ public abstract class MagiskInstaller {
|
||||
console.add("! Unable to detect target image");
|
||||
return false;
|
||||
}
|
||||
console.add("- Target image: " + srcBoot);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -160,44 +164,107 @@ public abstract class MagiskInstaller {
|
||||
return false;
|
||||
}
|
||||
|
||||
SuFile init64 = new SuFile(installDir, "magiskinit64");
|
||||
File init64 = SuFile.open(installDir, "magiskinit64");
|
||||
if (Build.VERSION.SDK_INT >= 21 && Build.SUPPORTED_64_BIT_ABIS.length != 0) {
|
||||
init64.renameTo(new SuFile(installDir, "magiskinit"));
|
||||
init64.renameTo(SuFile.open(installDir, "magiskinit"));
|
||||
} else {
|
||||
init64.delete();
|
||||
}
|
||||
Shell.sh("cd " + installDir, "chmod 755 *").exec();
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean copyBoot(Uri bootUri) {
|
||||
srcBoot = new File(installDir, "boot.img").getPath();
|
||||
console.add("- Copying image to cache");
|
||||
// Copy boot image to local
|
||||
try (InputStream in = App.self.getContentResolver().openInputStream(bootUri);
|
||||
OutputStream out = new FileOutputStream(srcBoot)) {
|
||||
if (in == null)
|
||||
throw new FileNotFoundException();
|
||||
private TarEntry newEntry(String name, long size) {
|
||||
console.add("-- Writing: " + name);
|
||||
return new TarEntry(TarHeader.createHeader(name, size, 0, false, 0644));
|
||||
}
|
||||
|
||||
InputStream src;
|
||||
if (Utils.getNameFromUri(App.self, bootUri).endsWith(".tar")) {
|
||||
// Extract boot.img from tar
|
||||
TarInputStream tar = new TarInputStream(new BufferedInputStream(in));
|
||||
org.kamranzafar.jtar.TarEntry entry;
|
||||
while ((entry = tar.getNextEntry()) != null) {
|
||||
if (entry.getName().equals("boot.img"))
|
||||
break;
|
||||
private void handleTar(InputStream in) throws IOException {
|
||||
console.add("- Processing tar file");
|
||||
boolean vbmeta = false;
|
||||
try (TarInputStream tarIn = new TarInputStream(in);
|
||||
TarOutputStream tarOut = new TarOutputStream(destFile)) {
|
||||
TarEntry entry;
|
||||
while ((entry = tarIn.getNextEntry()) != null) {
|
||||
if (entry.getName().contains("boot.img")
|
||||
|| entry.getName().contains("recovery.img")) {
|
||||
String name = entry.getName();
|
||||
console.add("-- Extracting: " + name);
|
||||
File extract = new File(installDir, name);
|
||||
try (FileOutputStream fout = new FileOutputStream(extract)) {
|
||||
ShellUtils.pump(tarIn, fout);
|
||||
}
|
||||
if (name.contains(".lz4")) {
|
||||
console.add("-- Decompressing: " + name);
|
||||
Shell.sh("./magiskboot --decompress " + extract).to(console).exec();
|
||||
}
|
||||
} else if (entry.getName().contains("vbmeta.img")) {
|
||||
vbmeta = true;
|
||||
ByteBuffer buf = ByteBuffer.allocate(256);
|
||||
buf.put("AVB0".getBytes()); // magic
|
||||
buf.putInt(1); // required_libavb_version_major
|
||||
buf.putInt(120, 2); // flags
|
||||
buf.position(128); // release_string
|
||||
buf.put("avbtool 1.1.0".getBytes());
|
||||
tarOut.putNextEntry(newEntry("vbmeta.img", 256));
|
||||
tarOut.write(buf.array());
|
||||
} else {
|
||||
console.add("-- Writing: " + entry.getName());
|
||||
tarOut.putNextEntry(entry);
|
||||
ShellUtils.pump(tarIn, tarOut);
|
||||
}
|
||||
}
|
||||
File boot = SuFile.open(installDir, "boot.img");
|
||||
File recovery = SuFile.open(installDir, "recovery.img");
|
||||
if (vbmeta && recovery.exists() && boot.exists()) {
|
||||
// Install Magisk to recovery
|
||||
srcBoot = recovery.getPath();
|
||||
// Repack boot image to prevent restore
|
||||
Shell.sh(
|
||||
"./magiskboot --unpack boot.img",
|
||||
"./magiskboot --repack boot.img",
|
||||
"./magiskboot --cleanup",
|
||||
"mv new-boot.img boot.img").exec();
|
||||
try (InputStream sin = new SuFileInputStream(boot)) {
|
||||
tarOut.putNextEntry(newEntry("boot.img", boot.length()));
|
||||
ShellUtils.pump(sin, tarOut);
|
||||
}
|
||||
boot.delete();
|
||||
} else {
|
||||
if (!boot.exists()) {
|
||||
console.add("! No boot image found");
|
||||
throw new IOException();
|
||||
}
|
||||
srcBoot = boot.getPath();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean handleFile(Uri uri) {
|
||||
try (InputStream in = new BufferedInputStream(App.self.getContentResolver().openInputStream(uri))) {
|
||||
in.mark(500);
|
||||
byte[] magic = new byte[5];
|
||||
if (in.skip(257) != 257 || in.read(magic) != magic.length) {
|
||||
console.add("! Invalid file");
|
||||
return false;
|
||||
}
|
||||
in.reset();
|
||||
if (Arrays.equals(magic, "ustar".getBytes())) {
|
||||
isTar = true;
|
||||
destFile = new File(Const.EXTERNAL_PATH, "magisk_patched.tar");
|
||||
handleTar(in);
|
||||
} else {
|
||||
// Raw image
|
||||
srcBoot = new File(installDir, "boot.img").getPath();
|
||||
destFile = new File(Const.EXTERNAL_PATH, "magisk_patched.img");
|
||||
console.add("- Copying image to cache");
|
||||
try (OutputStream out = new FileOutputStream(srcBoot)) {
|
||||
ShellUtils.pump(in, out);
|
||||
}
|
||||
src = tar;
|
||||
} else {
|
||||
// Direct copy raw image
|
||||
src = new BufferedInputStream(in);
|
||||
}
|
||||
ShellUtils.pump(src, out);
|
||||
} catch (FileNotFoundException e) {
|
||||
console.add("! Invalid Uri");
|
||||
return false;
|
||||
} catch (IOException e) {
|
||||
console.add("! Copy failed");
|
||||
console.add("! Process error");
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -215,9 +282,10 @@ public abstract class MagiskInstaller {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Shell.sh("cd " + installDir, Utils.fmt(
|
||||
"KEEPFORCEENCRYPT=%b KEEPVERITY=%b sh update-binary sh boot_patch.sh %s",
|
||||
Config.keepEnc, Config.keepVerity, srcBoot))
|
||||
if (!Shell.sh(Utils.fmt(
|
||||
"KEEPFORCEENCRYPT=%b KEEPVERITY=%b RECOVERYMODE=%b " +
|
||||
"sh update-binary sh boot_patch.sh %s",
|
||||
Config.keepEnc, Config.keepVerity, Config.recovery, srcBoot))
|
||||
.to(console, logs).exec().isSuccess())
|
||||
return false;
|
||||
|
||||
@@ -252,35 +320,30 @@ public abstract class MagiskInstaller {
|
||||
}
|
||||
|
||||
protected boolean storeBoot() {
|
||||
File patched = new File(installDir, "new-boot.img");
|
||||
String fmt = Config.get(Config.Key.BOOT_FORMAT);
|
||||
File dest = new File(Const.EXTERNAL_PATH, "patched_boot" + fmt);
|
||||
dest.getParentFile().mkdirs();
|
||||
OutputStream os;
|
||||
File patched = SuFile.open(installDir, "new-boot.img");
|
||||
try {
|
||||
switch (fmt) {
|
||||
case ".img.tar":
|
||||
os = new TarOutputStream(new BufferedOutputStream(new FileOutputStream(dest)));
|
||||
((TarOutputStream) os).putNextEntry(new TarEntry(patched, "boot.img"));
|
||||
break;
|
||||
default:
|
||||
case ".img":
|
||||
os = new BufferedOutputStream(new FileOutputStream(dest));
|
||||
break;
|
||||
OutputStream os;
|
||||
if (isTar) {
|
||||
os = new TarOutputStream(destFile, true);
|
||||
((TarOutputStream) os).putNextEntry(newEntry(
|
||||
srcBoot.contains("recovery") ? "recovery.img" : "boot.img",
|
||||
patched.length()));
|
||||
} else {
|
||||
os = new BufferedOutputStream(new FileOutputStream(destFile));
|
||||
}
|
||||
try (InputStream in = new SuFileInputStream(patched)) {
|
||||
ShellUtils.pump(in, os);
|
||||
os.close();
|
||||
try (InputStream in = new SuFileInputStream(patched);
|
||||
OutputStream out = os) {
|
||||
ShellUtils.pump(in, out);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
console.add("! Failed to store boot to " + dest);
|
||||
return false;
|
||||
console.add("! Failed to output to " + destFile);
|
||||
e.printStackTrace();
|
||||
}
|
||||
Shell.sh("rm -f " + patched).exec();
|
||||
patched.delete();
|
||||
console.add("");
|
||||
console.add("****************************");
|
||||
console.add(" Patched image is placed in ");
|
||||
console.add(" " + dest + " ");
|
||||
console.add(" Output file is placed in ");
|
||||
console.add(" " + destFile + " ");
|
||||
console.add("****************************");
|
||||
return true;
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ import android.util.Pair;
|
||||
import com.topjohnwu.magisk.App;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.container.Repo;
|
||||
import com.topjohnwu.magisk.model.entity.Repo;
|
||||
import com.topjohnwu.magisk.utils.Event;
|
||||
import com.topjohnwu.magisk.utils.Logger;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk;
|
||||
package com.topjohnwu.magisk.ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
@@ -16,14 +16,18 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
import com.topjohnwu.magisk.components.BaseActivity;
|
||||
import com.topjohnwu.magisk.fragments.LogFragment;
|
||||
import com.topjohnwu.magisk.fragments.MagiskFragment;
|
||||
import com.topjohnwu.magisk.fragments.MagiskHideFragment;
|
||||
import com.topjohnwu.magisk.fragments.ModulesFragment;
|
||||
import com.topjohnwu.magisk.fragments.ReposFragment;
|
||||
import com.topjohnwu.magisk.fragments.SettingsFragment;
|
||||
import com.topjohnwu.magisk.fragments.SuperuserFragment;
|
||||
import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.ui.base.BaseActivity;
|
||||
import com.topjohnwu.magisk.ui.hide.MagiskHideFragment;
|
||||
import com.topjohnwu.magisk.ui.home.MagiskFragment;
|
||||
import com.topjohnwu.magisk.ui.log.LogFragment;
|
||||
import com.topjohnwu.magisk.ui.module.ModulesFragment;
|
||||
import com.topjohnwu.magisk.ui.module.ReposFragment;
|
||||
import com.topjohnwu.magisk.ui.settings.SettingsFragment;
|
||||
import com.topjohnwu.magisk.ui.superuser.SuperuserFragment;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
@@ -50,7 +54,7 @@ public class MainActivity extends BaseActivity
|
||||
|
||||
@Override
|
||||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
if (!getIntent().getBooleanExtra(Const.Key.FROM_SPLASH, false)) {
|
||||
if (!SplashActivity.DONE) {
|
||||
startActivity(new Intent(this, ClassMap.get(SplashActivity.class)));
|
||||
finish();
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk;
|
||||
package com.topjohnwu.magisk.ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
@@ -7,18 +7,26 @@ import android.text.TextUtils;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.topjohnwu.magisk.components.BaseActivity;
|
||||
import com.topjohnwu.magisk.database.RepoDatabaseHelper;
|
||||
import com.topjohnwu.magisk.BuildConfig;
|
||||
import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.data.database.RepoDatabaseHelper;
|
||||
import com.topjohnwu.magisk.tasks.CheckUpdates;
|
||||
import com.topjohnwu.magisk.tasks.UpdateRepos;
|
||||
import com.topjohnwu.magisk.uicomponents.Notifications;
|
||||
import com.topjohnwu.magisk.uicomponents.Shortcuts;
|
||||
import com.topjohnwu.magisk.ui.base.BaseActivity;
|
||||
import com.topjohnwu.magisk.utils.LocaleManager;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.view.Notifications;
|
||||
import com.topjohnwu.magisk.view.Shortcuts;
|
||||
import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
public class SplashActivity extends BaseActivity {
|
||||
|
||||
public static boolean DONE = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -63,6 +71,7 @@ public class SplashActivity extends BaseActivity {
|
||||
|
||||
// Schedule periodic update checks
|
||||
Utils.scheduleUpdateCheck();
|
||||
CheckUpdates.check();
|
||||
|
||||
// Setup shortcuts
|
||||
Shortcuts.setup(this);
|
||||
@@ -81,8 +90,7 @@ public class SplashActivity extends BaseActivity {
|
||||
|
||||
Intent intent = new Intent(this, ClassMap.get(MainActivity.class));
|
||||
intent.putExtra(Const.Key.OPEN_SECTION, getIntent().getStringExtra(Const.Key.OPEN_SECTION));
|
||||
intent.putExtra(Const.Key.FROM_SPLASH, true);
|
||||
intent.putExtra(BaseActivity.INTENT_PERM, getIntent().getStringExtra(BaseActivity.INTENT_PERM));
|
||||
DONE = true;
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
@@ -1,20 +1,21 @@
|
||||
package com.topjohnwu.magisk.components;
|
||||
package com.topjohnwu.magisk.ui.base;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StyleRes;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.collection.SparseArrayCompat;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
@@ -27,18 +28,11 @@ import com.topjohnwu.magisk.utils.LocaleManager;
|
||||
|
||||
public abstract class BaseActivity extends AppCompatActivity implements Event.AutoListener {
|
||||
|
||||
public static final String INTENT_PERM = "perm_dialog";
|
||||
private static Runnable grantCallback;
|
||||
|
||||
static int[] EMPTY_INT_ARRAY = new int[0];
|
||||
|
||||
private ActivityResultListener activityResultListener;
|
||||
private SparseArrayCompat<ActivityResultListener> resultListeners = new SparseArrayCompat<>();
|
||||
public App app = App.self;
|
||||
|
||||
static {
|
||||
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getListeningEvents() {
|
||||
return EMPTY_INT_ARRAY;
|
||||
@@ -64,9 +58,6 @@ public abstract class BaseActivity extends AppCompatActivity implements Event.Au
|
||||
setTheme(getDarkTheme());
|
||||
}
|
||||
super.onCreate(savedInstanceState);
|
||||
String[] perms = getIntent().getStringArrayExtra(INTENT_PERM);
|
||||
if (perms != null)
|
||||
ActivityCompat.requestPermissions(this, perms, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -89,15 +80,22 @@ public abstract class BaseActivity extends AppCompatActivity implements Event.Au
|
||||
}
|
||||
}
|
||||
|
||||
protected void lockOrientation() {
|
||||
if (Build.VERSION.SDK_INT < 18)
|
||||
setRequestedOrientation(getResources().getConfiguration().orientation);
|
||||
else
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
|
||||
}
|
||||
|
||||
public void runWithExternalRW(Runnable callback) {
|
||||
runWithPermission(new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE }, callback);
|
||||
runWithPermissions(new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE }, callback);
|
||||
}
|
||||
|
||||
public void runWithPermission(String[] permissions, Runnable callback) {
|
||||
runWithPermission(this, permissions, callback);
|
||||
public void runWithPermissions(String[] permissions, Runnable callback) {
|
||||
runWithPermissions(this, permissions, callback);
|
||||
}
|
||||
|
||||
public static void runWithPermission(Context context, String[] permissions, Runnable callback) {
|
||||
public static void runWithPermissions(Context context, String[] permissions, Runnable callback) {
|
||||
boolean granted = true;
|
||||
for (String perm : permissions) {
|
||||
if (ContextCompat.checkSelfPermission(context, perm) != PackageManager.PERMISSION_GRANTED)
|
||||
@@ -109,21 +107,29 @@ public abstract class BaseActivity extends AppCompatActivity implements Event.Au
|
||||
} else {
|
||||
// Passed in context should be an activity if not granted, need to show dialog!
|
||||
if (context instanceof BaseActivity) {
|
||||
grantCallback = callback;
|
||||
ActivityCompat.requestPermissions((BaseActivity) context, permissions, 0);
|
||||
BaseActivity activity = (BaseActivity) context;
|
||||
int code = callback.hashCode() & 0xFFFF;
|
||||
activity.resultListeners.put(code, ((i, d) -> callback.run()));
|
||||
ActivityCompat.requestPermissions(activity, permissions, code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (activityResultListener != null)
|
||||
activityResultListener.onActivityResult(requestCode, resultCode, data);
|
||||
activityResultListener = null;
|
||||
onActivityResultListener(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
private void onActivityResultListener(int requestCode, int resultCode, Intent data) {
|
||||
ActivityResultListener listener = resultListeners.get(requestCode);
|
||||
if (listener != null) {
|
||||
resultListeners.remove(requestCode);
|
||||
listener.onActivityResult(resultCode, data);
|
||||
}
|
||||
}
|
||||
|
||||
public void startActivityForResult(Intent intent, int requestCode, ActivityResultListener listener) {
|
||||
activityResultListener = listener;
|
||||
resultListeners.put(requestCode, listener);
|
||||
super.startActivityForResult(intent, requestCode);
|
||||
}
|
||||
|
||||
@@ -134,18 +140,14 @@ public abstract class BaseActivity extends AppCompatActivity implements Event.Au
|
||||
if (result != PackageManager.PERMISSION_GRANTED)
|
||||
grant = false;
|
||||
}
|
||||
if (grant) {
|
||||
if (grantCallback != null) {
|
||||
grantCallback.run();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this, R.string.no_rw_storage, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
grantCallback = null;
|
||||
if (grant)
|
||||
onActivityResultListener(requestCode, 0, null);
|
||||
else
|
||||
resultListeners.remove(requestCode);
|
||||
}
|
||||
|
||||
public interface ActivityResultListener {
|
||||
void onActivityResult(int requestCode, int resultCode, Intent data);
|
||||
void onActivityResult(int resultCode, Intent data);
|
||||
}
|
||||
|
||||
@Override
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.components;
|
||||
package com.topjohnwu.magisk.ui.base;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
@@ -35,15 +35,17 @@ public abstract class BaseFragment extends Fragment implements Event.AutoListene
|
||||
|
||||
@Override
|
||||
public void startActivityForResult(Intent intent, int requestCode) {
|
||||
startActivityForResult(intent, requestCode, this::onActivityResult);
|
||||
startActivityForResult(intent, requestCode, (resultCode, data) ->
|
||||
onActivityResult(requestCode, resultCode, data));
|
||||
}
|
||||
|
||||
public void startActivityForResult(Intent intent, int requestCode, BaseActivity.ActivityResultListener listener) {
|
||||
public void startActivityForResult(Intent intent, int requestCode,
|
||||
BaseActivity.ActivityResultListener listener) {
|
||||
((BaseActivity) requireActivity()).startActivityForResult(intent, requestCode, listener);
|
||||
}
|
||||
|
||||
public void runWithPermission(String[] permissions, Runnable callback) {
|
||||
((BaseActivity) requireActivity()).runWithPermission(permissions,callback);
|
||||
protected void runWithExternalRW(Runnable callback) {
|
||||
((BaseActivity) requireActivity()).runWithExternalRW(callback);
|
||||
}
|
||||
|
||||
@Override
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.components;
|
||||
package com.topjohnwu.magisk.ui.base;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.SharedPreferences;
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk;
|
||||
package com.topjohnwu.magisk.ui.flash;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
@@ -13,10 +13,13 @@ import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.topjohnwu.magisk.adapters.StringListAdapter;
|
||||
import com.topjohnwu.magisk.components.BaseActivity;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.model.adapters.StringListAdapter;
|
||||
import com.topjohnwu.magisk.tasks.FlashZip;
|
||||
import com.topjohnwu.magisk.tasks.MagiskInstaller;
|
||||
import com.topjohnwu.magisk.ui.base.BaseActivity;
|
||||
import com.topjohnwu.magisk.utils.RootUtils;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.CallbackList;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
@@ -47,7 +50,7 @@ public class FlashActivity extends BaseActivity {
|
||||
|
||||
@OnClick(R.id.reboot)
|
||||
void reboot() {
|
||||
Utils.reboot();
|
||||
RootUtils.reboot();
|
||||
}
|
||||
|
||||
@OnClick(R.id.save_logs)
|
||||
@@ -125,8 +128,8 @@ public class FlashActivity extends BaseActivity {
|
||||
case Const.Value.FLASH_INACTIVE_SLOT:
|
||||
new SecondSlot().exec();
|
||||
break;
|
||||
case Const.Value.PATCH_BOOT:
|
||||
new PatchBoot(uri).exec();
|
||||
case Const.Value.PATCH_FILE:
|
||||
new PatchFile(uri).exec();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -254,17 +257,17 @@ public class FlashActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private class PatchBoot extends BaseInstaller {
|
||||
private class PatchFile extends BaseInstaller {
|
||||
|
||||
private Uri uri;
|
||||
|
||||
PatchBoot(Uri u) {
|
||||
PatchFile(Uri u) {
|
||||
uri = u;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean operations() {
|
||||
return copyBoot(uri) && extractZip() && patchBoot() && storeBoot();
|
||||
return extractZip() && handleFile(uri) && patchBoot() && storeBoot();
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.fragments;
|
||||
package com.topjohnwu.magisk.ui.hide;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -16,8 +16,8 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.adapters.ApplicationAdapter;
|
||||
import com.topjohnwu.magisk.components.BaseFragment;
|
||||
import com.topjohnwu.magisk.model.adapters.ApplicationAdapter;
|
||||
import com.topjohnwu.magisk.ui.base.BaseFragment;
|
||||
import com.topjohnwu.magisk.utils.Event;
|
||||
|
||||
import butterknife.BindView;
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.fragments;
|
||||
package com.topjohnwu.magisk.ui.home;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
@@ -22,23 +22,23 @@ import androidx.transition.TransitionSet;
|
||||
import com.topjohnwu.magisk.BuildConfig;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.MainActivity;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.components.BaseActivity;
|
||||
import com.topjohnwu.magisk.components.BaseFragment;
|
||||
import com.topjohnwu.magisk.dialogs.EnvFixDialog;
|
||||
import com.topjohnwu.magisk.dialogs.MagiskInstallDialog;
|
||||
import com.topjohnwu.magisk.dialogs.ManagerInstallDialog;
|
||||
import com.topjohnwu.magisk.dialogs.UninstallDialog;
|
||||
import com.topjohnwu.magisk.tasks.CheckUpdates;
|
||||
import com.topjohnwu.magisk.uicomponents.ArrowExpandable;
|
||||
import com.topjohnwu.magisk.uicomponents.Expandable;
|
||||
import com.topjohnwu.magisk.uicomponents.ExpandableViewHolder;
|
||||
import com.topjohnwu.magisk.uicomponents.MarkDownWindow;
|
||||
import com.topjohnwu.magisk.uicomponents.SafetyNet;
|
||||
import com.topjohnwu.magisk.uicomponents.UpdateCardHolder;
|
||||
import com.topjohnwu.magisk.ui.MainActivity;
|
||||
import com.topjohnwu.magisk.ui.base.BaseActivity;
|
||||
import com.topjohnwu.magisk.ui.base.BaseFragment;
|
||||
import com.topjohnwu.magisk.utils.Event;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.view.ArrowExpandable;
|
||||
import com.topjohnwu.magisk.view.Expandable;
|
||||
import com.topjohnwu.magisk.view.ExpandableViewHolder;
|
||||
import com.topjohnwu.magisk.view.MarkDownWindow;
|
||||
import com.topjohnwu.magisk.view.SafetyNet;
|
||||
import com.topjohnwu.magisk.view.UpdateCardHolder;
|
||||
import com.topjohnwu.magisk.view.dialogs.EnvFixDialog;
|
||||
import com.topjohnwu.magisk.view.dialogs.MagiskInstallDialog;
|
||||
import com.topjohnwu.magisk.view.dialogs.ManagerInstallDialog;
|
||||
import com.topjohnwu.magisk.view.dialogs.UninstallDialog;
|
||||
import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.fragments;
|
||||
package com.topjohnwu.magisk.ui.log;
|
||||
|
||||
|
||||
import android.os.Build;
|
||||
@@ -10,10 +10,10 @@ import android.view.ViewGroup;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.topjohnwu.magisk.MainActivity;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.adapters.TabFragmentAdapter;
|
||||
import com.topjohnwu.magisk.components.BaseFragment;
|
||||
import com.topjohnwu.magisk.model.adapters.TabFragmentAdapter;
|
||||
import com.topjohnwu.magisk.ui.MainActivity;
|
||||
import com.topjohnwu.magisk.ui.base.BaseFragment;
|
||||
|
||||
import butterknife.BindView;
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.topjohnwu.magisk.fragments;
|
||||
package com.topjohnwu.magisk.ui.log;
|
||||
|
||||
import android.Manifest;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
@@ -16,10 +15,10 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.adapters.StringListAdapter;
|
||||
import com.topjohnwu.magisk.components.BaseFragment;
|
||||
import com.topjohnwu.magisk.uicomponents.SnackbarMaker;
|
||||
import com.topjohnwu.magisk.model.adapters.StringListAdapter;
|
||||
import com.topjohnwu.magisk.ui.base.BaseFragment;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.view.SnackbarMaker;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.internal.NOPList;
|
||||
|
||||
@@ -67,7 +66,7 @@ public class MagiskLogFragment extends BaseFragment {
|
||||
readLogs();
|
||||
return true;
|
||||
case R.id.menu_save:
|
||||
runWithPermission(new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE }, this::saveLogs);
|
||||
runWithExternalRW(this::saveLogs);
|
||||
return true;
|
||||
case R.id.menu_clear:
|
||||
clearLogs();
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.fragments;
|
||||
package com.topjohnwu.magisk.ui.log;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -13,8 +13,8 @@ import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.adapters.SuLogAdapter;
|
||||
import com.topjohnwu.magisk.components.BaseFragment;
|
||||
import com.topjohnwu.magisk.model.adapters.SuLogAdapter;
|
||||
import com.topjohnwu.magisk.ui.base.BaseFragment;
|
||||
|
||||
import butterknife.BindView;
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.topjohnwu.magisk.fragments;
|
||||
package com.topjohnwu.magisk.ui.module;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
@@ -19,12 +18,13 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.FlashActivity;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.adapters.ModulesAdapter;
|
||||
import com.topjohnwu.magisk.components.BaseFragment;
|
||||
import com.topjohnwu.magisk.container.Module;
|
||||
import com.topjohnwu.magisk.model.adapters.ModulesAdapter;
|
||||
import com.topjohnwu.magisk.model.entity.Module;
|
||||
import com.topjohnwu.magisk.ui.base.BaseFragment;
|
||||
import com.topjohnwu.magisk.ui.flash.FlashActivity;
|
||||
import com.topjohnwu.magisk.utils.Event;
|
||||
import com.topjohnwu.magisk.utils.RootUtils;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ModulesFragment extends BaseFragment {
|
||||
|
||||
@OnClick(R.id.fab)
|
||||
void selectFile() {
|
||||
runWithPermission(new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE }, () -> {
|
||||
runWithExternalRW(() -> {
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.setType("application/zip");
|
||||
startActivityForResult(intent, Const.ID.FETCH_ZIP);
|
||||
@@ -110,7 +110,7 @@ public class ModulesFragment extends BaseFragment {
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.reboot:
|
||||
Utils.reboot();
|
||||
RootUtils.reboot();
|
||||
return true;
|
||||
case R.id.reboot_recovery:
|
||||
Shell.su("/system/bin/reboot recovery").submit();
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.fragments;
|
||||
package com.topjohnwu.magisk.ui.module;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.os.Bundle;
|
||||
@@ -18,9 +18,9 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.adapters.ReposAdapter;
|
||||
import com.topjohnwu.magisk.components.BaseFragment;
|
||||
import com.topjohnwu.magisk.model.adapters.ReposAdapter;
|
||||
import com.topjohnwu.magisk.tasks.UpdateRepos;
|
||||
import com.topjohnwu.magisk.ui.base.BaseFragment;
|
||||
import com.topjohnwu.magisk.utils.Event;
|
||||
|
||||
import butterknife.BindView;
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.fragments;
|
||||
package com.topjohnwu.magisk.ui.settings;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
@@ -19,15 +19,15 @@ import com.topjohnwu.magisk.BuildConfig;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.components.BasePreferenceFragment;
|
||||
import com.topjohnwu.magisk.dialogs.FingerprintAuthDialog;
|
||||
import com.topjohnwu.magisk.tasks.CheckUpdates;
|
||||
import com.topjohnwu.magisk.ui.base.BasePreferenceFragment;
|
||||
import com.topjohnwu.magisk.utils.DownloadApp;
|
||||
import com.topjohnwu.magisk.utils.Event;
|
||||
import com.topjohnwu.magisk.utils.FingerprintHelper;
|
||||
import com.topjohnwu.magisk.utils.LocaleManager;
|
||||
import com.topjohnwu.magisk.utils.PatchAPK;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.view.dialogs.FingerprintAuthDialog;
|
||||
import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
@@ -239,39 +239,34 @@ public class SettingsFragment extends BasePreferenceFragment {
|
||||
private void setSummary(String key) {
|
||||
switch (key) {
|
||||
case Config.Key.UPDATE_CHANNEL:
|
||||
int ch = Config.get(key);
|
||||
ch = ch < 0 ? Config.Value.STABLE_CHANNEL : ch;
|
||||
updateChannel.setSummary(getResources()
|
||||
.getStringArray(R.array.update_channel)
|
||||
[(int) Config.get(Config.Key.UPDATE_CHANNEL)]);
|
||||
.getStringArray(R.array.update_channel)[ch]);
|
||||
break;
|
||||
case Config.Key.ROOT_ACCESS:
|
||||
rootConfig.setSummary(getResources()
|
||||
.getStringArray(R.array.su_access)
|
||||
[(int) Config.get(Config.Key.ROOT_ACCESS)]);
|
||||
.getStringArray(R.array.su_access)[(int)Config.get(key)]);
|
||||
break;
|
||||
case Config.Key.SU_AUTO_RESPONSE:
|
||||
autoRes.setSummary(getResources()
|
||||
.getStringArray(R.array.auto_response)
|
||||
[(int) Config.get(Config.Key.SU_AUTO_RESPONSE)]);
|
||||
.getStringArray(R.array.auto_response)[(int)Config.get(key)]);
|
||||
break;
|
||||
case Config.Key.SU_NOTIFICATION:
|
||||
suNotification.setSummary(getResources()
|
||||
.getStringArray(R.array.su_notification)
|
||||
[(int) Config.get(Config.Key.SU_NOTIFICATION)]);
|
||||
.getStringArray(R.array.su_notification)[(int)Config.get(key)]);
|
||||
break;
|
||||
case Config.Key.SU_REQUEST_TIMEOUT:
|
||||
requestTimeout.setSummary(
|
||||
getString(R.string.request_timeout_summary,
|
||||
(int) Config.get(Config.Key.SU_REQUEST_TIMEOUT)));
|
||||
getString(R.string.request_timeout_summary, (int)Config.get(key)));
|
||||
break;
|
||||
case Config.Key.SU_MULTIUSER_MODE:
|
||||
multiuserConfig.setSummary(getResources()
|
||||
.getStringArray(R.array.multiuser_summary)
|
||||
[(int) Config.get(Config.Key.SU_MULTIUSER_MODE)]);
|
||||
.getStringArray(R.array.multiuser_summary)[(int)Config.get(key)]);
|
||||
break;
|
||||
case Config.Key.SU_MNT_NS:
|
||||
nsConfig.setSummary(getResources()
|
||||
.getStringArray(R.array.namespace_summary)
|
||||
[(int) Config.get(Config.Key.SU_MNT_NS)]);
|
||||
.getStringArray(R.array.namespace_summary)[(int)Config.get(key)]);
|
||||
break;
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.fragments;
|
||||
package com.topjohnwu.magisk.ui.superuser;
|
||||
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
@@ -11,9 +11,9 @@ import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.adapters.PolicyAdapter;
|
||||
import com.topjohnwu.magisk.components.BaseFragment;
|
||||
import com.topjohnwu.magisk.container.Policy;
|
||||
import com.topjohnwu.magisk.model.adapters.PolicyAdapter;
|
||||
import com.topjohnwu.magisk.model.entity.Policy;
|
||||
import com.topjohnwu.magisk.ui.base.BaseFragment;
|
||||
|
||||
import java.util.List;
|
||||
|
@@ -0,0 +1,287 @@
|
||||
package com.topjohnwu.magisk.ui.surequest;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.hardware.fingerprint.FingerprintManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
|
||||
import com.topjohnwu.magisk.App;
|
||||
import com.topjohnwu.magisk.BuildConfig;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.model.entity.Policy;
|
||||
import com.topjohnwu.magisk.ui.base.BaseActivity;
|
||||
import com.topjohnwu.magisk.utils.FingerprintHelper;
|
||||
import com.topjohnwu.magisk.utils.SuConnector;
|
||||
import com.topjohnwu.magisk.utils.SuLogger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import java9.lang.Iterables;
|
||||
|
||||
public class SuRequestActivity extends BaseActivity {
|
||||
|
||||
@BindView(R.id.su_popup) LinearLayout suPopup;
|
||||
@BindView(R.id.timeout) Spinner timeout;
|
||||
@BindView(R.id.app_icon) ImageView appIcon;
|
||||
@BindView(R.id.app_name) TextView appNameView;
|
||||
@BindView(R.id.package_name) TextView packageNameView;
|
||||
@BindView(R.id.grant_btn) Button grant_btn;
|
||||
@BindView(R.id.deny_btn) Button deny_btn;
|
||||
@BindView(R.id.fingerprint) ImageView fingerprintImg;
|
||||
@BindView(R.id.warning) TextView warning;
|
||||
|
||||
private ActionHandler handler;
|
||||
private Policy policy;
|
||||
private SharedPreferences timeoutPrefs;
|
||||
|
||||
public static final String REQUEST = "request";
|
||||
public static final String LOG = "log";
|
||||
public static final String NOTIFY = "notify";
|
||||
|
||||
@Override
|
||||
public int getDarkTheme() {
|
||||
return R.style.SuRequest_Dark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
handler.handleAction(Policy.DENY, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
lockOrientation();
|
||||
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
|
||||
timeoutPrefs = App.deContext.getSharedPreferences("su_timeout", 0);
|
||||
Intent intent = getIntent();
|
||||
|
||||
String action = intent.getAction();
|
||||
|
||||
if (TextUtils.equals(action, REQUEST)) {
|
||||
if (!handleRequest())
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.equals(action, LOG))
|
||||
SuLogger.handleLogs(intent);
|
||||
else if (TextUtils.equals(action, NOTIFY))
|
||||
SuLogger.handleNotify(intent);
|
||||
|
||||
finish();
|
||||
}
|
||||
|
||||
private boolean handleRequest() {
|
||||
String socketName = getIntent().getStringExtra("socket");
|
||||
|
||||
if (socketName == null)
|
||||
return false;
|
||||
|
||||
SuConnector connector;
|
||||
try {
|
||||
connector = new SuConnector(socketName) {
|
||||
@Override
|
||||
protected void onResponse() throws IOException {
|
||||
out.writeInt(policy.policy);
|
||||
}
|
||||
};
|
||||
Bundle bundle = connector.readSocketInput();
|
||||
int uid = Integer.parseInt(bundle.getString("uid"));
|
||||
app.mDB.clearOutdated();
|
||||
policy = app.mDB.getPolicy(uid);
|
||||
if (policy == null) {
|
||||
policy = new Policy(uid, getPackageManager());
|
||||
}
|
||||
} catch (IOException | PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
handler = new ActionHandler() {
|
||||
@Override
|
||||
void handleAction() {
|
||||
connector.response();
|
||||
done();
|
||||
}
|
||||
|
||||
@Override
|
||||
void handleAction(int action) {
|
||||
int pos = timeout.getSelectedItemPosition();
|
||||
timeoutPrefs.edit().putInt(policy.packageName, pos).apply();
|
||||
handleAction(action, Config.Value.TIMEOUT_LIST[pos]);
|
||||
}
|
||||
|
||||
@Override
|
||||
void handleAction(int action, int time) {
|
||||
policy.policy = action;
|
||||
if (time >= 0) {
|
||||
policy.until = (time == 0) ? 0
|
||||
: (System.currentTimeMillis() / 1000 + time * 60);
|
||||
app.mDB.updatePolicy(policy);
|
||||
}
|
||||
handleAction();
|
||||
}
|
||||
};
|
||||
|
||||
// Never allow com.topjohnwu.magisk (could be malware)
|
||||
if (TextUtils.equals(policy.packageName, BuildConfig.APPLICATION_ID))
|
||||
return false;
|
||||
|
||||
// If not interactive, response directly
|
||||
if (policy.policy != Policy.INTERACTIVE) {
|
||||
handler.handleAction();
|
||||
return true;
|
||||
}
|
||||
|
||||
switch ((int) Config.get(Config.Key.SU_AUTO_RESPONSE)) {
|
||||
case Config.Value.SU_AUTO_DENY:
|
||||
handler.handleAction(Policy.DENY, 0);
|
||||
return true;
|
||||
case Config.Value.SU_AUTO_ALLOW:
|
||||
handler.handleAction(Policy.ALLOW, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
showUI();
|
||||
return true;
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
private void showUI() {
|
||||
setContentView(R.layout.activity_request);
|
||||
new SuRequestActivity_ViewBinding(this);
|
||||
|
||||
appIcon.setImageDrawable(policy.info.loadIcon(getPackageManager()));
|
||||
appNameView.setText(policy.appName);
|
||||
packageNameView.setText(policy.packageName);
|
||||
warning.setCompoundDrawablesRelativeWithIntrinsicBounds(
|
||||
AppCompatResources.getDrawable(this, R.drawable.ic_warning), null, null, null);
|
||||
|
||||
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
|
||||
R.array.allow_timeout, android.R.layout.simple_spinner_item);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
timeout.setAdapter(adapter);
|
||||
timeout.setSelection(timeoutPrefs.getInt(policy.packageName, 0));
|
||||
|
||||
CountDownTimer timer = new CountDownTimer(
|
||||
(int) Config.get(Config.Key.SU_REQUEST_TIMEOUT) * 1000, 1000) {
|
||||
@Override
|
||||
public void onTick(long remains) {
|
||||
deny_btn.setText(getString(R.string.deny) + "(" + remains / 1000 + ")");
|
||||
}
|
||||
@Override
|
||||
public void onFinish() {
|
||||
deny_btn.setText(getString(R.string.deny));
|
||||
handler.handleAction(Policy.DENY);
|
||||
}
|
||||
};
|
||||
timer.start();
|
||||
Runnable cancelTimer = () -> {
|
||||
timer.cancel();
|
||||
deny_btn.setText(getString(R.string.deny));
|
||||
};
|
||||
handler.addCancel(cancelTimer);
|
||||
|
||||
boolean useFP = FingerprintHelper.useFingerprint();
|
||||
|
||||
if (useFP) try {
|
||||
FingerprintHelper helper = new SuFingerprint();
|
||||
helper.authenticate();
|
||||
handler.addCancel(helper::cancel);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
useFP = false;
|
||||
}
|
||||
|
||||
if (!useFP) {
|
||||
grant_btn.setOnClickListener(v -> {
|
||||
handler.handleAction(Policy.ALLOW);
|
||||
timer.cancel();
|
||||
});
|
||||
grant_btn.requestFocus();
|
||||
}
|
||||
|
||||
grant_btn.setVisibility(useFP ? View.GONE : View.VISIBLE);
|
||||
fingerprintImg.setVisibility(useFP ? View.VISIBLE : View.GONE);
|
||||
|
||||
deny_btn.setOnClickListener(v -> {
|
||||
handler.handleAction(Policy.DENY);
|
||||
timer.cancel();
|
||||
});
|
||||
suPopup.setOnClickListener(v -> cancelTimer.run());
|
||||
timeout.setOnTouchListener((v, event) -> {
|
||||
cancelTimer.run();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
private class SuFingerprint extends FingerprintHelper {
|
||||
|
||||
SuFingerprint() throws Exception {}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationError(int errorCode, CharSequence errString) {
|
||||
warning.setText(errString);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationHelp(int helpCode, CharSequence helpString) {
|
||||
warning.setText(helpString);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
|
||||
handler.handleAction(Policy.ALLOW);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAuthenticationFailed() {
|
||||
warning.setText(R.string.auth_fail);
|
||||
}
|
||||
}
|
||||
|
||||
private class ActionHandler {
|
||||
private List<Runnable> cancelTasks = new ArrayList<>();
|
||||
|
||||
void handleAction() {
|
||||
done();
|
||||
}
|
||||
|
||||
void handleAction(int action) {
|
||||
done();
|
||||
}
|
||||
|
||||
void handleAction(int action, int time) {
|
||||
done();
|
||||
}
|
||||
|
||||
void addCancel(Runnable r) {
|
||||
cancelTasks.add(r);
|
||||
}
|
||||
|
||||
void done() {
|
||||
Iterables.forEach(cancelTasks, Runnable::run);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,104 +0,0 @@
|
||||
package com.topjohnwu.magisk.uicomponents;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.caverock.androidsvg.SVG;
|
||||
import com.topjohnwu.magisk.App;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.net.ResponseListener;
|
||||
import com.topjohnwu.signing.ByteArrayStream;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import ru.noties.markwon.Markwon;
|
||||
import ru.noties.markwon.SpannableConfiguration;
|
||||
import ru.noties.markwon.spans.AsyncDrawable;
|
||||
|
||||
public class MarkDownWindow {
|
||||
|
||||
private static final SpannableConfiguration config = SpannableConfiguration.builder(App.self)
|
||||
.asyncDrawableLoader(new Loader()).build();
|
||||
|
||||
public static void show(Activity activity, String title, String url) {
|
||||
Networking.get(url).getAsString(new Listener(activity, title));
|
||||
}
|
||||
|
||||
public static void show (Activity activity, String title, InputStream is) {
|
||||
try {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ShellUtils.pump(is, baos);
|
||||
new Listener(activity, title).onResponse(baos.toString());
|
||||
} catch (IOException ignored) {}
|
||||
}
|
||||
|
||||
static class Listener implements ResponseListener<String> {
|
||||
|
||||
Activity activity;
|
||||
String title;
|
||||
|
||||
Listener(Activity a, String t) {
|
||||
activity = a;
|
||||
title = t;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(String md) {
|
||||
AlertDialog.Builder alert = new AlertDialog.Builder(activity);
|
||||
alert.setTitle(title);
|
||||
View mv = LayoutInflater.from(activity).inflate(R.layout.markdown_window, null);
|
||||
Markwon.setMarkdown(mv.findViewById(R.id.md_txt), config, md);
|
||||
alert.setView(mv);
|
||||
alert.setNegativeButton(R.string.close, (dialog, id) -> dialog.dismiss());
|
||||
alert.show();
|
||||
}
|
||||
}
|
||||
|
||||
static class Loader implements AsyncDrawable.Loader {
|
||||
|
||||
@Override
|
||||
public void load(@NonNull String url, @NonNull AsyncDrawable asyncDrawable) {
|
||||
App.THREAD_POOL.submit((Callable<?>) () -> {
|
||||
InputStream is = Networking.get(url).execForInputStream().getResult();
|
||||
if (is == null)
|
||||
return null;
|
||||
ByteArrayStream buf = new ByteArrayStream();
|
||||
buf.readFrom(is);
|
||||
// First try default drawables
|
||||
Drawable drawable = Drawable.createFromStream(buf.getInputStream(), "");
|
||||
if (drawable == null) {
|
||||
// SVG
|
||||
SVG svg = SVG.getFromInputStream(buf.getInputStream());
|
||||
int width = Utils.dpInPx((int) svg.getDocumentWidth());
|
||||
int height = Utils.dpInPx((int) svg.getDocumentHeight());
|
||||
final Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_4444);
|
||||
final Canvas canvas = new Canvas(bitmap);
|
||||
float density = App.self.getResources().getDisplayMetrics().density;
|
||||
canvas.scale(density, density);
|
||||
svg.renderToCanvas(canvas);
|
||||
drawable = new BitmapDrawable(App.self.getResources(), bitmap);
|
||||
}
|
||||
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
||||
asyncDrawable.setResult(drawable);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(@NonNull String url) {}
|
||||
}
|
||||
}
|
@@ -7,8 +7,8 @@ import com.topjohnwu.magisk.BuildConfig;
|
||||
import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.SplashActivity;
|
||||
import com.topjohnwu.magisk.uicomponents.ProgressNotification;
|
||||
import com.topjohnwu.magisk.ui.SplashActivity;
|
||||
import com.topjohnwu.magisk.view.ProgressNotification;
|
||||
import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.net.ResponseListener;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
@@ -11,8 +11,8 @@ import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.SplashActivity;
|
||||
import com.topjohnwu.magisk.uicomponents.Notifications;
|
||||
import com.topjohnwu.magisk.ui.SplashActivity;
|
||||
import com.topjohnwu.magisk.view.Notifications;
|
||||
import com.topjohnwu.signing.JarMap;
|
||||
import com.topjohnwu.signing.SignAPK;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
@@ -2,6 +2,9 @@ package com.topjohnwu.magisk.utils;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -13,6 +16,9 @@ import com.topjohnwu.superuser.ShellUtils;
|
||||
import com.topjohnwu.superuser.io.SuFile;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RootUtils extends Shell.Initializer {
|
||||
|
||||
@@ -20,6 +26,106 @@ public class RootUtils extends Shell.Initializer {
|
||||
Shell.su(Utils.fmt("(rm_launch %s %s)&", rm, component.flattenToString())).exec();
|
||||
}
|
||||
|
||||
public static void reboot() {
|
||||
Shell.su("/system/bin/reboot" + (Config.recovery ? " recovery" : "")).submit();
|
||||
}
|
||||
|
||||
public static void startActivity(Intent intent) {
|
||||
if (intent.getComponent() == null)
|
||||
return;
|
||||
List<String> args = new ArrayList<>();
|
||||
args.add("am");
|
||||
args.add("start");
|
||||
intentToCommand(intent, args);
|
||||
Shell.su(Utils.argsToCommand(args)).exec();
|
||||
}
|
||||
|
||||
public static void intentToCommand(Intent intent, List<String> args) {
|
||||
if (intent.getAction() != null) {
|
||||
args.add("-a");
|
||||
args.add(intent.getAction());
|
||||
}
|
||||
if (intent.getComponent() != null) {
|
||||
args.add("-n");
|
||||
args.add(intent.getComponent().flattenToString());
|
||||
}
|
||||
if (intent.getData() != null) {
|
||||
args.add("-d");
|
||||
args.add(intent.getDataString());
|
||||
}
|
||||
if (intent.getCategories() != null) {
|
||||
for (String cat : intent.getCategories()) {
|
||||
args.add("-c");
|
||||
args.add(cat);
|
||||
}
|
||||
}
|
||||
if (intent.getType() != null) {
|
||||
args.add("-t");
|
||||
args.add(intent.getType());
|
||||
}
|
||||
Bundle extras = intent.getExtras();
|
||||
if (extras != null) {
|
||||
for (String key : extras.keySet()) {
|
||||
Object val = extras.get(key);
|
||||
if (val == null)
|
||||
continue;
|
||||
Object value = val;
|
||||
String arg;
|
||||
if (val instanceof String) arg = "--es";
|
||||
else if (val instanceof Boolean) arg = "--ez";
|
||||
else if (val instanceof Integer) arg = "--ei";
|
||||
else if (val instanceof Long) arg = "--el";
|
||||
else if (val instanceof Float) arg = "--ef";
|
||||
else if (val instanceof Uri) arg = "--eu";
|
||||
else if (val instanceof ComponentName) {
|
||||
arg = "--ecn";
|
||||
value = ((ComponentName) val).flattenToString();
|
||||
} else if (val instanceof ArrayList) {
|
||||
ArrayList arr = (ArrayList) val;
|
||||
if (arr.size() <= 0)
|
||||
/* Impossible to know the type due to type erasure */
|
||||
continue;
|
||||
|
||||
if (arr.get(0) instanceof Integer) arg = "--eial";
|
||||
else if (arr.get(0) instanceof Long) arg = "--elal";
|
||||
else if (arr.get(0) instanceof Float) arg = "--efal";
|
||||
else if (arr.get(0) instanceof String) arg = "--esal";
|
||||
else continue; /* Unsupported */
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Object o : arr) {
|
||||
sb.append(o.toString().replace(",", "\\,"));
|
||||
sb.append(',');
|
||||
}
|
||||
// Remove trailing comma
|
||||
sb.deleteCharAt(sb.length() - 1);
|
||||
value = sb;
|
||||
} else if (val.getClass().isArray()) {
|
||||
if (val instanceof int[]) arg = "--eia";
|
||||
else if (val instanceof long[]) arg = "--ela";
|
||||
else if (val instanceof float[]) arg = "--efa";
|
||||
else if (val instanceof String[]) arg = "--esa";
|
||||
else continue; /* Unsupported */
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int len = Array.getLength(val);
|
||||
for (int i = 0; i < len; ++i) {
|
||||
sb.append(Array.get(val, i).toString().replace(",", "\\,"));
|
||||
sb.append(',');
|
||||
}
|
||||
// Remove trailing comma
|
||||
sb.deleteCharAt(sb.length() - 1);
|
||||
value = sb;
|
||||
}
|
||||
else continue; /* Unsupported */
|
||||
|
||||
args.add(arg);
|
||||
args.add(key);
|
||||
args.add(value.toString());
|
||||
}
|
||||
}
|
||||
args.add("-f");
|
||||
args.add(String.valueOf(intent.getFlags()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onInit(Context context, @NonNull Shell shell) {
|
||||
Shell.Job job = shell.newJob();
|
||||
|
@@ -8,14 +8,15 @@ import android.widget.Toast;
|
||||
|
||||
import com.topjohnwu.magisk.App;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.container.Policy;
|
||||
import com.topjohnwu.magisk.container.SuLogEntry;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.model.entity.Policy;
|
||||
import com.topjohnwu.magisk.model.entity.SuLogEntry;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public abstract class SuLogger {
|
||||
public class SuLogger {
|
||||
|
||||
public void handleLogs(Intent intent) {
|
||||
public static void handleLogs(Intent intent) {
|
||||
|
||||
int fromUid = intent.getIntExtra("from.uid", -1);
|
||||
if (fromUid < 0) return;
|
||||
@@ -64,13 +65,16 @@ public abstract class SuLogger {
|
||||
app.mDB.addLog(log);
|
||||
}
|
||||
|
||||
private void handleNotify(Policy policy) {
|
||||
private static void handleNotify(Policy policy) {
|
||||
if (policy.notification &&
|
||||
(int) Config.get(Config.Key.SU_NOTIFICATION) == Config.Value.NOTIFICATION_TOAST)
|
||||
Utils.toast(getMessage(policy), Toast.LENGTH_SHORT);
|
||||
(int) Config.get(Config.Key.SU_NOTIFICATION) == Config.Value.NOTIFICATION_TOAST) {
|
||||
Utils.toast(App.self.getString(policy.policy == Policy.ALLOW ?
|
||||
R.string.su_allow_toast : R.string.su_deny_toast, policy.appName),
|
||||
Toast.LENGTH_SHORT);
|
||||
}
|
||||
}
|
||||
|
||||
public void handleNotify(Intent intent) {
|
||||
public static void handleNotify(Intent intent) {
|
||||
int fromUid = intent.getIntExtra("from.uid", -1);
|
||||
if (fromUid < 0) return;
|
||||
if (fromUid == Process.myUid()) return;
|
||||
@@ -81,6 +85,4 @@ public abstract class SuLogger {
|
||||
handleNotify(policy);
|
||||
} catch (PackageManager.NameNotFoundException ignored) {}
|
||||
}
|
||||
|
||||
public abstract String getMessage(Policy policy);
|
||||
}
|
||||
|
@@ -24,15 +24,14 @@ import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.components.UpdateCheckService;
|
||||
import com.topjohnwu.magisk.container.Module;
|
||||
import com.topjohnwu.magisk.container.ValueSortedMap;
|
||||
import com.topjohnwu.magisk.tasks.CheckUpdates;
|
||||
import com.topjohnwu.magisk.model.entity.Module;
|
||||
import com.topjohnwu.magisk.model.update.UpdateCheckService;
|
||||
import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.internal.UiThreadHandler;
|
||||
import com.topjohnwu.superuser.io.SuFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -136,10 +135,6 @@ public class Utils {
|
||||
Config.Value.MULTIUSER_MODE_OWNER_MANAGED);
|
||||
}
|
||||
|
||||
public static void reboot() {
|
||||
Shell.su("/system/bin/reboot" + (Config.recovery ? " recovery" : "")).submit();
|
||||
}
|
||||
|
||||
public static boolean isCanary() {
|
||||
return BuildConfig.VERSION_NAME.contains("-");
|
||||
}
|
||||
@@ -158,7 +153,6 @@ public class Utils {
|
||||
ExistingPeriodicWorkPolicy.REPLACE, request);
|
||||
} else {
|
||||
WorkManager.getInstance().cancelUniqueWork(Const.ID.CHECK_MAGISK_UPDATE_WORKER_ID);
|
||||
CheckUpdates.check();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,4 +165,19 @@ public class Utils {
|
||||
toast(R.string.open_link_failed_toast, Toast.LENGTH_SHORT);
|
||||
}
|
||||
}
|
||||
|
||||
public static String argsToCommand(List<String> args) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String s : args) {
|
||||
if (s.contains(" ")) {
|
||||
sb.append('"').append(s).append('"');
|
||||
} else {
|
||||
sb.append(s);
|
||||
}
|
||||
sb.append(' ');
|
||||
}
|
||||
sb.deleteCharAt(sb.length() - 1);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.container;
|
||||
package com.topjohnwu.magisk.utils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.uicomponents;
|
||||
package com.topjohnwu.magisk.view;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.uicomponents;
|
||||
package com.topjohnwu.magisk.view;
|
||||
|
||||
public abstract class Expandable {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.uicomponents;
|
||||
package com.topjohnwu.magisk.view;
|
||||
|
||||
import android.animation.ValueAnimator;
|
||||
import android.view.View;
|
@@ -0,0 +1,60 @@
|
||||
package com.topjohnwu.magisk.view;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.net.ResponseListener;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Scanner;
|
||||
|
||||
import ru.noties.markwon.Markwon;
|
||||
import ru.noties.markwon.html.HtmlPlugin;
|
||||
import ru.noties.markwon.image.ImagesPlugin;
|
||||
import ru.noties.markwon.image.svg.SvgPlugin;
|
||||
|
||||
public class MarkDownWindow {
|
||||
|
||||
public static void show(Activity activity, String title, String url) {
|
||||
Networking.get(url).getAsString(new Listener(activity, title));
|
||||
}
|
||||
|
||||
public static void show (Activity activity, String title, InputStream is) {
|
||||
try (Scanner s = new Scanner(is, "UTF-8")) {
|
||||
s.useDelimiter("\\A");
|
||||
new Listener(activity, title).onResponse(s.next());
|
||||
}
|
||||
}
|
||||
|
||||
static class Listener implements ResponseListener<String> {
|
||||
|
||||
Activity activity;
|
||||
String title;
|
||||
|
||||
Listener(Activity a, String t) {
|
||||
activity = a;
|
||||
title = t;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(String md) {
|
||||
Markwon markwon = Markwon.builder(activity)
|
||||
.usePlugin(HtmlPlugin.create())
|
||||
.usePlugin(ImagesPlugin.create(activity))
|
||||
.usePlugin(SvgPlugin.create(activity.getResources()))
|
||||
.build();
|
||||
AlertDialog.Builder alert = new AlertDialog.Builder(activity);
|
||||
alert.setTitle(title);
|
||||
View mv = LayoutInflater.from(activity).inflate(R.layout.markdown_window, null);
|
||||
markwon.setMarkdown(mv.findViewById(R.id.md_txt), md);
|
||||
alert.setView(mv);
|
||||
alert.setNegativeButton(R.string.close, (dialog, id) -> dialog.dismiss());
|
||||
alert.show();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.uicomponents;
|
||||
package com.topjohnwu.magisk.view;
|
||||
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
@@ -16,8 +16,8 @@ import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.SplashActivity;
|
||||
import com.topjohnwu.magisk.components.GeneralReceiver;
|
||||
import com.topjohnwu.magisk.model.receiver.GeneralReceiver;
|
||||
import com.topjohnwu.magisk.ui.SplashActivity;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
|
||||
public class Notifications {
|
@@ -1,6 +1,8 @@
|
||||
package com.topjohnwu.magisk.uicomponents;
|
||||
package com.topjohnwu.magisk.view;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Intent;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.core.app.NotificationCompat;
|
||||
@@ -55,10 +57,17 @@ public class ProgressNotification implements DownloadProgressListener {
|
||||
}
|
||||
|
||||
public void dlDone() {
|
||||
dlDone(PendingIntent.getActivity(App.self, hashCode(),
|
||||
new Intent(), PendingIntent.FLAG_UPDATE_CURRENT));
|
||||
}
|
||||
|
||||
public void dlDone(PendingIntent intent) {
|
||||
builder.setProgress(0, 0, false)
|
||||
.setContentText(App.self.getString(R.string.download_complete))
|
||||
.setSmallIcon(android.R.drawable.stat_sys_download_done)
|
||||
.setOngoing(false);
|
||||
.setContentIntent(intent)
|
||||
.setOngoing(false)
|
||||
.setAutoCancel(true);
|
||||
lastUpdate();
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.uicomponents;
|
||||
package com.topjohnwu.magisk.view;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
@@ -16,8 +16,8 @@ import androidx.cardview.widget.CardView;
|
||||
import com.topjohnwu.magisk.App;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.dialogs.CustomAlertDialog;
|
||||
import com.topjohnwu.magisk.utils.ISafetyNetHelper;
|
||||
import com.topjohnwu.magisk.view.dialogs.CustomAlertDialog;
|
||||
import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.uicomponents;
|
||||
package com.topjohnwu.magisk.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -13,7 +13,7 @@ import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.SplashActivity;
|
||||
import com.topjohnwu.magisk.ui.SplashActivity;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.uicomponents;
|
||||
package com.topjohnwu.magisk.view;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.net.Uri;
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.uicomponents;
|
||||
package com.topjohnwu.magisk.view;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.dialogs;
|
||||
package com.topjohnwu.magisk.view.dialogs;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.DialogInterface;
|
@@ -1,22 +1,19 @@
|
||||
package com.topjohnwu.magisk.dialogs;
|
||||
package com.topjohnwu.magisk.view.dialogs;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.SplashActivity;
|
||||
import com.topjohnwu.magisk.tasks.MagiskInstaller;
|
||||
import com.topjohnwu.magisk.utils.RootUtils;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.internal.UiThreadHandler;
|
||||
import com.topjohnwu.superuser.io.SuFile;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class EnvFixDialog extends CustomAlertDialog {
|
||||
|
||||
public EnvFixDialog(@NonNull Activity activity) {
|
||||
@@ -39,18 +36,9 @@ public class EnvFixDialog extends CustomAlertDialog {
|
||||
@Override
|
||||
protected void onResult(boolean success) {
|
||||
pd.dismiss();
|
||||
Utils.toast(success ? R.string.setup_done : R.string.setup_fail, Toast.LENGTH_LONG);
|
||||
if (success) {
|
||||
// Relaunch the app
|
||||
try {
|
||||
Shell.getShell().close();
|
||||
} catch (IOException ignored) {}
|
||||
Intent intent = new Intent(activity, ClassMap.get(SplashActivity.class));
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_TASK_ON_HOME | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
activity.startActivity(intent);
|
||||
activity.finish();
|
||||
}
|
||||
|
||||
Utils.toast(success ? R.string.reboot_delay_toast : R.string.setup_fail, Toast.LENGTH_LONG);
|
||||
if (success)
|
||||
UiThreadHandler.handler.postDelayed(RootUtils::reboot, 5000);
|
||||
}
|
||||
}.exec();
|
||||
});
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.dialogs;
|
||||
package com.topjohnwu.magisk.view.dialogs;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.dialogs;
|
||||
package com.topjohnwu.magisk.view.dialogs;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
@@ -10,12 +10,12 @@ import com.google.android.material.snackbar.Snackbar;
|
||||
import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.FlashActivity;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.components.BaseActivity;
|
||||
import com.topjohnwu.magisk.uicomponents.ProgressNotification;
|
||||
import com.topjohnwu.magisk.uicomponents.SnackbarMaker;
|
||||
import com.topjohnwu.magisk.ui.base.BaseActivity;
|
||||
import com.topjohnwu.magisk.ui.flash.FlashActivity;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.view.ProgressNotification;
|
||||
import com.topjohnwu.magisk.view.SnackbarMaker;
|
||||
import com.topjohnwu.net.Networking;
|
||||
|
||||
import java.io.File;
|
||||
@@ -26,7 +26,7 @@ class InstallMethodDialog extends AlertDialog.Builder {
|
||||
InstallMethodDialog(BaseActivity activity, List<String> options) {
|
||||
super(activity);
|
||||
setTitle(R.string.select_method);
|
||||
setItems(options.toArray(new String [0]), (dialog, idx) -> {
|
||||
setItems(options.toArray(new String[0]), (dialog, idx) -> {
|
||||
Intent intent;
|
||||
switch (idx) {
|
||||
case 1:
|
||||
@@ -48,25 +48,26 @@ class InstallMethodDialog extends AlertDialog.Builder {
|
||||
});
|
||||
}
|
||||
|
||||
private void patchBoot(BaseActivity a) {
|
||||
Utils.toast(R.string.boot_file_patch_msg, Toast.LENGTH_LONG);
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT).setType("*/*").addCategory(Intent.CATEGORY_OPENABLE);
|
||||
a.runWithExternalRW(() ->
|
||||
a.startActivityForResult(intent, Const.ID.SELECT_BOOT,
|
||||
(requestCode, resultCode, data) -> {
|
||||
if (requestCode == Const.ID.SELECT_BOOT &&
|
||||
resultCode == Activity.RESULT_OK && data != null) {
|
||||
Intent i = new Intent(a, ClassMap.get(FlashActivity.class))
|
||||
.setData(data.getData())
|
||||
.putExtra(Const.Key.FLASH_ACTION, Const.Value.PATCH_BOOT);
|
||||
a.startActivity(i);
|
||||
}
|
||||
})
|
||||
);
|
||||
private void patchBoot(BaseActivity activity) {
|
||||
activity.runWithExternalRW(() -> {
|
||||
Utils.toast(R.string.patch_file_msg, Toast.LENGTH_LONG);
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT)
|
||||
.setType("*/*")
|
||||
.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
activity.startActivityForResult(intent, Const.ID.SELECT_BOOT,
|
||||
(resultCode, data) -> {
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
Intent i = new Intent(activity, ClassMap.get(FlashActivity.class))
|
||||
.setData(data.getData())
|
||||
.putExtra(Const.Key.FLASH_ACTION, Const.Value.PATCH_FILE);
|
||||
activity.startActivity(i);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private void downloadOnly(BaseActivity a) {
|
||||
a.runWithExternalRW(() -> {
|
||||
private void downloadOnly(BaseActivity activity) {
|
||||
activity.runWithExternalRW(() -> {
|
||||
String filename = Utils.fmt("Magisk-v%s(%d).zip",
|
||||
Config.remoteMagiskVersionString, Config.remoteMagiskVersionCode);
|
||||
File zip = new File(Const.EXTERNAL_PATH, filename);
|
||||
@@ -76,8 +77,8 @@ class InstallMethodDialog extends AlertDialog.Builder {
|
||||
.setErrorHandler(((conn, e) -> progress.dlFail()))
|
||||
.getAsFile(zip, f -> {
|
||||
progress.dlDone();
|
||||
SnackbarMaker.make(a,
|
||||
a.getString(R.string.internal_storage, "/Download/" + filename),
|
||||
SnackbarMaker.make(activity,
|
||||
activity.getString(R.string.internal_storage, "/Download/" + filename),
|
||||
Snackbar.LENGTH_LONG).show();
|
||||
});
|
||||
});
|
@@ -1,13 +1,13 @@
|
||||
package com.topjohnwu.magisk.dialogs;
|
||||
package com.topjohnwu.magisk.view.dialogs;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.components.BaseActivity;
|
||||
import com.topjohnwu.magisk.uicomponents.MarkDownWindow;
|
||||
import com.topjohnwu.magisk.ui.base.BaseActivity;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.view.MarkDownWindow;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
import com.topjohnwu.superuser.ShellUtils;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class MagiskInstallDialog extends CustomAlertDialog {
|
||||
setPositiveButton(R.string.install, (d, i) -> {
|
||||
List<String> options = new ArrayList<>();
|
||||
options.add(a.getString(R.string.download_zip_only));
|
||||
options.add(a.getString(R.string.patch_boot_file));
|
||||
options.add(a.getString(R.string.select_patch_file));
|
||||
if (Shell.rootAccess()) {
|
||||
options.add(a.getString(R.string.direct_install));
|
||||
String s = ShellUtils.fastCmd("grep_prop ro.build.ab_update");
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.dialogs;
|
||||
package com.topjohnwu.magisk.view.dialogs;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.text.TextUtils;
|
||||
@@ -7,9 +7,9 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.uicomponents.MarkDownWindow;
|
||||
import com.topjohnwu.magisk.utils.DownloadApp;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.view.MarkDownWindow;
|
||||
|
||||
public class ManagerInstallDialog extends CustomAlertDialog {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package com.topjohnwu.magisk.dialogs;
|
||||
package com.topjohnwu.magisk.view.dialogs;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
@@ -12,10 +12,10 @@ import androidx.annotation.NonNull;
|
||||
import com.topjohnwu.magisk.ClassMap;
|
||||
import com.topjohnwu.magisk.Config;
|
||||
import com.topjohnwu.magisk.Const;
|
||||
import com.topjohnwu.magisk.FlashActivity;
|
||||
import com.topjohnwu.magisk.R;
|
||||
import com.topjohnwu.magisk.uicomponents.ProgressNotification;
|
||||
import com.topjohnwu.magisk.ui.flash.FlashActivity;
|
||||
import com.topjohnwu.magisk.utils.Utils;
|
||||
import com.topjohnwu.magisk.view.ProgressNotification;
|
||||
import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
@@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M20.54,5.23l-1.39,-1.68C18.88,3.21 18.47,3 18,3H6c-0.47,0 -0.88,0.21 -1.16,0.55L3.46,5.23C3.17,5.57 3,6.02 3,6.5V19c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V6.5c0,-0.48 -0.17,-0.93 -0.46,-1.27zM12,17.5L6.5,12H10v-2h4v2h3.5L12,17.5zM5.12,5l0.81,-1h12l0.94,1H5.12z"/>
|
||||
</vector>
|
@@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#757575"
|
||||
android:pathData="M11.8,10.9c-2.27,-0.59 -3,-1.2 -3,-2.15 0,-1.09 1.01,-1.85 2.7,-1.85 1.78,0 2.44,0.85 2.5,2.1h2.21c-0.07,-1.72 -1.12,-3.3 -3.21,-3.81V3h-3v2.16c-1.94,0.42 -3.5,1.68 -3.5,3.61 0,2.31 1.91,3.46 4.7,4.13 2.5,0.6 3,1.48 3,2.41 0,0.69 -0.49,1.79 -2.7,1.79 -2.06,0 -2.87,-0.92 -2.98,-2.1h-2.2c0.12,2.19 1.76,3.42 3.68,3.83V21h3v-2.15c1.95,-0.37 3.5,-1.5 3.5,-3.55 0,-2.84 -2.43,-3.81 -4.7,-4.4z"/>
|
||||
</vector>
|
@@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M13,7h-2v2h2L13,7zM13,11h-2v6h2v-6zM17,1.01L7,1c-1.1,0 -2,0.9 -2,2v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2L19,3c0,-1.1 -0.9,-1.99 -2,-1.99zM17,19L7,19L7,5h10v14z"/>
|
||||
</vector>
|
@@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#757575"
|
||||
android:pathData="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z"/>
|
||||
</vector>
|
@@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#757575"
|
||||
android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/>
|
||||
</vector>
|
@@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#757575"
|
||||
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z"/>
|
||||
</vector>
|
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0" >
|
||||
<path
|
||||
android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2c-1.1,0 -2,0.9 -2,2S10.9,8 12,8zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2c1.1,0 2,-0.9 2,-2S13.1,10 12,10zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2c1.1,0 2,-0.9 2,-2S13.1,16 12,16z"
|
||||
android:fillColor="#757575"/>
|
||||
</vector>
|
@@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#757575"
|
||||
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
|
||||
</vector>
|
@@ -1,6 +1,3 @@
|
||||
# v7.1.0
|
||||
- Support the new module format
|
||||
- Support per-application component granularity MagiskHide targets (only on v19+)
|
||||
- Ask for fingerprint before deleting rules if enabled
|
||||
- Fix the bug that causes repackaging to lose settings
|
||||
- Several UI fixes
|
||||
# v7.1.2
|
||||
- Support patching Samsung AP firmware
|
||||
- Much better module downloading mechanism
|
||||
|
@@ -77,6 +77,7 @@ post_ota() {
|
||||
cat << EOF > post-fs-data.d/post_ota.sh
|
||||
${1}/bootctl mark-boot-successful
|
||||
rm -f ${1}/bootctl
|
||||
rm -f ${1}/post-fs-data.d/post_ota.sh
|
||||
EOF
|
||||
chmod 755 post-fs-data.d/post_ota.sh
|
||||
cd /
|
||||
|
@@ -108,8 +108,7 @@
|
||||
<string name="android_o_not_support">لا يدعم إصدار الأندرويد +8.0</string>
|
||||
<string name="auth_fail">فشل المصادقة</string>
|
||||
<string name="auth_fingerprint">مصادقة البصمة</string>
|
||||
<string name="boot_file_patch_msg">حدد الذاكرة المؤقتة لنسخة boot الأصلية بتنسيق img. أو .img.tar</string>
|
||||
<string name="complete_uninstall">إلغاء التثبيت بالكامل</string>
|
||||
<string name="complete_uninstall">إلغاء التثبيت بالكامل</string>
|
||||
<string name="direct_install">تثبيت مباشر (موصى به)</string>
|
||||
<string name="disable_fingerprint">لم يتم تعيين بصمات الأصابع أو لا يوجد جهاز مدعوم</string>
|
||||
<string name="download_zip_only">تحميل ملف zip فقط</string>
|
||||
@@ -134,8 +133,7 @@
|
||||
<string name="menuSaveLog">حفظ السجل</string>
|
||||
<string name="mount_namespace_mode">وضع تركيب مساحة الأسم</string>
|
||||
<string name="open_link_failed_toast">لم يتم العثور على تطبيق لفتح الرابط …</string>
|
||||
<string name="patch_boot_file">تصحيح ملف صورة boot</string>
|
||||
<string name="proprietary_notice">مدير Magisk هو FOSS ، والذي لا يحتوي على شفرة API الخاصة بشركة SafetyNet الخاصة بشركة Google.
|
||||
<string name="proprietary_notice">مدير Magisk هو FOSS ، والذي لا يحتوي على شفرة API الخاصة بشركة SafetyNet الخاصة بشركة Google.
|
||||
|
||||
هل تسمح لـ Magisk Manager بتنزيل ملحق (يحتوي على GoogleApiClient) لعمليات التحقق من SafetyNet؟ "</string>
|
||||
<string name="proprietary_title">تحميل رمز الملكية</string>
|
||||
@@ -149,10 +147,7 @@
|
||||
<string name="restore_img_msg">الأستعادة …</string>
|
||||
<string name="safetyNet_api_error">خطأ SafetyNet API</string>
|
||||
<string name="select_method">حدد الطريقة</string>
|
||||
<string name="settings_boot_format_summary">"حدد تنسيق ملف boot المصحح للإخراج.
|
||||
اختر img. للتثبيت من خلال وضع fastboot/ التحميل ؛ اختر img.tar. للتثبيت مع ODIN. "</string>
|
||||
<string name="settings_boot_format_title">تنسيق إخراج ملف Boot المصحح</string>
|
||||
<string name="settings_check_update_summary">التحقق من التحديثات في الخلفية بشكل دوري</string>
|
||||
<string name="settings_check_update_summary">التحقق من التحديثات في الخلفية بشكل دوري</string>
|
||||
<string name="settings_check_update_title">تفقد التحديث</string>
|
||||
<string name="settings_hide_manager_summary">أعد حزم مدير Magisk مع اسم حزمة عشوائية</string>
|
||||
<string name="settings_hide_manager_title">إخفاء مدير Magisk</string>
|
||||
@@ -171,8 +166,7 @@
|
||||
<string name="settings_update_custom">مخصص</string>
|
||||
<string name="settings_update_custom_msg">أدخل عنوان URL مخصص</string>
|
||||
<string name="settings_update_stable">مستقر</string>
|
||||
<string name="setup_done">تم الإعداد</string>
|
||||
<string name="setup_fail">فشل الإعداد</string>
|
||||
<string name="setup_fail">فشل الإعداد</string>
|
||||
<string name="setup_msg">تشغيل إعداد البيئة…</string>
|
||||
<string name="setup_title">إعداد إضافي</string>
|
||||
<string name="sort_by_name">الترتيب حسب الاسم</string>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
<string name="unsupport_magisk_title">Dəstəklənməyən Magisk Versiyası</string>
|
||||
|
||||
<string name="unsupport_magisk_message">Magisk Menecerin bu versiyası Magisk\'in v18.0 versiyasndan aşağısını dəstəkləmir.\n\nMagisk\'i əllə yüksəldə, yaxud tətbiqi əvvəlki versiyalarına qaytara bilərsiniz.</string>
|
||||
<string name="unsupport_magisk_message">Magisk Manager\'in bu versiyası Magisk\'in v18.0 versiyasndan aşağısını dəstəkləmir.\n\nMagisk\'i əllə yüksəldə, yaxud tətbiqi əvvəlki versiyalarına qaytara bilərsiniz.</string>
|
||||
|
||||
<!--Status Fragment-->
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
<string name="invalid_update_channel">Etibarsız Yeniləmə Kanalı</string>
|
||||
|
||||
<string name="safetyNet_check_text">SafetyNet vəziyətinə baxmaq üçün toxun</string>
|
||||
<string name="safetyNet_check_text">SafetyNet vəziyətinə bax</string>
|
||||
|
||||
<string name="checking_safetyNet_status">SafetyNet vəziyəti yoxlanılır…</string>
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
|
||||
<string name="magisk_update_title">Magisk Yeniləməsi Var!</string>
|
||||
|
||||
<string name="manager_update_title">Magisk Menecer Yeniləməsi Var!</string>
|
||||
<string name="manager_update_title">Magisk Manager Yeniləməsi Var!</string>
|
||||
|
||||
<!--Toasts, Dialogs-->
|
||||
|
||||
@@ -162,16 +162,14 @@
|
||||
|
||||
<string name="flashing">Qurulur</string>
|
||||
|
||||
<string name="hide_manager_title">Magisk Menecer gizlədilir…</string>
|
||||
<string name="hide_manager_title">Magisk Manageri\'i gizlədilir…</string>
|
||||
|
||||
<string name="hide_manager_fail_toast">Magisk Meneceri gizlətmək alınmadı.</string>
|
||||
<string name="hide_manager_fail_toast">Magisk Manager\'i gizlətmək alınmadı.</string>
|
||||
|
||||
<string name="open_link_failed_toast">Keçid açmağa heçbir tətbiq tapılmadı.</string>
|
||||
|
||||
<string name="download_zip_only">Yalnız Zip yüklə</string>
|
||||
|
||||
<string name="patch_boot_file">Patch Boot Image File</string>
|
||||
|
||||
<string name="direct_install">Birdəfəlik Yüklə (Tövsiyə olunur)</string>
|
||||
|
||||
<string name="install_inactive_slot">Fəal olmayan slota quraşdır (OTA\'dan sonra)</string>
|
||||
@@ -182,8 +180,6 @@
|
||||
|
||||
<string name="select_method">Üsul Seçin</string>
|
||||
|
||||
<string name="boot_file_patch_msg">Standart boot surətinin yığılma formatını .imb yaxud img.tar kimi seçin.</string>
|
||||
|
||||
<string name="complete_uninstall">Silməni Bitir</string>
|
||||
|
||||
<string name="restore_img">Şəkilləri Geri Qaytar</string>
|
||||
@@ -194,223 +190,217 @@
|
||||
|
||||
<string name="restore_fail">Stock nüsxə mövcud deyil!</string>
|
||||
|
||||
<string name="proprietary_title">Download Proprietary Code</string>
|
||||
<string name="proprietary_title">Özəl kodu yükləyin</string>
|
||||
|
||||
<string name="proprietary_notice">Magisk Manager is FOSS and doesn\'t contain Google\'s proprietary SafetyNet API code.\n\nWill you allow Magisk Manager to download an extension (contains GoogleApiClient) for SafetyNet checks?</string>
|
||||
<string name="proprietary_notice">Magisk Manager açıq lisenziyalıdır və Google\'ın özəl SafetyNet API kodunu ehtiva etmir.\n\Magisk Managerə SafetyNet yoxlamaları üçün tərkibində GoogleApiClient olan əlavəni yükləməyə icazə verirsiniz?</string>
|
||||
|
||||
<string name="setup_done">Setup done.</string>
|
||||
<string name="setup_fail">Quraşdırma alınmadı.</string>
|
||||
|
||||
<string name="setup_fail">Setup failed.</string>
|
||||
<string name="env_fix_title">Əlavə Quraşdırma Lazımdır</string>
|
||||
|
||||
<string name="env_fix_title">Requires Additional Setup</string>
|
||||
<string name="env_fix_msg">Cihazınızın Magisk\'in düzgün işləməsi üçün əlavə quraşdırmaya ehtiyacı var . Bu Magisk zip faylını endirəcək, davam etmək istəyirsiniz?</string>
|
||||
|
||||
<string name="env_fix_msg">Your device needs additional setup for Magisk to work properly. It will download the Magisk setup zip, do you want to proceed now?</string>
|
||||
<string name="setup_title">Əlavə quraşdırma</string>
|
||||
|
||||
<string name="setup_title">Additional Setup</string>
|
||||
<string name="setup_msg">Quraşdırma yerinə yetirilir…</string>
|
||||
|
||||
<string name="setup_msg">Running environment setup…</string>
|
||||
<string name="downloading_toast">%1$s yüklənir</string>
|
||||
|
||||
<string name="downloading_toast">Downloading %1$s</string>
|
||||
<string name="no_rw_storage">Bu xüsusiyyət xarici yaddaş icazəsi olmadan düzgün işləməyəcək.</string>
|
||||
|
||||
<string name="no_rw_storage">This feature will not work without permission to write external storage.</string>
|
||||
|
||||
<string name="dl_one_module">Download one module at a time.</string>
|
||||
<string name="dl_one_module">Bir dəfədə bir əlavə yüklə.</string>
|
||||
|
||||
<!--Settings Activity -->
|
||||
|
||||
<string name="settings_general_category">General</string>
|
||||
<string name="settings_general_category">Ümumi</string>
|
||||
|
||||
<string name="settings_dark_theme_title">Dark Theme</string>
|
||||
<string name="settings_dark_theme_title">Qaranlıq Mövzu</string>
|
||||
|
||||
<string name="settings_dark_theme_summary">Enable dark theme.</string>
|
||||
<string name="settings_dark_theme_summary">Qaranlıq mövzunu aç.</string>
|
||||
|
||||
<string name="settings_clear_cache_title">Clear Repo Cache</string>
|
||||
<string name="settings_clear_cache_title">Repo Keşini Təmizlə</string>
|
||||
|
||||
<string name="settings_clear_cache_summary">Clear the cached information for online repos. This forces the app to refresh online.</string>
|
||||
<string name="settings_clear_cache_summary">Onlayn repolar üçün keşlənmiş məlumatı silin. Bu tətbiqi onlayn şəkildə yenilənməyə məcbur edir.</string>
|
||||
|
||||
<string name="settings_hide_manager_title">Hide Magisk Manager</string>
|
||||
<string name="settings_hide_manager_title">Magisk Manager\'i Gizlə</string>
|
||||
|
||||
<string name="settings_hide_manager_summary">Repackage Magisk Manager with random package name.</string>
|
||||
<string name="settings_hide_manager_summary">Magisk Manageri\'i təsadüfi adla yenidən sıxışdır.</string>
|
||||
|
||||
<string name="settings_restore_manager_title">Restore Magisk Manager</string>
|
||||
<string name="settings_restore_manager_title">Magisk Manager\'i Geri Qaytar</string>
|
||||
|
||||
<string name="settings_restore_manager_summary">Restore Magisk Manager with original package</string>
|
||||
<string name="settings_restore_manager_summary">Magisk Manageri\'i orjinal sıxışdırma ilə geri qaytar</string>
|
||||
|
||||
<string name="language">Language</string>
|
||||
<string name="language">Dil</string>
|
||||
|
||||
<string name="system_default">(System Default)</string>
|
||||
<string name="system_default">(Sistem Dili)</string>
|
||||
|
||||
<string name="settings_update">Update Settings</string>
|
||||
<string name="settings_update">Tənzimləmələri Yenilə</string>
|
||||
|
||||
<string name="settings_check_update_title">Check Updates</string>
|
||||
<string name="settings_check_update_title">Yeniləmələri Yoxla</string>
|
||||
|
||||
<string name="settings_check_update_summary">Periodically check for updates in the background.</string>
|
||||
<string name="settings_check_update_summary">Axraplanda vaxtaşırı yeniləmələri yoxla.</string>
|
||||
|
||||
<string name="settings_update_channel_title">Update Channel</string>
|
||||
<string name="settings_update_channel_title">Kanalı Yenilə</string>
|
||||
|
||||
<string name="settings_update_stable">Stable</string>
|
||||
<string name="settings_update_stable">Stabil</string>
|
||||
|
||||
<string name="settings_update_beta">Beta</string>
|
||||
|
||||
<string name="settings_update_custom">Custom</string>
|
||||
<string name="settings_update_custom">Özəl</string>
|
||||
|
||||
<string name="settings_update_custom_msg">Insert a custom URL</string>
|
||||
<string name="settings_update_custom_msg">Özəl URL daxil edin</string>
|
||||
|
||||
<string name="settings_boot_format_title">Patched Boot Output Format</string>
|
||||
<string name="settings_core_only_title">Magisk Yalnız Nüvə Modu</string>
|
||||
|
||||
<string name="settings_boot_format_summary">Select the format for the output patched boot image.\nChoose .img to flash through fastboot/download mode; choose .img.tar to flash with ODIN.</string>
|
||||
<string name="settings_core_only_summary">Yalnız nüvə xüsusiyyətlərini aç. MagiskSU və MagiskHide hələ də açıq qalacaq, amma əlavələr yüklənməyəcək.</string>
|
||||
|
||||
<string name="settings_core_only_title">Magisk Core Only Mode</string>
|
||||
<string name="settings_magiskhide_summary">Magisk\'i fərqli növdə aşkarlamalardan gizləyin.</string>
|
||||
|
||||
<string name="settings_core_only_summary">Enable only core features. MagiskSU and MagiskHide will still be enabled, but no modules will be loaded.</string>
|
||||
<string name="settings_hosts_title">Sistemsiz host\'lar</string>
|
||||
|
||||
<string name="settings_magiskhide_summary">Hide Magisk from various forms of detection.</string>
|
||||
<string name="settings_hosts_summary">Adblock tətbiqləri üçün Sistemsiz host dəstəyi.</string>
|
||||
|
||||
<string name="settings_hosts_title">Systemless hosts</string>
|
||||
<string name="settings_hosts_toast">Sistemsiz host əlavəsi quraşdırıldı</string>
|
||||
|
||||
<string name="settings_hosts_summary">Systemless hosts support for Adblock apps.</string>
|
||||
<string name="settings_su_app_adb">Tətbiqlər və ADB</string>
|
||||
|
||||
<string name="settings_hosts_toast">Added systemless hosts module</string>
|
||||
<string name="settings_su_app">Yalnız Tətbiqlər</string>
|
||||
|
||||
<string name="settings_su_app_adb">Apps and ADB</string>
|
||||
<string name="settings_su_adb">Yalnız ADB</string>
|
||||
|
||||
<string name="settings_su_app">Apps only</string>
|
||||
<string name="settings_su_disable">Qapalı</string>
|
||||
|
||||
<string name="settings_su_adb">ADB only</string>
|
||||
<string name="settings_su_request_10">10 saniyə</string>
|
||||
|
||||
<string name="settings_su_disable">Disabled</string>
|
||||
<string name="settings_su_request_15">15 saniyə</string>
|
||||
|
||||
<string name="settings_su_request_10">10 seconds</string>
|
||||
<string name="settings_su_request_20">20 saniyə</string>
|
||||
|
||||
<string name="settings_su_request_15">15 seconds</string>
|
||||
<string name="settings_su_request_30">30 saniyə</string>
|
||||
|
||||
<string name="settings_su_request_20">20 seconds</string>
|
||||
<string name="settings_su_request_45">45 saniyə</string>
|
||||
|
||||
<string name="settings_su_request_30">30 seconds</string>
|
||||
<string name="settings_su_request_60">60 saniyə</string>
|
||||
|
||||
<string name="settings_su_request_45">45 seconds</string>
|
||||
<string name="superuser_access">Superuser İcazəsi</string>
|
||||
|
||||
<string name="settings_su_request_60">60 seconds</string>
|
||||
<string name="auto_response">Avtomatik Cavab</string>
|
||||
|
||||
<string name="superuser_access">Superuser Access</string>
|
||||
<string name="request_timeout">İcazə Vaxtaşımı</string>
|
||||
|
||||
<string name="auto_response">Automatic Response</string>
|
||||
<string name="superuser_notification">Superuser Bildirişləri</string>
|
||||
|
||||
<string name="request_timeout">Request Timeout</string>
|
||||
<string name="request_timeout_summary">%1$d saniyə</string>
|
||||
|
||||
<string name="superuser_notification">Superuser Notification</string>
|
||||
<string name="settings_su_reauth_title">Yüksəltmədən sonra Yenidən İdentifikasiya et</string>
|
||||
|
||||
<string name="request_timeout_summary">%1$d seconds</string>
|
||||
<string name="settings_su_reauth_summary">Tətbiq yeniləmələridən sonra superuser icazələrini yenidən identifikasiya et</string>
|
||||
|
||||
<string name="settings_su_reauth_title">Reauthenticate after upgrade</string>
|
||||
<string name="settings_su_fingerprint_title">Barmaq İzi İdentifikasiyasını Aç</string>
|
||||
|
||||
<string name="settings_su_reauth_summary">Reauthenticate superuser permissions after an application upgrades</string>
|
||||
<string name="settings_su_fingerprint_summary">Barmaq izi oxuyucunu superuser icazələri üçün işlət</string>
|
||||
|
||||
<string name="settings_su_fingerprint_title">Enable Fingerprint Authentication</string>
|
||||
<string name="auth_fingerprint">Barmaq izini İdentifikasiya et</string>
|
||||
|
||||
<string name="settings_su_fingerprint_summary">Use fingerprint scanner to allow superuser requests</string>
|
||||
<string name="multiuser_mode">Çox-istifadəçi modu</string>
|
||||
|
||||
<string name="auth_fingerprint">Authenticate Fingerprint</string>
|
||||
<string name="settings_owner_only">Yalnız cihaz sahibi</string>
|
||||
|
||||
<string name="multiuser_mode">Multiuser Mode</string>
|
||||
<string name="settings_owner_manage">Cihaz sahibinin idarəçiliyində</string>
|
||||
|
||||
<string name="settings_owner_only">Device Owner Only</string>
|
||||
<string name="settings_user_independent">İstifadəçidən asılı olmayaraq</string>
|
||||
|
||||
<string name="settings_owner_manage">Device Owner Managed</string>
|
||||
<string name="owner_only_summary">Yalnız cihaz sahibinin root icazəsi var.</string>
|
||||
|
||||
<string name="settings_user_independent">User-Independent</string>
|
||||
<string name="owner_manage_summary">Yalnız cihaz sahibi root icazələrini redaktə edə və icazə istəkləri qəbul edə bilər.</string>
|
||||
|
||||
<string name="owner_only_summary">Only owner has root access.</string>
|
||||
<string name="user_indepenent_summary">Hər istifadəçinin ayrı root qaydaları var.</string>
|
||||
|
||||
<string name="owner_manage_summary">Only owner can manage root access and receive request prompts.</string>
|
||||
<string name="mount_namespace_mode">Namespace Modunu Qoş</string>
|
||||
|
||||
<string name="user_indepenent_summary">Each user has his/her own separate root rules.</string>
|
||||
<string name="settings_ns_global">Qlobal Namespace</string>
|
||||
|
||||
<string name="mount_namespace_mode">Mount Namespace Mode</string>
|
||||
<string name="settings_ns_requester">Keçmə Namespace</string>
|
||||
|
||||
<string name="settings_ns_global">Global Namespace</string>
|
||||
<string name="settings_ns_isolate">Ayrılmış Namespace</string>
|
||||
|
||||
<string name="settings_ns_requester">Inherit Namespace</string>
|
||||
<string name="global_summary">Bütün root sessyaları qlobal qoşma namespace\'dən istifadə edir.</string>
|
||||
|
||||
<string name="settings_ns_isolate">Isolated Namespace</string>
|
||||
<string name="requester_summary">Root sessyaları soruşulan namespace\'ləri birindən digərinə keçirəcək.</string>
|
||||
|
||||
<string name="global_summary">All root sessions use the global mount namespace.</string>
|
||||
<string name="isolate_summary">Hər bir root sessyasının ayrılmış namespace\'i olacaq.</string>
|
||||
|
||||
<string name="requester_summary">Root sessions will inherit their requester\'s namespace.</string>
|
||||
<string name="android_o_not_support">Android 8.0+\'da dəstəklənmir.</string>
|
||||
|
||||
<string name="isolate_summary">Each root session will have its own isolated namespace.</string>
|
||||
|
||||
<string name="android_o_not_support">Does not support Android 8.0+.</string>
|
||||
|
||||
<string name="disable_fingerprint">No fingerprints were set or no device support.</string>
|
||||
<string name="disable_fingerprint">Barmaq izi təyin edilməyib ya da dəstəklənmir.</string>
|
||||
|
||||
<!--Superuser-->
|
||||
|
||||
<string name="su_request_title">Superuser Request</string>
|
||||
<string name="su_request_title">Superuser Tələbi</string>
|
||||
|
||||
<string name="deny_with_str">Deny%1$s</string>
|
||||
<string name="deny_with_str">Ləğv et%1$s</string>
|
||||
|
||||
<string name="deny">Deny</string>
|
||||
<string name="deny">Ləğv et</string>
|
||||
|
||||
<string name="prompt">Prompt</string>
|
||||
<string name="prompt">Yönləndir</string>
|
||||
|
||||
<string name="grant">Grant</string>
|
||||
<string name="grant">Təmin et</string>
|
||||
|
||||
<string name="su_warning">Grants full access to your device.\nDeny if you\'re not sure!</string>
|
||||
<string name="su_warning">Cihazın tam icazəsi ilə təmin edin.\nƏmin deyilsinizsə ləğv edin!</string>
|
||||
|
||||
<string name="forever">Forever</string>
|
||||
<string name="forever">Sonsuz</string>
|
||||
|
||||
<string name="once">Once</string>
|
||||
<string name="once">Bir dəfəlik</string>
|
||||
|
||||
<string name="tenmin">10 mins</string>
|
||||
<string name="tenmin">10 dəq</string>
|
||||
|
||||
<string name="twentymin">20 mins</string>
|
||||
<string name="twentymin">20 dəq</string>
|
||||
|
||||
<string name="thirtymin">30 mins</string>
|
||||
<string name="thirtymin">30 dəq</string>
|
||||
|
||||
<string name="sixtymin">60 mins</string>
|
||||
<string name="sixtymin">60 dəq</string>
|
||||
|
||||
<string name="su_allow_toast">%1$s was granted Superuser rights</string>
|
||||
<string name="su_allow_toast">%1$s SuperUser icazəsi ilə təmin edildi</string>
|
||||
|
||||
<string name="su_deny_toast">%1$s was denied Superuser rights</string>
|
||||
<string name="su_deny_toast">%1$s SuperUser icazəsi ilə təmin edilmədi</string>
|
||||
|
||||
<string name="no_apps_found">No apps found</string>
|
||||
<string name="no_apps_found">Tətbiq yoxdur</string>
|
||||
|
||||
<string name="su_snack_grant">Superuser rights of %1$s are granted</string>
|
||||
<string name="su_snack_grant">%1$s üçün Superuser icazəsi verilib</string>
|
||||
|
||||
<string name="su_snack_deny">Superuser rights of %1$s are denied</string>
|
||||
<string name="su_snack_deny">%1$s üçün Superuser icazəsi verilməyib</string>
|
||||
|
||||
<string name="su_snack_notif_on">Notifications of %1$s are enabled</string>
|
||||
<string name="su_snack_notif_on">%1$s üçün bildirişlər açıqdır</string>
|
||||
|
||||
<string name="su_snack_notif_off">Notifications of %1$s are disabled</string>
|
||||
<string name="su_snack_notif_off">%1$s üçün bildirişlər bağlıdır</string>
|
||||
|
||||
<string name="su_snack_log_on">Logging of %1$s is enabled</string>
|
||||
<string name="su_snack_log_on">%1$s üçün giriş açıqdır</string>
|
||||
|
||||
<string name="su_snack_log_off">Logging of %1$s is disabled</string>
|
||||
<string name="su_snack_log_off">%1$s üçün giriş bağlıdır</string>
|
||||
|
||||
<string name="su_snack_revoke">%1$s rights are revoked</string>
|
||||
<string name="su_snack_revoke">%1$s üçün icazələr ləğv olundu</string>
|
||||
|
||||
<string name="su_revoke_title">Revoke?</string>
|
||||
<string name="su_revoke_title">Ləğv olunsun?</string>
|
||||
|
||||
<string name="su_revoke_msg">Confirm to revoke %1$s rights?</string>
|
||||
<string name="su_revoke_msg">%1$s üçün haqları ləğv etməyi təsdiq edirsiniz?</string>
|
||||
|
||||
<string name="toast">Toast</string>
|
||||
<string name="toast">Tost</string>
|
||||
|
||||
<string name="none">None</string>
|
||||
<string name="none">Heçnə</string>
|
||||
|
||||
<string name="auth_fail">Authentication Failed</string>
|
||||
<string name="auth_fail">İdentifikasiya xətası</string>
|
||||
|
||||
<!--Superuser logs-->
|
||||
|
||||
<string name="pid">PID: %1$d</string>
|
||||
|
||||
<string name="target_uid">Target UID: %1$d</string>
|
||||
<string name="target_uid">Hədəf UID: %1$d</string>
|
||||
|
||||
<string name="command">Command: %1$s</string>
|
||||
<string name="command">Komanda: %1$s</string>
|
||||
|
||||
<!-- MagiskHide -->
|
||||
|
||||
<string name="show_system_app">Show system apps</string>
|
||||
<string name="show_system_app">Sistem tətbiqlərini göstər</string>
|
||||
|
||||
</resources>
|
||||
|
||||
|
@@ -84,13 +84,11 @@
|
||||
<string name="hide_manager_fail_toast">Скриването на Magisk Manager бе неуспешно.</string>
|
||||
<string name="open_link_failed_toast">Не бе намерено приложение за отваряне на линка.</string>
|
||||
<string name="download_zip_only">Изтегляне само на архив</string>
|
||||
<string name="patch_boot_file">Модифициране на Boot образа</string>
|
||||
<string name="direct_install">Директно инсталиране (Препоръчва се.)</string>
|
||||
<string name="install_inactive_slot">Инсталиране на неактивен слот (След OTA)</string>
|
||||
<string name="warning">Внимание</string>
|
||||
<string name="install_inactive_slot_msg">Вашето устройство НАЛОЖИТЕЛНО ще стартира текущия неактивен слот при следващото рестартиране.\nИзползвайте тази опция само след като приключи инсталирането на OTA.\nПродължаване?</string>
|
||||
. <string name="select_method">Избор на метод</string>
|
||||
<string name="boot_file_patch_msg">Изберете стоков boot образ с формат .img или .img.tar.</string>
|
||||
<string name="complete_uninstall">Пълно деинсталиране</string>
|
||||
<string name="restore_img">Възстановяване на образи</string>
|
||||
<string name="restore_img_msg">Възстановяване…</string>
|
||||
@@ -98,7 +96,6 @@
|
||||
<string name="restore_fail">Не е налице архив на стоковия образ!</string>
|
||||
<string name="proprietary_title">Изтегляне на патентования код</string>
|
||||
<string name="proprietary_notice">Magisk Manager е FOSS и затова не включва патентования код за SafetyNet ППИ на Google.\n\nПозволявате ли на Magisk Manager да изтегли добавката (включва GoogleApiClient) за SafetyNet проверки?</string>
|
||||
<string name="setup_done">Първоначалната настройка е готова.</string>
|
||||
<string name="setup_fail">Първоначалната настройка е неуспешна.</string>
|
||||
<string name="env_fix_title">Изисква допълнително настройване</string>
|
||||
<string name="env_fix_msg">Вашето устройство се нуждае от допълнително надстройване на Magisk, за да работи нормално. Ще бъде изтеглен архивът за надстройка на Magisk. Желаете ли да продължите?</string>
|
||||
@@ -128,8 +125,6 @@
|
||||
<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">Изходен формат за модифициран boot образ</string>
|
||||
<string name="settings_boot_format_summary">Избор на изходен формат за модифициран boot образ.\nИзберете .img за инсталиране чрез fastboot/даунлоуд режима; изберете .img.tar за инсталиране чрез ODIN.</string>
|
||||
<string name="settings_core_only_title">Режим Magisk Core Only</string>
|
||||
<string name="settings_core_only_summary">Работят само основни функции, като MagiskSU и MagiskHide, без всякакви модули.</string>
|
||||
<string name="settings_magiskhide_summary">Скриване на Magisk от различни детектори.</string>
|
||||
|
@@ -92,13 +92,11 @@
|
||||
<string name="hide_manager_fail_toast">L\'amagament de Magisk Manager ha fallat.</string>
|
||||
<string name="open_link_failed_toast">No s\'ha trobat una aplicació per obrir l\'enllaç.</string>
|
||||
<string name="download_zip_only">Descarrega només el ZIP</string>
|
||||
<string name="patch_boot_file">Arranja l\'imatge d\'arrencada</string>
|
||||
<string name="direct_install">Instal·lació directa (Recomanat)</string>
|
||||
<string name="install_inactive_slot">Instal·lar a la ranura inactiva (Després d\'una OTA)</string>
|
||||
<string name="warning">Avís</string>
|
||||
<string name="install_inactive_slot_msg">El teu dispositiu serà FORÇAT a arrancar en la ranura inactiva després de reiniciar!\nUtilitza aquesta opció només quan s\'hagi fet la OTA.\nContinuar?</string>
|
||||
<string name="select_method">Selecciona mètode</string>
|
||||
<string name="boot_file_patch_msg">Seleccioneu l\'arxiu de bolcat de l\'arrencada en format .img o img.tar.</string>
|
||||
<string name="complete_uninstall">Desinstal·lació completa</string>
|
||||
<string name="restore_img">Restaura imatges</string>
|
||||
<string name="restore_img_msg">Restaurant…</string>
|
||||
@@ -106,7 +104,6 @@
|
||||
<string name="restore_fail">La còpia de seguretat de Stock no existeix!</string>
|
||||
<string name="proprietary_title">Descarrega codi propietari</string>
|
||||
<string name="proprietary_notice">Magisk Manager és codi lliure i no conté codi de l\'API de SafetyNet, ja que és codi propietari de Google.\n\nPot permetre que Magisk Manager descarregui una extensió que conté el GoogleApiClient per poder fer la comprobació de SafetyNet?</string>
|
||||
<string name="setup_done">Instal·lació realitzada.</string>
|
||||
<string name="setup_fail">Instal·lació fallida.</string>
|
||||
<string name="env_fix_title">Es requereix instal·lació addicional</string>
|
||||
<string name="env_fix_msg">El teu dispositiu necessita instal·lació addicional per Magisk per funcionar correctament. Es descarregarà el ZIP d\'instal·lació de Magisk , vol procedir a l\'instalació ara?</string>
|
||||
@@ -136,8 +133,6 @@
|
||||
<string name="settings_update_beta">Beta</string>
|
||||
<string name="settings_update_custom">Personalitzat</string>
|
||||
<string name="settings_update_custom_msg">Inserta una URL personalitzada</string>
|
||||
<string name="settings_boot_format_title">Arranja la imatge d’arrancada segons el tipus de format</string>
|
||||
<string name="settings_boot_format_summary">Seleccionar el format de sortida per arranjar la imatge d’arrancada.\nTriï .img per flashejar mitcançant fastboot/download; triï .img.tar per flashejar amb ODIN.</string>
|
||||
<string name="settings_core_only_title">Mode únicament nucli de Magisk</string>
|
||||
<string name="settings_core_only_summary">Habilitar només les funcions principals, no es carregaran tots els mòduls. MagiskSU y MagiskHide seguirán habilitats</string>
|
||||
<string name="settings_magiskhide_summary">Amagar Magisk de varies deteccions</string>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<resources>
|
||||
<!--Universal-->
|
||||
|
||||
<!--Welcome Activity-->
|
||||
<string name="modules">Moduly</string>
|
||||
@@ -8,78 +7,146 @@
|
||||
<string name="log">Log</string>
|
||||
<string name="settings">Nastavení</string>
|
||||
<string name="install">Instalovat</string>
|
||||
<string name="unsupport_magisk_title">Nepodporovaná verze Magisk</string>
|
||||
<string name="unsupport_magisk_message">Tato verze Magisk Managera nepodporuje verzi Magisk nižší než v18.0.\n\nMůžete buď ručně aktualizovat Magisk, nebo aplikaci downgradovat na starší verzi.</string>
|
||||
|
||||
<!--Status Fragment-->
|
||||
<string name="magisk_version_error">Magisk není nainstalován</string>
|
||||
|
||||
<string name="magisk_version_error">Magisk není nainstalován.</string>
|
||||
<string name="checking_for_updates">Kontrola aktualizací…</string>
|
||||
<string name="safetyNet_check_text">Kliknutím zahájíte SafetyNet kontrolu</string>
|
||||
<string name="invalid_update_channel">Neplatný kanál aktualizace</string>
|
||||
<string name="safetyNet_check_text">Klepnutím spustíte kontrolu SafetyNet</string>
|
||||
<string name="checking_safetyNet_status">Kontrola stavu SafetyNet…</string>
|
||||
|
||||
<!--Install Fragment-->
|
||||
<string name="advanced_settings_title">Pokročilá Nastavení</string>
|
||||
<string name="safetyNet_check_success">Kontrola SafetyNet úspěšná</string>
|
||||
<string name="safetyNet_api_error">Chyba SafetyNet API</string>
|
||||
<string name="safetyNet_res_invalid">Odpověď je neplatná.</string>
|
||||
<string name="magisk_up_to_date">Magisk je aktuální</string>
|
||||
<string name="manager_up_to_date">Magisk Manager je aktuální</string>
|
||||
<string name="advanced_settings_title">Pokročilá nastavení</string>
|
||||
<string name="keep_force_encryption">Udržet "force encryption"</string>
|
||||
<string name="keep_dm_verity">Udržet AVB 2.0/dm-verity</string>
|
||||
<string name="current_installed">Nainstalovaná: %1$s</string>
|
||||
<string name="latest_version">Poslední: %1$s</string>
|
||||
<string name="keep_dm_verity">Udržet "AVB 2.0/dm-verity"</string>
|
||||
<string name="current_installed">Nainstalovaná verze: %1$s</string>
|
||||
<string name="latest_version">Poslední verze: %1$s</string>
|
||||
<string name="uninstall">Odinstalovat</string>
|
||||
<string name="uninstall_magisk_title">Odinstalovat Magisk</string>
|
||||
<string name="uninstall_magisk_msg">Všechny moduly budou zakázány/odstraněny. Root bude odstraněn a pokud jsou data dešifrována, můžou být zašifrována.</string>
|
||||
<string name="update">Aktualizovat</string>
|
||||
<string name="core_only_enabled">(Je povolen pouze režim jádra)</string>
|
||||
|
||||
<!--Module Fragment-->
|
||||
<string name="no_info_provided">(Žádné info)</string>
|
||||
<string name="no_modules_found">Žádný modul nenalezen</string>
|
||||
<string name="update_file_created">Modul bude aktualizován během příštího restartu</string>
|
||||
<string name="remove_file_created">Modul bude smazán během příštího restartu</string>
|
||||
<string name="remove_file_deleted">Modul nebude smazán během příštího restartu</string>
|
||||
<string name="disable_file_created">Modul bude zakázán během příštího restartu</string>
|
||||
<string name="disable_file_removed">Modul bude povolen během příštího restartu</string>
|
||||
<string name="no_info_provided">(Žádné informace)</string>
|
||||
<string name="no_modules_found">Nebyly nalezeny žádné moduly.</string>
|
||||
<string name="update_file_created">Modul bude aktualizován během příštího restartu.</string>
|
||||
<string name="remove_file_created">Modul bude smazán během příštího restartu.</string>
|
||||
<string name="remove_file_deleted">Modul nebude smazán během příštího restartu.</string>
|
||||
<string name="disable_file_created">Modul bude zakázán během příštího restartu.</string>
|
||||
<string name="disable_file_removed">Modul nebude zakázán během příštího restartu.</string>
|
||||
<string name="author">Vytvořeno %1$s</string>
|
||||
<string name="reboot_recovery">Restartovat do Recovery</string>
|
||||
<string name="reboot_bootloader">Restartovat do Bootloaderu</string>
|
||||
<string name="reboot_download">Restartovat do Download</string>
|
||||
|
||||
<!--Repo Fragment-->
|
||||
<string name="update_available">Dostupná Aktualizace</string>
|
||||
<string name="update_available">Dostupná aktualizace</string>
|
||||
<string name="installed">Nainstalováno</string>
|
||||
<string name="not_installed">Nenainstalováno</string>
|
||||
<string name="updated_on">Aktualizováno: %1$s</string>
|
||||
<string name="sorting_order">Pořadí řazení</string>
|
||||
<string name="sort_by_name">Seřadit dle názvu</string>
|
||||
<string name="sort_by_update">Seřadit dle poslední aktualizace</string>
|
||||
|
||||
<!--Log Fragment-->
|
||||
<string name="menuSaveLog">Uložit log</string>
|
||||
<string name="menuReload">Aktualizovat</string>
|
||||
<string name="menuClearLog">Smazat Log</string>
|
||||
<string name="logs_cleared">Log byl smazán</string>
|
||||
<string name="log_is_empty">Log je prázdný</string>
|
||||
<string name="menuReload">Znovu načíst</string>
|
||||
<string name="menuClearLog">Smazat log</string>
|
||||
<string name="logs_cleared">Log byl smazán.</string>
|
||||
<string name="log_is_empty">Log je prázdný.</string>
|
||||
|
||||
<!--About Activity-->
|
||||
<string name="app_changelog">Seznam změn</string>
|
||||
<string name="translators" />
|
||||
<string name="app_translators">Překladatelé aplikace</string>
|
||||
<string name="translators">gargamelek, novas78</string>
|
||||
<string name="app_translators">Překladatelé</string>
|
||||
|
||||
<!-- System Components, Notifications -->
|
||||
<string name="update_channel">Aktualizace Magisk</string>
|
||||
<string name="progress_channel">Oznámení o průběhu</string>
|
||||
<string name="download_complete">Stahování dokončeno</string>
|
||||
<string name="download_file_error">Chyba při stahování souboru</string>
|
||||
<string name="magisk_update_title">Aktualizace Magisk je dostupná!</string>
|
||||
<string name="manager_update_title">Aktualizace Magisk Manager je dostupná!</string>
|
||||
|
||||
<!-- Installation -->
|
||||
<string name="manager_download_install">Stiskněte pro stažení a instalaci.</string>
|
||||
<string name="download_zip_only">Stáhnout pouze zip</string>
|
||||
<string name="direct_install">Přímá instalace (doporučeno)</string>
|
||||
<string name="install_inactive_slot">Instalace do druhého slotu (po OTA)</string>
|
||||
<string name="install_inactive_slot_msg">Vaše zařízení bude po restartu VYNUCENĚ spuštěno do aktuálního neaktivního slotu!\nTuto možnost použijte pouze po dokončení OTA.\nPokračovat?</string>
|
||||
<string name="select_method">Vyberte metodu</string>
|
||||
<string name="setup_title">Další nastavení</string>
|
||||
<string name="select_patch_file">Vybrat a opravit soubor</string>
|
||||
<string name="patch_file_msg">Vyberte obraz raw (*.img) nebo soubor tar pro ODIN (*.tar)</string>
|
||||
<string name="reboot_delay_toast">Restartování za 5 sekund…</string>
|
||||
|
||||
<!--Toasts, Dialogs-->
|
||||
|
||||
<string name="close">Zavřít</string>
|
||||
<string name="repo_install_title">Instalovat %1$s</string>
|
||||
<string name="repo_install_msg">Chcete nainstalovat %1$s ?</string>
|
||||
<string name="repo_install_msg">Chcete nyní nainstalovat %1$s?</string>
|
||||
<string name="download">Stáhnout</string>
|
||||
<string name="reboot">Restart</string>
|
||||
<string name="magisk_update_title">K dispozici je aktualizace Magisk!</string>
|
||||
<string name="settings_reboot_toast">Restartovat pro použití nastavení</string>
|
||||
<string name="reboot">Restartovat</string>
|
||||
<string name="settings_reboot_toast">Restartovat pro použití nastavení.</string>
|
||||
<string name="release_notes">Poznámky k vydání</string>
|
||||
<string name="repo_cache_cleared">Mezipaměť smazána</string>
|
||||
<string name="internal_storage">Zip je uchován v:\n[Interním Úložišti]%1$s</string>
|
||||
<string name="download_file_error">Chyba při Stahování souboru</string>
|
||||
<string name="internal_storage">Zip soubor je uložen v:\n[Interním úložišti]%1$s</string>
|
||||
|
||||
<string name="dtbo_patched_title">DTBO opraveno!</string>
|
||||
<string name="dtbo_patched_reboot">Magisk Manager opravil dtbo.img, restartujte prosím</string>
|
||||
<string name="flashing">Instalování</string>
|
||||
<string name="hide_manager_title">Skrytí Magisk Manageru…</string>
|
||||
<string name="hide_manager_fail_toast">Skrytí Magisk Manageru selhalo.</string>
|
||||
<string name="open_link_failed_toast">Nebyla nalezena žádná aplikace pro otevření odkazu.</string>
|
||||
<string name="warning">Varování</string>
|
||||
<string name="complete_uninstall">Dokončete odinstalaci</string>
|
||||
<string name="restore_img">Obnovit obrazy</string>
|
||||
<string name="restore_img_msg">Obnovování…</string>
|
||||
<string name="restore_done">Obnovení bylo provedeno!</string>
|
||||
<string name="restore_fail">Výchozí záloha neexistuje!</string>
|
||||
<string name="proprietary_title">Stáhnout proprietární kód</string>
|
||||
<string name="proprietary_notice">Magisk Manager je FOSS a neobsahuje proprietární kód SafetyNet API společnosti Google.\n\nChcete povolit aplikaci Magisk Manager stažení rozšíření (obsahuje GoogleApiClient) pro kontrolu SafetyNet?</string>
|
||||
<string name="setup_fail">Nastavení selhalo.</string>
|
||||
<string name="env_fix_title">Vyžaduje se další nastavení</string>
|
||||
<string name="env_fix_msg">Vaše zařízení potřebuje další nastavení, aby Magisk fungoval správně. Stáhne se instalační zip Magisk, chcete pokračovat?</string>
|
||||
<string name="setup_msg">Nastavení je spuštěno…</string>
|
||||
<string name="downloading_toast">Stahování %1$s</string>
|
||||
<string name="no_rw_storage">Tato funkce nebude fungovat bez povolení k zápisu na externí úložiště.</string>
|
||||
<string name="no_rw_storage">Tato funkce nebude fungovat bez povolení k zápisu do externího úložiště.</string>
|
||||
<string name="dl_one_module">Stáhnout vždy jeden modul.</string>
|
||||
|
||||
<!--Settings Activity -->
|
||||
<string name="settings_general_category">Obecné</string>
|
||||
<string name="settings_dark_theme_title">Tmavý Vzhled</string>
|
||||
<string name="settings_dark_theme_summary">Povolit tmavý vzhled</string>
|
||||
<string name="settings_clear_cache_title">Smazat Uchovanou Mezipaměť</string>
|
||||
<string name="settings_clear_cache_summary">Smaže informace online použití v Mezipaměti, donutí aplikaci obnovit informace online</string>
|
||||
<string name="settings_dark_theme_title">Tmavý motiv</string>
|
||||
<string name="settings_dark_theme_summary">Povolit tmavý motiv.</string>
|
||||
<string name="settings_clear_cache_title">Smazat uchovanou mezipaměť</string>
|
||||
<string name="settings_clear_cache_summary">Smaže informace online použití v mezipaměti, donutí aplikaci obnovit informace online.</string>
|
||||
<string name="settings_hide_manager_title">Skrýt Magisk Manager</string>
|
||||
<string name="settings_hide_manager_summary">Nahradí Magisk Manager náhodným názvem balíčku.</string>
|
||||
<string name="settings_restore_manager_title">Obnovit Magisk Manager</string>
|
||||
<string name="settings_restore_manager_summary">Obnoví Magisk Manager na původní název balíčku.</string>
|
||||
<string name="language">Jazyk</string>
|
||||
<string name="system_default">(Výchozí systémový)</string>
|
||||
<string name="settings_update">Aktualizace - nastavení</string>
|
||||
<string name="settings_check_update_title">Zkontrolovat aktualizace</string>
|
||||
<string name="settings_check_update_summary">Pravidelně kontrolujte aktualizace na pozadí.</string>
|
||||
<string name="settings_update_channel_title">Kanál aktualizace</string>
|
||||
<string name="settings_update_stable">Stabilní</string>
|
||||
<string name="settings_update_beta">Beta</string>
|
||||
<string name="settings_update_custom">Vlastní</string>
|
||||
<string name="settings_update_custom_msg">Vložte vlastní URL</string>
|
||||
<string name="settings_core_only_title">Režim pouze Magisk Core</string>
|
||||
<string name="settings_core_only_summary">Povolit pouze funkce jádra. MagiskSU, MagiskHide a nesystémoví hostitelé budou stále povoleni, ale žádné moduly nebudou načteny.</string>
|
||||
<string name="settings_magiskhide_summary">Skrýt Magisk z různých detekcí.</string>
|
||||
<string name="settings_hosts_title">Nesystémoví hostitelé</string>
|
||||
<string name="settings_hosts_summary">Podpora nesystémových hostitelů pro aplikace Adblock.</string>
|
||||
<string name="settings_hosts_toast">Přidán systémový modul hostitelů</string>
|
||||
|
||||
<string name="settings_magiskhide_summary">Skryje root (MagiskSU) před různými aplikacemi</string>
|
||||
<string name="settings_hosts_title">Nesystémová "hosts" data</string>
|
||||
<string name="settings_hosts_summary">Podpora nesystémových dat "hosts" pro Adblock aplikace</string>
|
||||
|
||||
<string name="settings_su_app_adb">Aplikace i ADB</string>
|
||||
<string name="settings_su_app_adb">Aplikace a ADB</string>
|
||||
<string name="settings_su_app">Pouze aplikace</string>
|
||||
<string name="settings_su_adb">Pouze ADB</string>
|
||||
<string name="settings_su_disable">Zakázáno</string>
|
||||
@@ -90,10 +157,33 @@
|
||||
<string name="settings_su_request_45">45 sekund</string>
|
||||
<string name="settings_su_request_60">60 sekund</string>
|
||||
<string name="superuser_access">Přístup Superuser</string>
|
||||
<string name="auto_response">Automatická Reakce</string>
|
||||
<string name="request_timeout">Časový limit Požadavku</string>
|
||||
<string name="auto_response">Automatická odezva</string>
|
||||
<string name="request_timeout">Časový limit požadavku</string>
|
||||
<string name="superuser_notification">Oznámení Superuser</string>
|
||||
<string name="request_timeout_summary">%1$d sekund</string>
|
||||
<string name="request_timeout_summary">%1$s sekund</string>
|
||||
<string name="settings_su_reauth_title">Opětovné ověření po aktualizaci</string>
|
||||
<string name="settings_su_reauth_summary">Opětovné ověření oprávnění Superuser po aktualizaci aplikace</string>
|
||||
<string name="settings_su_fingerprint_title">Povolit ověřování otisky prstů</string>
|
||||
<string name="settings_su_fingerprint_summary">Chcete-li povolit požadavky Superuser, použijte snímač otisků prstů</string>
|
||||
<string name="auth_fingerprint">Ověřování otisky prstů</string>
|
||||
|
||||
<string name="multiuser_mode">Režim více uživatelů</string>
|
||||
<string name="settings_owner_only">Pouze vlastník zařízení</string>
|
||||
<string name="settings_owner_manage">Spravováno vlastníkem zařízení</string>
|
||||
<string name="settings_user_independent">Nezávislý uživatel</string>
|
||||
<string name="owner_only_summary">Pouze vlastník má root přístup.</string>
|
||||
<string name="owner_manage_summary">Root přístup spravuje pouze vlastník a přijímá požadavky k přístupu.</string>
|
||||
<string name="user_indepenent_summary">Každý uživatel má svá vlastní pravidla root.</string>
|
||||
|
||||
<string name="mount_namespace_mode">Režim připojení jmenného prostoru</string>
|
||||
<string name="settings_ns_global">Globální jmenný prostor</string>
|
||||
<string name="settings_ns_requester">Zděděný jmenný prostor</string>
|
||||
<string name="settings_ns_isolate">Izolovaný jmenný prostor</string>
|
||||
<string name="global_summary">Všechny relace root používají globální připojení jmenného prostoru.</string>
|
||||
<string name="requester_summary">Kořenové relace dědí jmenný prostor žadatele.</string>
|
||||
<string name="isolate_summary">Každá relace root bude mít svůj vlastní izolovaný jmenný prostor.</string>
|
||||
<string name="android_o_not_support">Nepodporuje Android 8.0+.</string>
|
||||
<string name="disable_fingerprint">Nebyly nastaveny žádné otisky prstů ani žádná podpora zařízení.</string>
|
||||
|
||||
<!--Superuser-->
|
||||
<string name="su_request_title">Požadavek Superuser</string>
|
||||
@@ -101,30 +191,35 @@
|
||||
<string name="deny">Zamítnout</string>
|
||||
<string name="prompt">Dotaz</string>
|
||||
<string name="grant">Povolit</string>
|
||||
<string name="su_warning">Povolí plný přístup k vašemu zařízení.\nZamítněte pokud si nejste jisti!</string>
|
||||
<string name="su_warning">Povolí plný přístup k vašemu zařízení.\nZamítněte, pokud si nejste jisti!</string>
|
||||
<string name="forever">Navždy</string>
|
||||
<string name="once">Jednou</string>
|
||||
<string name="tenmin">10 min</string>
|
||||
<string name="twentymin">20 min</string>
|
||||
<string name="thirtymin">30 min</string>
|
||||
<string name="sixtymin">60 min</string>
|
||||
<string name="tenmin">10 minut</string>
|
||||
<string name="twentymin">20 minut</string>
|
||||
<string name="thirtymin">30 minut</string>
|
||||
<string name="sixtymin">60 minut</string>
|
||||
<string name="su_allow_toast">Pro %1$s bylo oprávnění Superuser povoleno</string>
|
||||
<string name="su_deny_toast">Pro %1$s bylo oprávnění Superuser zamítnuto</string>
|
||||
<string name="no_apps_found">Zatím zde není žádná aplikace</string>
|
||||
<string name="su_snack_grant">Superuser oprávnění pro %1$s je povoleno</string>
|
||||
<string name="su_snack_deny">Superuser oprávnění pro %1$s je zamítnuto</string>
|
||||
<string name="su_snack_notif_on">Oznámení pro %1$s je povoleno</string>
|
||||
<string name="su_snack_notif_off">Oznámení pro %1$s je zakázáno</string>
|
||||
<string name="su_snack_notif_on">Oznámení pro %1$s jsou povolena</string>
|
||||
<string name="su_snack_notif_off">Oznámení pro %1$s jsou zakázána</string>
|
||||
<string name="su_snack_log_on">Logování %1$s je povoleno</string>
|
||||
<string name="su_snack_log_off">Logování %1$s je zakázáno</string>
|
||||
<string name="su_snack_revoke">Záznamy oprávnění %1$s jsou smazány</string>
|
||||
<string name="su_revoke_title">Smazat?</string>
|
||||
<string name="su_revoke_msg">Smazat záznam ohledně oprávnění pro %1$s?</string>
|
||||
<string name="toast">Toast</string>
|
||||
<string name="none">Žádné</string>
|
||||
<string name="toast">Informační text</string>
|
||||
<string name="none">Žádný</string>
|
||||
<string name="auth_fail">Ověření se nezdařilo</string>
|
||||
|
||||
<!--Superuser logs-->
|
||||
<string name="pid">PID: %1$d</string>
|
||||
<string name="target_uid">Cílové UID: %1$d</string>
|
||||
<string name="command">Příkaz: %1$s</string>
|
||||
|
||||
<!-- MagiskHide -->
|
||||
<string name="show_system_app">Zobrazit systémové aplikace</string>
|
||||
|
||||
</resources>
|
||||
|
@@ -84,13 +84,11 @@
|
||||
<string name="hide_manager_fail_toast">Verbergen von Magisk Manager fehlgeschlagen…</string>
|
||||
<string name="open_link_failed_toast">Es wurde keine Anwendung gefunden, um diesen Link zu öffnen...</string>
|
||||
<string name="download_zip_only">Nur Zip-Datei herunterladen</string>
|
||||
<string name="patch_boot_file">Boot-Image-Datei patchen</string>
|
||||
<string name="direct_install">Direkt installieren (empfohlen)</string>
|
||||
<string name="install_inactive_slot">Installiere auf inaktiven Slot (Nach OTA)</string>
|
||||
<string name="warning">Warnung</string>
|
||||
<string name="install_inactive_slot_msg">Dein Gerät wird GEZWUNGEN in den aktuell inaktiven Slot zu starten, nachdem nach dem ein Neustart durchgeführt wurde!\nBenutze diese Option nur, nachdem das OTA beendet wurde.\nFortsetzen?</string>
|
||||
<string name="select_method">Methode auswählen</string>
|
||||
<string name="boot_file_patch_msg">Wähle das original Boot-Image-Dump im Format .img oder .img.tar</string>
|
||||
<string name="complete_uninstall">Komplette Deinstallation</string>
|
||||
<string name="restore_img">Images wiederherstellen</string>
|
||||
<string name="restore_img_msg">Wiederherstellen...</string>
|
||||
@@ -98,7 +96,6 @@
|
||||
<string name="restore_fail">Kein Original Backup vorhanden!</string>
|
||||
<string name="proprietary_title">Lade proprietären Code herunter</string>
|
||||
<string name="proprietary_notice">Magisk Manager ist FOSS und enthält keinen proprietären SafetyNet API Code von Google. Magisk Manager erlauben eine Erweiterung (enthält GoogleApiClient) für SafetyNet-Checks herunterzuladen?</string>
|
||||
<string name="setup_done">Einrichtung abgeschlossen</string>
|
||||
<string name="setup_fail">Einrichtung fehlgeschlagen</string>
|
||||
<string name="env_fix_title">Zusätzliche Einrichtung erforderlich</string>
|
||||
<string name="env_fix_msg">Ihr Gerät benötigt zusätzliche Einrichtung, damit Magisk ordnungsgemäß funktioniert. Es wird eine Magisk-Installations-Zip wird heruntergeladen, fortfahren?</string>
|
||||
@@ -128,8 +125,6 @@
|
||||
<string name="settings_update_beta">Beta</string>
|
||||
<string name="settings_update_custom">Benutzerdefiniert</string>
|
||||
<string name="settings_update_custom_msg">Gib eine benutzerdefinierte URL ein</string>
|
||||
<string name="settings_boot_format_title">Ausgabeformat des gepatchten Boot-Images</string>
|
||||
<string name="settings_boot_format_summary">Wähle das Ausgabeformat des gepatchten Boot-Images.\nWähle .img, um mit \"fastboot/download mode\" zu flashen; wähle .img.tar zum Flashen mit ODIN.</string>
|
||||
<string name="settings_core_only_title">Nur Kernfunktionen</string>
|
||||
<string name="settings_core_only_summary">Aktiviert lediglich die Kernfunktionen, Module werden nicht geladen. MagiskSU und Magisk Hide bleiben weiterhin aktiv</string>
|
||||
<string name="settings_magiskhide_summary">Versteckt Magisk vor diversen Entdeckungsmethoden</string>
|
||||
|
@@ -84,10 +84,8 @@
|
||||
<string name="hide_manager_title">Κρύβοντας το Magisk Manager…</string>
|
||||
<string name="hide_manager_fail_toast">Η απόκρυψη του Magisk Manager απέτυχε…</string>
|
||||
<string name="download_zip_only">Λήψη Zip Μόνο</string>
|
||||
<string name="patch_boot_file">Εφαρμογή Patch στο Αρχείο Εικόνας Boot</string>
|
||||
<string name="direct_install">Απευθείας Εγκατάσταση (Προτείνεται)</string>
|
||||
<string name="select_method">Επιλογή Μεθόδου</string>
|
||||
<string name="boot_file_patch_msg">Επιλογή stock boot image dump σε μορφή .img ή .img.tar</string>
|
||||
<string name="complete_uninstall">Πλήρης απεγκατάσταση</string>
|
||||
<string name="restore_done">Η ανάκτηση έγινε!</string>
|
||||
<string name="restore_fail">Δεν υπάρχει αντίγραφο ασφαλείας!</string>
|
||||
@@ -113,8 +111,6 @@
|
||||
<string name="settings_update_beta">Δοκιμαστικό</string>
|
||||
<string name="settings_update_custom">Custom</string>
|
||||
<string name="settings_update_custom_msg">Εισαγωγή ενός custom URL</string>
|
||||
<string name="settings_boot_format_title">Μορφή Τροποποιημένης Εικόνας Boot</string>
|
||||
<string name="settings_boot_format_summary">Επιλέξτε τη μορφή της εξαγόμενης εικόνας boot μετά το patch.\nΕπιλέξτε .img για flash μέσω λειτουργίας fastboot/download· επιλέξτε .img.tar για flash μέσω ODIN.</string>
|
||||
<string name="settings_core_only_title">Magisk Λειτουργία Πυρήνα Μόνο</string>
|
||||
<string name="settings_core_only_summary">Ενεργοποίηση μόνο των λειτουργιών πυρήνα, καμία από τις ενότητες δεν θα ενεργοποιηθεί. Τα MagiskSU και MagiskHide θα παραμείνουν ενεργά</string>
|
||||
<string name="settings_magiskhide_summary">Κρύβει το Magisk από διάφορες ανιχνεύσεις</string>
|
||||
|
@@ -73,7 +73,19 @@
|
||||
<string name="download_file_error">Error descargando archivo</string>
|
||||
<string name="magisk_update_title">Actualización de Magisk disponible!</string>
|
||||
<string name="manager_update_title">Actualización de Magisk Manager disponible!</string>
|
||||
|
||||
|
||||
<!-- Installation -->
|
||||
<string name="manager_download_install">Pulse para descargar e instalar</string>
|
||||
<string name="download_zip_only">Descargar sólo el archivo ZIP</string>
|
||||
<string name="direct_install">Instalación Directa (Recomendado)</string>
|
||||
<string name="install_inactive_slot">Instalar en ranura inactiva (después de OTA)</string>
|
||||
<string name="install_inactive_slot_msg">¡Se forzará su dispositivo para que arranque en la ranura inactiva actual después de un reinicio!\nUtilice esta opción solo después de que se haya completado la OTA.\nContinuar?</string>
|
||||
<string name="select_method">Seleccionar Método</string>
|
||||
<string name="setup_title">Configuración Adicional</string>
|
||||
<string name="select_patch_file">Seleccionar y parchear un archivo</string>
|
||||
<string name="patch_file_msg">Seleccione una imagen raw (* .img) o un archivo tar de ODIN (* .tar)</string>
|
||||
<string name="reboot_delay_toast">Reiniciando en 5 segundos…</string>
|
||||
|
||||
<!--Toasts, Dialogs-->
|
||||
<string name="close">Cerrar</string>
|
||||
<string name="repo_install_title">Instalar %1$s</string>
|
||||
@@ -84,31 +96,24 @@
|
||||
<string name="release_notes">Notas de lanzamiento</string>
|
||||
<string name="repo_cache_cleared">Caché del repositorio limpiada</string>
|
||||
<string name="internal_storage">El zip es almacenado en:\n[Internal Storage]%1$s</string>
|
||||
<string name="manager_download_install">Pulse para descargar e instalar</string>
|
||||
|
||||
<string name="dtbo_patched_title">DTBO fue parchado!</string>
|
||||
<string name="dtbo_patched_reboot">Magisk Manager ha parcheado dtbo.img, por favor reinicia</string>
|
||||
<string name="flashing">Flasheando</string>
|
||||
<string name="hide_manager_title">Ocultando Magisk Manager…</string>
|
||||
<string name="hide_manager_fail_toast">La Ocultación de Magisk Manager ha fallado…</string>
|
||||
<string name="open_link_failed_toast">No se encontró ninguna aplicación para abrir el enlace…</string>
|
||||
<string name="download_zip_only">Descargar sólo el archivo ZIP</string>
|
||||
<string name="patch_boot_file">Parcheo de la imagen boot</string>
|
||||
<string name="direct_install">Instalación Directa (Recomendado)</string>
|
||||
<string name="install_inactive_slot">Instalar en ranura inactiva (después de OTA)</string>
|
||||
<string name="select_method">Seleccionar Método</string>
|
||||
<string name="boot_file_patch_msg">Seleccione el volcado de la imagen boot en formato .img o .img.tar</string>
|
||||
<string name="warning">Advertencia</string>
|
||||
<string name="complete_uninstall">Desinstalación completa</string>
|
||||
<string name="restore_img">Restaurar imágenes</string>
|
||||
<string name="restore_img_msg">Restaurando …</string>
|
||||
<string name="restore_done">¡Restauración Terminada!</string>
|
||||
<string name="restore_img_msg">Restaurando …</string>
|
||||
<string name="restore_fail">¡El respaldo de la imagen boot Stock no existe!</string>
|
||||
<string name="proprietary_title">Descargar Código Propietario</string>
|
||||
<string name="proprietary_notice">Magisk Manager es un Software Libre por lo que no contiene el código API de SafetyNet (Código Propietario de Google).\n\n ¿Puede permitir que Magisk Manager descargue una extensión (contiene el GoogleApiClient) para la comprobación de SafetyNet?</string>
|
||||
<string name="setup_done">Instalación Realizada</string>
|
||||
<string name="setup_fail">Instalación Fallida</string>
|
||||
<string name="env_fix_title">Se Requiere una Instalación Adicional</string>
|
||||
<string name="env_fix_msg">Su dispositivo requiere una instalación adicional para que Magisk funcione correctamente. Se descargará el zip de instalación de Magisk, desea continuar ahora?</string>
|
||||
<string name="setup_title">Configuración Adicional</string>
|
||||
<string name="setup_msg">Ejecutando Configuración de Entorno</string>
|
||||
<string name="downloading_toast">Descargando %1$s</string>
|
||||
<string name="no_rw_storage">Esta opción no funcionará sin permiso de escritura en la memoria externa.</string>
|
||||
@@ -134,9 +139,6 @@
|
||||
<string name="settings_update_beta">Beta</string>
|
||||
<string name="settings_update_custom">Personalizado</string>
|
||||
<string name="settings_update_custom_msg">Insertar una URL personalizada</string>
|
||||
<string name="settings_boot_format_title">Parchear imagen boot por tipo de formato</string>
|
||||
<string name="settings_boot_format_summary">Seleccionar el formato de salida para parchear la imagen boot.\nEscoja .img para flashear mediante fastboot/download mode; escoja .img.tar para flashear con ODIN.</string>
|
||||
|
||||
<string name="settings_core_only_summary">Habilitar sólo funciones principales, no se cargarán todos los módulos. MagiskSU y MagiskHide seguirán habilitados</string>
|
||||
<string name="settings_magiskhide_summary">Ocultar Magisk de varias detecciones</string>
|
||||
<string name="settings_hosts_title">Systemless Hosts</string>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user