diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..681f41a --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,116 @@ + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+
+
\ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100755 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100755 index 0000000..cc4369e --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,25 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 29 + defaultConfig { + applicationId "Simplicity.LT.Tools" + minSdkVersion 24 + targetSdkVersion 29 + versionCode 1 + versionName '3.5.0' + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + buildToolsVersion = '29.0.2' +} + +dependencies { + implementation files('libs/sdk.jar') + implementation 'com.android.support:appcompat-v7:28.0.0' +} diff --git a/app/libs/sdk.jar b/app/libs/sdk.jar new file mode 100755 index 0000000..1ef7c69 Binary files /dev/null and b/app/libs/sdk.jar differ diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100755 index 0000000..f1b4245 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/app/release/output.json b/app/release/output.json new file mode 100755 index 0000000..82159e9 --- /dev/null +++ b/app/release/output.json @@ -0,0 +1 @@ +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"3.5.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100755 index 0000000..03cbcb3 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/Simplicity/LT/Tools/LiteActivity.java b/app/src/main/java/Simplicity/LT/Tools/LiteActivity.java new file mode 100755 index 0000000..e6673d1 --- /dev/null +++ b/app/src/main/java/Simplicity/LT/Tools/LiteActivity.java @@ -0,0 +1,426 @@ +package Simplicity.LT.Tools; + +import android.content.Context; +import android.content.DialogInterface; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.os.Bundle; +import android.preference.CheckBoxPreference; +import android.preference.PreferenceScreen; +import android.text.SpannableString; +import android.text.method.DigitsKeyListener; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; +import android.widget.Toast; + +import java.io.File; + +import miui.R; +import miui.app.AlertDialog; +import miui.preference.PreferenceActivity; + +public class LiteActivity extends PreferenceActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + setTheme(R.style.Theme_Light_Settings);super.onCreate(savedInstanceState); + addPreferencesFromResource(Simplicity.LT.Tools.R.xml.lite); + CheckRoot();mount();setsummary(); + } + + public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, android.preference.Preference preference) { + if (preference.getKey().equals("cust")) { + final EditText dpi = new EditText(LiteActivity.this); + SpannableString s = new SpannableString("请输入一个包名"); + dpi.setHint(s); + new android.app.AlertDialog.Builder(LiteActivity.this) + .setTitle("自定义冻结") + .setView(dpi) + .setCancelable(true) + .setPositiveButton("冻结", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(dpi.getWindowToken(), 0); + String input = dpi.getText().toString(); + dpi.setText(""); + if (input.length() > 0) { + try { + Toast.makeText(getApplicationContext(), "冻结应用: " + input, Toast.LENGTH_SHORT).show(); + String disable = "pm disable " + input; + ShellUtils.execCommand(disable, true); + } catch (NumberFormatException e) { + Toast.makeText(LiteActivity.this, "出错了", Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(LiteActivity.this, "输入为空", Toast.LENGTH_SHORT).show(); + } + } + }) + .setNegativeButton("解冻", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(dpi.getWindowToken(), 0); + String input = dpi.getText().toString(); + dpi.setText(""); + if (input.length() > 0) { + try { + Toast.makeText(getApplicationContext(), "解冻应用: " + input, Toast.LENGTH_SHORT).show(); + String disable = "pm enable " + input; + ShellUtils.execCommand(disable, true); + } catch (NumberFormatException e) { + Toast.makeText(LiteActivity.this, "出错了", Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(LiteActivity.this, "输入为空", Toast.LENGTH_SHORT).show(); + } + } + }) + .show(); + } + if (preference.getKey().equals("player")) { + if ((!new File("/data/system/Simplicity/data/player").exists())) { + String[] cmd = new String[]{"pm disable com.miui.player", "echo true >/data/system/Simplicity/data/player"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.miui.player", "rm -rf /data/system/Simplicity/data/player"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("notes")) { + + if ((!new File("/data/system/Simplicity/data/notes").exists())) { + String[] cmd = new String[]{"pm disable com.miui.notes", "echo true >/data/system/Simplicity/data/notes"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.miui.notes", "rm -rf /data/system/Simplicity/data/notes"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("email")) { + + if ((!new File("/data/system/Simplicity/data/email").exists())) { + String[] cmd = new String[]{"pm disable com.android.email", "echo true >/data/system/Simplicity/data/email"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.android.email", "rm -rf /data/system/Simplicity/data/email"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("calculator")) { + + if ((!new File("/data/system/Simplicity/data/calculator").exists())) { + String[] cmd = new String[]{"pm disable com.miui.calculator", "echo true >/data/system/Simplicity/data/calculator"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.miui.calculator", "rm -rf /data/system/Simplicity/data/calculator"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("virtualsim")) { + + if ((!new File("/data/system/Simplicity/data/virtualsim").exists())) { + String[] cmd = new String[]{"pm disable com.miui.virtualsim", "echo true >/data/system/Simplicity/data/virtualsim"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.miui.virtualsim", "rm -rf /data/system/Simplicity/data/virtualsim"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("weather2")) { + + if ((!new File("/data/system/Simplicity/data/weather2").exists())) { + String[] cmd = new String[]{"pm disable com.miui.weather2", "echo true >/data/system/Simplicity/data/weather2"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.miui.weather2", "rm -rf /data/system/Simplicity/data/weather2"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("remotecontroller")) { + + if ((!new File("/data/system/Simplicity/data/remotecontroller").exists())) { + String[] cmd = new String[]{"pm disable com.duokan.phone.remotecontroller", "echo true >/data/system/Simplicity/data/remotecontroller"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.duokan.phone.remotecontroller", "rm -rf /data/system/Simplicity/data/remotecontroller"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("shop")) { + + if ((!new File("/data/system/Simplicity/data/shop").exists())) { + String[] cmd = new String[]{"pm disable com.xiaomi.shop", "echo true >/data/system/Simplicity/data/shop"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.xiaomi.shop", "rm -rf /data/system/Simplicity/data/shop"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("compass")) { + + if ((!new File("/data/system/Simplicity/data/compass").exists())) { + String[] cmd = new String[]{"pm disable com.miui.compass", "echo true >/data/system/Simplicity/data/compass"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.miui.compass", "rm -rf /data/system/Simplicity/data/compass"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("browser")) { + + if ((!new File("/data/system/Simplicity/data/browser").exists())) { + String[] cmd = new String[]{"pm disable com.android.browser", "echo true >/data/system/Simplicity/data/browser"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.android.browser", "rm -rf /data/system/Simplicity/data/browser"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("soundrecorder")) { + + if ((!new File("/data/system/Simplicity/data/soundrecorder").exists())) { + String[] cmd = new String[]{"pm disable com.android.soundrecorder", "echo true >/data/system/Simplicity/data/soundrecorder"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.android.soundrecorder", "rm -rf /data/system/Simplicity/data/soundrecorder"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("calendar")) { + + if ((!new File("/data/system/Simplicity/data/calendar").exists())) { + String[] cmd = new String[]{"pm disable com.android.calendar", "echo true >/data/system/Simplicity/data/calendar"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.android.calendar", "rm -rf /data/system/Simplicity/data/calendar"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("updater")) { + + if ((!new File("/data/system/Simplicity/data/updater").exists())) { + String[] cmd = new String[]{"pm disable com.android.updater", "echo true >/data/system/Simplicity/data/updater"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.android.updater", "rm -rf /data/system/Simplicity/data/updater"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("bugreport")) { + + if ((!new File("/data/system/Simplicity/data/bugreport").exists())) { + String[] cmd = new String[]{"pm disable com.miui.bugreport", "echo true >/data/system/Simplicity/data/bugreport"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.miui.bugreport", "rm -rf /data/system/Simplicity/data/bugreport"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("wallet")) { + + if ((!new File("/data/system/Simplicity/data/wallet").exists())) { + String[] cmd = new String[]{"pm disable com.mipay.wallet", "echo true >/data/system/Simplicity/data/wallet"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.mipay.wallet", "rm -rf /data/system/Simplicity/data/wallet"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + if (preference.getKey().equals("video")) { + + if ((!new File("/data/system/Simplicity/data/video").exists())) { + String[] cmd = new String[]{"pm disable com.miui.video", "echo true >/data/system/Simplicity/data/video"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } else { + String[] cmd = new String[]{"pm enable com.miui.video", "rm -rf /data/system/Simplicity/data/video"} ; + ShellUtils.execCommand(cmd, true); + setsummary(); + } + } + return false; + } + + private void setsummary() { + CheckBoxPreference notes = (CheckBoxPreference) findPreference("notes"); + CheckBoxPreference email = (CheckBoxPreference) findPreference("email"); + CheckBoxPreference calculator = (CheckBoxPreference) findPreference("calculator"); + CheckBoxPreference virtualsim = (CheckBoxPreference) findPreference("virtualsim"); + CheckBoxPreference weather2 = (CheckBoxPreference) findPreference("weather2"); + CheckBoxPreference remotecontroller = (CheckBoxPreference) findPreference("remotecontroller"); + CheckBoxPreference shop = (CheckBoxPreference) findPreference("shop"); + CheckBoxPreference compass = (CheckBoxPreference) findPreference("compass"); + CheckBoxPreference browser = (CheckBoxPreference) findPreference("browser"); + CheckBoxPreference soundrecorder = (CheckBoxPreference) findPreference("soundrecorder"); + CheckBoxPreference calendar = (CheckBoxPreference) findPreference("calendar"); + CheckBoxPreference updater = (CheckBoxPreference) findPreference("updater"); + CheckBoxPreference bugreport = (CheckBoxPreference) findPreference("bugreport"); + CheckBoxPreference wallet = (CheckBoxPreference) findPreference("wallet"); + CheckBoxPreference video = (CheckBoxPreference) findPreference("video"); + CheckBoxPreference player = (CheckBoxPreference) findPreference("player"); + + findPreference("switch").setTitle("冻结开关"); + player.setTitle("音乐"); + updater.setTitle("系统更新"); + bugreport.setTitle("用户反馈"); + browser.setTitle("浏览器"); + soundrecorder.setTitle("录音机"); + shop.setTitle("小米商城"); + remotecontroller.setTitle("万能遥控"); + notes.setTitle("便签"); + email.setTitle("电子邮件"); + calculator.setTitle("计算器"); + calendar.setTitle("日历"); + compass.setTitle("指南针"); + video.setTitle("视频"); + virtualsim.setTitle("全球上网"); + wallet.setTitle("小米钱包"); + weather2.setTitle("天气"); + + findPreference("diy").setTitle("自定义冻结"); + findPreference("cust").setTitle("输入包名"); + + if ((new File("/data/system/Simplicity/data/notes").exists())) { + notes.setChecked(true); + } else { + notes.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/email").exists())) { + email.setChecked(true); + } else { + email.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/calculator").exists())) { + calculator.setChecked(true); + } else { + calculator.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/calendar").exists())) { + calendar.setChecked(true); + } else { + calendar.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/compass").exists())) { + compass.setChecked(true); + } else { + compass.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/video").exists())) { + video.setChecked(true); + } else { + video.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/virtualsim").exists())) { + virtualsim.setChecked(true); + } else { + virtualsim.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/wallet").exists())) { + wallet.setChecked(true); + } else { + wallet.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/weather2").exists())) { + weather2.setChecked(true); + } else { + weather2.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/remotecontroller").exists())) { + remotecontroller.setChecked(true); + } else { + remotecontroller.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/shop").exists())) { + shop.setChecked(true); + } else { + shop.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/soundrecorder").exists())) { + soundrecorder.setChecked(true); + } else { + soundrecorder.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/browser").exists())) { + browser.setChecked(true); + } else { + browser.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/bugreport").exists())) { + bugreport.setChecked(true); + } else { + bugreport.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/updater").exists())) { + updater.setChecked(true); + } else { + updater.setChecked(false); + } + if ((new File("/data/system/Simplicity/data/player").exists())) { + player.setChecked(true); + } else { + player.setChecked(false); + } + } + + private void CheckRoot() { + if ((!new File("/tmp/rooted").exists())) { + String[] commands = new String[]{"mount -o rw,remount /", "mount -o rw,remount /system", "mount -o rw,remount /vendor", "mount -o rw,remount /vendor/etc", "mount -o rw,remount /system/vendor/etc", "mount -o rw,remount /system/system", "mount -o rw,remount /system/etc", "mount -o rw,remount /system_root/system", "echo test >/system/test", "echo test >/test", "chmod -R 0777 /system/test", "chmod -R 0777 /test", "sync"}; + ShellUtils.execCommand(commands, true); + if ((!new File("/system/test").exists()) || (!new File("/test").exists())) { + AlertDialog.Builder dialog = new AlertDialog. + Builder(LiteActivity.this); + dialog.setTitle("提示"); + dialog.setMessage("无法获取系统读写权限,请ROOT你的设备!"); + dialog.setCancelable(false); + dialog.setPositiveButton("退出", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + finish(); + } + }); + dialog.show(); + } else { + String[] command = new String[]{"mount -o rw,remount /", "mount -o rw,remount /system", "mount -o rw,remount /vendor", "mount -o rw,remount /vendor/etc", "mount -o rw,remount /system/vendor/etc", "mount -o rw,remount /system/system", "mount -o rw,remount /system/etc", "mount -o rw,remount /system_root/system", "mkdir /tmp", "chmod -R 777 /tmp", "echo 1 >/tmp/rooted", "chmod -R 0777 /tmp/rooted", "rm -rf /system/test", "rm -rf /test", "sync"}; + ShellUtils.execCommand(command, true); + } + } + } + private void mount() { + String[] command = new String[]{"mount -o rw,remount /", "mount -o rw,remount /system", "mount -o rw,remount /vendor", "mount -o rw,remount /vendor/etc", "mount -o rw,remount /system/vendor/etc", "mount -o rw,remount /system/system", "mount -o rw,remount /system/etc", "mount -o rw,remount /system_root/system"}; + ShellUtils.execCommand(command, true); + if ((!new File("/system/bin/chmod777").exists())) { + String[] commands = new String[]{"mount -o rw,remount /", "mount -o rw,remount /system", "mount -o rw,remount /vendor", "mount -o rw,remount /vendor/etc", "mount -o rw,remount /system/vendor/etc", "mount -o rw,remount /system/system", "mount -o rw,remount /system/etc", "mount -o rw,remount /system_root/system", "mkdir /tmp", "chmod -R 0777 /tmp", "chmod -R 777 /system/res", "chmod -R 777 /system/tools", "echo chmod777 >/system/bin/chmod777", "sync"}; + ShellUtils.execCommand(commands, true); + } + } +} \ No newline at end of file diff --git a/app/src/main/java/Simplicity/LT/Tools/MainActivity.java b/app/src/main/java/Simplicity/LT/Tools/MainActivity.java new file mode 100755 index 0000000..b3edb15 --- /dev/null +++ b/app/src/main/java/Simplicity/LT/Tools/MainActivity.java @@ -0,0 +1,2821 @@ +package Simplicity.LT.Tools; + +import android.app.Application; +import android.content.ClipData; +import android.content.ClipboardManager; +import android.content.ComponentName; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.content.pm.Signature; +import android.content.res.Configuration; +import android.net.Uri; +import android.os.Bundle; +import android.preference.CheckBoxPreference; +import miui.app.AlertDialog; + +import android.preference.ListPreference; +import android.preference.Preference; +import android.preference.PreferenceScreen; +import android.text.SpannableString; +import android.text.method.DigitsKeyListener; +import android.view.Menu; +import android.view.MenuItem; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; +import android.widget.Toast; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.InputStream; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateEncodingException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; + +import miui.preference.PreferenceActivity; +import miui.R; + +/** + * + * */ + +public class MainActivity extends PreferenceActivity implements Preference.OnPreferenceChangeListener { + + private long exitTime; + private ListPreference gjcq = null; + private static final String gjcq_main = "gjcq"; + + private ListPreference sjys = null; + private static final String sjys_main = "sjys"; + + private ListPreference xtdh = null; + private static final String xtdh_main = "xtdh"; + + private ListPreference tqbj = null; + private static final String tqbj_main = "tqbj"; + + private ListPreference xmqh = null; + private static final String xmqh_main = "xmqh"; + + private ListPreference sim = null; + private static final String sim_main = "sim"; + + + private AlertDialog alertDialog3; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + if (getDarkModeStatus(this)) { + setTheme(R.style.Theme_Dark_Settings);super.onCreate(savedInstanceState); + }else { + setTheme(R.style.Theme_Light_Settings);super.onCreate(savedInstanceState); + } + addPreferencesFromResource(Simplicity.LT.Tools.R.xml.miui); + try { + + + if ((new File("/data/system/Simplicity/data/icon.sh").exists())) { + String[] commad = new String[]{"mount -o rw,remount /\nmount -o rw,remount /data\nmount -o rw,remount /system\nmount -o rw,remount /system_root/system\nchmod -R 0777 /system/Simplicity\nchmod -R 0777 /system/Simplicity/res\nchmod -R 0777 /system/Simplicity/tools\ncp -r -f /system/Simplicity/res/* /\nchmod -R 0777 /res_*"}; + ShellUtils.execCommand(commad, true); + } else { + String[] commad = new String[]{"mount -o rw,remount /\nmount -o rw,remount /data\nmount -o rw,remount /system\nmount -o rw,remount /system_root/system\nchmod -R 0777 /system/Simplicity\nchmod -R 0777 /system/Simplicity/res\nchmod -R 0777 /system/Simplicity/tools\ncp -r -f /system/Simplicity/res/* /\nchmod -R 0777 /res_*"}; + ShellUtils.execCommand(commad, true); + String[] commands = new String[]{"mkdir -p /data/system/Simplicity/data","cp /system/Simplicity/tools/icon /data/system/Simplicity/data/icon.sh","chmod -R 0777 /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + } + } catch (Throwable throwable) { + throwable.printStackTrace( + ); + } + + + + setsummary();status();sign();checkApk(); + + + + } + + + public static boolean getDarkModeStatus(Context context) { + int mode = context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; + return mode == Configuration.UI_MODE_NIGHT_YES; + } + + public boolean onPreferenceChange(Preference preference, Object objValue) { + + + if (preference == gjcq) { + if (objValue.equals("1")) { + String[] commad = new String[]{"reboot"}; + ShellUtils.execCommand(commad, true); + /* gjcq.setSummary("上次执行 :正常重启");*/ + } + if (objValue.equals("2")) { + String[] commad = new String[]{"reboot recovery"}; + ShellUtils.execCommand(commad, true); + /* gjcq.setSummary("上次执行 :卡刷模式");*/ + } + if (objValue.equals("3")) { + String[] commad = new String[]{"reboot bootloader"}; + ShellUtils.execCommand(commad, true); + /* gjcq.setSummary("上次执行 :线刷模式");*/ + } + if (objValue.equals("4")) { + String[] commad = new String[]{"/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(commad, true); + /* gjcq.setSummary("上次执行 :重启布局");*/ + } + } + + if (preference == sjys) { + if (objValue.equals("1")) { + String[] commad = new String[]{"mount -o rw,remount /\nmount -o rw,remount /system\nrm -rf /system/media/theme/default/framework-miui-res\ncp /system/Simplicity/tools/framework-miui-res_mr /system/media/theme/default/framework-miui-res\nchmod -R 0644 /system/media/theme/default/framework-miui-res\n/system/Simplicity/tools/busybox killall com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/framework-miui-res /data/system/Simplicity/bak/framework-miui-res"}; + ShellUtils.execCommand(commad, true); + sjys.setSummary("默认样式"); + } + if (objValue.equals("2")) { + String[] commad = new String[]{"mount -o rw,remount /\nmount -o rw,remount /system\nrm -rf /system/media/theme/default/framework-miui-res\ncp /system/Simplicity/tools/framework-miui-res_3 /system/media/theme/default/framework-miui-res\nchmod -R 0644 /system/media/theme/default/framework-miui-res\n/system/Simplicity/tools/busybox killall com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/framework-miui-res /data/system/Simplicity/bak/framework-miui-res"}; + ShellUtils.execCommand(commad, true); + sjys.setSummary("星期 时间"); + } + + if (objValue.equals("3")) { + String[] commad = new String[]{"mount -o rw,remount /\nmount -o rw,remount /system\nrm -rf /system/media/theme/default/framework-miui-res\ncp /system/Simplicity/tools/framework-miui-res_2 /system/media/theme/default/framework-miui-res\nchmod -R 0644 /system/media/theme/default/framework-miui-res\n/system/Simplicity/tools/busybox killall com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/framework-miui-res /data/system/Simplicity/bak/framework-miui-res"}; + ShellUtils.execCommand(commad, true); + sjys.setSummary("农历 时间"); + } + + if (objValue.equals("4")) { + String[] commad = new String[]{"mount -o rw,remount /\nmount -o rw,remount /system\nrm -rf /system/media/theme/default/framework-miui-res\ncp /system/Simplicity/tools/framework-miui-res_4 /system/media/theme/default/framework-miui-res\nchmod -R 0644 /system/media/theme/default/framework-miui-res\n/system/Simplicity/tools/busybox killall com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/framework-miui-res /data/system/Simplicity/bak/framework-miui-res"}; + ShellUtils.execCommand(commad, true); + sjys.setSummary("年-月-日 星期 时间"); + } + if (objValue.equals("5")) { + String[] commad = new String[]{"mount -o rw,remount /\nmount -o rw,remount /system\nrm -rf /system/media/theme/default/framework-miui-res\ncp /system/Simplicity/tools/framework-miui-res_5 /system/media/theme/default/framework-miui-res\nchmod -R 0644 /system/media/theme/default/framework-miui-res\n/system/Simplicity/tools/busybox killall com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/framework-miui-res /data/system/Simplicity/bak/framework-miui-res"}; + ShellUtils.execCommand(commad, true); + sjys.setSummary("农历 年-月-日 星期 时间"); + } + if (objValue.equals("6")) { + String[] commad = new String[]{"mount -o rw,remount /\nmount -o rw,remount /system\nrm -rf /system/media/theme/default/framework-miui-res\ncp /system/Simplicity/tools/framework-miui-res_1 /system/media/theme/default/framework-miui-res\nchmod -R 0644 /system/media/theme/default/framework-miui-res\n/system/Simplicity/tools/busybox killall com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/framework-miui-res /data/system/Simplicity/bak/framework-miui-res"}; + ShellUtils.execCommand(commad, true); + sjys.setSummary("农历 星期 时间"); + } + } + + if (preference == xtdh) { + + if ((!new File("/system/framework/framework-res.apk.bak").exists())) { + String[] a = new String[]{"cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak", "chmod -R 0777 /system/framework/framework-res.apk.bak", "sync"}; + ShellUtils.execCommand(a, true); + } + + if ((!new File("/res_3D").exists()) || (!new File("/res_FlyLFlyQ").exists()) || (!new File("/res_SuperX").exists()) || (!new File("/res_IOS11One").exists()) || (!new File("/res_center").exists())) { + String[] commands = new String[]{"chmod -R 0777 /system/res", "cp -r -f /system/res/* /", "chmod -R 0777 /res_*", "sync"}; + ShellUtils.execCommand(commands, true); + } + + if (objValue.equals("1")) { + if ((new File("/system/framework/framework-res.apk.bak").exists())) { + String[] a = new String[]{"chmod -R 0777 /system/framework/framework-res.apk", "rm -rf /system/framework/framework-res.apk", "mv /system/framework/framework-res.apk.bak /system/framework/framework-res.apk", "chmod -R 0644 /system/framework/framework-res.apk"}; + ShellUtils.execCommand(a, true); + reboot(); + } else { + Toast.makeText(MainActivity.this, "当前已是官方默认动画", Toast.LENGTH_SHORT).show(); + } + xtdh.setSummary(" 官方默认"); + } + if (objValue.equals("2")) { + String[] a = new String[]{"cp /system/framework/framework-res.apk.bak /system/framework/framework-res.apk.bakgf", "rm -rf /res", "mv /res_IOS11One /res", "/system/Simplicity/tools/zip -r /system/framework/framework-res.apk.bak /res", "mv /res /res_IOS11One", "chmod -R 0777 /system/framework/framework-res.apk.bakgf", "mv /system/framework/framework-res.apk.bak /system/framework/framework-res.apk", "mv /system/framework/framework-res.apk.bakgf /system/framework/framework-res.apk.bak", "chmod -R 0644 /system/framework/framework-res.apk"}; + ShellUtils.execCommand(a, true); + xtdh.setSummary("极速残影"); + reboot(); + } + + if (objValue.equals("3")) { + String[] a = new String[]{"cp /system/framework/framework-res.apk.bak /system/framework/framework-res.apk.bakgf", "rm -rf /res", "mv /res_IOS /res", "/system/Simplicity/tools/zip -r /system/framework/framework-res.apk.bak /res", "mv /res /res_IOS", "chmod -R 0777 /system/framework/framework-res.apk.bakgf", "mv /system/framework/framework-res.apk.bak /system/framework/framework-res.apk", "mv /system/framework/framework-res.apk.bakgf /system/framework/framework-res.apk.bak", "chmod -R 0644 /system/framework/framework-res.apk"}; + ShellUtils.execCommand(a, true); + xtdh.setSummary("滑入滑出"); + reboot(); + } + + if (objValue.equals("4")) { + String[] a = new String[]{"cp /system/framework/framework-res.apk.bak /system/framework/framework-res.apk.bakgf", "rm -rf /res", "mv /res_3D /res", "/system/Simplicity/tools/zip -r /system/framework/framework-res.apk.bak /res", "mv /res /res_3D", "chmod -R 0777 /system/framework/framework-res.apk.bakgf", "mv /system/framework/framework-res.apk.bak /system/framework/framework-res.apk", "mv /system/framework/framework-res.apk.bakgf /system/framework/framework-res.apk.bak", "chmod -R 0644 /system/framework/framework-res.apk"}; + ShellUtils.execCommand(a, true); + xtdh.setSummary("3D特效"); + reboot(); + } + + if (objValue.equals("5")) { + String[] a = new String[]{"cp /system/framework/framework-res.apk.bak /system/framework/framework-res.apk.bakgf", "rm -rf /res", "mv /res_DouDong /res", "/system/Simplicity/tools/zip -r /system/framework/framework-res.apk.bak /res", "mv /res /res_DouDong", "chmod -R 0777 /system/framework/framework-res.apk.bakgf", "mv /system/framework/framework-res.apk.bak /system/framework/framework-res.apk", "mv /system/framework/framework-res.apk.bakgf /system/framework/framework-res.apk.bak", "chmod -R 0644 /system/framework/framework-res.apk"}; + ShellUtils.execCommand(a, true); + xtdh.setSummary("抖动特效"); + reboot(); + } + + if (objValue.equals("6")) { + String[] a = new String[]{"cp /system/framework/framework-res.apk.bak /system/framework/framework-res.apk.bakgf", "rm -rf /res", "mv /res_DX8 /res", "/system/Simplicity/tools/zip -r /system/framework/framework-res.apk.bak /res", "mv /res /res_DX8", "chmod -R 0777 /system/framework/framework-res.apk.bakgf", "mv /system/framework/framework-res.apk.bak /system/framework/framework-res.apk", "mv /system/framework/framework-res.apk.bakgf /system/framework/framework-res.apk.bak", "chmod -R 0644 /system/framework/framework-res.apk"}; + ShellUtils.execCommand(a, true); + xtdh.setSummary("DX8特效"); + reboot(); + } + + if (objValue.equals("7")) { + String[] a = new String[]{"cp /system/framework/framework-res.apk.bak /system/framework/framework-res.apk.bakgf", "rm -rf /res", "mv /res_FlyLFlyQ /res", "/system/Simplicity/tools/zip -r /system/framework/framework-res.apk.bak /res", "mv /res /res_FlyLFlyQ", "chmod -R 0777 /system/framework/framework-res.apk.bakgf", "mv /system/framework/framework-res.apk.bak /system/framework/framework-res.apk", "mv /system/framework/framework-res.apk.bakgf /system/framework/framework-res.apk.bak", "chmod -R 0644 /system/framework/framework-res.apk"}; + ShellUtils.execCommand(a, true); + xtdh.setSummary(" 飞来飞去"); + reboot(); + } + + if (objValue.equals("8")) { + String[] a = new String[]{"cp /system/framework/framework-res.apk.bak /system/framework/framework-res.apk.bakgf", "rm -rf /res", "mv /res_NiName /res", "/system/Simplicity/tools/zip -r /system/framework/framework-res.apk.bak /res", "mv /res /res_NiName", "chmod -R 0777 /system/framework/framework-res.apk.bakgf", "mv /system/framework/framework-res.apk.bak /system/framework/framework-res.apk", "mv /system/framework/framework-res.apk.bakgf /system/framework/framework-res.apk.bak", "chmod -R 0644 /system/framework/framework-res.apk"}; + ShellUtils.execCommand(a, true); + xtdh.setSummary(" 匿名特效"); + reboot(); + } + + if (objValue.equals("9")) { + String[] a = new String[]{"cp /system/framework/framework-res.apk.bak /system/framework/framework-res.apk.bakgf", "rm -rf /res", "mv /res_PiaoLPiaoQ /res", "/system/Simplicity/tools/zip -r /system/framework/framework-res.apk.bak /res", "mv /res /res_PiaoLPiaoQ", "chmod -R 0777 /system/framework/framework-res.apk.bakgf", "mv /system/framework/framework-res.apk.bak /system/framework/framework-res.apk", "mv /system/framework/framework-res.apk.bakgf /system/framework/framework-res.apk.bak", "chmod -R 0644 /system/framework/framework-res.apk"}; + ShellUtils.execCommand(a, true); + xtdh.setSummary(" 飘来飘去"); + reboot(); + } + + if (objValue.equals("10")) { + String[] a = new String[]{"cp /system/framework/framework-res.apk.bak /system/framework/framework-res.apk.bakgf", "rm -rf /res", "mv /res_SuperX /res", "/system/Simplicity/tools/zip -r /system/framework/framework-res.apk.bak /res", "mv /res /res_SuperX", "chmod -R 0777 /system/framework/framework-res.apk.bakgf", "mv /system/framework/framework-res.apk.bak /system/framework/framework-res.apk", "mv /system/framework/framework-res.apk.bakgf /system/framework/framework-res.apk.bak", "chmod -R 0644 /system/framework/framework-res.apk"}; + ShellUtils.execCommand(a, true); + xtdh.setSummary(" 超炫特效"); + reboot(); + } + + if (objValue.equals("11")) { + String[] a = new String[]{"cp /system/framework/framework-res.apk.bak /system/framework/framework-res.apk.bakgf", "rm -rf /res", "mv /res_TanDong /res", "/system/Simplicity/tools/zip -r /system/framework/framework-res.apk.bak /res", "mv /res /res_TanDong", "chmod -R 0777 /system/framework/framework-res.apk.bakgf", "mv /system/framework/framework-res.apk.bak /system/framework/framework-res.apk", "mv /system/framework/framework-res.apk.bakgf /system/framework/framework-res.apk.bak", "chmod -R 0644 /system/framework/framework-res.apk"}; + ShellUtils.execCommand(a, true); + xtdh.setSummary(" 翻转特效"); + reboot(); + } + + if (objValue.equals("12")) { + String[] a = new String[]{"cp /system/framework/framework-res.apk.bak /system/framework/framework-res.apk.bakgf", "rm -rf /res", "mv /res_UP /res", "/system/Simplicity/tools/zip -r /system/framework/framework-res.apk.bak /res", "mv /res /res_UP", "chmod -R 0777 /system/framework/framework-res.apk.bakgf", "mv /system/framework/framework-res.apk.bak /system/framework/framework-res.apk", "mv /system/framework/framework-res.apk.bakgf /system/framework/framework-res.apk.bak", "chmod -R 0644 /system/framework/framework-res.apk"}; + ShellUtils.execCommand(a, true); + xtdh.setSummary(" 上中下特效"); + reboot(); + } + + } + + + if (preference == tqbj) { + if (objValue.equals("1")) { + String[] commad = new String[]{"mount -o rw,remount /","mount -o rw,remount /system","mount -o rw,remount /system_root/system","rm -rf /res","mv /res_tq_sf /res","/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /res","mv /res /res_tq_sf","chmod -R 0644 /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(commad, true); + tqbj.setSummary("状态栏图标上方(横屏不完美,不限DPI)"); + } + if (objValue.equals("2")) { + String[] commad = new String[]{"mount -o rw,remount /","mount -o rw,remount /system","mount -o rw,remount /system_root/system","rm -rf /res","mv /res_tq_zc /res","/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /res","mv /res /res_tq_zc","chmod -R 0644 /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(commad, true); + tqbj.setSummary("状态栏图标左侧(横屏完美,需小DPI)"); + } + if (objValue.equals("3")) { + String[] commad = new String[]{"mount -o rw,remount /","mount -o rw,remount /system","mount -o rw,remount /system_root/system","rm -rf /res","mv /res_tq_gb /res","/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /res","mv /res /res_tq_gb","chmod -R 0644 /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(commad, true); + tqbj.setSummary("关闭状态栏天气"); + } + } + + + if (preference == sim) { + if (objValue.equals("1")) { + String[] commad = new String[]{"mount -o rw,remount /","mount -o rw,remount /system","mount -o rw,remount /system_root/system","rm -rf /res","mv /res_yc_k0 /res","/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /res","mv /res /res_yc_k0","chmod -R 0644 /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(commad, true); + sim.setSummary("全部显示"); + } + if (objValue.equals("2")) { + String[] commad = new String[]{"mount -o rw,remount /","mount -o rw,remount /system","mount -o rw,remount /system_root/system","rm -rf /res","mv /res_yc_k1 /res","/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /res","mv /res /res_yc_k1","chmod -R 0644 /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(commad, true); + sim.setSummary("仅隐藏SIM卡1"); + } + if (objValue.equals("3")) { + String[] commad = new String[]{"mount -o rw,remount /","mount -o rw,remount /system","mount -o rw,remount /system_root/system","rm -rf /res","mv /res_yc_k2 /res","/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /res","mv /res /res_yc_k2","chmod -R 0644 /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(commad, true); + sim.setSummary("仅隐藏SIM卡2"); + } + } + if (preference == xmqh) { + if (objValue.equals("1")) { + String[] commad = new String[]{"mount -o rw,remount /", + "mount -o rw,remount /system", + "mount -o rw,remount /system_root/system", + "rm -rf /res", + "mv /ztl_mr /res", + "/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /res", + "mv /ztl_xm_cj/gfcj.dex /classes3.dex", + "/system/Simplicity/tools/zip -d /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /classes3.dex", + "/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /classes3.dex", + "mv /res /ztl_mr", + "mv /classes3.dex /ztl_xm_cj/gfcj.dex", + "chmod -R 0644 /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk", + "/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(commad, true); + + } + if (objValue.equals("2")) { + String[] commad = new String[]{"mount -o rw,remount /", + "mount -o rw,remount /system", + "mount -o rw,remount /system_root/system", + "rm -rf /res", + "mv /ztl_mr_xm /res", + "/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /res", + "mv /ztl_xm_cj/xmcj.dex /classes3.dex", + "/system/Simplicity/tools/zip -d /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /classes3.dex", + "/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /classes3.dex", + "mv /res /ztl_mr_xm", + "mv /classes3.dex /ztl_xm_cj/xmcj.dex", + "chmod -R 0644 /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk", + "/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(commad, true); + + } + if (objValue.equals("3")) { + String[] commad = new String[]{"mount -o rw,remount /", + "mount -o rw,remount /system", + "mount -o rw,remount /system_root/system", + "rm -rf /res", + "mv /ztl_jz_zc /res", + "/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /res", + "mv /ztl_xm_cj/gfcj.dex /classes3.dex", + "/system/Simplicity/tools/zip -d /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /classes3.dex", + "/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /classes3.dex", + "mv /res /ztl_jz_zc", + "mv /classes3.dex /ztl_xm_cj/gfcj.dex", + "chmod -R 0644 /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk", + "/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(commad, true); + + } + if (objValue.equals("4")) { + String[] commad = new String[]{"mount -o rw,remount /", + "mount -o rw,remount /system", + "mount -o rw,remount /system_root/system", + "rm -rf /res", + "mv /ztl_jz_xm_zc /res", + "/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /res", + "mv /ztl_xm_cj/xmcj.dex /classes3.dex", + "/system/Simplicity/tools/zip -d /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /classes3.dex", + "/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /classes3.dex", + "mv /res /ztl_jz_xm_zc", + "mv /classes3.dex /ztl_xm_cj/xmcj.dex", + "chmod -R 0644 /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk", + "/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(commad, true); + + } + if (objValue.equals("5")) { + String[] commad = new String[]{"mount -o rw,remount /", + "mount -o rw,remount /system", + "mount -o rw,remount /system_root/system", + "rm -rf /res", + "mv /ztl_jz_yc /res", + "/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /res", + "mv /ztl_xm_cj/gfcj.dex /classes3.dex", + "/system/Simplicity/tools/zip -d /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /classes3.dex", + "/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /classes3.dex", + "mv /res /ztl_jz_yc", + "mv /classes3.dex /ztl_xm_cj/gfcj.dex", + "chmod -R 0644 /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk", + "/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(commad, true); + + } + if (objValue.equals("6")) { + String[] commad = new String[]{"mount -o rw,remount /", + "mount -o rw,remount /system", + "mount -o rw,remount /system_root/system", + "rm -rf /res", + "mv /ztl_jz_xm_yc /res", + "/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /res", + "mv /ztl_xm_cj/xmcj.dex /classes3.dex", + "/system/Simplicity/tools/zip -d /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /classes3.dex", + "/system/Simplicity/tools/zip -r /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /classes3.dex", + "mv /res /ztl_jz_xm_yc", + "mv /classes3.dex /ztl_xm_cj/xmcj.dex", + "chmod -R 0644 /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk", + "/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(commad, true); + + } + } + return true; + } + + + + + + + public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, android.preference.Preference preference) { + + all_mount(); + + CheckBoxPreference hykg = (CheckBoxPreference) findPreference("hykg"); + CheckBoxPreference xptq = (CheckBoxPreference) findPreference("xptq"); + CheckBoxPreference jzcd = (CheckBoxPreference) findPreference("jzcd"); + CheckBoxPreference hide = (CheckBoxPreference) findPreference("hide"); + CheckBoxPreference ycnz = (CheckBoxPreference) findPreference("ycnz"); + CheckBoxPreference ycly = (CheckBoxPreference) findPreference("ycly"); + CheckBoxPreference ycej = (CheckBoxPreference) findPreference("ycej"); + CheckBoxPreference ycyl = (CheckBoxPreference) findPreference("ycyl"); + CheckBoxPreference ycfx = (CheckBoxPreference) findPreference("ycfx"); + CheckBoxPreference ycdw = (CheckBoxPreference) findPreference("ycdw"); + CheckBoxPreference ychd = (CheckBoxPreference) findPreference("ychd"); + CheckBoxPreference ggpb = (CheckBoxPreference) findPreference("ggpb"); + CheckBoxPreference yysd = (CheckBoxPreference) findPreference("yysd"); + CheckBoxPreference ycmg = (CheckBoxPreference) findPreference("ycmg"); + CheckBoxPreference ycmz = (CheckBoxPreference) findPreference("ycmz"); + CheckBoxPreference ycdl = (CheckBoxPreference) findPreference("ycdl"); + CheckBoxPreference dylj = (CheckBoxPreference) findPreference("dylj"); + CheckBoxPreference dydk = (CheckBoxPreference) findPreference("dydk"); + CheckBoxPreference ddl = (CheckBoxPreference) findPreference("ddl"); + + try{ + if (preference.getKey() != null && preference.getKey().startsWith("sh /")) { + ShellUtils.execCommand(preference.getKey(), true); + } + + if (preference.getKey().equals("wifi")){ + try { + Intent intent2=new Intent(MainActivity.this, WifiActivity.class); startActivity(intent2); + } catch (Exception e) { + Toast.makeText(MainActivity.this, "失败", Toast.LENGTH_SHORT).show(); + } + } + + + if (preference.getKey().equals("yydj")){ + Intent intent = new Intent(MainActivity.this, LiteActivity.class); + startActivity(intent); + } + + if (preference.getKey().equals("gw")){ + try { + Uri uri = Uri.parse("http://www.lt2333.com/"); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(intent); + } catch (Exception e) { + Toast.makeText(MainActivity.this, "访问失败", Toast.LENGTH_SHORT).show(); + } + } + + + + + if (preference.getKey().equals("pmmd")){ + final EditText dpi = new EditText(MainActivity.this); + dpi.setKeyListener(DigitsKeyListener.getInstance("0123456789")); + SpannableString s = new SpannableString("请输入220到560之间的数值"); + dpi.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("屏幕密度") + .setView(dpi) + .setCancelable(true) + .setPositiveButton("修改", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(dpi.getWindowToken(), 0); + String input = dpi.getText().toString(); + dpi.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 220 || i > 560) { + Toast.makeText(MainActivity.this, "请输入220到560之间的数值", Toast.LENGTH_SHORT).show(); + } else { + String capacity = "wm density " + i; + ShellUtils.execCommand(capacity, true); + Toast.makeText(getApplicationContext(), "密度修改为: " + input, Toast.LENGTH_SHORT).show(); + } + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + .setNegativeButton("还原", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + Toast.makeText(getApplicationContext(), "还原为官方默认", Toast.LENGTH_SHORT).show(); + ShellUtils.execCommand("wm density reset", true); + } + }) + .show(); + } + + + if (preference.getKey().equals("wk")){ + try { + String[] commad = new String[]{"am broadcast --user 0 -a update_profile com.miui.powerkeeper/com.miui.powerkeeper.cloudcontrol.CloudUpdateReceiver"}; + ShellUtils.execCommand(commad, true); + Toast.makeText(MainActivity.this, "开启成功,前往设置-电量和性能查看下吧", Toast.LENGTH_SHORT).show(); + } catch (Exception e) { + Toast.makeText(MainActivity.this, "开启失败", Toast.LENGTH_SHORT).show(); + } + } + + + + if (preference.getKey().equals("yjjj")){ + AlertDialog.Builder dialog = new AlertDialog. + Builder(MainActivity.this); + dialog.setTitle("一键精简"); + dialog.setMessage("此操作不可逆袭,可覆盖完整包恢复"); + dialog.setCancelable(false); + dialog.setPositiveButton("确定精简", new DialogInterface. + OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] { "rm -rf /system/app/VipAccount\nrm -rf /system/app/Stk\nrm -rf /system/app/AnalyticsCore\nrm -rf /system/app/BasicDreams\nrm -rf /system/app/BookmarkProvider\nrm -rf /system/app/BugReport\nrm -rf /system/app/BuiltInPrintService\nrm -rf /system/app/CaptivePortalLogin\nrm -rf /system/app/ConferenceDialer\nrm -rf /system/app/ConfURIDialer\nrm -rf /system/app/GameCenter\nrm -rf /system/app/GPSLogSave\nrm -rf /system/app/greenguard\nrm -rf /system/app/HTMLViewer\nrm -rf /system/app/KSICibaEngine\nrm -rf /system/app/LiveWallpapersPicker\nrm -rf /system/app/mab\nrm -rf /system/app/MetokNLP\nrm -rf /system/app/MiDrive\nrm -rf /system/app/MiWallpaper\nrm -rf /system/app/MSA\nrm -rf /system/app/PacProcessor\nrm -rf /system/app/PaymentService\nrm -rf /system/app/PhotoTable\nrm -rf /system/app/PrintRecommendationService\nrm -rf /system/app/PrintSpooler\nrm -rf /system/app/SYSOPT\nrm -rf /system/app/talkback\nrm -rf /system/app/TranslationService\nrm -rf /system/app/UpnpService\nrm -rf /system/app/Userguide\nrm -rf /system/app/WallpaperBackup\nrm -rf /system/app/XMPass\nrm -rf /system/app/YouDaoEngine\nrm -rf /system/priv-app/CallLogBackup\nrm -rf /system/priv-app/MiGameCenterSDKService\nrm -rf /system/priv-app/MiRcs\nrm -rf /system/priv-app/MiuiFreeformService\nrm -rf /system/priv-app/MiuiVideo\nrm -rf /system/priv-app/PicoTts\nrm -rf /system/priv-app/ProxyHandler\nrm -rf /system/priv-app/SharedStorageBackup\nrm -rf /system/priv-app/WallpaperCropper\nrm -rf /system/priv-app/Music" }; + ShellUtils.execCommand(a, true); + status();reboot(); + } + }); + dialog.setNegativeButton("取消", new DialogInterface. + OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + + } + + }); + dialog.show(); + } + + + if (preference.getKey().equals("xfss")){ + AlertDialog.Builder dialog = new AlertDialog. + Builder(MainActivity.this); + dialog.setTitle("修复搜索框显示异常"); + dialog.setCancelable(false); + dialog.setPositiveButton("修复", new DialogInterface. + OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/res","mkdir -p /data/system/Simplicity/res","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/res /system/media/theme/default/framework-miui-res","/system/Simplicity/tools/busybox sed -i '/dimen name=\"action_bar_default_height\"/d' /data/system/Simplicity/res/framework-miui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] b = new String[] {"cd /data/system/Simplicity/res","/system/Simplicity/tools/zip -r /system/media/theme/default/framework-miui-res.zip ./*","mv /system/media/theme/default/framework-miui-res.zip /system/media/theme/default/framework-miui-res","chmod -R 0644 /system/media/theme/default/framework-miui-res","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/framework-miui-res /data/system/Simplicity/bak/framework-miui-res"}; + ShellUtils.execCommand(b, true); + reboot(); + } + }); + dialog.setNegativeButton("取消", new DialogInterface. + OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + + } + + }); + dialog.show(); + } + + if (preference.getKey().equals("glhy")){ + try { + Intent intent = new Intent(); + ComponentName comp = new ComponentName("me.piebridge.prevent", "me.piebridge.prevent.ui.PreventActivity"); + intent.setComponent(comp); + startActivity(intent); + } catch (Exception e) { + Toast.makeText(MainActivity.this, "启动失败", Toast.LENGTH_SHORT).show(); + } + } + + if (preference.getKey().equals("wx")){ + ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); + ClipData mClipData = ClipData.newPlainText("Label", "小乌龟LittleTurtle网络科技"); + cm.setPrimaryClip(mClipData); + AlertDialog.Builder dialog = new AlertDialog. + Builder(MainActivity.this); + dialog.setTitle("关注微信公众号"); + dialog.setCancelable(false); + dialog.setMessage( + "微信号已复制,前往微信搜素"); + dialog.setPositiveButton("去微信", new DialogInterface. + OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + Intent intent = new Intent(); + ComponentName comp = new ComponentName("com.tencent.mm", "com.tencent.mm.ui.LauncherUI"); + intent.addCategory(Intent.CATEGORY_LAUNCHER); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setComponent(comp); + startActivity(intent); + } + }); + dialog.show(); + } + + if (preference.getKey().equals("dcys")){ + try { + Intent intent = new Intent(); + ComponentName comp = new ComponentName("com.android.settings", "com.android.settings.fuelgauge.BatteryIndicatorStyle"); + intent.setComponent(comp); + startActivity(intent); + } catch (Exception e) { + Toast.makeText(MainActivity.this, "启动失败", Toast.LENGTH_SHORT).show(); + } + } + + if (preference.getKey().equals("ca")){ + if (checkApkExist(this, "com.coolapk.market")){ + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.coolapk.com/u/883441"))); + Toast.makeText(this,"乌堆小透明:靓仔,点个关注吧!",Toast.LENGTH_SHORT).show(); + }else{ + Toast.makeText(this,"本机未安装酷安应用",Toast.LENGTH_SHORT).show(); + Uri uri = Uri.parse("http://www.coolapk.com/u/883441"); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(intent); + } + } + + if (preference.getKey().equals("dlwz")){ + final EditText dlwz = new EditText(MainActivity.this); + dlwz.setKeyListener(DigitsKeyListener.getInstance("0123456789")); + SpannableString s = new SpannableString("请输入需要伪装的电量(1-100)"); + dlwz.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("电量伪装") + .setView(dlwz) + .setCancelable(true) + .setPositiveButton("伪装", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(dlwz.getWindowToken(), 0); + String input = dlwz.getText().toString(); + dlwz.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 1 || i > 100) { + Toast.makeText(MainActivity.this, "请输入1到100之间的数值", Toast.LENGTH_SHORT).show(); + } else { + String capacity = "dumpsys battery set level " + i; + ShellUtils.execCommand(capacity, true); + Toast.makeText(getApplicationContext(), "电量伪装为: " + input, Toast.LENGTH_SHORT).show(); + } + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + .setNegativeButton("还原", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + Toast.makeText(getApplicationContext(), "还原为默认", Toast.LENGTH_SHORT).show(); + ShellUtils.execCommand("dumpsys battery reset", true); + } + }) + .show(); + } + + + if (preference.getKey().equals("zmbj_x")){ + final EditText zmbj_x = new EditText(MainActivity.this); + zmbj_x.setKeyListener(DigitsKeyListener.getInstance("0123456789")); + SpannableString s = new SpannableString("请输入(1-100)16:9/全面屏默认:4"); + zmbj_x.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("桌面布局-行-图标个数") + .setView(zmbj_x) + .setCancelable(true) + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(zmbj_x.getWindowToken(), 0); + String input = zmbj_x.getText().toString(); + zmbj_x.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 1 || i > 100) { + Toast.makeText(MainActivity.this, "请输入1到100之间的数值", Toast.LENGTH_SHORT).show(); + } else { + if ((new File("/system/media/theme/default/com.miui.home").exists())) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/integer name=\"config_cell_count_x\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i +"<\\/integer>/\" /data/system/Simplicity/home/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "桌面布局-行-图标个数 设置为: " + input, Toast.LENGTH_SHORT).show(); + } else { + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.miui.home /system/media/theme/default/com.miui.home","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/integer name=\"config_cell_count_x\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i +"<\\/integer>/\" /data/system/Simplicity/home/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "桌面布局-行-图标个数 设置为: " + input, Toast.LENGTH_SHORT).show(); + } + } + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + .setNegativeButton("取消", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + + } + }) + .show(); + } + + + if (preference.getKey().equals("zmbj_y")){ + final EditText zmbj_y = new EditText(MainActivity.this); + zmbj_y.setKeyListener(DigitsKeyListener.getInstance("0123456789")); + SpannableString s = new SpannableString("请输入(1-100)16:9默认:5 全面屏默认:6"); + zmbj_y.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("桌面布局-列-图标个数") + .setView(zmbj_y) + .setCancelable(true) + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(zmbj_y.getWindowToken(), 0); + String input = zmbj_y.getText().toString(); + zmbj_y.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 1 || i > 100) { + Toast.makeText(MainActivity.this, "请输入1到100之间的数值", Toast.LENGTH_SHORT).show(); + } else { + if ((new File("/system/media/theme/default/com.miui.home").exists())) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/integer name=\"config_cell_count_y\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i +"<\\/integer>/\" /data/system/Simplicity/home/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "桌面布局-列-图标个数 设置为: " + input, Toast.LENGTH_SHORT).show(); + } else { + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.miui.home /system/media/theme/default/com.miui.home","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/integer name=\"config_cell_count_y\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i +"<\\/integer>/\" /data/system/Simplicity/home/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "桌面布局-列-图标个数 设置为: " + input, Toast.LENGTH_SHORT).show(); + } + } + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + .setNegativeButton("取消", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + + } + }) + .show(); + } + + if (preference.getKey().equals("szgs_12h")){ + final EditText szgs_12h = new EditText(MainActivity.this); + SpannableString s = new SpannableString("请输入自定义时钟格式"); + szgs_12h.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("时钟格式-自定义-12小时制") + .setView(szgs_12h) + .setCancelable(true) + .setMessage( + "官方时钟组件不支持秒数显示\n" + + "y年 M月 d日\n" + + "h时在上午或下午(1~12)\n" + + "H时在一天中(0~23)\n" + + "m分 s秒 S毫秒 E星期\n" + + "D一年中的第几天\n" + + "F一月中第几个星期几\n" + + "w一年中第几个星期\n" + + "W一月中第几个星期\n" + + "a上午/下午标记符\n" + + "k时在一天中(1~24)\n" + + "K时在上午或下午(0~11)\n" + + "z时区 N月e农历\n" + + "支持空格,中文及- / \\等分隔符\n" + + "注:使用/或\\时需要在前加\\\n" + + "例:输入\\/ 状态栏则显示为 /\n" + + "输入\\\\ 状态栏则显示为 \\\n\n" + + "例如:N月e yyyy-MM-dd E aah:mm\n" + + "对应:七月十九 2019-08-19 周一 晚上8:50") + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(szgs_12h.getWindowToken(), 0); + String input = szgs_12h.getText().toString(); + szgs_12h.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 1 || i > 100) { + Toast.makeText(MainActivity.this, "请输入1到100之间的数值", Toast.LENGTH_SHORT).show(); + } else { + + } + } catch (NumberFormatException e) { + if ((new File("/system/media/theme/default/framework-miui-res").exists())) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/res","mkdir -p /data/system/Simplicity/res","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/res /system/media/theme/default/framework-miui-res","/system/Simplicity/tools/busybox sed -i '/string name=\"fmt_time_12hour_minute_pm\"/d' /data/system/Simplicity/res/framework-miui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + input +"<\\/string>/\" /data/system/Simplicity/res/framework-miui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"cd /data/system/Simplicity/res","/system/Simplicity/tools/zip -r /system/media/theme/default/framework-miui-res.zip ./*","mv /system/media/theme/default/framework-miui-res.zip /system/media/theme/default/framework-miui-res","chmod -R 0644 /system/media/theme/default/framework-miui-res","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/framework-miui-res /data/system/Simplicity/bak/framework-miui-res","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "时钟格式-12小时制 设置为: " + input, Toast.LENGTH_SHORT).show(); + } else { + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/framework-miui-res /system/media/theme/default/framework-miui-res","rm -rf /data/system/Simplicity/res","mkdir -p /data/system/Simplicity/res","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/res /system/media/theme/default/framework-miui-res","/system/Simplicity/tools/busybox sed -i '/string name=\"fmt_time_12hour_minute_pm\"/d' /data/system/Simplicity/res/framework-miui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + input +"<\\/string>/\" /data/system/Simplicity/res/framework-miui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"cd /data/system/Simplicity/res","/system/Simplicity/tools/zip -r /system/media/theme/default/framework-miui-res.zip ./*","mv /system/media/theme/default/framework-miui-res.zip /system/media/theme/default/framework-miui-res","chmod -R 0644 /system/media/theme/default/framework-miui-res","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/framework-miui-res /data/system/Simplicity/bak/framework-miui-res","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "时钟格式-12小时制 设置为: " + input, Toast.LENGTH_SHORT).show(); + } + } + } + }) + .setNegativeButton("恢复默认", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/res","mkdir -p /data/system/Simplicity/res","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/res /system/media/theme/default/framework-miui-res","/system/Simplicity/tools/busybox sed -i '/string name=\"fmt_time_12hour_minute_pm\"/d' /data/system/Simplicity/res/framework-miui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] b = new String[] {"cd /data/system/Simplicity/res","/system/Simplicity/tools/zip -r /system/media/theme/default/framework-miui-res.zip ./*","mv /system/media/theme/default/framework-miui-res.zip /system/media/theme/default/framework-miui-res","chmod -R 0644 /system/media/theme/default/framework-miui-res","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/framework-miui-res /data/system/Simplicity/bak/framework-miui-res","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "时钟格式-12小时制 设置为:默认", Toast.LENGTH_SHORT).show(); + } + }) + .show(); + } + + if (preference.getKey().equals("szgs_24h")){ + final EditText szgs_24h = new EditText(MainActivity.this); + SpannableString s = new SpannableString("请输入自定义时钟格式"); + szgs_24h.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("时钟格式-自定义-24小时制") + .setView(szgs_24h) + .setCancelable(true) + .setMessage( + "官方时钟组件不支持秒数显示\n" + + "y年 M月 d日\n" + + "h时在上午或下午(1~12)\n" + + "H时在一天中(0~23)\n" + + "m分 s秒 S毫秒 E星期\n" + + "D一年中的第几天\n" + + "F一月中第几个星期几\n" + + "w一年中第几个星期\n" + + "W一月中第几个星期\n" + + "a上午/下午标记符\n" + + "k时在一天中(1~24)\n" + + "K时在上午或下午(0~11)\n" + + "z时区 N月e农历\n" + + "支持空格,中文及- / \\等分隔符\n" + + "注:使用/或\\时需要在前加\\\n" + + "例:输入\\/ 状态栏则显示为 /\n" + + "输入\\\\ 状态栏则显示为 \\\n\n" + + "例如:N月e yyyy-MM-dd E aah:mm\n" + + "对应:七月十九 2019-08-19 周一 晚上8:50") + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(szgs_24h.getWindowToken(), 0); + String input = szgs_24h.getText().toString(); + szgs_24h.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 1 || i > 100) { + Toast.makeText(MainActivity.this, "请输入1到100之间的数值", Toast.LENGTH_SHORT).show(); + } else { + + } + } catch (NumberFormatException e) { + if ((new File("/system/media/theme/default/framework-miui-res").exists())) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/res","mkdir -p /data/system/Simplicity/res","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/res /system/media/theme/default/framework-miui-res","/system/Simplicity/tools/busybox sed -i '/string name=\"fmt_time_24hour_minute\"/d' /data/system/Simplicity/res/framework-miui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + input +"<\\/string>/\" /data/system/Simplicity/res/framework-miui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"cd /data/system/Simplicity/res","/system/Simplicity/tools/zip -r /system/media/theme/default/framework-miui-res.zip ./*","mv /system/media/theme/default/framework-miui-res.zip /system/media/theme/default/framework-miui-res","chmod -R 0644 /system/media/theme/default/framework-miui-res","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/framework-miui-res /data/system/Simplicity/bak/framework-miui-res","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "时钟格式-24小时制 设置为: " + input, Toast.LENGTH_SHORT).show(); + } else { + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/framework-miui-res /system/media/theme/default/framework-miui-res","rm -rf /data/system/Simplicity/res","mkdir -p /data/system/Simplicity/res","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/res /system/media/theme/default/framework-miui-res","/system/Simplicity/tools/busybox sed -i '/string name=\"fmt_time_24hour_minute\"/d' /data/system/Simplicity/res/framework-miui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + input +"<\\/string>/\" /data/system/Simplicity/res/framework-miui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"cd /data/system/Simplicity/res","/system/Simplicity/tools/zip -r /system/media/theme/default/framework-miui-res.zip ./*","mv /system/media/theme/default/framework-miui-res.zip /system/media/theme/default/framework-miui-res","chmod -R 0644 /system/media/theme/default/framework-miui-res","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/framework-miui-res /data/system/Simplicity/bak/framework-miui-res","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "时钟格式-24小时制 设置为: " + input, Toast.LENGTH_SHORT).show(); + } + } + } + }) + .setNegativeButton("恢复默认", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/res","mkdir -p /data/system/Simplicity/res","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/res /system/media/theme/default/framework-miui-res","/system/Simplicity/tools/busybox sed -i '/string name=\"fmt_time_24hour_minute\"/d' /data/system/Simplicity/res/framework-miui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] b = new String[] {"cd /data/system/Simplicity/res","/system/Simplicity/tools/zip -r /system/media/theme/default/framework-miui-res.zip ./*","mv /system/media/theme/default/framework-miui-res.zip /system/media/theme/default/framework-miui-res","chmod -R 0644 /system/media/theme/default/framework-miui-res","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/framework-miui-res /data/system/Simplicity/bak/framework-miui-res","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "时钟格式-24小时制 设置为:默认", Toast.LENGTH_SHORT).show(); + } + }) + .show(); + } + + if (preference.getKey().equals("ctbj_x")){ + final EditText ctbj_x = new EditText(MainActivity.this); + ctbj_x.setKeyListener(DigitsKeyListener.getInstance("0123456789")); + SpannableString s = new SpannableString("请输入(1-100)默认:4"); + ctbj_x.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("磁贴展开布局-行-图标个数") + .setView(ctbj_x) + .setCancelable(true) + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(ctbj_x.getWindowToken(), 0); + String input = ctbj_x.getText().toString(); + ctbj_x.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 1 || i > 100) { + Toast.makeText(MainActivity.this, "请输入1到100之间的数值", Toast.LENGTH_SHORT).show(); + } else { + if ((new File("/system/media/theme/default/com.android.systemui").exists())) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/integer name=\"quick_settings_num_columns\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i +"<\\/integer>/\" /data/system/Simplicity/ui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "磁贴展开布局-行-图标个数 设置为: " + input, Toast.LENGTH_SHORT).show(); + } else { + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.android.systemui /system/media/theme/default/com.android.systemui","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/integer name=\"quick_settings_num_columns\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i +"<\\/integer>/\" /data/system/Simplicity/ui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "磁贴展开布局-行-图标个数 设置为: " + input, Toast.LENGTH_SHORT).show(); + } + } + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + .setNegativeButton("还原", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/integer name=\"quick_settings_num_columns\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + } + }) + .show(); + } + + if (preference.getKey().equals("ctbj_y")){ + final EditText ctbj_y = new EditText(MainActivity.this); + ctbj_y.setKeyListener(DigitsKeyListener.getInstance("0123456789")); + SpannableString s = new SpannableString("请输入(1-100)默认:3"); + ctbj_y.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("磁贴展开布局-列-图标个数") + .setView(ctbj_y) + .setCancelable(true) + .setMessage("横屏时会存在BUG,可点击左下角“还原”恢复") + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(ctbj_y.getWindowToken(), 0); + String input = ctbj_y.getText().toString(); + ctbj_y.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 1 || i > 100) { + Toast.makeText(MainActivity.this, "请输入1到100之间的数值", Toast.LENGTH_SHORT).show(); + } else { + if ((new File("/system/media/theme/default/com.android.systemui").exists())) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/integer name=\"quick_settings_num_rows\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i +"<\\/integer>/\" /data/system/Simplicity/ui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "磁贴展开布局-列-图标个数 设置为: " + input, Toast.LENGTH_SHORT).show(); + } else { + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.android.systemui /system/media/theme/default/com.android.systemui","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/integer name=\"quick_settings_num_rows\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i +"<\\/integer>/\" /data/system/Simplicity/ui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "磁贴展开布局-列-图标个数 设置为: " + input, Toast.LENGTH_SHORT).show(); + } + } + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + + .setNegativeButton("还原", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/integer name=\"quick_settings_num_rows\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + } + }) + + .show(); + } + + + if (preference.getKey().equals("wjj")){ + final EditText wjj = new EditText(MainActivity.this); + wjj.setKeyListener(DigitsKeyListener.getInstance("0123456789")); + SpannableString s = new SpannableString("请输入(1-100)默认:3"); + wjj.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("桌面文件夹-行-图标个数") + .setView(wjj) + .setCancelable(true) + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(wjj.getWindowToken(), 0); + String input = wjj.getText().toString(); + wjj.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 1 || i > 100) { + Toast.makeText(MainActivity.this, "请输入1到100之间的数值", Toast.LENGTH_SHORT).show(); + } else { + if ((new File("/system/media/theme/default/com.miui.home").exists())) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/integer name=\"config_folder_columns_count\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i +"<\\/integer>/\" /data/system/Simplicity/home/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "桌面文件夹-行-图标个数 设置为: " + input, Toast.LENGTH_SHORT).show(); + } else { + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.miui.home /system/media/theme/default/com.miui.home","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/integer name=\"config_folder_columns_count\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i +"<\\/integer>/\" /data/system/Simplicity/home/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "桌面文件夹-行-图标个数 设置为: " + input, Toast.LENGTH_SHORT).show(); + } + } + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + .setNegativeButton("取消", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + + } + }) + .show(); + } + + + if (preference.getKey().equals("tbdx")){ + final EditText tbdx = new EditText(MainActivity.this); + tbdx.setKeyListener(DigitsKeyListener.getInstance("0123456789")); + SpannableString s = new SpannableString("请输入(1-100)"); + tbdx.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("桌面图标大小(单位:dp)") + .setView(tbdx) + .setCancelable(true) + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(tbdx.getWindowToken(), 0); + String input = tbdx.getText().toString(); + tbdx.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 1 || i > 100) { + Toast.makeText(MainActivity.this, "请输入1到100之间的数值", Toast.LENGTH_SHORT).show(); + } else { + if ((new File("/system/media/theme/default/com.miui.home").exists())) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"config_icon_height\"/d' /data/system/Simplicity/home/theme_values.xml","/system/Simplicity/tools/busybox sed -i '/dimen name=\"config_icon_width\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i + "dp" +"<\\/dimen>/\" /data/system/Simplicity/home/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String capacity2 = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i + "dp" + "<\\/dimen>/\" /data/system/Simplicity/home/theme_values.xml"; + ShellUtils.execCommand(capacity2, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "桌面图标大小 设置为: " + input, Toast.LENGTH_SHORT).show(); + } else { + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.miui.home /system/media/theme/default/com.miui.home","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"config_icon_height\"/d' /data/system/Simplicity/home/theme_values.xml","/system/Simplicity/tools/busybox sed -i '/dimen name=\"config_icon_width\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i + "dp" +"<\\/dimen>/\" /data/system/Simplicity/home/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String capacity2 = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i + "dp" +"<\\/dimen>/\" /data/system/Simplicity/home/theme_values.xml"; + ShellUtils.execCommand(capacity2, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "桌面图标大小 设置为: " + input, Toast.LENGTH_SHORT).show(); + } + } + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + .setNegativeButton("恢复默认", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"config_icon_height\"/d' /data/system/Simplicity/home/theme_values.xml","/system/Simplicity/tools/busybox sed -i '/dimen name=\"config_icon_width\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "已恢复默认", Toast.LENGTH_SHORT).show(); + } + }) + .show(); + } + + if (preference.getKey().equals("ksct")){ + final EditText ksct = new EditText(MainActivity.this); + ksct.setKeyListener(DigitsKeyListener.getInstance("0123456789")); + SpannableString s = new SpannableString("请输入(1-100)默认:5"); + ksct.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("磁贴未展开布局-行图标个数") + .setView(ksct) + .setCancelable(true) + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(ksct.getWindowToken(), 0); + String input = ksct.getText().toString(); + ksct.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 1 || i > 100) { + Toast.makeText(MainActivity.this, "请输入1到100之间的数值", Toast.LENGTH_SHORT).show(); + } else { + if ((new File("/system/media/theme/default/com.android.systemui").exists())) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/integer name=\"quick_settings_qqs_count\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i +"<\\/integer>/\" /data/system/Simplicity/ui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "磁贴未展开布局-行图标个数 设置为: " + input, Toast.LENGTH_SHORT).show(); + } else { + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.android.systemui /system/media/theme/default/com.android.systemui","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/integer name=\"quick_settings_qqs_count\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i +"<\\/integer>/\" /data/system/Simplicity/ui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "磁贴未展开布局-行图标个数 设置为: " + input, Toast.LENGTH_SHORT).show(); + } + } + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + .setNegativeButton("取消", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + + } + }) + .show(); + } + + + if (preference.getKey().equals("jz")){ + try { + Uri uri = Uri.parse("https://www.lt2333.com/#jz"); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(intent); + } catch (Exception e) { + Toast.makeText(MainActivity.this, "访问失败", Toast.LENGTH_SHORT).show(); + } + } + + if (preference.getKey().equals("dcjz")){ + try { + AlertDialog.Builder dialog = new AlertDialog. + Builder(MainActivity.this); + dialog.setTitle("提示"); + dialog.setMessage("请充电到100%再进行校准"); + dialog.setCancelable(false); + dialog.setPositiveButton("确定校准", new DialogInterface. + OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] {""}; + ShellUtils.execCommand(a, true); + status();reboot(); + } + }); + dialog.setNegativeButton("取消", new DialogInterface. + OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + + } + + }); + dialog.show(); + } catch (Exception e) { + + } + } + + + if (preference.getKey().equals("tzrz")){ + try { + Intent intent = new Intent(); + ComponentName comp = new ComponentName("com.android.settings", "com.android.settings.Settings$NotificationStationActivity"); + intent.setComponent(comp); + startActivity(intent); + } catch (Exception e) { + Toast.makeText(MainActivity.this, "启动失败", Toast.LENGTH_SHORT).show(); + } + } + + if (preference.getKey().equals("hdqx")){ + try { + Intent intent = new Intent(); + ComponentName comp = new ComponentName("com.miui.securitycenter", "com.miui.powercenter.batteryhistory.BatteryHistoryDetailActivity"); + intent.setComponent(comp); + startActivity(intent); + } catch (Exception e) { + Toast.makeText(MainActivity.this, "启动失败", Toast.LENGTH_SHORT).show(); + } + } + + if (preference.getKey().equals("syxz")){ + try { + + AlertDialog.Builder dialog = new AlertDialog. + Builder(MainActivity.this); + dialog.setTitle("使用须知&帮助"); + dialog.setMessage( + "如遇到无法生效的情况,请到\n" + + "【Magisk Manager-设置-开启Magisk核心功能模式】\n" + + "重启后重新进行操作。\n" + + "操作完成后可关闭Magisk核心功能模式。\n" + + "\n时间居中/天气布局/系统动画/广告屏蔽/息屏天气\n" + + "更新系统后需重新设置,其余功能不重置"); + dialog.setCancelable(false); + dialog.setPositiveButton("我知道了", new DialogInterface. + OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + } + }); + dialog.show(); + + } catch (Exception e) { + + } + } + + + if (preference.getKey().equals("ycnz")){ + ycnz.setChecked(false); + if ((new File("/data/system/Simplicity/data/ycnz_on").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycnz_on","echo 1 >/data/system/Simplicity/data/ycnz_off","/system/Simplicity/tools/busybox sed -i 's/,alarm_clock//g' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + if ((new File("/data/system/Simplicity/data/ycnz_off").exists())) { + // + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycnz_off","echo 1 >/data/system/Simplicity/data/ycnz_on","/system/Simplicity/tools/busybox sed -i 's/settings put secure icon_blacklist rotate/&,alarm_clock/' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/ycnz_on","/system/Simplicity/tools/busybox sed -i 's/settings put secure icon_blacklist rotate/&,alarm_clock/' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } + } + } + + if (preference.getKey().equals("ycly")){ + ycly.setChecked(false); + if ((new File("/data/system/Simplicity/data/ycly_on").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycly_on","echo 1 >/data/system/Simplicity/data/ycly_off","/system/Simplicity/tools/busybox sed -i 's/,bluetooth//g' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + if ((new File("/data/system/Simplicity/data/ycly_off").exists())) { + // + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycly_off","echo 1 >/data/system/Simplicity/data/ycly_on","/system/Simplicity/tools/busybox sed -i 's/settings put secure icon_blacklist rotate/&,bluetooth/' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/ycly_on","/system/Simplicity/tools/busybox sed -i 's/settings put secure icon_blacklist rotate/&,bluetooth/' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } + } + } + + + if (preference.getKey().equals("ycej")){ + ycej.setChecked(false); + if ((new File("/data/system/Simplicity/data/ycej_on").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycej_on","echo 1 >/data/system/Simplicity/data/ycej_off","/system/Simplicity/tools/busybox sed -i 's/,headset//g' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + if ((new File("/data/system/Simplicity/data/ycej_off").exists())) { + // + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycej_off","echo 1 >/data/system/Simplicity/data/ycej_on","/system/Simplicity/tools/busybox sed -i 's/settings put secure icon_blacklist rotate/&,headset/' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/ycej_on","/system/Simplicity/tools/busybox sed -i 's/settings put secure icon_blacklist rotate/&,headset/' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } + } + } + + if (preference.getKey().equals("ycyl")){ + ycyl.setChecked(false); + if ((new File("/data/system/Simplicity/data/ycyl_on").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycyl_on","echo 1 >/data/system/Simplicity/data/ycyl_off","/system/Simplicity/tools/busybox sed -i 's/,volume//g' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + if ((new File("/data/system/Simplicity/data/ycyl_off").exists())) { + // + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycyl_off","echo 1 >/data/system/Simplicity/data/ycyl_on","/system/Simplicity/tools/busybox sed -i 's/settings put secure icon_blacklist rotate/&,volume/' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/ycyl_on","/system/Simplicity/tools/busybox sed -i 's/settings put secure icon_blacklist rotate/&,volume/' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } + } + } + + if (preference.getKey().equals("ycfx")){ + ycfx.setChecked(false); + if ((new File("/data/system/Simplicity/data/ycfx_on").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycfx_on","echo 1 >/data/system/Simplicity/data/ycfx_off","/system/Simplicity/tools/busybox sed -i 's/,airplane//g' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + if ((new File("/data/system/Simplicity/data/ycfx_off").exists())) { + // + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycfx_off","echo 1 >/data/system/Simplicity/data/ycfx_on","/system/Simplicity/tools/busybox sed -i 's/settings put secure icon_blacklist rotate/&,airplane/' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/ycfx_on","/system/Simplicity/tools/busybox sed -i 's/settings put secure icon_blacklist rotate/&,airplane/' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } + } + } + + if (preference.getKey().equals("ycdw")){ + ycdw.setChecked(false); + if ((new File("/data/system/Simplicity/data/ycdw_on").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycdw_on","echo 1 >/data/system/Simplicity/data/ycdw_off","/system/Simplicity/tools/busybox sed -i 's/,location//g' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + if ((new File("/data/system/Simplicity/data/ycdw_off").exists())) { + // + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycdw_off","echo 1 >/data/system/Simplicity/data/ycdw_on","/system/Simplicity/tools/busybox sed -i 's/settings put secure icon_blacklist rotate/&,location/' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/ycdw_on","/system/Simplicity/tools/busybox sed -i 's/settings put secure icon_blacklist rotate/&,location/' /data/system/Simplicity/data/icon.sh","sh /data/system/Simplicity/data/icon.sh"}; + ShellUtils.execCommand(commands, true); + status(); + } + } + } + + if (preference.getKey().equals("dylj")){ + dylj.setChecked(false); + if ((new File("/data/system/Simplicity/data/dylj_on").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/dylj_on","echo 1 >/data/system/Simplicity/data/dylj_off","cp /system/Simplicity/tools/charging /system/media/audio/ui/charging.ogg","chmod 0644 /system/media/audio/ui/charging.ogg","mkdir -p /data/system/Simplicity/media","cp /system/media/audio/ui/charging.ogg /data/system/Simplicity/media/charging.ogg"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + if ((new File("/data/system/Simplicity/data/dylj_off").exists())) { + // + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/dylj_off","echo 1 >/data/system/Simplicity/data/dylj_on","cp /system/Simplicity/tools/0ogg /system/media/audio/ui/charging.ogg","chmod 0644 /system/media/audio/ui/charging.ogg","mkdir -p /data/system/Simplicity/media","cp /system/media/audio/ui/charging.ogg /data/system/Simplicity/media/charging.ogg"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/dylj_on","cp /system/Simplicity/tools/0ogg /system/media/audio/ui/charging.ogg","chmod 0644 /system/media/audio/ui/charging.ogg","mkdir -p /data/system/Simplicity/media","cp /system/media/audio/ui/charging.ogg /data/system/Simplicity/media/charging.ogg"}; + ShellUtils.execCommand(commands, true); + status(); + } + } + } + + + if (preference.getKey().equals("dydk")){ + dydk.setChecked(false); + if ((new File("/data/system/Simplicity/data/dydk_on").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/dydk_on","echo 1 >/data/system/Simplicity/data/dydk_off","cp /system/Simplicity/tools/disconnect /system/media/audio/ui/disconnect.ogg","chmod 0644 /system/media/audio/ui/disconnect.ogg","mkdir -p /data/system/Simplicity/media","cp /system/media/audio/ui/disconnect.ogg /data/system/Simplicity/media/disconnect.ogg"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + if ((new File("/data/system/Simplicity/data/dydk_off").exists())) { + // + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/dydk_off","echo 1 >/data/system/Simplicity/data/dydk_on","cp /system/Simplicity/tools/0ogg /system/media/audio/ui/disconnect.ogg","chmod 0644 /system/media/audio/ui/disconnect.ogg","mkdir -p /data/system/Simplicity/media","cp /system/media/audio/ui/disconnect.ogg /data/system/Simplicity/media/disconnect.ogg"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/dydk_on","cp /system/Simplicity/tools/0ogg /system/media/audio/ui/disconnect.ogg","chmod 0644 /system/media/audio/ui/disconnect.ogg","mkdir -p /data/system/Simplicity/media","cp /system/media/audio/ui/disconnect.ogg /data/system/Simplicity/media/disconnect.ogg"}; + ShellUtils.execCommand(commands, true); + status(); + } + } + } + + if (preference.getKey().equals("ddl")){ + ddl.setChecked(false); + if ((new File("/data/system/Simplicity/data/ddl_on").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ddl_on","echo 1 >/data/system/Simplicity/data/ddl_off","cp /system/Simplicity/tools/LowBattery /system/media/audio/ui/LowBattery.ogg","chmod 0644 /system/media/audio/ui/LowBattery.ogg","mkdir -p /data/system/Simplicity/media","cp /system/media/audio/ui/LowBattery.ogg /data/system/Simplicity/media/LowBattery.ogg"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + if ((new File("/data/system/Simplicity/data/ddl_off").exists())) { + // + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ddl_off","echo 1 >/data/system/Simplicity/data/ddl_on","cp /system/Simplicity/tools/0ogg /system/media/audio/ui/LowBattery.ogg","chmod 0644 /system/media/audio/ui/LowBattery.ogg","mkdir -p /data/system/Simplicity/media","cp /system/media/audio/ui/LowBattery.ogg /data/system/Simplicity/media/LowBattery.ogg"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/ddl_on","cp /system/Simplicity/tools/0ogg /system/media/audio/ui/LowBattery.ogg","chmod 0644 /system/media/audio/ui/LowBattery.ogg","mkdir -p /data/system/Simplicity/media","cp /system/media/audio/ui/LowBattery.ogg /data/system/Simplicity/media/LowBattery.ogg"}; + ShellUtils.execCommand(commands, true); + status(); + } + } + } + + if (preference.getKey().equals("ychd")){ + ychd.setChecked(false); + if ((new File("/data/system/Simplicity/data/ychd_on").exists())) { + if ((new File("/system/media/theme/default/com.android.systemui").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ychd_on","echo 1 >/data/system/Simplicity/data/ychd_off"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/bool name=\"status_bar_hide_volte\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ychd_on","echo 1 >/data/system/Simplicity/data/ychd_off"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.android.systemui /system/media/theme/default/com.android.systemui","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/bool name=\"status_bar_hide_volte\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + status(); + } + } else { + if ((new File("/data/system/Simplicity/data/ychd_off").exists())) { + if ((new File("/system/media/theme/default/com.android.systemui").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ychd_off","echo 1 >/data/system/Simplicity/data/ychd_on"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/bool name=\"status_bar_hide_volte\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] commands2 = new String[]{"/system/Simplicity/tools/busybox sed -i \"s//&\\n true<\\/bool>/\" /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(commands2, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ychd_off","echo 1 >/data/system/Simplicity/data/ychd_on"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.android.systemui /system/media/theme/default/com.android.systemui","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/bool name=\"status_bar_hide_volte\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] commands2 = new String[]{"/system/Simplicity/tools/busybox sed -i \"s//&\\n true<\\/bool>/\" /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(commands2, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + status(); + } + } else { + if ((new File("/system/media/theme/default/com.android.systemui").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/ychd_on"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/bool name=\"status_bar_hide_volte\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] commands2 = new String[]{"/system/Simplicity/tools/busybox sed -i \"s//&\\n true<\\/bool>/\" /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(commands2, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/ychd_on"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.android.systemui /system/media/theme/default/com.android.systemui","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/bool name=\"status_bar_hide_volte\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] commands2 = new String[]{"/system/Simplicity/tools/busybox sed -i \"s//&\\n true<\\/bool>/\" /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(commands2, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + status(); + } + } + + } + } + + if (preference.getKey().equals("xlszdx")){ + final EditText xlszdx = new EditText(MainActivity.this); + xlszdx.setKeyListener(DigitsKeyListener.getInstance("0123456789")); + SpannableString s = new SpannableString("请输入(1-100)"); + xlszdx.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("下拉时钟大小(单位:dp)") + .setView(xlszdx) + .setCancelable(true) + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(xlszdx.getWindowToken(), 0); + String input = xlszdx.getText().toString(); + xlszdx.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 1 || i > 100) { + Toast.makeText(MainActivity.this, "请输入1到100之间的数值", Toast.LENGTH_SHORT).show(); + } else { + if ((new File("/system/media/theme/default/com.android.systemui").exists())) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/dimen name=\"notch_expanded_clock_size\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i + "dp" +"<\\/dimen>/\" /data/system/Simplicity/ui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "下拉通知栏时钟大小 设置为: " + input, Toast.LENGTH_SHORT).show(); + } else { + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.android.systemui /system/media/theme/default/com.android.systemui","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/dimen name=\"notch_expanded_clock_size\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i + "dp" +"<\\/dimen>/\" /data/system/Simplicity/ui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "下拉通知栏时钟大小 设置为: " + input, Toast.LENGTH_SHORT).show(); + } + } + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + .setNegativeButton("恢复默认", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/dimen name=\"notch_expanded_clock_size\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "已恢复默认", Toast.LENGTH_SHORT).show(); + + } + }) + .show(); + } + + if (preference.getKey().equals("ztlszdx")){ + final EditText ztlszdx = new EditText(MainActivity.this); + ztlszdx.setKeyListener(DigitsKeyListener.getInstance("0123456789")); + SpannableString s = new SpannableString("请输入(1-100)"); + ztlszdx.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("状态栏时钟大小(单位:sp)") + .setView(ztlszdx) + .setCancelable(true) + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(ztlszdx.getWindowToken(), 0); + String input = ztlszdx.getText().toString(); + ztlszdx.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 1 || i > 100) { + Toast.makeText(MainActivity.this, "请输入1到100之间的数值", Toast.LENGTH_SHORT).show(); + } else { + if ((new File("/system/media/theme/default/com.android.systemui").exists())) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/dimen name=\"status_bar_clock_size\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i + "sp" +"<\\/dimen>/\" /data/system/Simplicity/ui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "状态栏时钟大小 设置为: " + input, Toast.LENGTH_SHORT).show(); + } else { + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.android.systemui /system/media/theme/default/com.android.systemui","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/dimen name=\"status_bar_clock_size\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i + "sp" +"<\\/dimen>/\" /data/system/Simplicity/ui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "状态栏时钟大小 设置为: " + input, Toast.LENGTH_SHORT).show(); + } + } + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + .setNegativeButton("恢复默认", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/dimen name=\"status_bar_clock_size\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "已恢复默认", Toast.LENGTH_SHORT).show(); + + } + }) + .show(); + } + + if (preference.getKey().equals("ycmg")){ + ycmg.setChecked(false); + if ((new File("/data/system/Simplicity/data/ycmg_on").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycmg_on","echo 1 >/data/system/Simplicity/data/ycmg_off", "/sbin/magiskhide --rm cmb.pb\n/sbin/magiskhide --rm com.chinamworld.main\n/sbin/magiskhide --rm com.unionpay\n/sbin/magiskhide --rm com.icbc\n/sbin/magiskhide --rm com.chinamworld.bocmbci\n/sbin/magiskhide --rm com.android.bankabc\n/sbin/magiskhide --rm com.cmbchina.ccd.pluto.cmbActivity\n/sbin/magiskhide --rm com.webank.wemoney\n/sbin/magiskhide --rm com.yitong.mbank.psbc\n/sbin/magiskhide --rm com.bankcomm.Bankcomm\n/sbin/magiskhide --rm com.citiccard.mobilebank\n/sbin/magiskhide --rm cn.com.spdb.mobilebank.per\n/sbin/magiskhide --rm com.ecitic.bank.mobile\n/sbin/magiskhide --rm com.forms\n/sbin/magiskhide --rm com.pingan.paces.ccms\n/sbin/magiskhide --rm com.cgbchina.xpt\n/sbin/magiskhide --rm com.ccb.companybank\n/sbin/magiskhide --rm com.miui.virtualsim\n/sbin/magiskhide --rm com.miui.virtualsim com.android.phone\n/sbin/magiskhide --rm com.miui.virtualsim com.miui.virtualsim:authentication\n/sbin/magiskhide --rm com.miui.virtualsim com.miui.virtualsim:pushservice"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + if ((new File("/data/system/Simplicity/data/ycmg_off").exists())) { + // + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycmg_off","echo 1 >/data/system/Simplicity/data/ycmg_on", "/sbin/magiskhide --add cmb.pb\n/sbin/magiskhide --add com.chinamworld.main\n/sbin/magiskhide --add com.unionpay\n/sbin/magiskhide --add com.icbc\n/sbin/magiskhide --add com.chinamworld.bocmbci\n/sbin/magiskhide --add com.android.bankabc\n/sbin/magiskhide --add com.cmbchina.ccd.pluto.cmbActivity\n/sbin/magiskhide --add com.webank.wemoney\n/sbin/magiskhide --add com.yitong.mbank.psbc\n/sbin/magiskhide --add com.bankcomm.Bankcomm\n/sbin/magiskhide --add com.citiccard.mobilebank\n/sbin/magiskhide --add cn.com.spdb.mobilebank.per\n/sbin/magiskhide --add com.ecitic.bank.mobile\n/sbin/magiskhide --add com.forms\n/sbin/magiskhide --add com.pingan.paces.ccms\n/sbin/magiskhide --add com.cgbchina.xpt\n/sbin/magiskhide --add com.ccb.companybank\n/sbin/magiskhide --add com.miui.virtualsim\n/sbin/magiskhide --add com.miui.virtualsim com.android.phone\n/sbin/magiskhide --add com.miui.virtualsim com.miui.virtualsim:authentication\n/sbin/magiskhide --add com.miui.virtualsim com.miui.virtualsim:pushservice"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/ycmg_on","/sbin/magiskhide --add cmb.pb\n/sbin/magiskhide --add com.chinamworld.main\n/sbin/magiskhide --add com.unionpay\n/sbin/magiskhide --add com.icbc\n/sbin/magiskhide --add com.chinamworld.bocmbci\n/sbin/magiskhide --add com.android.bankabc\n/sbin/magiskhide --add com.cmbchina.ccd.pluto.cmbActivity\n/sbin/magiskhide --add com.webank.wemoney\n/sbin/magiskhide --add com.yitong.mbank.psbc\n/sbin/magiskhide --add com.bankcomm.Bankcomm\n/sbin/magiskhide --add com.citiccard.mobilebank\n/sbin/magiskhide --add cn.com.spdb.mobilebank.per\n/sbin/magiskhide --add com.ecitic.bank.mobile\n/sbin/magiskhide --add com.forms\n/sbin/magiskhide --add com.pingan.paces.ccms\n/sbin/magiskhide --add com.cgbchina.xpt\n/sbin/magiskhide --add com.ccb.companybank\n/sbin/magiskhide --add com.miui.virtualsim\n/sbin/magiskhide --add com.miui.virtualsim com.android.phone\n/sbin/magiskhide --add com.miui.virtualsim com.miui.virtualsim:authentication\n/sbin/magiskhide --add com.miui.virtualsim com.miui.virtualsim:pushservice"}; + ShellUtils.execCommand(commands, true); + status(); + } + } + } + + + if (preference.getKey().equals("ycmz")){ + ycmz.setChecked(false); + if ((new File("/data/system/Simplicity/data/ycmz_on").exists())) { + if ((new File("/system/media/theme/default/com.miui.home").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycmz_on","echo 1 >/data/system/Simplicity/data/ycmz_off"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"icon_title_margin_top\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycmz_on","echo 1 >/data/system/Simplicity/data/ycmz_off"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.miui.home /system/media/theme/default/com.miui.home","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"icon_title_margin_top\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + status(); + } + } else { + if ((new File("/data/system/Simplicity/data/ycmz_off").exists())) { + if ((new File("/system/media/theme/default/com.miui.home").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycmz_off","echo 1 >/data/system/Simplicity/data/ycmz_on"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"icon_title_margin_top\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] commands2 = new String[]{"/system/Simplicity/tools/busybox sed -i \"s//&\\n 99dip<\\/dimen>/\" /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(commands2, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycmz_off","echo 1 >/data/system/Simplicity/data/ycmz_on"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.miui.home /system/media/theme/default/com.miui.home","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"icon_title_margin_top\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] commands2 = new String[]{"/system/Simplicity/tools/busybox sed -i \"s//&\\n 99dip<\\/dimen>/\" /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(commands2, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + status(); + } + } else { + if ((new File("/system/media/theme/default/com.miui.home").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/ycmz_on"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"icon_title_margin_top\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] commands2 = new String[]{"/system/Simplicity/tools/busybox sed -i \"s//&\\n 99dip<\\/dimen>/\" /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(commands2, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/ycmz_on"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.miui.home /system/media/theme/default/com.miui.home","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"icon_title_margin_top\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] commands2 = new String[]{"/system/Simplicity/tools/busybox sed -i \"s//&\\n 99dip<\\/dimen>/\" /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(commands2, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + status(); + } + + } + + } + } + + + if (preference.getKey().equals("ycdl")){ + ycdl.setChecked(false); + if ((new File("/data/system/Simplicity/data/ycdl_on").exists())) { + if ((new File("/system/media/theme/default/com.miui.home").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycdl_on","echo 1 >/data/system/Simplicity/data/ycdl_off"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"hotseats_height\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycdl_on","echo 1 >/data/system/Simplicity/data/ycdl_off"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.miui.home /system/media/theme/default/com.miui.home","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"hotseats_height\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + status(); + } + } else { + if ((new File("/data/system/Simplicity/data/ycdl_off").exists())) { + if ((new File("/system/media/theme/default/com.miui.home").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycdl_off","echo 1 >/data/system/Simplicity/data/ycdl_on"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"hotseats_height\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] commands2 = new String[]{"/system/Simplicity/tools/busybox sed -i \"s//&\\n 0dp<\\/dimen>/\" /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(commands2, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","rm -rf /data/system/Simplicity/data/ycdl_off","echo 1 >/data/system/Simplicity/data/ycdl_on"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.miui.home /system/media/theme/default/com.miui.home","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"hotseats_height\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] commands2 = new String[]{"/system/Simplicity/tools/busybox sed -i \"s//&\\n 0dp<\\/dimen>/\" /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(commands2, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + status(); + } + } else { + if ((new File("/system/media/theme/default/com.miui.home").exists())) { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/ycdl_on"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"hotseats_height\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] commands2 = new String[]{"/system/Simplicity/tools/busybox sed -i \"s//&\\n 0dp<\\/dimen>/\" /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(commands2, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + status(); + } else { + String[] commands = new String[]{"mkdir /data/system/Simplicity/data", "chmod 777 /data/system/Simplicity/data","echo 1 >/data/system/Simplicity/data/ycdl_on"}; + ShellUtils.execCommand(commands, true); + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.miui.home /system/media/theme/default/com.miui.home","rm -rf /data/system/Simplicity/home","mkdir -p /data/system/Simplicity/home","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/home /system/media/theme/default/com.miui.home","/system/Simplicity/tools/busybox sed -i '/dimen name=\"hotseats_height\"/d' /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String[] commands2 = new String[]{"/system/Simplicity/tools/busybox sed -i \"s//&\\n 0dp<\\/dimen>/\" /data/system/Simplicity/home/theme_values.xml"}; + ShellUtils.execCommand(commands2, true); + String[] b = new String[] {"/system/Simplicit y/tools/zip -r /system/media/theme/default/com.miui.home -j /data/system/Simplicity/home/*","chmod -R 0644 /system/media/theme/default/com.miui.home","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.miui.home /data/system/Simplicity/bak/com.miui.home","/system/Simplicity/tools/busybox killall com.miui.home"}; + ShellUtils.execCommand(b, true); + status(); + } + + } + + } + } + + + if (preference.getKey().equals("ggpb")){ + ggpb.setChecked(false); + if ((new File("/system/Simplicity/data/ggpb_on").exists())) { + String[] commands = new String[]{"mkdir /system/Simplicity/data", "chmod 777 /system/Simplicity/data","rm -rf /system/Simplicity/data/ggpb_on","echo 1 >/system/Simplicity/data/ggpb_off", "mount -o rw,remount /\nmount -o rw,remount /system\nrm -rf /system/etc/hosts\ncp /system/Simplicity/tools/AdAway_OFF /system/etc/hosts\nchmod -R 0644 /system/etc/hosts"}; + ShellUtils.execCommand(commands, true); + status();reboot(); + } else { + if ((new File("/system/Simplicity/data/ggpb_off").exists())) { + // + String[] commands = new String[]{"mkdir /system/Simplicity/data", "chmod 777 /system/Simplicity/data","rm -rf /system/Simplicity/data/ggpb_off","echo 1 >/system/Simplicity/data/ggpb_on", "mount -o rw,remount /\nmount -o rw,remount /system\nrm -rf /system/etc/hosts\ncp /system/Simplicity/tools/AdAway_ON /system/etc/hosts\nchmod -R 0644 /system/etc/hosts"}; + ShellUtils.execCommand(commands, true); + status();reboot(); + } else { + String[] commands = new String[]{"mkdir /system/Simplicity/data", "chmod 777 /system/Simplicity/data","echo 1 >/system/Simplicity/data/ggpb_on","mount -o rw,remount /\nmount -o rw,remount /system\nrm -rf /system/etc/hosts\ncp /system/Simplicity/tools/AdAway_ON /system/etc/hosts\nchmod -R 0644 /system/etc/hosts"}; + ShellUtils.execCommand(commands, true); + status();reboot(); + } + } + } + + if (preference.getKey().equals("yysd")){ + yysd.setChecked(false); + if ((new File("/system/app/MiuiSuperMarket/MiuiSuperMarket.apk").exists())) { + String[] commands = new String[]{"mount -o rw,remount /\nmount -o rw,remount /system\nmv /system/app/MiuiSuperMarket/MiuiSuperMarket.apk /system/app/MiuiSuperMarket/MiuiSuperMarket.apk.bak\nchmod -R 0644 /system/app/MiuiSuperMarket/MiuiSuperMarket.apk.bak"}; + ShellUtils.execCommand(commands, true); + status();reboot(); + } else { + if ((new File("/system/app/MiuiSuperMarket/MiuiSuperMarket.apk.bak").exists())) { + // + String[] commands = new String[]{"mount -o rw,remount /\nmount -o rw,remount /system\nmv /system/app/MiuiSuperMarket/MiuiSuperMarket.apk.bak /system/app/MiuiSuperMarket/MiuiSuperMarket.apk\nchmod -R 0644 /system/app/MiuiSuperMarket/MiuiSuperMarket.apk"}; + ShellUtils.execCommand(commands, true); + status();reboot(); + } else { + String[] commands = new String[]{"mount -o rw,remount /\nmount -o rw,remount /system\nmv /system/app/MiuiSuperMarket/MiuiSuperMarket.apk.bak /system/app/MiuiSuperMarket/MiuiSuperMarket.apk\nchmod -R 0644 /system/app/MiuiSuperMarket/MiuiSuperMarket.apk"}; + ShellUtils.execCommand(commands, true); + status();reboot(); + } + } + } + + if (preference.getKey().equals("hide")){ + hide.setChecked(false); + if ((new File("/system/Simplicity/data/hide_off").exists())) { + String[] commands = new String[] { "mkdir /system/Simplicity/data", "chmod 777 /system/Simplicity/data","rm -rf /system/Simplicity/data/hide_off","echo 1 >/system/Simplicity/data/hide_on","settings put global policy_control immersive.status=*","sync" }; + ShellUtils.execCommand(commands, true); + status(); + } else { + if ((new File("/system/Simplicity/data/hide_on").exists())) { + String[] commands = new String[] { "mkdir /system/Simplicity/data", "chmod 777 /system/Simplicity/data","rm -rf /system/Simplicity/data/hide_on","echo 1 >/system/Simplicity/data/hide_off","settings put global policy_control null","sync" }; + ShellUtils.execCommand(commands, true); + status(); + } else { + String[] commands = new String[] { "mkdir /system/Simplicity/data", "chmod 777 /system/Simplicity/data","echo 1 >/system/Simplicity/data/hide_on","settings put global policy_control immersive.status=*","sync" }; + ShellUtils.execCommand(commands, true); + status(); + } + } + } + + if (preference.getKey().equals("jzcd")){ + jzcd.setChecked(false); + if ((new File("/system/Simplicity/data/jzcd_on").exists())) { + String[] commands = new String[]{"mkdir /system/Simplicity/data", "chmod 777 /system/Simplicity/data","rm -rf /system/Simplicity/data/jzcd_on","echo 1 >/system/Simplicity/data/jzcd_off", "dumpsys battery reset", "echo 1 > /sys/class/power_supply/battery/jzcd_enabled", "echo 0 > /sys/class/power_supply/battery/input_supend"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + if ((new File("/system/Simplicity/data/jzcd_off").exists())) { + // + String[] commands = new String[]{"mkdir /system/Simplicity/data", "chmod 777 /system/Simplicity/data","rm -rf /system/Simplicity/data/jzcd_off","echo 1 >/system/Simplicity/data/jzcd_on", "dumpsys battery reset", "echo 0 > /sys/class/power_supply/battery/jzcd_enabled", "echo 1 > /sys/class/power_supply/battery/input_supend"}; + ShellUtils.execCommand(commands, true); + status(); + } else { + String[] commands = new String[]{"mkdir /system/Simplicity/data", "chmod 777 /system/Simplicity/data","echo 1 >/system/Simplicity/data/jzcd_on","dumpsys battery reset", "echo 0 > /sys/class/power_supply/battery/jzcd_enabled", "echo 1 > /sys/class/power_supply/battery/input_supend"}; + ShellUtils.execCommand(commands, true); + status(); + } + } + } + + if (preference.getKey().equals("qqq")){ + joinQQGroup("owdUmO3qcOX55kwO8HXnbY3C1xHep8OS"); + } + + + + if (preference.getKey().equals("hykg")){ + hykg.setChecked(false); + if ((new File("/system/framework/services.jar.hy").exists())) { + String[] a = new String[] { "mv /system/framework/services.jar /system/framework/services.jar.gf","mv /system/framework/services.jar.hy /system/framework/services.jar" }; + ShellUtils.execCommand(a, true); + hykg.setChecked(false); + status();reboot(); + } else { + if ((new File("/system/framework/services.jar.gf").exists())) { + String[] a = new String[] { "mv /system/framework/services.jar /system/framework/services.jar.hy","mv /system/framework/services.jar.gf /system/framework/services.jar" }; + ShellUtils.execCommand(a, true); + hykg.setChecked(true); + status();reboot(); + } else { + status(); + bcz(); + } + } + } + + if (preference.getKey().equals("xptq")){ + xptq.setChecked(false); + if ((new File("/system/Simplicity/data/xptq_on").exists())) { + String[] a = new String[] {"mount -o rw,remount /","mount -o rw,remount /system","mount -o rw,remount /system_root/system","mkdir /system/Simplicity/data", "chmod 777 /system/Simplicity/data","rm -rf /system/Simplicity/data/xptq_on","echo 1 >/system/Simplicity/data/xptq_off","rm -rf /res\nmv /res_xp_gb /res\n/system/Simplicity/tools/zip -r /system/priv-app/MiuiAod/MiuiAod.apk /res\nmv /res /res_xp_gb\nchmod -R 0644 /system/priv-app/MiuiAod/MiuiAod.apk\n/system/Simplicity/tools/busybox killall com.miui.aod"}; + ShellUtils.execCommand(a, true); + xptq.setChecked(false); + status(); + } else { + if ((new File("/system/Simplicity/data/xptq_off").exists())) { + String[] a = new String[] {"mount -o rw,remount /","mount -o rw,remount /system","mount -o rw,remount /system_root/system","mkdir /system/Simplicity/data", "chmod 777 /system/Simplicity/data","rm -rf /system/Simplicity/data/xptq_off","echo 1 >/system/Simplicity/data/xptq_on","rm -rf /res\nmv /res_xp_dk /res\n/system/Simplicity/tools/zip -r /system/priv-app/MiuiAod/MiuiAod.apk /res\nmv /res /res_xp_dk\nchmod -R 0644 /system/priv-app/MiuiAod/MiuiAod.apk\n/system/Simplicity/tools/busybox killall com.miui.aod"}; + ShellUtils.execCommand(a, true); + xptq.setChecked(true); + status(); + } else { + String[] a = new String[] {"mount -o rw,remount /","mount -o rw,remount /system","mount -o rw,remount /system_root/system","mkdir /system/Simplicity/data", "chmod 777 /system/Simplicity/data","echo 1 >/system/Simplicity/data/xptq_on","rm -rf /res\nmv /res_xp_dk /res\n/system/Simplicity/tools/zip -r /system/priv-app/MiuiAod/MiuiAod.apk /res\nmv /res /res_xp_dk\nchmod -R 0644 /system/priv-app/MiuiAod/MiuiAod.apk\n/system/Simplicity/tools/busybox killall com.miui.aod"}; + ShellUtils.execCommand(a, true); + xptq.setChecked(true); + status(); + } + } + } + + if (preference.getKey().equals("cksd")){ + final EditText cksd = new EditText(MainActivity.this); + cksd.setKeyListener(DigitsKeyListener.getInstance("0123456789.")); + SpannableString s = new SpannableString("整数时无需小数 | 默认:1 | 推荐:0.75"); + cksd.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("窗口动画缩放速度(单位:倍)") + .setView(cksd) + .setCancelable(true) + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(cksd.getWindowToken(), 0); + String input = cksd.getText().toString(); + cksd.setText(""); + try { + String capacity = "settings put global window_animation_scale " + input; + ShellUtils.execCommand(capacity, true); + Toast.makeText(getApplicationContext(), "窗口动画缩放速度 设置为: " + input, Toast.LENGTH_SHORT).show(); + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + + .setNegativeButton("还原", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] {"settings put global window_animation_scale 1"}; + ShellUtils.execCommand(a, true); + } + }) + .show(); + } + + if (preference.getKey().equals("dhsf")){ + final EditText dhsf = new EditText(MainActivity.this); + dhsf.setKeyListener(DigitsKeyListener.getInstance("0123456789.")); + SpannableString s = new SpannableString("整数时无需小数 | 默认:1 | 推荐:0.75"); + dhsf.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("过渡动画缩放速度(单位:倍)") + .setView(dhsf) + .setCancelable(true) + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(dhsf.getWindowToken(), 0); + String input = dhsf.getText().toString(); + dhsf.setText(""); + try { + String capacity = "settings put global transition_animation_scale " + input; + ShellUtils.execCommand(capacity, true); + Toast.makeText(getApplicationContext(), "过渡动画缩放速度 设置为: " + input, Toast.LENGTH_SHORT).show(); + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + + .setNegativeButton("还原", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] {"settings put global transition_animation_scale 1"}; + ShellUtils.execCommand(a, true); + } + }) + .show(); + } + + if (preference.getKey().equals("szsbj")){ + final EditText szsbj = new EditText(MainActivity.this); + szsbj.setKeyListener(DigitsKeyListener.getInstance("0123456789")); + SpannableString s = new SpannableString("请输入(1-1000)"); + szsbj.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("通知栏时钟上边距(单位:dp)") + .setView(szsbj) + .setCancelable(true) + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(szsbj.getWindowToken(), 0); + String input = szsbj.getText().toString(); + szsbj.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 1 || i > 1000) { + Toast.makeText(MainActivity.this, "请输入1到1000之间的数值", Toast.LENGTH_SHORT).show(); + } else { + if ((new File("/system/media/theme/default/com.android.systemui").exists())) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/dimen name=\"notch_expanded_header_height\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i + "dp" +"<\\/dimen>/\" /data/system/Simplicity/ui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "通知栏时钟上边距 设置为: " + input, Toast.LENGTH_SHORT).show(); + } else { + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.android.systemui /system/media/theme/default/com.android.systemui","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/dimen name=\"notch_expanded_header_height\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i + "dp" +"<\\/dimen>/\" /data/system/Simplicity/ui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "通知栏时钟上边距 设置为: " + input, Toast.LENGTH_SHORT).show(); + } + } + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + .setNegativeButton("恢复默认", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/dimen name=\"notch_expanded_header_height\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "已恢复默认", Toast.LENGTH_SHORT).show(); + + } + }) + .show(); + } + + if (preference.getKey().equals("tqdx")){ + final EditText tqdx = new EditText(MainActivity.this); + tqdx.setKeyListener(DigitsKeyListener.getInstance("0123456789")); + SpannableString s = new SpannableString("请输入(1-100)"); + tqdx.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("通知栏日期&天气大小(单位:dp)") + .setView(tqdx) + .setCancelable(true) + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(tqdx.getWindowToken(), 0); + String input = tqdx.getText().toString(); + tqdx.setText(""); + try { + int i = Integer.parseInt(input); + if (i < 1 || i > 100) { + Toast.makeText(MainActivity.this, "请输入1到100之间的数值", Toast.LENGTH_SHORT).show(); + } else { + if ((new File("/system/media/theme/default/com.android.systemui").exists())) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/dimen name=\"expanded_weather_size\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i + "dp" +"<\\/dimen>/\" /data/system/Simplicity/ui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "通知栏日期&天气大小 设置为: " + input, Toast.LENGTH_SHORT).show(); + } else { + String[] a = new String[] {"mount -o rw,remount /system","cp /system/Simplicity/tools/com.android.systemui /system/media/theme/default/com.android.systemui","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/dimen name=\"expanded_weather_size\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + String capacity = "/system/Simplicity/tools/busybox sed -i \"s//&\\n " + i + "dp" +"<\\/dimen>/\" /data/system/Simplicity/ui/theme_values.xml"; + ShellUtils.execCommand(capacity, true); + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "通知栏日期&天气大小 设置为: " + input, Toast.LENGTH_SHORT).show(); + } + } + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + .setNegativeButton("恢复默认", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] {"mount -o rw,remount /system","rm -rf /data/system/Simplicity/ui","mkdir -p /data/system/Simplicity/ui","/system/Simplicity/tools/unzip -o -d /data/system/Simplicity/ui /system/media/theme/default/com.android.systemui","/system/Simplicity/tools/busybox sed -i '/dimen name=\"expanded_weather_size\"/d' /data/system/Simplicity/ui/theme_values.xml"}; + ShellUtils.execCommand(a, true); + + String[] b = new String[] {"/system/Simplicity/tools/zip -r /system/media/theme/default/com.android.systemui -j /data/system/Simplicity/ui/*","chmod -R 0644 /system/media/theme/default/com.android.systemui","mkdir -p /data/system/Simplicity/bak","cp /system/media/theme/default/com.android.systemui /data/system/Simplicity/bak/com.android.systemui","/system/Simplicity/tools/busybox killall com.android.systemui"}; + ShellUtils.execCommand(b, true); + Toast.makeText(getApplicationContext(), "已恢复默认", Toast.LENGTH_SHORT).show(); + + } + }) + .show(); + } + + if (preference.getKey().equals("scsf")){ + final EditText scsf = new EditText(MainActivity.this); + scsf.setKeyListener(DigitsKeyListener.getInstance("0123456789.")); + SpannableString s = new SpannableString("整数时无需小数 | 默认:1 | 推荐:0.75"); + scsf.setHint(s); + + new android.app.AlertDialog.Builder(MainActivity.this) + .setTitle("Animator动画缩放速度(单位:倍)") + .setView(scsf) + .setCancelable(true) + .setPositiveButton("确定", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(scsf.getWindowToken(), 0); + String input = scsf.getText().toString(); + scsf.setText(""); + try { + String capacity = "settings put global animator_duration_scale " + input; + ShellUtils.execCommand(capacity, true); + Toast.makeText(getApplicationContext(), "Animator动画缩放速度 设置为: " + input, Toast.LENGTH_SHORT).show(); + } catch (NumberFormatException e) { + Toast.makeText(MainActivity.this, "请重新输入", Toast.LENGTH_SHORT).show(); + } + } + }) + + .setNegativeButton("还原", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] {"settings put global animator_duration_scale 1"}; + ShellUtils.execCommand(a, true); + } + }) + .show(); + } + + + + }catch(Exception e){ + // 异常 + } + return false; + } + private void bcz() { + AlertDialog.Builder dialog = new AlertDialog. + Builder(MainActivity.this); + dialog.setTitle("提示"); + dialog.setMessage( + "配置文件不存在,当前版本暂不支持"); + dialog.setCancelable(false); + dialog.setPositiveButton("确定", new DialogInterface. + OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + } + }); + dialog.show(); + } + private void setsummary() { + + findPreference("hide").setTitle("去通知栏"); + ((CheckBoxPreference) findPreference("hide")).setSummaryOff("去除通知栏 | 关"); + ((CheckBoxPreference) findPreference("hide")).setSummaryOn("去除通知栏 | 开"); + + findPreference("jzcd").setTitle("禁止充电"); + ((CheckBoxPreference) findPreference("jzcd")).setSummaryOff("禁止手机充电 | 关"); + ((CheckBoxPreference) findPreference("jzcd")).setSummaryOn("禁止手机充电 | 开"); + + + + findPreference("hykg").setTitle("黑域开关"); + ((CheckBoxPreference) findPreference("hykg")).setSummaryOff("控制后台 | 关"); + ((CheckBoxPreference) findPreference("hykg")).setSummaryOn("控制后台 | 开"); + + findPreference("ycnz").setTitle("隐藏闹钟"); + ((CheckBoxPreference) findPreference("ycnz")).setSummaryOff("隐藏闹钟图标 | 关"); + ((CheckBoxPreference) findPreference("ycnz")).setSummaryOn("隐藏闹钟图标 | 开"); + + findPreference("ycly").setTitle("隐藏蓝牙"); + ((CheckBoxPreference) findPreference("ycly")).setSummaryOff("隐藏蓝牙图标 | 关"); + ((CheckBoxPreference) findPreference("ycly")).setSummaryOn("隐藏蓝牙图标 | 开"); + + findPreference("ycej").setTitle("隐藏耳机"); + ((CheckBoxPreference) findPreference("ycej")).setSummaryOff("隐藏耳机图标 | 关"); + ((CheckBoxPreference) findPreference("ycej")).setSummaryOn("隐藏耳机图标 | 开"); + + findPreference("ycyl").setTitle("隐藏音量"); + ((CheckBoxPreference) findPreference("ycyl")).setSummaryOff("隐藏音量图标 | 关"); + ((CheckBoxPreference) findPreference("ycyl")).setSummaryOn("隐藏音量图标 | 开"); + + findPreference("ycfx").setTitle("隐藏飞行"); + ((CheckBoxPreference) findPreference("ycfx")).setSummaryOff("隐藏飞行图标 | 关"); + ((CheckBoxPreference) findPreference("ycfx")).setSummaryOn("隐藏飞行图标 | 开"); + + findPreference("ycdw").setTitle("隐藏定位"); + ((CheckBoxPreference) findPreference("ycdw")).setSummaryOff("隐藏定位图标 | 关"); + ((CheckBoxPreference) findPreference("ycdw")).setSummaryOn("隐藏定位图标 | 开"); + + findPreference("ychd").setTitle("隐藏HD"); + ((CheckBoxPreference) findPreference("ychd")).setSummaryOff("隐藏HD图标 | 关"); + ((CheckBoxPreference) findPreference("ychd")).setSummaryOn("隐藏HD图标 | 开"); + + findPreference("ggpb").setTitle("广告屏蔽"); + ((CheckBoxPreference) findPreference("ggpb")).setSummaryOff("通过Hosts屏蔽广告 | 关"); + ((CheckBoxPreference) findPreference("ggpb")).setSummaryOn("通过Hosts屏蔽广告 | 开"); + + findPreference("yysd").setTitle("官方应用商店"); + ((CheckBoxPreference) findPreference("yysd")).setSummaryOff("官方应用商店 | 关"); + ((CheckBoxPreference) findPreference("yysd")).setSummaryOn("官方应用商店 | 开"); + + findPreference("ycmg").setTitle("隐藏ROOT"); + ((CheckBoxPreference) findPreference("ycmg")).setSummaryOff("隐藏ROOT使用银行APP/一元流量等 | 关"); + ((CheckBoxPreference) findPreference("ycmg")).setSummaryOn("隐藏ROOT使用银行APP/一元流量等 | 开"); + + findPreference("ycmz").setTitle("隐藏系统桌面应用名"); + ((CheckBoxPreference) findPreference("ycmz")).setSummaryOff("隐藏系统桌面应用名 | 关"); + ((CheckBoxPreference) findPreference("ycmz")).setSummaryOn("隐藏系统桌面应用名 | 开"); + + findPreference("dylj").setTitle("禁用电源连接音效"); + ((CheckBoxPreference) findPreference("dylj")).setSummaryOff("禁用电源连接音效 | 关"); + ((CheckBoxPreference) findPreference("dylj")).setSummaryOn("禁用电源连接音效 | 开"); + + findPreference("dydk").setTitle("禁用电源断开音效"); + ((CheckBoxPreference) findPreference("dydk")).setSummaryOff("禁用电源断开音效 | 关"); + ((CheckBoxPreference) findPreference("dydk")).setSummaryOn("禁用电源断开音效 | 开"); + + findPreference("ddl").setTitle("禁用低电量提示音效"); + ((CheckBoxPreference) findPreference("ddl")).setSummaryOff("禁用低电量提示音效 | 关"); + ((CheckBoxPreference) findPreference("ddl")).setSummaryOn("禁用低电量提示音效 | 开"); + + findPreference("ycdl").setTitle("隐藏系统桌面底栏"); + ((CheckBoxPreference) findPreference("ycdl")).setSummaryOff("移除底栏应用后开启 推荐4x8布局 | 关"); + ((CheckBoxPreference) findPreference("ycdl")).setSummaryOn("移除底栏应用后开启 推荐4x8布局 | 开"); + + findPreference("xptq").setTitle("息屏天气"); + ((CheckBoxPreference) findPreference("xptq")).setSummaryOff("息屏显示天气 | 关"); + ((CheckBoxPreference) findPreference("xptq")).setSummaryOn("息屏显示天气 | 开"); + + findPreference("xmqh").setTitle("显秒&布局切换"); + findPreference("xmqh").setSummary("切换时钟显示位置和时钟秒数显示"); + + findPreference("wifi").setTitle("WIFI密码"); + findPreference("wifi").setSummary("查询已连接过的WIFI密码"); + + findPreference("sjys").setTitle("时钟格式-预设"); + findPreference("sjys").setSummary("切换状态栏时钟格式"); + + findPreference("qqq").setTitle("点此加入QQ群"); + findPreference("qqq").setSummary("QQ群 | 206256181"); + + findPreference("ca").setTitle("点此关注开发者酷安"); + findPreference("ca").setSummary("酷安 | @乌堆小透明"); + + findPreference("gw").setTitle("点此进入官网"); + findPreference("gw").setSummary("www.lt2333.com"); + + findPreference("bbh").setTitle("Simplicity Tools 版本号"); + + findPreference("ctbj_x").setTitle("磁贴展开-行-图标个数"); + findPreference("ctbj_x").setSummary("自定义快捷磁贴展开时-行-图标个数"); + + findPreference("ctbj_y").setTitle("磁贴展开-列-图标个数"); + findPreference("ctbj_y").setSummary("自定义快捷磁贴展开时-列-图标个数"); + + findPreference("ksct").setTitle("磁贴未展开-行-图标个数"); + findPreference("ksct").setSummary("自定义快捷磁贴未展开时-行-图标个数"); + + findPreference("dcys").setTitle("电池样式"); + findPreference("dcys").setSummary("在刘海屏设备使用百分比外显"); + + findPreference("pmmd").setTitle("屏幕密度"); + findPreference("pmmd").setSummary("更改屏幕密度(DPI)"); + + findPreference("xtdh").setTitle("系统动画"); + findPreference("xtdh").setSummary("更改系统过渡动画"); + + findPreference("wk").setTitle("激活温控开关"); + findPreference("wk").setSummary("激活系统设置-电池-温控开关"); + + findPreference("gjcq").setTitle("高级重启"); + findPreference("gjcq").setSummary("软重启/界面/Recovery/FastBoot……"); + + findPreference("yjjj").setTitle("一键精简"); + findPreference("yjjj").setSummary("此操作不可逆袭,可覆盖完整包恢复"); + + findPreference("glhy").setTitle("管理黑域"); + findPreference("glhy").setSummary("管理黑域,设置黑域白/黑名单"); + + findPreference("dlwz").setTitle("电量伪装"); + findPreference("dlwz").setSummary("和盆友借充电器,电量低的先充"); + + findPreference("tzrz").setTitle("通知日志"); + findPreference("tzrz").setSummary("可检查MIPUSH是否正常推送"); + + findPreference("hdqx").setTitle("耗电曲线"); + findPreference("hdqx").setSummary("快速查看电量折线图"); + + findPreference("jz").setTitle("捐赠开发者"); + findPreference("jz").setSummary("请开发者喝杯咖啡,恰顿饭"); + + findPreference("tqbj").setTitle("天气布局"); + findPreference("tqbj").setSummary("更改状态栏天气的布局"); + + findPreference("dcjz").setTitle("电池校准"); + findPreference("dcjz").setSummary("通过删除batterystats.bin校准电池"); + + findPreference("syxz").setTitle("使用须知&帮助"); + findPreference("syxz").setSummary("使用前需要知道的东西"); + + findPreference("zmbj_x").setTitle("桌面布局-行-图标个数"); + findPreference("zmbj_x").setSummary("自定义桌面布局-行-图标个数"); + + findPreference("zmbj_y").setTitle("桌面布局-列-图标个数"); + findPreference("zmbj_y").setSummary("自定义桌面布局-列-图标个数"); + + findPreference("wjj").setTitle("桌面文件夹-行-图标个数"); + findPreference("wjj").setSummary("自定义桌面文件夹-行-图标个数"); + + findPreference("yydj").setTitle("应用冻结"); + findPreference("yydj").setSummary("冻结已安装的应用程序"); + + findPreference("szgs_12h").setTitle("时钟格式-自定义-12小时制"); + findPreference("szgs_12h").setSummary("自定义时钟格式-12小时制"); + + findPreference("szgs_24h").setTitle("时钟格式-自定义-24小时制"); + findPreference("szgs_24h").setSummary("自定义时钟格式-24小时制"); + + findPreference("sim").setTitle("隐藏SIM卡图标"); + findPreference("sim").setSummary("状态栏需使用官方主题(可混搭)"); + + findPreference("cksd").setTitle("窗口动画缩放"); + findPreference("cksd").setSummary("自定义窗口动画缩放速度"); + + findPreference("dhsf").setTitle("过渡动画缩放"); + findPreference("dhsf").setSummary("自定义过渡动画缩放速度"); + + findPreference("scsf").setTitle("Animator时长缩放"); + findPreference("scsf").setSummary("自定义Animator时长缩放速度"); + + findPreference("xfss").setTitle("修复搜索框显示异常"); + findPreference("xfss").setSummary("修复MIUI11搜索框显示异常"); + + findPreference("wx").setTitle("点击关注微信公众号"); + findPreference("wx").setSummary("小乌龟LiitleTurtle网络科技"); + + findPreference("tbdx").setTitle("桌面图标大小"); + findPreference("tbdx").setSummary("自定义桌面应用图标大小"); + + findPreference("xlszdx").setTitle("下拉时钟大小"); + findPreference("xlszdx").setSummary("自定义下拉通知栏时钟大小"); + + findPreference("ztlszdx").setTitle("状态栏时钟大小"); + findPreference("ztlszdx").setSummary("自定义状态栏时钟大小"); + + findPreference("szsbj").setTitle("通知栏时钟上边距"); + findPreference("szsbj").setSummary("自定义通知栏时钟上边距"); + + findPreference("tqdx").setTitle("通知栏日期&天气大小"); + findPreference("tqdx").setSummary("自定义通知栏日期&天气文字大小"); + } + private void all_mount() { + String[] commands = new String[] { "mount -o rw,remount /","mount -o rw,remount /system","mount -o rw,remount /vendor","mount -o rw,remount /vendor/etc","mount -o rw,remount /system/vendor/etc","mount -o rw,remount /system/system","mount -o rw,remount /system/etc","mount -o rw,remount /system_root/system","echo Simplicity >/system/test","echo Simplicity >/test","rm -rf /system/res/res_center/layout/readme.txt","sync" }; + ShellUtils.execCommand(commands, true); + } + private void status() { + + + CheckBoxPreference hykg = (CheckBoxPreference) findPreference("hykg"); + CheckBoxPreference xptq = (CheckBoxPreference) findPreference("xptq"); + CheckBoxPreference jzcd = (CheckBoxPreference) findPreference("jzcd"); + CheckBoxPreference hide = (CheckBoxPreference) findPreference("hide"); + CheckBoxPreference ycnz = (CheckBoxPreference) findPreference("ycnz"); + CheckBoxPreference ycly = (CheckBoxPreference) findPreference("ycly"); + CheckBoxPreference ycej = (CheckBoxPreference) findPreference("ycej"); + CheckBoxPreference ycyl = (CheckBoxPreference) findPreference("ycyl"); + CheckBoxPreference ychd = (CheckBoxPreference) findPreference("ychd"); + CheckBoxPreference ycfx = (CheckBoxPreference) findPreference("ycfx"); + CheckBoxPreference ycdw = (CheckBoxPreference) findPreference("ycdw"); + CheckBoxPreference ggpb = (CheckBoxPreference) findPreference("ggpb"); + CheckBoxPreference yysd = (CheckBoxPreference) findPreference("yysd"); + CheckBoxPreference ycmg = (CheckBoxPreference) findPreference("ycmg"); + CheckBoxPreference ycmz = (CheckBoxPreference) findPreference("ycmz"); + CheckBoxPreference ycdl = (CheckBoxPreference) findPreference("ycdl"); + CheckBoxPreference dylj = (CheckBoxPreference) findPreference("dylj"); + CheckBoxPreference dydk = (CheckBoxPreference) findPreference("dydk"); + CheckBoxPreference ddl = (CheckBoxPreference) findPreference("ddl"); + + gjcq = (ListPreference) findPreference(gjcq_main); + gjcq.setOnPreferenceChangeListener(this); + + sjys = (ListPreference) findPreference(sjys_main); + sjys.setOnPreferenceChangeListener(this); + + xtdh = (ListPreference) findPreference(xtdh_main); + xtdh.setOnPreferenceChangeListener(this); + + tqbj = (ListPreference) findPreference(tqbj_main); + tqbj.setOnPreferenceChangeListener(this); + + xmqh = (ListPreference) findPreference(xmqh_main); + xmqh.setOnPreferenceChangeListener(this); + + sim = (ListPreference) findPreference(sim_main); + sim.setOnPreferenceChangeListener(this); + + if ((new File("/system/Simplicity/data/jzcd_on").exists())) { + jzcd.setChecked(true); + } else { + if ((new File("/system/Simplicity/data/jzcd_off").exists())) { + jzcd.setChecked(false); + } else { + jzcd.setChecked(false); + } + } + + if ((new File("/system/Simplicity/data/xptq_on").exists())) { + xptq.setChecked(true); + } else { + if ((new File("/system/Simplicity/data/xptq_off").exists())) { + xptq.setChecked(false); + } else { + xptq.setChecked(false); + } + } + + if ((new File("/data/system/Simplicity/data/ycnz_on").exists())) { + ycnz.setChecked(true); + } else { + if ((new File("/data/system/Simplicity/data/ycnz_off").exists())) { + ycnz.setChecked(false); + } else { + ycnz.setChecked(false); + } + } + + if ((new File("/data/system/Simplicity/data/ychd_on").exists())) { + ychd.setChecked(true); + } else { + if ((new File("/data/system/Simplicity/data/ychd_off").exists())) { + ychd.setChecked(false); + } else { + ychd.setChecked(false); + } + } + + + + if ((new File("/data/system/Simplicity/data/dylj_on").exists())) { + dylj.setChecked(true); + } else { + if ((new File("/data/system/Simplicity/data/dylj_off").exists())) { + dylj.setChecked(false); + } else { + dylj.setChecked(false); + } + } + + if ((new File("/data/system/Simplicity/data/dydk_on").exists())) { + dydk.setChecked(true); + } else { + if ((new File("/data/system/Simplicity/data/dydk_off").exists())) { + dydk.setChecked(false); + } else { + dydk.setChecked(false); + } + } + + if ((new File("/data/system/Simplicity/data/ddl_on").exists())) { + ddl.setChecked(true); + } else { + if ((new File("/data/system/Simplicity/data/ddl_off").exists())) { + ddl.setChecked(false); + } else { + ddl.setChecked(false); + } + } + + + if ((new File("/data/system/Simplicity/data/ycly_on").exists())) { + ycly.setChecked(true); + } else { + if ((new File("/data/system/Simplicity/data/ycly_off").exists())) { + ycly.setChecked(false); + } else { + ycly.setChecked(false); + } + } + + if ((new File("/data/system/Simplicity/data/ycyl_on").exists())) { + ycyl.setChecked(true); + } else { + if ((new File("/data/system/Simplicity/data/ycyl_off").exists())) { + ycyl.setChecked(false); + } else { + ycyl.setChecked(false); + } + } + + if ((new File("/data/system/Simplicity/data/ycfx_on").exists())) { + ycfx.setChecked(true); + } else { + if ((new File("/data/system/Simplicity/data/ycfx_off").exists())) { + ycfx.setChecked(false); + } else { + ycfx.setChecked(false); + } + } + + if ((new File("/data/system/Simplicity/data/ycdw_on").exists())) { + ycdw.setChecked(true); + } else { + if ((new File("/data/system/Simplicity/data/ycdw_off").exists())) { + ycdw.setChecked(false); + } else { + ycdw.setChecked(false); + } + } + + if ((new File("/data/system/Simplicity/data/ycej_on").exists())) { + ycej.setChecked(true); + } else { + if ((new File("/data/system/Simplicity/data/ycej_off").exists())) { + ycej.setChecked(false); + } else { + ycej.setChecked(false); + } + } + + if ((new File("/system/Simplicity/data/ggpb_on").exists())) { + ggpb.setChecked(true); + } else { + if ((new File("/system/Simplicity/data/ggpb_off").exists())) { + ggpb.setChecked(false); + } else { + ggpb.setChecked(false); + } + } + + if ((new File("/data/system/Simplicity/data/ycmz_on").exists())) { + ycmz.setChecked(true); + } else { + if ((new File("/data/system/Simplicity/data/ycmz_off").exists())) { + ycmz.setChecked(false); + } else { + ycmz.setChecked(false); + } + } + + if ((new File("/data/system/Simplicity/data/ycdl_on").exists())) { + ycdl.setChecked(true); + } else { + if ((new File("/data/system/Simplicity/data/ycdl_off").exists())) { + ycdl.setChecked(false); + } else { + ycdl.setChecked(false); + } + } + + if ((new File("/system/app/MiuiSuperMarket/MiuiSuperMarket.apk").exists())) { + yysd.setChecked(true); + } else { + if ((new File("/system/app/MiuiSuperMarket/MiuiSuperMarket.apk.bak").exists())) { + yysd.setChecked(false); + } else { + yysd.setChecked(false); + } + } + + if ((new File("/system/Simplicity/data/hide_on").exists())) { + hide.setChecked(true); + } else { + if ((new File("/system/Simplicity/data/hide_off").exists())) { + hide.setChecked(false); + } else { + hide.setChecked(false); + } + } + + if ((new File("/data/system/Simplicity/data/ycmg_on").exists())) { + ycmg.setChecked(true); + } else { + if ((new File("/data/system/Simplicity/data/ycmg_off").exists())) { + hide.setChecked(false); + } else { + hide.setChecked(false); + } + } + + + if ((new File("/system/framework/services.jar.gf").exists())) { + hykg.setChecked(true); + } else { + if ((new File("/system/framework/services.jar.hy").exists())) { + hykg.setChecked(false); + } + } + } + private void reboot() { + AlertDialog.Builder dialog = new AlertDialog. + Builder(MainActivity.this); + dialog.setTitle("提示"); + dialog.setMessage("重启手机后生效"); + dialog.setCancelable(false); + dialog.setPositiveButton("立即重启", new DialogInterface. + OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + String[] a = new String[] { "reboot" }; + ShellUtils.execCommand(a, true); + } + }); + dialog.setNegativeButton("稍后重启", new DialogInterface. + OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + Toast.makeText(MainActivity.this, "重启手机后生效", Toast.LENGTH_SHORT).show(); + } + + }); + dialog.show(); + } + + public boolean joinQQGroup(String key) { + Intent intent = new Intent(); + intent.setData(Uri.parse("mqqopensdkapi://bizAgent/qm/qr?url=http%3A%2F%2Fqm.qq.com%2Fcgi-bin%2Fqm%2Fqr%3Ffrom%3Dapp%26p%3Dandroid%26k%3D" + key)); + try { + startActivity(intent); + return true; + } catch (Exception e) { + Toast.makeText(MainActivity.this, "未安装手Q或安装的版本不支持", Toast.LENGTH_SHORT).show(); + return false; + } + } + + public boolean checkApkExist(Context context, String packageName) { + if (packageName == null || "".equals(packageName)) + return false; + try { + ApplicationInfo info = context.getPackageManager().getApplicationInfo(packageName, + PackageManager.GET_UNINSTALLED_PACKAGES); + return true; + } catch (PackageManager.NameNotFoundException e) { + return false; + } + } + + + + public void sign(){ + SignCheck signCheck = new SignCheck(this, "78:E2:A3:25:2B:7B:FD:7B:2D:FB:07:CE:EC:C3:36:D7:ED:D3:E0:19"); + if (!signCheck.check()) { + AlertDialog.Builder dialog = new AlertDialog. + Builder(MainActivity.this); + dialog.setTitle("提示"); + dialog.setMessage("Simplicity Tools异常"); + dialog.setCancelable(false); + dialog.setPositiveButton("退出", new DialogInterface. + OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + finish(); + System.exit(0); + } + }); + dialog.show(); + } + } + + public class SignCheck { + private Context context; + private String cer; + private String realCer; + + public SignCheck(Context context, String realCer) { + this.context = context; + this.realCer = realCer; + cer = null; + this.cer = getCertificateSHA1Fingerprint(); + } + + public String getCertificateSHA1Fingerprint() { + PackageManager pm = context.getPackageManager(); + String packageName = context.getPackageName(); + int flags = PackageManager.GET_SIGNATURES; + PackageInfo packageInfo = null; + try { + packageInfo = pm.getPackageInfo(packageName, flags); + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + Signature[] signatures = packageInfo.signatures; + byte[] cert = signatures[0].toByteArray(); + InputStream input = new ByteArrayInputStream(cert); + CertificateFactory cf = null; + try { + cf = CertificateFactory.getInstance("X509"); + } catch (Exception e) { + e.printStackTrace(); + } + X509Certificate c = null; + + try { + c = (X509Certificate) cf.generateCertificate(input); + } catch (Exception e) { + e.printStackTrace(); + } + String hexString = null; + try { + MessageDigest md = MessageDigest.getInstance("SHA1"); + byte[] publicKey = md.digest(c.getEncoded()); + hexString = byte2HexFormatted(publicKey); + } catch (NoSuchAlgorithmException e1) { + e1.printStackTrace(); + } catch (CertificateEncodingException e) { + e.printStackTrace(); + } + return hexString; + } + private String byte2HexFormatted(byte[] arr) { + + StringBuilder str = new StringBuilder(arr.length * 2); + + for (int i = 0; i < arr.length; i++) { + String h = Integer.toHexString(arr[i]); + int l = h.length(); + if (l == 1) + h = "0" + h; + if (l > 2) + h = h.substring(l - 2, l); + str.append(h.toUpperCase()); + if (i < (arr.length - 1)) + str.append(':'); + } + return str.toString(); + } + public boolean check() { + + if (this.realCer != null) { + cer = cer.trim(); + realCer = realCer.trim(); + return this.cer.equals(this.realCer); + } else { + finish(); + System.exit(0); + } + return false; + } + } + public void checkApk(){ + if (!checkApkExist(MainActivity.this, "Simplicity.LT.Tools")) { + AlertDialog.Builder dialog = new AlertDialog. + Builder(MainActivity.this); + dialog.setTitle("提示"); + dialog.setMessage("Simplicity Tools异常"); + dialog.setCancelable(false); + dialog.setPositiveButton("退出", new DialogInterface. + OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + finish(); + System.exit(0); + } + }); + dialog.show(); + } + } + +} \ No newline at end of file diff --git a/app/src/main/java/Simplicity/LT/Tools/ReadFile.java b/app/src/main/java/Simplicity/LT/Tools/ReadFile.java new file mode 100755 index 0000000..a0ba6d4 --- /dev/null +++ b/app/src/main/java/Simplicity/LT/Tools/ReadFile.java @@ -0,0 +1,217 @@ +package Simplicity.LT.Tools; + +import android.content.Context; +import android.net.wifi.WifiInfo; +import android.net.wifi.WifiManager; + +import java.io.BufferedReader; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ReadFile { + + ArrayList> list = new ArrayList>(); + + public ReadFile(String path) throws IOException { + String s = ""; + DataOutputStream os = null; + BufferedReader br = null; + try { + Process p = Runtime.getRuntime().exec("su"); + os = new DataOutputStream(p.getOutputStream()); + os.writeBytes("cat " + path + "\n"); + os.writeBytes("exit\n"); + os.flush(); + br = new BufferedReader(new InputStreamReader(p.getInputStream())); + String line; + while ((line = br.readLine()) != null) { + s += line.trim() + "\n"; + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (os != null) { + os.close(); + } + if (br != null) { + br.close(); + } + } + pattern(s); + } + + + private void pattern(String s) { + //if (android.os.Build.VERSION.SDK_INT >= 26) { + Pattern pattern = Pattern.compile("\\n([\\s\\S]+?)\\n\\"); + Matcher matcher = pattern.matcher(s); + while (matcher.find()) { + addOreo(matcher.group(), matcher.start(), matcher.end()); + } + //} else { + Pattern pattern1 = Pattern.compile("network=\\{\\n([\\s\\S]+?)\\n\\}"); + Matcher matcher1 = pattern1.matcher(s); + while (matcher1.find()) { + add(matcher1.group(), matcher1.start(), matcher1.end()); + } + //} + } + + private void add(String content, int s, int e) { + HashMap map = new HashMap(); + map.put("view", content); + map.put("pos",s + "," + e); + content = content.substring(9, content.length() - 2); + String[] list = content.split("\\n"); + String x, y; + for (String info : list) { + int index = info.indexOf("="); + if (index > -1) { + x = info.substring(0, index); + y = info.substring(index + 1); + } else { + continue; + } + if ("ssid".equals(x)) { + if (y.charAt(0) == '"') { + y = y.substring(1, y.length() - 1); + } else { + y = toUTF8(y); + } + } else if ("psk".equals(x)) { + y = y.substring(1, y.length() - 1); + } + if (y == null) { + continue; + } + map.put(x, y); + } + this.list.add(map); + } + + + private void addOreo(String content, int s, int e) { + HashMap map = new HashMap(); + map.put("pos",s + "," + e); + String[] list = content.split("\\n"); + String x; + for (String info : list) { + if (info.contains("name=\"SSID\">")) { + x = getSubUtilSimple(info, "name=\"SSID\">"(.*?)""); + map.put("ssid",x); + } else if (info.contains("name=\"PreSharedKey\"")) { + if (!info.contains("null")) { + x = getSubUtilSimple(info, "name=\"PreSharedKey\">"(.*?)""); + map.put("psk", x); + } + } + } + map.put("view", content); + this.list.add(map); + } + + public ArrayList> getList(Context context) { + ArrayList> m = new ArrayList>(); + for (Map map : this.list) { + if (map.containsKey("ssid") && map.containsKey("psk")) { + m.add(map); + } + } + return this.sorting(m, context); + } + + private ArrayList> sorting(ArrayList> lv, Context context) { + if (lv.size() < 1) { + return lv; + } + + Collections.sort(lv, new sort(getCurrentSSID(context))); + + return lv; + } + + private String getCurrentSSID(Context context) { + try { + WifiManager mWifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); + if (!mWifi.isWifiEnabled()) { + return ""; + } + WifiInfo wifiInfo = mWifi.getConnectionInfo(); + String ssid = wifiInfo.getSSID(); + + if (ssid.charAt(0) == '"') { + ssid = ssid.substring(1, ssid.length() - 1); + } else { + ssid = toUTF8(ssid); + } + + return ssid; + } catch (Exception e) { + + return ""; + } + } + + private static String toUTF8(String s) { + if (s == null || s.equals("")) { + return null; + } + s = s.toUpperCase(); + int total = s.length() / 2; + int pos = 0; + byte[] buffer = new byte[total]; + for (int i = 0; i < total; i++) { + int start = i * 2; + buffer[i] = (byte) Integer.parseInt(s.substring(start, start + 2), 16); + pos++; + } + return new String(buffer, 0, pos, StandardCharsets.UTF_8); + } + + public static String getSubUtilSimple(String soap, String rgex){ + Pattern pattern = Pattern.compile(rgex); + Matcher m = pattern.matcher(soap); + while(m.find()){ + return m.group(1); + } + return ""; + } + +} + +class sort implements Comparator> { + + private String currentSSID; + + public sort(String currentSSID) { + this.currentSSID = currentSSID; + } + + @Override + public int compare(Map t1, Map t2) { + String s1 = t1.get("ssid"); + String s2 = t2.get("ssid"); + + if (s1.equals(s2)) { + return 0; + } + + if (s1.equals(currentSSID)) { + return -1; + } + if (s2.equals(currentSSID)) { + return 1; + } + return s1.compareToIgnoreCase(s2); + } +} + diff --git a/app/src/main/java/Simplicity/LT/Tools/ShellUtils.java b/app/src/main/java/Simplicity/LT/Tools/ShellUtils.java new file mode 100755 index 0000000..06a8e4a --- /dev/null +++ b/app/src/main/java/Simplicity/LT/Tools/ShellUtils.java @@ -0,0 +1,204 @@ +package Simplicity.LT.Tools; + +import java.io.BufferedReader; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.List; + +public class ShellUtils { + + public static final String COMMAND_SU = "su"; + public static final String COMMAND_SH = "sh"; + public static final String COMMAND_EXIT = "exit\n"; + public static final String COMMAND_LINE_END = "\n"; + + private ShellUtils() { + throw new AssertionError(); + } + + /** + * check whether has root permission + * + * @return + */ + public static boolean checkRootPermission() { + return execCommand("echo root", true, false).result == 0; + } + + /** + * execute shell command, default return result msg + * + * @param command command + * @param isRoot whether need to run with root + * @return + * @see ShellUtils#execCommand(String[], boolean, boolean) + */ + public static CommandResult execCommand(String command, boolean isRoot) { + return execCommand(new String[] {command}, isRoot, true); + } + + /** + * execute shell commands, default return result msg + * + * @param commands command activity_wifi + * @param isRoot whether need to run with root + * @return + * @see ShellUtils#execCommand(String[], boolean, boolean) + */ + public static CommandResult execCommand(List commands, boolean isRoot) { + return execCommand(commands == null ? null : commands.toArray(new String[] {}), isRoot, true); + } + + /** + * execute shell commands, default return result msg + * + * @param commands command array + * @param isRoot whether need to run with root + * @return + * @see ShellUtils#execCommand(String[], boolean, boolean) + */ + public static CommandResult execCommand(String[] commands, boolean isRoot) { + return execCommand(commands, isRoot, true); + } + + /** + * execute shell command + * + * @param command command + * @param isRoot whether need to run with root + * @param isNeedResultMsg whether need result msg + * @return + * @see ShellUtils#execCommand(String[], boolean, boolean) + */ + public static CommandResult execCommand(String command, boolean isRoot, boolean isNeedResultMsg) { + return execCommand(new String[] {command}, isRoot, isNeedResultMsg); + } + + /** + * execute shell commands + * + * @param commands command activity_wifi + * @param isRoot whether need to run with root + * @param isNeedResultMsg whether need result msg + * @return + * @see ShellUtils#execCommand(String[], boolean, boolean) + */ + public static CommandResult execCommand(List commands, boolean isRoot, boolean isNeedResultMsg) { + return execCommand(commands == null ? null : commands.toArray(new String[] {}), isRoot, isNeedResultMsg); + } + + /** + * execute shell commands + * + * @param commands command array + * @param isRoot whether need to run with root + * @param isNeedResultMsg whether need result msg + * @return
    + *
  • if isNeedResultMsg is false, {@link CommandResult#successMsg} is null and + * {@link CommandResult#errorMsg} is null.
  • + *
  • if {@link CommandResult#result} is -1, there maybe some excepiton.
  • + *
+ */ + public static CommandResult execCommand(String[] commands, boolean isRoot, boolean isNeedResultMsg) { + int result = -1; + if (commands == null || commands.length == 0) { + return new CommandResult(result, null, null); + } + + Process process = null; + BufferedReader successResult = null; + BufferedReader errorResult = null; + StringBuilder successMsg = null; + StringBuilder errorMsg = null; + + DataOutputStream os = null; + try { + process = Runtime.getRuntime().exec(isRoot ? COMMAND_SU : COMMAND_SH); + os = new DataOutputStream(process.getOutputStream()); + for (String command : commands) { + if (command == null) { + continue; + } + + // donnot use os.writeBytes(commmand), avoid chinese charset error + os.write(command.getBytes()); + os.writeBytes(COMMAND_LINE_END); + os.flush(); + } + os.writeBytes(COMMAND_EXIT); + os.flush(); + + result = process.waitFor(); + // get command result + if (isNeedResultMsg) { + successMsg = new StringBuilder(); + errorMsg = new StringBuilder(); + successResult = new BufferedReader(new InputStreamReader(process.getInputStream())); + errorResult = new BufferedReader(new InputStreamReader(process.getErrorStream())); + String s; + while ((s = successResult.readLine()) != null) { + successMsg.append(s); + } + while ((s = errorResult.readLine()) != null) { + errorMsg.append(s); + } + } + } catch (IOException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + if (os != null) { + os.close(); + } + if (successResult != null) { + successResult.close(); + } + if (errorResult != null) { + errorResult.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + if (process != null) { + process.destroy(); + } + } + return new CommandResult(result, successMsg == null ? null : successMsg.toString(), errorMsg == null ? null + : errorMsg.toString()); + } + + /** + * result of command + *
    + *
  • {@link CommandResult#result} means result of command, 0 means normal, else means error, same to excute in + * linux shell
  • + *
  • {@link CommandResult#successMsg} means success message of command result
  • + *
  • {@link CommandResult#errorMsg} means error message of command result
  • + *
+ * + * @author
Trinea
2013-5-16 + */ + public static class CommandResult { + + /** result of command **/ + public int result; + /** success message of command result **/ + public String successMsg; + /** error message of command result **/ + public String errorMsg; + + public CommandResult(int result) { + this.result = result; + } + + public CommandResult(int result, String successMsg, String errorMsg) { + this.result = result; + this.successMsg = successMsg; + this.errorMsg = errorMsg; + } + } +} \ No newline at end of file diff --git a/app/src/main/java/Simplicity/LT/Tools/SystemProperties.java b/app/src/main/java/Simplicity/LT/Tools/SystemProperties.java new file mode 100755 index 0000000..c7d3592 --- /dev/null +++ b/app/src/main/java/Simplicity/LT/Tools/SystemProperties.java @@ -0,0 +1,189 @@ +package Simplicity.LT.Tools; + +import android.content.Context; + +import java.io.File; +import java.lang.reflect.Method; + +import dalvik.system.DexFile; + +public class SystemProperties { + /** + * 根据给定Key获取值. + * + * @return 如果不存在该key则返回空字符串 + */ + public static String get(Context context, String key) throws IllegalArgumentException { + String ret = ""; + try { + ClassLoader cl = context.getClassLoader(); + @SuppressWarnings("rawtypes") + Class SystemProperties = cl.loadClass("android.os.SystemProperties"); +//参数类型 + @SuppressWarnings("rawtypes") + Class[] paramTypes = new Class[1]; + paramTypes[0] = String.class; + Method get = SystemProperties.getMethod("get", paramTypes); +//参数 + Object[] params = new Object[1]; + params[0] = key; + ret = (String) get.invoke(SystemProperties, params); + } catch (IllegalArgumentException iAE) { + throw iAE; + } catch (Exception e) { + ret = ""; +//TODO + } + return ret; + } + + + + public static String get(Context context, String key, String def) throws IllegalArgumentException { + String ret = def; + try { + ClassLoader cl = context.getClassLoader(); + @SuppressWarnings("rawtypes") + Class SystemProperties = cl.loadClass("android.os.SystemProperties"); +//参数类型 + @SuppressWarnings("rawtypes") + Class[] paramTypes = new Class[2]; + paramTypes[0] = String.class; + paramTypes[1] = String.class; + Method get = SystemProperties.getMethod("get", paramTypes); +//参数 + Object[] params = new Object[2]; + params[0] = key; + params[1] = def; + ret = (String) get.invoke(SystemProperties, params); + } catch (IllegalArgumentException iAE) { + throw iAE; + } catch (Exception e) { + ret = def; +//TODO + } + return ret; + } + + + public static Integer getInt(Context context, String key, int def) throws IllegalArgumentException { + Integer ret = def; + try { + ClassLoader cl = context.getClassLoader(); + @SuppressWarnings("rawtypes") + Class SystemProperties = cl.loadClass("android.os.SystemProperties"); +//参数类型 + @SuppressWarnings("rawtypes") + Class[] paramTypes = new Class[2]; + paramTypes[0] = String.class; + paramTypes[1] = int.class; + Method getInt = SystemProperties.getMethod("getInt", paramTypes); +//参数 + Object[] params = new Object[2]; + params[0] = key; + params[1] = new Integer(def); + ret = (Integer) getInt.invoke(SystemProperties, params); + } catch (IllegalArgumentException iAE) { + throw iAE; + } catch (Exception e) { + ret = def; +//TODO + } + return ret; + } + + /** + * 根据给定的key返回long类型值. + * + * @param key 要查询的key + * @param def 默认返回值 + * @return 返回一个long类型的值, 如果没有发现则返回默认值 + + */ + public static Long getLong(Context context, String key, long def) throws IllegalArgumentException { + Long ret = def; + try { + ClassLoader cl = context.getClassLoader(); + @SuppressWarnings("rawtypes") + Class SystemProperties = cl.loadClass("android.os.SystemProperties"); +//参数类型 + @SuppressWarnings("rawtypes") + Class[] paramTypes = new Class[2]; + paramTypes[0] = String.class; + paramTypes[1] = long.class; + Method getLong = SystemProperties.getMethod("getLong", paramTypes); +//参数 + Object[] params = new Object[2]; + params[0] = key; + params[1] = new Long(def); + ret = (Long) getLong.invoke(SystemProperties, params); + } catch (IllegalArgumentException iAE) { + throw iAE; + } catch (Exception e) { + ret = def; +//TODO + } + return ret; + } + + /** + * 根据给定的key返回boolean类型值. + * 如果值为 'n', 'no', '0', 'false' or 'off' 返回false. + * 如果值为'y', 'yes', '1', 'true' or 'on' 返回true. + * 如果key不存在, 或者是其它的值, 则返回默认值. + * + + */ + public static Boolean getBoolean(Context context, String key, boolean def) throws IllegalArgumentException { + Boolean ret = def; + try { + ClassLoader cl = context.getClassLoader(); + @SuppressWarnings("rawtypes") + Class SystemProperties = cl.loadClass("android.os.SystemProperties"); + //参数类型 + @SuppressWarnings("rawtypes") + Class[] paramTypes = new Class[2]; + paramTypes[0] = String.class; + paramTypes[1] = boolean.class; + Method getBoolean = SystemProperties.getMethod("getBoolean", paramTypes); + //参数 + Object[] params = new Object[2]; + params[0] = key; + params[1] = new Boolean(def); + ret = (Boolean) getBoolean.invoke(SystemProperties, params); + } catch (IllegalArgumentException iAE) { + throw iAE; + } catch (Exception e) { + ret = def; +//TODO + } + return ret; + } + + + public static void set(Context context, String key, String val) throws IllegalArgumentException { + try { + @SuppressWarnings("unused") + DexFile df = new DexFile(new File("/system/app/Settings.apk")); + @SuppressWarnings("unused") + ClassLoader cl = context.getClassLoader(); + @SuppressWarnings("rawtypes") + Class SystemProperties = Class.forName("android.os.SystemProperties"); +//参数类型 + @SuppressWarnings("rawtypes") + Class[] paramTypes = new Class[2]; + paramTypes[0] = String.class; + paramTypes[1] = String.class; + Method set = SystemProperties.getMethod("set", paramTypes); +//参数 + Object[] params = new Object[2]; + params[0] = key; + params[1] = val; + set.invoke(SystemProperties, params); + } catch (IllegalArgumentException iAE) { + throw iAE; + } catch (Exception e) { +//TODO + } + } +} \ No newline at end of file diff --git a/app/src/main/java/Simplicity/LT/Tools/WiFiAdapter.java b/app/src/main/java/Simplicity/LT/Tools/WiFiAdapter.java new file mode 100755 index 0000000..aff496c --- /dev/null +++ b/app/src/main/java/Simplicity/LT/Tools/WiFiAdapter.java @@ -0,0 +1,59 @@ +package Simplicity.LT.Tools; + +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.TextView; + +import java.util.ArrayList; +import java.util.Map; + +public class WiFiAdapter extends BaseAdapter { + private Context context; + ArrayList> mainList; + public WiFiAdapter(Context context, ArrayList> list) { + super(); + this.context = context; + this.mainList = list; + } + + @Override + public int getCount() { + return mainList.size(); + } + + @Override + public Object getItem(int position) { + return position; + } + + @Override + public long getItemId(int position) { + return position; + } + + @Override + public View getView(int position, View view, ViewGroup parent) { + ViewHolder holder; + Map m = mainList.get(position); + if (view != null) { + holder = (ViewHolder) view.getTag(); + } else { + view = View.inflate(context, R.layout.wifi_info, null); + holder = new ViewHolder(); + holder.ssid = view.findViewById(R.id.ssid); + holder.password = view.findViewById(R.id.password); + view.setTag(holder); + } + holder.ssid.setText(m.get("ssid")); + holder.password.setText(m.get("psk")); + return view; + } + + class ViewHolder { + public TextView ssid; + public TextView password; + } + + } diff --git a/app/src/main/java/Simplicity/LT/Tools/WifiActivity.java b/app/src/main/java/Simplicity/LT/Tools/WifiActivity.java new file mode 100755 index 0000000..59092c7 --- /dev/null +++ b/app/src/main/java/Simplicity/LT/Tools/WifiActivity.java @@ -0,0 +1,94 @@ +package Simplicity.LT.Tools; + +import android.content.ClipData; +import android.content.ClipboardManager; +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import miui.app.Activity; +import android.view.MenuItem; +import android.view.View; +import android.widget.AdapterView; +import android.widget.ListView; +import android.widget.Toast; + +import java.util.ArrayList; +import java.util.Map; + +public class WifiActivity extends Activity { + ArrayList> mainList; + Context context = this; + String sPath; + + @Override + protected void onCreate(Bundle savedInstanceState) { + setTheme(miui.R.style.Theme_Light_Settings); + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_wifi); + Intent intent = getIntent(); + if (Build.VERSION.SDK_INT >= 26) { + intent.putExtra("path", "/data/misc/wifi/WifiConfigStore.xml"); + } else { + intent.putExtra("path", "/data/misc/wifi/wpa_supplicant.conf"); + } + if(Intent.ACTION_VIEW.equals(getIntent().getAction())) { + sPath = intent.getDataString().substring(8); + if(sPath.contains("%20")) { + finish(); + System.exit(0); + } else { + mainList = get(sPath); + } + } else { + Bundle bundle = intent.getExtras(); + sPath = bundle.getString("path"); + mainList = get(sPath); + } + onWork(); + } + + private void onWork() { + if (mainList == null) { + Toast.makeText(WifiActivity.this, "未发现密码", Toast.LENGTH_LONG).show(); + } else { + if (mainList.size() == 0) { + Toast.makeText(WifiActivity.this, "未发现密码", Toast.LENGTH_LONG).show(); + } else { + doWork(); + } + } + } + + + private void doWork() { + ListView lv = findViewById(R.id.WIFI); + lv.setAdapter(new WiFiAdapter(this, mainList)); + lv.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView parent, View view, final int position, long id) { + final ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); + cm.setPrimaryClip(ClipData.newPlainText(null, mainList.get(position).get("psk"))); + Toast.makeText(WifiActivity.this, "已复制密码到剪切板", Toast.LENGTH_SHORT).show(); + } + }); + + } + + public ArrayList> get(String path) { + try { + ReadFile file = new ReadFile(path); + return file.getList(this.context); + } catch (Exception e) { + Toast.makeText(this, "ReadFile:" + e.getMessage(), Toast.LENGTH_LONG).show(); + return null; + } + } + + public boolean onOptionsItemSelected(MenuItem item) { + if(item.getItemId() == android.R.id.home){ + onBackPressed(); + } + return true; + } +} diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100755 index 0000000..1f6bb29 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100755 index 0000000..0d025f9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_wifi.xml b/app/src/main/res/layout/activity_wifi.xml new file mode 100755 index 0000000..85b9e04 --- /dev/null +++ b/app/src/main/res/layout/activity_wifi.xml @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/app/src/main/res/layout/wifi_info.xml b/app/src/main/res/layout/wifi_info.xml new file mode 100755 index 0000000..ea5edee --- /dev/null +++ b/app/src/main/res/layout/wifi_info.xml @@ -0,0 +1,19 @@ + + + + + + diff --git a/app/src/main/res/menu/menu.xml b/app/src/main/res/menu/menu.xml new file mode 100755 index 0000000..311cf7b --- /dev/null +++ b/app/src/main/res/menu/menu.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100755 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100755 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100755 index 0000000..898f3ed Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100755 index 0000000..dffca36 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100755 index 0000000..64ba76f Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100755 index 0000000..dae5e08 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100755 index 0000000..e5ed465 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100755 index 0000000..14ed0af Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100755 index 0000000..b0907ca Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100755 index 0000000..d8ae031 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100755 index 0000000..2c18de9 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100755 index 0000000..beed3cd Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/values/array.xml b/app/src/main/res/values/array.xml new file mode 100755 index 0000000..efa4cdb --- /dev/null +++ b/app/src/main/res/values/array.xml @@ -0,0 +1,125 @@ + + + + gjcq + 正常重启 + Recovery + FastBoot + 重启系统UI + + + gjcq_values + 1 + 2 + 3 + 4 + + + xtdh + 官方默认 + 极速残影 + 滑入滑出 + 3D特效 + 抖动特效 + DX8特效 + 飞来飞去 + 匿名特效 + 飘来飘去 + 超炫特效 + 翻转特效 + 上中下特效 + + + xtdh_values + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + + + model + 官方默认 + 小米9 + 小米8 + 小米 MIX3 + 小米 MIX2S + + + + model_values + 1 + 2 + 3 + 4 + 5 + + + sjys + 默认样式 + 星期 时间 + 农历 时间 + 年-月-日 星期 时间 + 农历 年-月-日 星期 时间 + 农历 星期 时间 + + + sjys_values + 1 + 2 + 3 + 4 + 5 + 6 + + + tqbj + 状态栏图标上方(横屏不完美,不限DPI) + 状态栏图标左侧(横屏完美,需小DPI) + 关闭状态栏天气 + + + tqbj_values + 1 + 2 + 3 + + + sim + 全部显示 + 仅隐藏SIM卡1 + 仅隐藏SIM卡2 + + + sim_values + 1 + 2 + 3 + + + xmqh + 官方 + 官方+显秒 + 居中+左侧网速 + 居中+左侧网速+显秒 + 居中+右侧网速 + 居中+右侧网速+显秒 + + + xmqh_values + 1 + 2 + 3 + 4 + 5 + 6 + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100755 index 0000000..b1355e2 --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,22 @@ + + Simplicity Tools + 关于 + WIFI密码 + 状态栏 + 其他功能 + 桌面(某些主题不兼容) + 快速磁贴(某些主题不兼容) + 显示 + 实验性功能 + 系统 + 黑域 + 捷径 + 电池 + 应用冻结 + 冻结开关 + LittleTurtle网络科技 提供技术支持 + 声音 + 关于 + 退出 + 锁屏 + diff --git a/app/src/main/res/xml/lite.xml b/app/src/main/res/xml/lite.xml new file mode 100755 index 0000000..beb6192 --- /dev/null +++ b/app/src/main/res/xml/lite.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/miui.xml b/app/src/main/res/xml/miui.xml new file mode 100755 index 0000000..0b438dc --- /dev/null +++ b/app/src/main/res/xml/miui.xml @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100755 index 0000000..f5fb2cc --- /dev/null +++ b/build.gradle @@ -0,0 +1,27 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + google() + jcenter() + + } + dependencies { + classpath 'com.android.tools.build:gradle:3.5.0' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + google() + jcenter() + + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/gradle.properties b/gradle.properties new file mode 100755 index 0000000..82618ce --- /dev/null +++ b/gradle.properties @@ -0,0 +1,15 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx1536m +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true + + diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100755 index 0000000..f6b961f Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100755 index 0000000..0ad636b --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Aug 27 04:35:44 CST 2019 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..cccdd3d --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100755 index 0000000..f955316 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle new file mode 100755 index 0000000..e7b4def --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +include ':app'