diff --git a/app/build.gradle b/app/build.gradle index bc4ff82e..c9e6d109 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.lt2333.simplicitytools" minSdk 30 targetSdk 32 - versionCode 2 - versionName "1.0.1" + versionCode 3 + versionName "1.0.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/com/lt2333/simplicitytools/activity/SettingsActivity.kt b/app/src/main/java/com/lt2333/simplicitytools/activity/SettingsActivity.kt index 4a4ab896..d0f4c09c 100644 --- a/app/src/main/java/com/lt2333/simplicitytools/activity/SettingsActivity.kt +++ b/app/src/main/java/com/lt2333/simplicitytools/activity/SettingsActivity.kt @@ -22,9 +22,9 @@ class SettingsActivity : AppCompatActivity() { setContentView(R.layout.settings_activity) if (savedInstanceState == null) { supportFragmentManager - .beginTransaction() - .replace(R.id.settings, SettingsFragment()) - .commit() + .beginTransaction() + .replace(R.id.settings, SettingsFragment()) + .commit() } supportActionBar?.setDisplayHomeAsUpEnabled(false) checkLSPosed() @@ -41,13 +41,17 @@ class SettingsActivity : AppCompatActivity() { getSharedPreferences("config", MODE_WORLD_READABLE) } catch (exception: SecurityException) { AlertDialog.Builder(this) - .setMessage("您似乎正在使用过时的 LSPosed 版本或 LSPosed 未激活,请更新 LSPosed 或者激活后再试。") - .show() + .setMessage("您似乎正在使用过时的 LSPosed 版本或 LSPosed 未激活,请更新 LSPosed 或者激活后再试。") + .show() } } override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { + R.id.reboot -> { + val commad = arrayOf("reboot") + ShellUtils.execCommand(commad, true) + } R.id.reboot_ui -> { val commad = arrayOf("killall com.android.systemui") ShellUtils.execCommand(commad, true) @@ -61,7 +65,7 @@ class SettingsActivity : AppCompatActivity() { preferenceManager.sharedPreferencesName = "config" setPreferencesFromResource(R.xml.root_preferences, rootKey) findPreference("verison")!!.summary = - BuildConfig.VERSION_NAME + "(" + BuildConfig.BUILD_TYPE + ")" + BuildConfig.VERSION_NAME + "(" + BuildConfig.BUILD_TYPE + ")" } override fun onPreferenceTreeClick(preference: Preference?): Boolean { @@ -70,7 +74,7 @@ class SettingsActivity : AppCompatActivity() { "opensource" -> { try { val uri = - Uri.parse("https://github.com/LittleTurtle2333/Simplicity_Tools_Xposed") + Uri.parse("https://github.com/LittleTurtle2333/Simplicity_Tools_Xposed") val intent = Intent(Intent.ACTION_VIEW, uri) startActivity(intent) } catch (e: Exception) { @@ -90,10 +94,10 @@ class SettingsActivity : AppCompatActivity() { "dev_coolapk" -> { try { startActivity( - Intent( - Intent.ACTION_VIEW, - Uri.parse("coolmarket://u/883441") - ) + Intent( + Intent.ACTION_VIEW, + Uri.parse("coolmarket://u/883441") + ) ) Toast.makeText(activity, "乌堆小透明:靓仔,点个关注吧!", Toast.LENGTH_SHORT).show() } catch (e: Exception) { diff --git a/app/src/main/res/menu/main.xml b/app/src/main/res/menu/main.xml index 4cf16ade..9f9fc769 100644 --- a/app/src/main/res/menu/main.xml +++ b/app/src/main/res/menu/main.xml @@ -1,4 +1,9 @@ - + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3cf6a438..592110c0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -39,5 +39,7 @@ 反馈/提议 点击查看GitHub Issues 基于 MIUI13(Android 12) 适配的自定义工具 + 重启 + 隐藏 HD 图标 \ No newline at end of file diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml index 8542442b..4b4de71b 100644 --- a/app/src/main/res/xml/root_preferences.xml +++ b/app/src/main/res/xml/root_preferences.xml @@ -57,6 +57,11 @@ app:key="hide_vpn_icon" app:title="@string/hide_vpn_icon" /> + + + + +