Enhance EMUI 9 user experience

This commit is contained in:
topjohnwu
2018-12-25 01:08:46 +08:00
parent 3c6c0e6700
commit 8d210b5e37
7 changed files with 24 additions and 8 deletions

View File

@@ -37,6 +37,7 @@ public class Data {
// Install flags
public static boolean keepVerity = false;
public static boolean keepEnc = false;
public static boolean recovery = false;
// Configs
public static boolean isDarkTheme;

View File

@@ -42,6 +42,7 @@ public class RootUtils extends Shell.Initializer {
Data.keepVerity = Boolean.parseBoolean(ShellUtils.fastCmd("echo $KEEPVERITY"));
Data.keepEnc = Boolean.parseBoolean(ShellUtils.fastCmd("echo $KEEPFORCEENCRYPT"));
Data.recovery = Boolean.parseBoolean(ShellUtils.fastCmd("echo $RECOVERYMODE"));
return true;
}
}

View File

@@ -122,4 +122,8 @@ public class Utils {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.N ?
App.self.createDeviceProtectedStorageContext() : App.self;
}
public static void reboot() {
Shell.su("/system/bin/reboot" + (Data.recovery ? " recovery" : "")).submit();
}
}