mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 11:21:18 +08:00
适配Android多版本大框架
更新Blockmiui 优化结构
This commit is contained in:
@@ -11,8 +11,8 @@ android {
|
||||
applicationId = "com.lt2333.simplicitytools"
|
||||
minSdk = 31
|
||||
targetSdk = 33
|
||||
versionCode = 68
|
||||
versionName = "1.6.8"
|
||||
versionCode = 69
|
||||
versionName = "1.6.9"
|
||||
buildConfigField("String", "BUILD_TIME", "\"${System.currentTimeMillis()}\"")
|
||||
}
|
||||
|
||||
|
||||
2
app/proguard-rules.pro
vendored
2
app/proguard-rules.pro
vendored
@@ -27,7 +27,7 @@
|
||||
public void *(de.robv.android.xposed.IXposedHookZygoteInit$StartupParam);
|
||||
}
|
||||
|
||||
-keep class * extends com.lt2333.simplicitytools.util.xposed.EasyXposedInit
|
||||
-keep class * extends com.lt2333.simplicitytools.utils.xposed.EasyXposedInit
|
||||
|
||||
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
|
||||
public static void check*(...);
|
||||
|
||||
@@ -11,13 +11,11 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity
|
||||
android:name=".activity.SettingsActivity"
|
||||
android:name=".activity.MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<action android:name="miui.cn.fkj233.xposed.statusbarlyric.SettingsFragment"/>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="de.robv.android.xposed.category.MODULE_SETTINGS" />
|
||||
@@ -29,7 +27,7 @@
|
||||
android:name=".launcher"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
android:targetActivity=".activity.SettingsActivity">
|
||||
android:targetActivity=".activity.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
@@ -50,7 +48,7 @@
|
||||
android:resource="@array/xposed_scope" />
|
||||
|
||||
<service
|
||||
android:name=".tile.LockMaxFpsTile"
|
||||
android:name=".tiles.LockMaxFpsTile"
|
||||
android:exported="true"
|
||||
android:icon="@drawable/ic_fps"
|
||||
android:label="@string/lock_max"
|
||||
@@ -61,7 +59,7 @@
|
||||
</service>
|
||||
|
||||
<service
|
||||
android:name=".tile.AllowScreenshots"
|
||||
android:name=".tiles.AllowScreenshots"
|
||||
android:exported="true"
|
||||
android:icon="@drawable/ic_baseline_fullscreen_24"
|
||||
android:label="@string/allow_screenshots"
|
||||
|
||||
@@ -1 +1 @@
|
||||
com.lt2333.simplicitytools.hook.XposedEntry
|
||||
com.lt2333.simplicitytools.hooks.MainHook
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.lt2333.simplicitytools.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import cn.fkj233.ui.activity.MIUIActivity
|
||||
import cn.fkj233.ui.dialog.MIUIDialog
|
||||
import com.lt2333.simplicitytools.BuildConfig
|
||||
import com.lt2333.simplicitytools.R
|
||||
import com.lt2333.simplicitytools.activity.pages.all.AboutPage
|
||||
import com.lt2333.simplicitytools.activity.pages.all.MenuPage
|
||||
import com.lt2333.simplicitytools.activity.pages.s.*
|
||||
import com.lt2333.simplicitytools.activity.pages.t.*
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.android.*
|
||||
import com.microsoft.appcenter.AppCenter
|
||||
import com.microsoft.appcenter.analytics.Analytics
|
||||
import com.microsoft.appcenter.crashes.Crashes
|
||||
import java.util.*
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
class MainActivity : MIUIActivity() {
|
||||
private val activity = this
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
if (!checkLSPosed()) isLoad = false
|
||||
super.onCreate(savedInstanceState)
|
||||
if (isLoad && !BuildConfig.DEBUG) {
|
||||
AppCenter.start(
|
||||
application,
|
||||
"ae2037d3-9914-4e0c-b02b-f9b2bb2574e5",
|
||||
Analytics::class.java,
|
||||
Crashes::class.java
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
//检测LSPosed是否激活
|
||||
@SuppressLint("WorldReadableFiles")
|
||||
private fun checkLSPosed(): Boolean {
|
||||
try {
|
||||
setSP(getSharedPreferences("config", MODE_WORLD_READABLE))
|
||||
return true
|
||||
} catch (exception: SecurityException) {
|
||||
MIUIDialog(this) {
|
||||
setTitle(R.string.Tips)
|
||||
setMessage(R.string.not_support)
|
||||
setCancelable(false)
|
||||
setRButton(R.string.Done) {
|
||||
exitProcess(0)
|
||||
}
|
||||
}.show()
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
init {
|
||||
when (Build.VERSION.SDK_INT) {
|
||||
Build.VERSION_CODES.TIRAMISU -> {
|
||||
registerPage(MainPageForT::class.java)
|
||||
registerPage(SystemUIPageForT::class.java)
|
||||
registerPage(AndroidPageForT::class.java)
|
||||
registerPage(OtherPageForT::class.java)
|
||||
registerPage(HideIconPageForT::class.java)
|
||||
registerPage(AboutPage::class.java)
|
||||
registerPage(MenuPage::class.java)
|
||||
}
|
||||
Build.VERSION_CODES.S -> {
|
||||
registerPage(MainPageForS::class.java)
|
||||
registerPage(SystemUIPageForS::class.java)
|
||||
registerPage(AndroidPageForS::class.java)
|
||||
registerPage(OtherPageForS::class.java)
|
||||
registerPage(HideIconPageForS::class.java)
|
||||
registerPage(AboutPage::class.java)
|
||||
registerPage(MenuPage::class.java)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,200 @@
|
||||
package com.lt2333.simplicitytools.activity.pages.all
|
||||
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.widget.Toast
|
||||
import cn.fkj233.ui.activity.annotation.BMPage
|
||||
import cn.fkj233.ui.activity.data.BasePage
|
||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
||||
import com.lt2333.simplicitytools.BuildConfig
|
||||
import com.lt2333.simplicitytools.R
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
|
||||
@BMPage("about_module","About Module", hideMenu = true)
|
||||
class AboutPage : BasePage() {
|
||||
|
||||
override fun onCreate() {
|
||||
Author(
|
||||
authorHead = getDrawable(R.drawable.app_icon)!!,
|
||||
authorName = getString(R.string.app_name),
|
||||
authorTips = "${
|
||||
SimpleDateFormat(
|
||||
"yyyy-MM-dd HH:mm:ss",
|
||||
Locale.getDefault()
|
||||
).format(BuildConfig.BUILD_TIME.toLong())
|
||||
}\n${BuildConfig.VERSION_NAME}(${BuildConfig.BUILD_TYPE})",
|
||||
onClickListener = {
|
||||
try {
|
||||
activity.startActivity(
|
||||
Intent(
|
||||
Intent.ACTION_VIEW,
|
||||
Uri.parse("coolmarket://apk/com.lt2333.simplicitytools")
|
||||
)
|
||||
)
|
||||
Toast.makeText(activity, "恳求一个五星好评,Thanks♪(・ω・)ノ", Toast.LENGTH_LONG)
|
||||
.show()
|
||||
} catch (e: Exception) {
|
||||
val uri =
|
||||
Uri.parse("https://github.com/Xposed-Modules-Repo/com.lt2333.simplicitytools/releases")
|
||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
||||
activity.startActivity(intent)
|
||||
}
|
||||
})
|
||||
Line()
|
||||
TitleText(text = getString(R.string.developer))
|
||||
Author(
|
||||
authorHead = getDrawable(R.drawable.lt)!!,
|
||||
authorName = "乌堆小透明",
|
||||
authorTips = "LittleTurtle2333",
|
||||
onClickListener = {
|
||||
try {
|
||||
activity.startActivity(
|
||||
Intent(
|
||||
Intent.ACTION_VIEW,
|
||||
Uri.parse("coolmarket://u/883441")
|
||||
)
|
||||
)
|
||||
Toast.makeText(activity, "乌堆小透明:靓仔,点个关注吧!", Toast.LENGTH_SHORT).show()
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(activity, "本机未安装酷安应用", Toast.LENGTH_SHORT).show()
|
||||
val uri = Uri.parse("https://www.coolapk.com/u/883441")
|
||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
||||
activity.startActivity(intent)
|
||||
}
|
||||
})
|
||||
Line()
|
||||
TitleText(text = getString(R.string.thank_list))
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.contributor_list,
|
||||
onClickListener = {
|
||||
try {
|
||||
val uri =
|
||||
Uri.parse("https://github.com/LittleTurtle2333/SimplicityTools/graphs/contributors")
|
||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
||||
activity.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(activity, "访问失败", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
})
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.third_party_open_source_statement,
|
||||
onClickListener = {
|
||||
try {
|
||||
val uri =
|
||||
Uri.parse("https://github.com/LittleTurtle2333/SimplicityTools#%E7%AC%AC%E4%B8%89%E6%96%B9%E5%BC%80%E6%BA%90%E5%BC%95%E7%94%A8")
|
||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
||||
activity.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(activity, "访问失败", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
})
|
||||
)
|
||||
Line()
|
||||
TitleText(text = getString(R.string.discussions))
|
||||
TextSummaryArrow(TextSummaryV(textId = R.string.qq_channel, onClickListener = {
|
||||
try {
|
||||
val uri =
|
||||
Uri.parse("https://qun.qq.com/qqweb/qunpro/share?_wv=3&_wwv=128&inviteCode=29Mu64&from=246610&biz=ka")
|
||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
||||
activity.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(activity, "访问失败", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}))
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.tg_channel,
|
||||
tipsId = R.string.tg_channel_summary,
|
||||
onClickListener = {
|
||||
try {
|
||||
activity.startActivity(
|
||||
Intent(
|
||||
Intent.ACTION_VIEW,
|
||||
Uri.parse("tg://resolve?domain=simplicityrom")
|
||||
)
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(activity, "本机未安装Telegram应用", Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
val uri = Uri.parse("https://t.me/simplicityrom")
|
||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
||||
activity.startActivity(intent)
|
||||
}
|
||||
})
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.issues,
|
||||
tipsId = R.string.issues_url,
|
||||
onClickListener = {
|
||||
try {
|
||||
val uri =
|
||||
Uri.parse("https://github.com/LittleTurtle2333/SimplicityTools/issues")
|
||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
||||
activity.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(activity, "访问失败", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
})
|
||||
)
|
||||
Line()
|
||||
TitleText(getString(R.string.other))
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.app_coolapk_url,
|
||||
tipsId = R.string.app_coolapk_url_summary,
|
||||
onClickListener = {
|
||||
try {
|
||||
activity.startActivity(
|
||||
Intent(
|
||||
Intent.ACTION_VIEW,
|
||||
Uri.parse("coolmarket://apk/com.lt2333.simplicitytools")
|
||||
)
|
||||
)
|
||||
Toast.makeText(
|
||||
activity,
|
||||
"恳求一个五星好评,Thanks♪(・ω・)ノ",
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(activity, "本机未安装酷安应用", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
})
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.opensource,
|
||||
tipsId = R.string.github_url,
|
||||
onClickListener = {
|
||||
try {
|
||||
val uri =
|
||||
Uri.parse("https://github.com/LittleTurtle2333/SimplicityTools")
|
||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
||||
activity.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(activity, "访问失败", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
})
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.participate_in_translation,
|
||||
tipsId = R.string.participate_in_translation_summary,
|
||||
onClickListener = {
|
||||
try {
|
||||
val uri = Uri.parse("https://crowdin.com/project/simplicitytools")
|
||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
||||
activity.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(activity, "访问失败", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.lt2333.simplicitytools.activity.pages.all
|
||||
|
||||
import cn.fkj233.ui.activity.annotation.BMMenuPage
|
||||
import cn.fkj233.ui.activity.data.BasePage
|
||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
||||
import cn.fkj233.ui.dialog.MIUIDialog
|
||||
import com.lt2333.simplicitytools.R
|
||||
import com.lt2333.simplicitytools.utils.ShellUtils
|
||||
import java.util.*
|
||||
|
||||
|
||||
@BMMenuPage("Menu")
|
||||
class MenuPage : BasePage() {
|
||||
|
||||
override fun onCreate() {
|
||||
TextSummaryArrow(TextSummaryV(textId = R.string.reboot, onClickListener = {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.Tips)
|
||||
setMessage(R.string.are_you_sure_reboot)
|
||||
setLButton(R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(R.string.Done) {
|
||||
val command = arrayOf("reboot")
|
||||
ShellUtils.execCommand(command, true)
|
||||
dismiss()
|
||||
}
|
||||
}.show()
|
||||
}))
|
||||
|
||||
TextSummaryArrow(TextSummaryV(textId = R.string.reboot_host, onClickListener = {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.Tips)
|
||||
setMessage(R.string.are_you_sure_reboot_scope)
|
||||
setLButton(R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(R.string.Done) {
|
||||
val command = arrayOf(
|
||||
"killall com.android.systemui",
|
||||
"killall com.miui.home",
|
||||
"killall com.miui.securitycenter ",
|
||||
"killall com.android.settings",
|
||||
"killall com.miui.powerkeeper",
|
||||
"killall com.android.updater",
|
||||
"killall com.miui.mediaeditor",
|
||||
"killall com.miui.screenshot",
|
||||
"killall com.milink.service",
|
||||
"killall com.xiaomi.misubscreenui",
|
||||
)
|
||||
ShellUtils.execCommand(command, true)
|
||||
dismiss()
|
||||
}
|
||||
}.show()
|
||||
}))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.lt2333.simplicitytools.activity.pages.s
|
||||
|
||||
import android.view.View
|
||||
import android.widget.Switch
|
||||
import cn.fkj233.ui.activity.MIUIActivity
|
||||
import cn.fkj233.ui.activity.annotation.BMPage
|
||||
import cn.fkj233.ui.activity.data.BasePage
|
||||
import cn.fkj233.ui.activity.view.SwitchV
|
||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
||||
import cn.fkj233.ui.dialog.MIUIDialog
|
||||
import com.lt2333.simplicitytools.R
|
||||
|
||||
|
||||
@BMPage("scope_android","Android", hideMenu = false)
|
||||
class AndroidPageForS : BasePage() {
|
||||
|
||||
override fun onCreate() {
|
||||
TitleText(textId = R.string.corepacth)
|
||||
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.downgr,
|
||||
tipsId = R.string.downgr_summary
|
||||
), SwitchV("downgrade")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.authcreak,
|
||||
tipsId = R.string.authcreak_summary
|
||||
), SwitchV("authcreak")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.digestCreak,
|
||||
tipsId = R.string.digestCreak_summary
|
||||
), SwitchV("digestCreak")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.UsePreSig,
|
||||
tipsId = R.string.UsePreSig_summary
|
||||
), SwitchV("UsePreSig")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.enhancedMode,
|
||||
tipsId = R.string.enhancedMode_summary
|
||||
), SwitchV("enhancedMode")
|
||||
)
|
||||
Line()
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.disable_flag_secure,
|
||||
tipsId = R.string.disable_flag_secure_summary
|
||||
), SwitchV("disable_flag_secure")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.delete_on_post_notification,
|
||||
tipsId = R.string.delete_on_post_notification_summary
|
||||
), SwitchV("delete_on_post_notification")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.remove_small_window_restrictions,
|
||||
tipsId = R.string.remove_small_window_restrictions_summary
|
||||
), SwitchV("remove_small_window_restrictions")
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.max_wallpaper_scale,
|
||||
onClickListener = {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.max_wallpaper_scale)
|
||||
setEditText(
|
||||
"",
|
||||
"${activity.getString(R.string.def)}1.1, ${activity.getString(R.string.current)}${
|
||||
MIUIActivity.safeSP.getFloat("max_wallpaper_scale", 1.1f)
|
||||
}"
|
||||
)
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText() != "") {
|
||||
MIUIActivity.safeSP.putAny(
|
||||
"max_wallpaper_scale",
|
||||
getEditText().toFloat()
|
||||
)
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
}.show()
|
||||
})
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.allow_untrusted_touches,
|
||||
tipsId = R.string.take_effect_after_reboot
|
||||
), SwitchV("allow_untrusted_touches")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.sound)
|
||||
val mediaVolumeStepsSwitchBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"media_volume_steps_switch",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.media_volume_steps_switch,
|
||||
tips = "${getString(R.string.take_effect_after_reboot)}\n${getString(R.string.media_volume_steps_summary)}"
|
||||
),
|
||||
SwitchV(
|
||||
"media_volume_steps_switch",
|
||||
dataBindingSend = mediaVolumeStepsSwitchBinding.bindingSend
|
||||
)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"media_volume_steps",
|
||||
15,
|
||||
29,
|
||||
15,
|
||||
dataBindingRecv = mediaVolumeStepsSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.lt2333.simplicitytools.activity.pages.s
|
||||
|
||||
import android.view.View
|
||||
import android.widget.Switch
|
||||
import cn.fkj233.ui.activity.MIUIActivity
|
||||
import cn.fkj233.ui.activity.annotation.BMPage
|
||||
import cn.fkj233.ui.activity.data.BasePage
|
||||
import cn.fkj233.ui.activity.view.SwitchV
|
||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
||||
import cn.fkj233.ui.activity.view.TextV
|
||||
import cn.fkj233.ui.dialog.MIUIDialog
|
||||
import com.lt2333.simplicitytools.R
|
||||
|
||||
|
||||
@BMPage("hide_icon","Hide Icon", hideMenu = false)
|
||||
class HideIconPageForS : BasePage() {
|
||||
|
||||
override fun onCreate() {
|
||||
TitleText(textId = R.string.status_bar_icon)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_battery_icon),
|
||||
SwitchV("hide_battery_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_battery_charging_icon),
|
||||
SwitchV("hide_battery_charging_icon")
|
||||
)
|
||||
TextWithSwitch(TextV(textId = R.string.hide_gps_icon), SwitchV("hide_gps_icon"))
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_bluetooth_icon),
|
||||
SwitchV("hide_bluetooth_icon")
|
||||
)
|
||||
|
||||
TextWithSwitch(TextV(textId = R.string.hide_nfc_icon), SwitchV("hide_nfc_icon"))
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_bluetooth_battery_icon),
|
||||
SwitchV("hide_bluetooth_battery_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_small_hd_icon),
|
||||
SwitchV("hide_small_hd_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_big_hd_icon),
|
||||
SwitchV("hide_big_hd_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_new_hd_icon),
|
||||
SwitchV("hide_new_hd_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_hd_no_service_icon),
|
||||
SwitchV("hide_hd_no_service_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_no_sim_icon),
|
||||
SwitchV("hide_no_sim_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_sim_one_icon),
|
||||
SwitchV("hide_sim_one_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_sim_two_icon),
|
||||
SwitchV("hide_sim_two_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_mobile_activity_icon),
|
||||
SwitchV("hide_mobile_activity_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_mobile_type_icon),
|
||||
SwitchV("hide_mobile_type_icon")
|
||||
)
|
||||
TextWithSwitch(TextV(textId = R.string.hide_wifi_icon), SwitchV("hide_wifi_icon"))
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_wifi_activity_icon),
|
||||
SwitchV("hide_wifi_activity_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_wifi_standard_icon),
|
||||
SwitchV("hide_wifi_standard_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_slave_wifi_icon),
|
||||
SwitchV("hide_slave_wifi_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_hotspot_icon),
|
||||
SwitchV("hide_hotspot_icon")
|
||||
)
|
||||
TextWithSwitch(TextV(textId = R.string.hide_vpn_icon), SwitchV("hide_vpn_icon"))
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_airplane_icon),
|
||||
SwitchV("hide_airplane_icon")
|
||||
)
|
||||
TextWithSwitch(TextV(textId = R.string.hide_alarm_icon), SwitchV("hide_alarm_icon"))
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_headset_icon),
|
||||
SwitchV("hide_headset_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_volume_icon),
|
||||
SwitchV("hide_volume_icon")
|
||||
)
|
||||
TextWithSwitch(TextV(textId = R.string.hide_zen_icon), SwitchV("hide_zen_icon"))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.lt2333.simplicitytools.activity.pages.s
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.pm.PackageManager
|
||||
import cn.fkj233.ui.activity.annotation.BMMainPage
|
||||
import cn.fkj233.ui.activity.data.BasePage
|
||||
import cn.fkj233.ui.activity.view.SwitchV
|
||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
||||
import cn.fkj233.ui.dialog.MIUIDialog
|
||||
import com.lt2333.simplicitytools.BuildConfig
|
||||
import com.lt2333.simplicitytools.R
|
||||
|
||||
|
||||
@BMMainPage("WooBox[MIUI13]")
|
||||
class MainPageForS : BasePage() {
|
||||
|
||||
override fun onCreate() {
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.main_switch,
|
||||
colorId = R.color.purple_700
|
||||
), SwitchV("main_switch", true)
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.HideLauncherIcon),
|
||||
SwitchV("hLauncherIcon", onClickListener = {
|
||||
activity.packageManager.setComponentEnabledSetting(
|
||||
ComponentName(activity, "${BuildConfig.APPLICATION_ID}.launcher"),
|
||||
if (it) {
|
||||
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
|
||||
} else {
|
||||
PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
||||
},
|
||||
PackageManager.DONT_KILL_APP
|
||||
)
|
||||
})
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.matters_needing_attention,
|
||||
colorId = R.color.red,
|
||||
onClickListener = {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.matters_needing_attention)
|
||||
setMessage(R.string.matters_needing_attention_context)
|
||||
setRButton(R.string.Done) {
|
||||
dismiss()
|
||||
}
|
||||
}.show()
|
||||
})
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.scope)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.scope_systemui,
|
||||
tipsId = R.string.scope_systemui_summary,
|
||||
onClickListener = { showFragment("scope_systemui") })
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.scope_android,
|
||||
tipsId = R.string.scope_android_summary,
|
||||
onClickListener = { showFragment("scope_android") })
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.scope_other,
|
||||
tipsId = R.string.scope_other_summary,
|
||||
onClickListener = { showFragment("scope_other") })
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.about)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.about_module,
|
||||
tips = getString(R.string.about_module_summary),
|
||||
onClickListener = { showFragment("about_module") })
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package com.lt2333.simplicitytools.activity.pages.s
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.view.View
|
||||
import android.widget.Switch
|
||||
import android.widget.Toast
|
||||
import cn.fkj233.ui.activity.MIUIActivity
|
||||
import cn.fkj233.ui.activity.annotation.BMPage
|
||||
import cn.fkj233.ui.activity.data.BasePage
|
||||
import cn.fkj233.ui.activity.view.SwitchV
|
||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
||||
import cn.fkj233.ui.dialog.MIUIDialog
|
||||
import com.lt2333.simplicitytools.BuildConfig
|
||||
import com.lt2333.simplicitytools.R
|
||||
|
||||
|
||||
@BMPage("scope_other","Other", hideMenu = false)
|
||||
class OtherPageForS : BasePage() {
|
||||
|
||||
override fun onCreate() {
|
||||
TitleText(textId = R.string.scope_miuihome)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.home_time,
|
||||
tipsId = R.string.home_time_summary
|
||||
), SwitchV("home_time")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.double_tap_to_sleep,
|
||||
tipsId = R.string.home_double_tap_to_sleep_summary
|
||||
), SwitchV("double_tap_to_sleep")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.scope_powerkeeper)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.lock_max_fps,
|
||||
tipsId = R.string.lock_max_fps_summary
|
||||
), SwitchV("lock_max_fps")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.prevent_recovery_of_battery_optimization_white_list,
|
||||
tipsId = R.string.failed_after_restart
|
||||
), SwitchV("prevent_recovery_of_battery_optimization_white_list")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.do_not_clear_app,
|
||||
tipsId = R.string.do_not_clear_app_summary
|
||||
), SwitchV("do_not_clear_app")
|
||||
)
|
||||
val makeMilletMoreAggressiveSwitchBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"make_millet_more_aggressive",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.make_millet_more_aggressive,
|
||||
tipsId = R.string.make_millet_more_aggressive_summary
|
||||
),
|
||||
SwitchV(
|
||||
"make_millet_more_aggressive",
|
||||
dataBindingSend = makeMilletMoreAggressiveSwitchBinding.bindingSend
|
||||
)
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.make_millet_ignore_active,
|
||||
tipsId = R.string.make_millet_ignore_active_summary
|
||||
),
|
||||
SwitchV("make_millet_ignore_active"),
|
||||
dataBindingRecv = makeMilletMoreAggressiveSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.battery_optimization,
|
||||
tipsId = R.string.battery_optimization_summary,
|
||||
onClickListener = {
|
||||
try {
|
||||
val intent = Intent()
|
||||
val comp = ComponentName(
|
||||
"com.android.settings",
|
||||
"com.android.settings.Settings\$HighPowerApplicationsActivity"
|
||||
)
|
||||
intent.component = comp
|
||||
activity.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(activity, "启动失败,可能是不支持", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
})
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.scope_securitycenter)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.skip_waiting_time,
|
||||
tipsId = R.string.skip_waiting_time_summary
|
||||
), SwitchV("skip_waiting_time")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.remove_open_app_confirmation_popup,
|
||||
tipsId = R.string.remove_open_app_confirmation_popup_summary
|
||||
), SwitchV("remove_open_app_confirmation_popup")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.lock_one_hundred,
|
||||
tipsId = R.string.lock_one_hundred_summary
|
||||
), SwitchV("lock_one_hundred")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.remove_macro_blacklist),
|
||||
SwitchV("remove_macro_blacklist")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.battery_life_function),
|
||||
SwitchV("battery_life_function")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.scope_mediaeditor)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.unlock_unlimited_cropping,
|
||||
tipsId = R.string.unlock_unlimited_cropping_summary
|
||||
), SwitchV("unlock_unlimited_cropping")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.updater)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.remove_ota_validate,
|
||||
tipsId = R.string.remove_ota_validate_summary
|
||||
), SwitchV("remove_ota_validate")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.settings)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.show_notification_importance,
|
||||
tipsId = R.string.show_notification_importance_summary
|
||||
), SwitchV("show_notification_importance")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.cast)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.force_support_send_app,
|
||||
), SwitchV("force_support_send_app")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.rear_display)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.show_weather_main_switch,
|
||||
), SwitchV("rear_show_weather")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.remove_ad)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.remove_thememanager_ads),
|
||||
SwitchV("remove_thememanager_ads")
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,759 @@
|
||||
package com.lt2333.simplicitytools.activity.pages.s
|
||||
|
||||
import android.view.View
|
||||
import android.widget.Switch
|
||||
import android.widget.Toast
|
||||
import cn.fkj233.ui.activity.MIUIActivity
|
||||
import cn.fkj233.ui.activity.annotation.BMPage
|
||||
import cn.fkj233.ui.activity.data.BasePage
|
||||
import cn.fkj233.ui.activity.view.SpinnerV
|
||||
import cn.fkj233.ui.activity.view.SwitchV
|
||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
||||
import cn.fkj233.ui.activity.view.TextV
|
||||
import cn.fkj233.ui.dialog.MIUIDialog
|
||||
import com.lt2333.simplicitytools.R
|
||||
import java.util.HashMap
|
||||
|
||||
|
||||
@BMPage("scope_systemui","System UI", hideMenu = false)
|
||||
class SystemUIPageForS : BasePage() {
|
||||
|
||||
override fun onCreate() {
|
||||
TitleText(textId = R.string.statusbar)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.double_tap_to_sleep),
|
||||
SwitchV("status_bar_double_tap_to_sleep")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.status_bar_layout)
|
||||
val statusBarLayoutMode: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
||||
it[0] = getString(R.string.default1)
|
||||
it[1] = getString(R.string.clock_center)
|
||||
it[2] = getString(R.string.clock_right)
|
||||
it[3] = getString(R.string.clock_center_and_icon_left)
|
||||
}
|
||||
TextWithSpinner(
|
||||
TextV(textId = R.string.status_bar_layout_mode),
|
||||
SpinnerV(
|
||||
statusBarLayoutMode[MIUIActivity.safeSP.getInt(
|
||||
"status_bar_layout_mode",
|
||||
0
|
||||
)].toString()
|
||||
) {
|
||||
add(statusBarLayoutMode[0].toString()) {
|
||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 0)
|
||||
}
|
||||
add(statusBarLayoutMode[1].toString()) {
|
||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 1)
|
||||
}
|
||||
add(statusBarLayoutMode[2].toString()) {
|
||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 2)
|
||||
}
|
||||
add(statusBarLayoutMode[3].toString()) {
|
||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 3)
|
||||
}
|
||||
})
|
||||
|
||||
val layoutCompatibilityModeBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getInt(
|
||||
"screen_hole_location",
|
||||
0
|
||||
) == 2
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
val screenHoleLocation: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
||||
it[0] = getString(R.string.off)
|
||||
it[1] = getString(R.string.center)
|
||||
it[2] = getString(R.string.left_or_right)
|
||||
}
|
||||
TextSummaryWithSpinner(
|
||||
TextSummaryV(
|
||||
textId = R.string.layout_compatibility_mode,
|
||||
tipsId = R.string.screen_hole_location
|
||||
),
|
||||
SpinnerV(
|
||||
screenHoleLocation[MIUIActivity.safeSP.getInt(
|
||||
"screen_hole_location",
|
||||
0
|
||||
)].toString()
|
||||
) {
|
||||
add(screenHoleLocation[0].toString()) {
|
||||
MIUIActivity.safeSP.putAny("screen_hole_location", 0)
|
||||
layoutCompatibilityModeBinding.binding.Send().send(false)
|
||||
}
|
||||
add(screenHoleLocation[1].toString()) {
|
||||
MIUIActivity.safeSP.putAny("screen_hole_location", 1)
|
||||
layoutCompatibilityModeBinding.binding.Send().send(false)
|
||||
}
|
||||
add(screenHoleLocation[2].toString()) {
|
||||
MIUIActivity.safeSP.putAny("screen_hole_location", 2)
|
||||
layoutCompatibilityModeBinding.binding.Send().send(true)
|
||||
}
|
||||
})
|
||||
|
||||
Text(
|
||||
textId = R.string.left_margin,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_left_margin",
|
||||
0,
|
||||
300,
|
||||
0,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.right_margin,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_right_margin",
|
||||
0,
|
||||
300,
|
||||
0,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.status_bar_clock_format)
|
||||
|
||||
|
||||
val customClockPresetBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getInt(
|
||||
"custom_clock_mode",
|
||||
0
|
||||
) == 1
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
val customClockGeekBinding =
|
||||
GetDataBinding({ MIUIActivity.safeSP.getInt("custom_clock_mode", 0) == 2 }
|
||||
|
||||
) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
val customClockMode: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
||||
it[0] = getString(R.string.off)
|
||||
it[1] = getString(R.string.preset)
|
||||
it[2] = getString(R.string.geek)
|
||||
}
|
||||
TextWithSpinner(
|
||||
TextV(textId = R.string.custom_clock_mode),
|
||||
SpinnerV(customClockMode[MIUIActivity.safeSP.getInt("custom_clock_mode", 0)].toString()) {
|
||||
add(customClockMode[0].toString()) {
|
||||
MIUIActivity.safeSP.putAny("custom_clock_mode", 0)
|
||||
customClockPresetBinding.binding.Send().send(false)
|
||||
customClockGeekBinding.binding.Send().send(false)
|
||||
}
|
||||
add(customClockMode[1].toString()) {
|
||||
MIUIActivity.safeSP.putAny("custom_clock_mode", 1)
|
||||
customClockPresetBinding.binding.Send().send(true)
|
||||
customClockGeekBinding.binding.Send().send(false)
|
||||
}
|
||||
add(customClockMode[2].toString()) {
|
||||
MIUIActivity.safeSP.putAny("custom_clock_mode", 2)
|
||||
customClockPresetBinding.binding.Send().send(false)
|
||||
customClockGeekBinding.binding.Send().send(true)
|
||||
}
|
||||
})
|
||||
|
||||
//预设模式起始
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_year),
|
||||
SwitchV("status_bar_time_year"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_month),
|
||||
SwitchV("status_bar_time_month"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_day),
|
||||
SwitchV("status_bar_time_day"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_week),
|
||||
SwitchV("status_bar_time_week"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_double_hour),
|
||||
SwitchV("status_bar_time_double_hour"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_period),
|
||||
SwitchV("status_bar_time_period", true),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_seconds),
|
||||
SwitchV("status_bar_time_seconds"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_hide_space),
|
||||
SwitchV("status_bar_time_hide_space"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_double_line),
|
||||
SwitchV("status_bar_time_double_line"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_double_line_center_align),
|
||||
SwitchV("status_bar_time_double_line_center_align"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.status_bar_clock_size,
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_clock_size",
|
||||
0,
|
||||
18,
|
||||
0,
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.status_bar_clock_double_line_size,
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_clock_double_line_size",
|
||||
0,
|
||||
9,
|
||||
0,
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
//预设模式结束
|
||||
|
||||
//极客模式起始
|
||||
TextSummaryArrow(TextSummaryV(textId = R.string.custom_clock_format_geek) {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.custom_clock_format_geek)
|
||||
setEditText(MIUIActivity.safeSP.getString("custom_clock_format_geek", "HH:mm:ss"), "")
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText().isNotEmpty()) {
|
||||
try {
|
||||
MIUIActivity.safeSP.putAny("custom_clock_format_geek", getEditText())
|
||||
dismiss()
|
||||
return@setRButton
|
||||
} catch (_: Throwable) {
|
||||
}
|
||||
}
|
||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
}
|
||||
}.show()
|
||||
}, dataBindingRecv = customClockGeekBinding.binding.getRecv(2))
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_double_line_center_align),
|
||||
SwitchV("status_bar_time_center_align_geek"),
|
||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.status_bar_clock_size,
|
||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_clock_size_geek",
|
||||
0,
|
||||
18,
|
||||
0,
|
||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
||||
)
|
||||
//极客模式结束
|
||||
|
||||
|
||||
Line()
|
||||
TitleText(textId = R.string.status_bar_icon)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.hide_icon,
|
||||
onClickListener = { showFragment("hide_icon") })
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.show_wifi_standard),
|
||||
SwitchV("show_wifi_standard")
|
||||
)
|
||||
val customMobileTypeTextBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"custom_mobile_type_text_switch",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.custom_mobile_type_text_switch),
|
||||
SwitchV(
|
||||
"custom_mobile_type_text_switch",
|
||||
dataBindingSend = customMobileTypeTextBinding.bindingSend
|
||||
)
|
||||
)
|
||||
TextSummaryArrow(TextSummaryV(textId = R.string.custom_mobile_type_text) {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.custom_mobile_type_text)
|
||||
setEditText(MIUIActivity.safeSP.getString("custom_mobile_type_text", "5G"), "")
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText().isNotEmpty()) {
|
||||
try {
|
||||
MIUIActivity.safeSP.putAny("custom_mobile_type_text", getEditText())
|
||||
dismiss()
|
||||
return@setRButton
|
||||
} catch (_: Throwable) {
|
||||
}
|
||||
}
|
||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
}
|
||||
}.show()
|
||||
}, dataBindingRecv = customMobileTypeTextBinding.binding.getRecv(2))
|
||||
val bigMobileTypeIconBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"big_mobile_type_icon",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.big_mobile_type_icon),
|
||||
SwitchV(
|
||||
"big_mobile_type_icon",
|
||||
dataBindingSend = bigMobileTypeIconBinding.bindingSend
|
||||
)
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.big_mobile_type_icon_bold),
|
||||
SwitchV("big_mobile_type_icon_bold", true),
|
||||
dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.big_mobile_type_icon_size,
|
||||
onClickListener = {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.big_mobile_type_icon_size)
|
||||
setEditText(
|
||||
"",
|
||||
"${activity.getString(R.string.def)}12.5, ${activity.getString(R.string.current)}${
|
||||
MIUIActivity.safeSP.getFloat("big_mobile_type_icon_size", 12.5f)
|
||||
}"
|
||||
)
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText() != "") {
|
||||
MIUIActivity.safeSP.putAny(
|
||||
"big_mobile_type_icon_size",
|
||||
getEditText().toFloat()
|
||||
)
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
}.show()
|
||||
}), dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
||||
)
|
||||
TextSummaryArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_up_and_down_position) {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.big_mobile_type_icon_up_and_down_position)
|
||||
setMessage("${activity.getString(R.string.range)} -15~15")
|
||||
setEditText(
|
||||
"",
|
||||
"${activity.getString(R.string.def)}0, ${activity.getString(R.string.current)}${
|
||||
MIUIActivity.safeSP.getInt("big_mobile_type_icon_up_and_down_position", 0)
|
||||
}"
|
||||
)
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText().isNotEmpty()) {
|
||||
try {
|
||||
val value = getEditText().toInt()
|
||||
if (value in (-15..15)) {
|
||||
MIUIActivity.safeSP.putAny(
|
||||
"big_mobile_type_icon_up_and_down_position",
|
||||
value
|
||||
)
|
||||
dismiss()
|
||||
return@setRButton
|
||||
}
|
||||
} catch (_: Throwable) {
|
||||
}
|
||||
}
|
||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
}
|
||||
}.show()
|
||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2))
|
||||
TextSummaryArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_left_and_right_margins) {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.big_mobile_type_icon_left_and_right_margins)
|
||||
setMessage("${activity.getString(R.string.range)} 0~30")
|
||||
setEditText(
|
||||
"",
|
||||
"${activity.getString(R.string.def)}0, ${activity.getString(R.string.current)}${
|
||||
MIUIActivity.safeSP.getInt("big_mobile_type_icon_left_and_right_margins", 0)
|
||||
}"
|
||||
)
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText().isNotEmpty()) {
|
||||
try {
|
||||
val value = getEditText().toInt()
|
||||
if (value in (0..30)) {
|
||||
MIUIActivity.safeSP.putAny(
|
||||
"big_mobile_type_icon_left_and_right_margins",
|
||||
value
|
||||
)
|
||||
dismiss()
|
||||
return@setRButton
|
||||
}
|
||||
} catch (_: Throwable) {
|
||||
}
|
||||
}
|
||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
}
|
||||
}.show()
|
||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2))
|
||||
Text(textId = R.string.maximum_number_of_notification_icons)
|
||||
SeekBarWithText("maximum_number_of_notification_icons", 1, 30, 3)
|
||||
Text(textId = R.string.maximum_number_of_notification_dots)
|
||||
SeekBarWithText("maximum_number_of_notification_dots", 0, 4, 3)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.battery_percentage_font_size,
|
||||
onClickListener = {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.battery_percentage_font_size)
|
||||
setMessage(R.string.zero_do_no_change)
|
||||
setEditText(
|
||||
"", "${activity.getString(R.string.current)}${
|
||||
MIUIActivity.safeSP.getFloat("battery_percentage_font_size", 0f)
|
||||
}"
|
||||
)
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText() != "") {
|
||||
MIUIActivity.safeSP.putAny(
|
||||
"battery_percentage_font_size",
|
||||
getEditText().toFloat()
|
||||
)
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
}.show()
|
||||
})
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.hide_battery_percentage_icon,
|
||||
tipsId = R.string.hide_battery_percentage_icon_summary
|
||||
), SwitchV("hide_battery_percentage_icon")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.status_bar_network_speed)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.status_bar_network_speed_refresh_speed,
|
||||
tipsId = R.string.status_bar_network_speed_refresh_speed_summary
|
||||
), SwitchV("status_bar_network_speed_refresh_speed")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.hide_status_bar_network_speed_second,
|
||||
tipsId = R.string.hide_status_bar_network_speed_second_summary
|
||||
), SwitchV("hide_status_bar_network_speed_second")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_network_speed_splitter),
|
||||
SwitchV("hide_network_speed_splitter")
|
||||
)
|
||||
val statusBarDualRowNetworkSpeedBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"status_bar_dual_row_network_speed",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.status_bar_dual_row_network_speed,
|
||||
tipsId = R.string.status_bar_dual_row_network_speed_summary
|
||||
),
|
||||
SwitchV(
|
||||
"status_bar_dual_row_network_speed",
|
||||
dataBindingSend = statusBarDualRowNetworkSpeedBinding.bindingSend
|
||||
)
|
||||
)
|
||||
val align: HashMap<Int, String> = hashMapOf()
|
||||
align[0] = getString(R.string.left)
|
||||
align[1] = getString(R.string.right)
|
||||
TextWithSpinner(
|
||||
TextV(textId = R.string.status_bar_network_speed_dual_row_gravity),
|
||||
SpinnerV(
|
||||
align[MIUIActivity.safeSP.getInt(
|
||||
"status_bar_network_speed_dual_row_gravity",
|
||||
0
|
||||
)].toString()
|
||||
) {
|
||||
add(align[0].toString()) {
|
||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_gravity", 0)
|
||||
}
|
||||
add(align[1].toString()) {
|
||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_gravity", 1)
|
||||
|
||||
}
|
||||
},
|
||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSpinner(
|
||||
TextV(textId = R.string.status_bar_network_speed_dual_row_icon),
|
||||
SpinnerV(
|
||||
MIUIActivity.safeSP.getString(
|
||||
"status_bar_network_speed_dual_row_icon",
|
||||
getString(R.string.none)
|
||||
)
|
||||
) {
|
||||
add(getString(R.string.none)) {
|
||||
MIUIActivity.safeSP.putAny(
|
||||
"status_bar_network_speed_dual_row_icon",
|
||||
getString(R.string.none)
|
||||
)
|
||||
}
|
||||
add("▲▼") {
|
||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_icon", "▲▼")
|
||||
}
|
||||
add("△▽") {
|
||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_icon", "△▽")
|
||||
}
|
||||
add("↑↓") {
|
||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_icon", "↑↓")
|
||||
}
|
||||
})
|
||||
Text(
|
||||
textId = R.string.status_bar_network_speed_dual_row_size,
|
||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_network_speed_dual_row_size",
|
||||
0,
|
||||
9,
|
||||
0,
|
||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.notification_center)
|
||||
val showWeatherMainSwitchBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"notification_weather",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.show_weather_main_switch,
|
||||
colorId = R.color.purple_700
|
||||
),
|
||||
SwitchV(
|
||||
"notification_weather",
|
||||
dataBindingSend = showWeatherMainSwitchBinding.bindingSend
|
||||
)
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.show_city,
|
||||
),
|
||||
SwitchV("notification_weather_city"),
|
||||
dataBindingRecv = showWeatherMainSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.can_notification_slide,
|
||||
tipsId = R.string.can_notification_slide_summary,
|
||||
),
|
||||
SwitchV("can_notification_slide"),
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.control_center)
|
||||
val controlCenterWeatherBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"control_center_weather",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.show_weather_main_switch,
|
||||
colorId = R.color.purple_700,
|
||||
tipsId = R.string.control_center_weather_summary
|
||||
),
|
||||
SwitchV(
|
||||
"control_center_weather",
|
||||
dataBindingSend = controlCenterWeatherBinding.bindingSend
|
||||
)
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.show_city,
|
||||
),
|
||||
SwitchV("control_center_weather_city"),
|
||||
dataBindingRecv = controlCenterWeatherBinding.binding.getRecv(2)
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.lock_screen)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.lock_screen_clock_display_seconds,
|
||||
tipsId = R.string.only_official_default_themes_are_supported
|
||||
), SwitchV("lock_screen_clock_display_seconds")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.remove_the_left_side_of_the_lock_screen,
|
||||
tipsId = R.string.only_official_default_themes_are_supported
|
||||
), SwitchV("remove_the_left_side_of_the_lock_screen")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.remove_lock_screen_camera,
|
||||
tipsId = R.string.only_official_default_themes_are_supported
|
||||
), SwitchV("remove_lock_screen_camera")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.enable_wave_charge_animation),
|
||||
SwitchV("enable_wave_charge_animation")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.lock_screen_charging_current,
|
||||
tipsId = R.string.only_official_default_themes_are_supported
|
||||
), SwitchV("lock_screen_charging_current")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.double_tap_to_sleep,
|
||||
tipsId = R.string.home_double_tap_to_sleep_summary
|
||||
), SwitchV("lock_screen_double_tap_to_sleep")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.old_quick_settings_panel)
|
||||
val oldQSCustomSwitchBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"old_qs_custom_switch",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.old_qs_custom_switch,
|
||||
colorId = R.color.purple_700
|
||||
),
|
||||
SwitchV(
|
||||
"old_qs_custom_switch",
|
||||
dataBindingSend = oldQSCustomSwitchBinding.bindingSend
|
||||
)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.qs_custom_rows,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"qs_custom_rows",
|
||||
1,
|
||||
6,
|
||||
3,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.qs_custom_rows_horizontal,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"qs_custom_rows_horizontal",
|
||||
1,
|
||||
3,
|
||||
2,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.qs_custom_columns,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"qs_custom_columns",
|
||||
1,
|
||||
7,
|
||||
4,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.qs_custom_columns_unexpanded,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"qs_custom_columns_unexpanded",
|
||||
1,
|
||||
7,
|
||||
5,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.lt2333.simplicitytools.activity.pages.t
|
||||
|
||||
import android.view.View
|
||||
import android.widget.Switch
|
||||
import cn.fkj233.ui.activity.MIUIActivity
|
||||
import cn.fkj233.ui.activity.annotation.BMPage
|
||||
import cn.fkj233.ui.activity.data.BasePage
|
||||
import cn.fkj233.ui.activity.view.SwitchV
|
||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
||||
import cn.fkj233.ui.dialog.MIUIDialog
|
||||
import com.lt2333.simplicitytools.R
|
||||
|
||||
|
||||
@BMPage("scope_android","Android", hideMenu = false)
|
||||
class AndroidPageForT : BasePage() {
|
||||
|
||||
override fun onCreate() {
|
||||
TitleText(textId = R.string.corepacth)
|
||||
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.downgr,
|
||||
tipsId = R.string.downgr_summary
|
||||
), SwitchV("downgrade")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.authcreak,
|
||||
tipsId = R.string.authcreak_summary
|
||||
), SwitchV("authcreak")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.digestCreak,
|
||||
tipsId = R.string.digestCreak_summary
|
||||
), SwitchV("digestCreak")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.UsePreSig,
|
||||
tipsId = R.string.UsePreSig_summary
|
||||
), SwitchV("UsePreSig")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.enhancedMode,
|
||||
tipsId = R.string.enhancedMode_summary
|
||||
), SwitchV("enhancedMode")
|
||||
)
|
||||
Line()
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.disable_flag_secure,
|
||||
tipsId = R.string.disable_flag_secure_summary
|
||||
), SwitchV("disable_flag_secure")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.delete_on_post_notification,
|
||||
tipsId = R.string.delete_on_post_notification_summary
|
||||
), SwitchV("delete_on_post_notification")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.remove_small_window_restrictions,
|
||||
tipsId = R.string.remove_small_window_restrictions_summary
|
||||
), SwitchV("remove_small_window_restrictions")
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.max_wallpaper_scale,
|
||||
onClickListener = {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.max_wallpaper_scale)
|
||||
setEditText(
|
||||
"",
|
||||
"${activity.getString(R.string.def)}1.2, ${activity.getString(R.string.current)}${
|
||||
MIUIActivity.safeSP.getFloat("max_wallpaper_scale", 1.2f)
|
||||
}"
|
||||
)
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText() != "") {
|
||||
MIUIActivity.safeSP.putAny(
|
||||
"max_wallpaper_scale",
|
||||
getEditText().toFloat()
|
||||
)
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
}.show()
|
||||
})
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.allow_untrusted_touches,
|
||||
tipsId = R.string.take_effect_after_reboot
|
||||
), SwitchV("allow_untrusted_touches")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.sound)
|
||||
val mediaVolumeStepsSwitchBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"media_volume_steps_switch",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.media_volume_steps_switch,
|
||||
tips = "${getString(R.string.take_effect_after_reboot)}\n${getString(R.string.media_volume_steps_summary)}"
|
||||
),
|
||||
SwitchV(
|
||||
"media_volume_steps_switch",
|
||||
dataBindingSend = mediaVolumeStepsSwitchBinding.bindingSend
|
||||
)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"media_volume_steps",
|
||||
15,
|
||||
29,
|
||||
15,
|
||||
dataBindingRecv = mediaVolumeStepsSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.lt2333.simplicitytools.activity.pages.t
|
||||
|
||||
import android.view.View
|
||||
import android.widget.Switch
|
||||
import cn.fkj233.ui.activity.MIUIActivity
|
||||
import cn.fkj233.ui.activity.annotation.BMPage
|
||||
import cn.fkj233.ui.activity.data.BasePage
|
||||
import cn.fkj233.ui.activity.view.SwitchV
|
||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
||||
import cn.fkj233.ui.activity.view.TextV
|
||||
import cn.fkj233.ui.dialog.MIUIDialog
|
||||
import com.lt2333.simplicitytools.R
|
||||
|
||||
|
||||
@BMPage("hide_icon","Hide Icon", hideMenu = false)
|
||||
class HideIconPageForT : BasePage() {
|
||||
|
||||
override fun onCreate() {
|
||||
TitleText(textId = R.string.status_bar_icon)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_battery_icon),
|
||||
SwitchV("hide_battery_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_battery_charging_icon),
|
||||
SwitchV("hide_battery_charging_icon")
|
||||
)
|
||||
TextWithSwitch(TextV(textId = R.string.hide_gps_icon), SwitchV("hide_gps_icon"))
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_bluetooth_icon),
|
||||
SwitchV("hide_bluetooth_icon")
|
||||
)
|
||||
|
||||
TextWithSwitch(TextV(textId = R.string.hide_nfc_icon), SwitchV("hide_nfc_icon"))
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_bluetooth_battery_icon),
|
||||
SwitchV("hide_bluetooth_battery_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_small_hd_icon),
|
||||
SwitchV("hide_small_hd_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_big_hd_icon),
|
||||
SwitchV("hide_big_hd_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_new_hd_icon),
|
||||
SwitchV("hide_new_hd_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_hd_no_service_icon),
|
||||
SwitchV("hide_hd_no_service_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_no_sim_icon),
|
||||
SwitchV("hide_no_sim_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_sim_one_icon),
|
||||
SwitchV("hide_sim_one_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_sim_two_icon),
|
||||
SwitchV("hide_sim_two_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_mobile_activity_icon),
|
||||
SwitchV("hide_mobile_activity_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_mobile_type_icon),
|
||||
SwitchV("hide_mobile_type_icon")
|
||||
)
|
||||
TextWithSwitch(TextV(textId = R.string.hide_wifi_icon), SwitchV("hide_wifi_icon"))
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_wifi_activity_icon),
|
||||
SwitchV("hide_wifi_activity_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_wifi_standard_icon),
|
||||
SwitchV("hide_wifi_standard_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_slave_wifi_icon),
|
||||
SwitchV("hide_slave_wifi_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_hotspot_icon),
|
||||
SwitchV("hide_hotspot_icon")
|
||||
)
|
||||
TextWithSwitch(TextV(textId = R.string.hide_vpn_icon), SwitchV("hide_vpn_icon"))
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_airplane_icon),
|
||||
SwitchV("hide_airplane_icon")
|
||||
)
|
||||
TextWithSwitch(TextV(textId = R.string.hide_alarm_icon), SwitchV("hide_alarm_icon"))
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_headset_icon),
|
||||
SwitchV("hide_headset_icon")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_volume_icon),
|
||||
SwitchV("hide_volume_icon")
|
||||
)
|
||||
TextWithSwitch(TextV(textId = R.string.hide_zen_icon), SwitchV("hide_zen_icon"))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.lt2333.simplicitytools.activity.pages.t
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.pm.PackageManager
|
||||
import cn.fkj233.ui.activity.annotation.BMMainPage
|
||||
import cn.fkj233.ui.activity.data.BasePage
|
||||
import cn.fkj233.ui.activity.view.SwitchV
|
||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
||||
import cn.fkj233.ui.dialog.MIUIDialog
|
||||
import com.lt2333.simplicitytools.BuildConfig
|
||||
import com.lt2333.simplicitytools.R
|
||||
|
||||
|
||||
@BMMainPage("WooBox[MIUI14]")
|
||||
class MainPageForT : BasePage() {
|
||||
|
||||
override fun onCreate() {
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.main_switch,
|
||||
colorId = R.color.purple_700
|
||||
), SwitchV("main_switch", true)
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.HideLauncherIcon),
|
||||
SwitchV("hLauncherIcon", onClickListener = {
|
||||
activity.packageManager.setComponentEnabledSetting(
|
||||
ComponentName(activity, "${BuildConfig.APPLICATION_ID}.launcher"),
|
||||
if (it) {
|
||||
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
|
||||
} else {
|
||||
PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
||||
},
|
||||
PackageManager.DONT_KILL_APP
|
||||
)
|
||||
})
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.matters_needing_attention,
|
||||
colorId = R.color.red,
|
||||
onClickListener = {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.matters_needing_attention)
|
||||
setMessage(R.string.matters_needing_attention_context)
|
||||
setRButton(R.string.Done) {
|
||||
dismiss()
|
||||
}
|
||||
}.show()
|
||||
})
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.scope)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.scope_systemui,
|
||||
tipsId = R.string.scope_systemui_summary,
|
||||
onClickListener = { showFragment("scope_systemui") })
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.scope_android,
|
||||
tipsId = R.string.scope_android_summary,
|
||||
onClickListener = { showFragment("scope_android") })
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.scope_other,
|
||||
tipsId = R.string.scope_other_summary,
|
||||
onClickListener = { showFragment("scope_other") })
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.about)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.about_module,
|
||||
tips = getString(R.string.about_module_summary),
|
||||
onClickListener = { showFragment("about_module") })
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package com.lt2333.simplicitytools.activity.pages.t
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.view.View
|
||||
import android.widget.Switch
|
||||
import android.widget.Toast
|
||||
import cn.fkj233.ui.activity.MIUIActivity
|
||||
import cn.fkj233.ui.activity.annotation.BMPage
|
||||
import cn.fkj233.ui.activity.data.BasePage
|
||||
import cn.fkj233.ui.activity.view.SwitchV
|
||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
||||
import cn.fkj233.ui.dialog.MIUIDialog
|
||||
import com.lt2333.simplicitytools.BuildConfig
|
||||
import com.lt2333.simplicitytools.R
|
||||
|
||||
|
||||
@BMPage("scope_other","Other", hideMenu = false)
|
||||
class OtherPageForT : BasePage() {
|
||||
|
||||
override fun onCreate() {
|
||||
TitleText(textId = R.string.scope_miuihome)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.home_time,
|
||||
tipsId = R.string.home_time_summary
|
||||
), SwitchV("home_time")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.double_tap_to_sleep,
|
||||
tipsId = R.string.home_double_tap_to_sleep_summary
|
||||
), SwitchV("double_tap_to_sleep")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.scope_powerkeeper)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.lock_max_fps,
|
||||
tipsId = R.string.lock_max_fps_summary
|
||||
), SwitchV("lock_max_fps")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.prevent_recovery_of_battery_optimization_white_list,
|
||||
tipsId = R.string.failed_after_restart
|
||||
), SwitchV("prevent_recovery_of_battery_optimization_white_list")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.do_not_clear_app,
|
||||
tipsId = R.string.do_not_clear_app_summary
|
||||
), SwitchV("do_not_clear_app")
|
||||
)
|
||||
val makeMilletMoreAggressiveSwitchBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"make_millet_more_aggressive",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.make_millet_more_aggressive,
|
||||
tipsId = R.string.make_millet_more_aggressive_summary
|
||||
),
|
||||
SwitchV(
|
||||
"make_millet_more_aggressive",
|
||||
dataBindingSend = makeMilletMoreAggressiveSwitchBinding.bindingSend
|
||||
)
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.make_millet_ignore_active,
|
||||
tipsId = R.string.make_millet_ignore_active_summary
|
||||
),
|
||||
SwitchV("make_millet_ignore_active"),
|
||||
dataBindingRecv = makeMilletMoreAggressiveSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.battery_optimization,
|
||||
tipsId = R.string.battery_optimization_summary,
|
||||
onClickListener = {
|
||||
try {
|
||||
val intent = Intent()
|
||||
val comp = ComponentName(
|
||||
"com.android.settings",
|
||||
"com.android.settings.Settings\$HighPowerApplicationsActivity"
|
||||
)
|
||||
intent.component = comp
|
||||
activity.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(activity, "启动失败,可能是不支持", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
})
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.scope_securitycenter)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.skip_waiting_time,
|
||||
tipsId = R.string.skip_waiting_time_summary
|
||||
), SwitchV("skip_waiting_time")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.remove_open_app_confirmation_popup,
|
||||
tipsId = R.string.remove_open_app_confirmation_popup_summary
|
||||
), SwitchV("remove_open_app_confirmation_popup")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.lock_one_hundred,
|
||||
tipsId = R.string.lock_one_hundred_summary
|
||||
), SwitchV("lock_one_hundred")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.remove_macro_blacklist),
|
||||
SwitchV("remove_macro_blacklist")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.battery_life_function),
|
||||
SwitchV("battery_life_function")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.scope_mediaeditor)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.unlock_unlimited_cropping,
|
||||
tipsId = R.string.unlock_unlimited_cropping_summary
|
||||
), SwitchV("unlock_unlimited_cropping")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.updater)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.remove_ota_validate,
|
||||
tipsId = R.string.remove_ota_validate_summary
|
||||
), SwitchV("remove_ota_validate")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.settings)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.show_notification_importance,
|
||||
tipsId = R.string.show_notification_importance_summary
|
||||
), SwitchV("show_notification_importance")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.cast)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.force_support_send_app,
|
||||
), SwitchV("force_support_send_app")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.rear_display)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.show_weather_main_switch,
|
||||
), SwitchV("rear_show_weather")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.remove_ad)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.remove_thememanager_ads),
|
||||
SwitchV("remove_thememanager_ads")
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,759 @@
|
||||
package com.lt2333.simplicitytools.activity.pages.t
|
||||
|
||||
import android.view.View
|
||||
import android.widget.Switch
|
||||
import android.widget.Toast
|
||||
import cn.fkj233.ui.activity.MIUIActivity
|
||||
import cn.fkj233.ui.activity.annotation.BMPage
|
||||
import cn.fkj233.ui.activity.data.BasePage
|
||||
import cn.fkj233.ui.activity.view.SpinnerV
|
||||
import cn.fkj233.ui.activity.view.SwitchV
|
||||
import cn.fkj233.ui.activity.view.TextSummaryV
|
||||
import cn.fkj233.ui.activity.view.TextV
|
||||
import cn.fkj233.ui.dialog.MIUIDialog
|
||||
import com.lt2333.simplicitytools.R
|
||||
import java.util.HashMap
|
||||
|
||||
|
||||
@BMPage("scope_systemui","System UI", hideMenu = false)
|
||||
class SystemUIPageForT : BasePage() {
|
||||
|
||||
override fun onCreate() {
|
||||
TitleText(textId = R.string.statusbar)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.double_tap_to_sleep),
|
||||
SwitchV("status_bar_double_tap_to_sleep")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.status_bar_layout)
|
||||
val statusBarLayoutMode: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
||||
it[0] = getString(R.string.default1)
|
||||
it[1] = getString(R.string.clock_center)
|
||||
it[2] = getString(R.string.clock_right)
|
||||
it[3] = getString(R.string.clock_center_and_icon_left)
|
||||
}
|
||||
TextWithSpinner(
|
||||
TextV(textId = R.string.status_bar_layout_mode),
|
||||
SpinnerV(
|
||||
statusBarLayoutMode[MIUIActivity.safeSP.getInt(
|
||||
"status_bar_layout_mode",
|
||||
0
|
||||
)].toString()
|
||||
) {
|
||||
add(statusBarLayoutMode[0].toString()) {
|
||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 0)
|
||||
}
|
||||
add(statusBarLayoutMode[1].toString()) {
|
||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 1)
|
||||
}
|
||||
add(statusBarLayoutMode[2].toString()) {
|
||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 2)
|
||||
}
|
||||
add(statusBarLayoutMode[3].toString()) {
|
||||
MIUIActivity.safeSP.putAny("status_bar_layout_mode", 3)
|
||||
}
|
||||
})
|
||||
|
||||
val layoutCompatibilityModeBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getInt(
|
||||
"screen_hole_location",
|
||||
0
|
||||
) == 2
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
val screenHoleLocation: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
||||
it[0] = getString(R.string.off)
|
||||
it[1] = getString(R.string.center)
|
||||
it[2] = getString(R.string.left_or_right)
|
||||
}
|
||||
TextSummaryWithSpinner(
|
||||
TextSummaryV(
|
||||
textId = R.string.layout_compatibility_mode,
|
||||
tipsId = R.string.screen_hole_location
|
||||
),
|
||||
SpinnerV(
|
||||
screenHoleLocation[MIUIActivity.safeSP.getInt(
|
||||
"screen_hole_location",
|
||||
0
|
||||
)].toString()
|
||||
) {
|
||||
add(screenHoleLocation[0].toString()) {
|
||||
MIUIActivity.safeSP.putAny("screen_hole_location", 0)
|
||||
layoutCompatibilityModeBinding.binding.Send().send(false)
|
||||
}
|
||||
add(screenHoleLocation[1].toString()) {
|
||||
MIUIActivity.safeSP.putAny("screen_hole_location", 1)
|
||||
layoutCompatibilityModeBinding.binding.Send().send(false)
|
||||
}
|
||||
add(screenHoleLocation[2].toString()) {
|
||||
MIUIActivity.safeSP.putAny("screen_hole_location", 2)
|
||||
layoutCompatibilityModeBinding.binding.Send().send(true)
|
||||
}
|
||||
})
|
||||
|
||||
Text(
|
||||
textId = R.string.left_margin,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_left_margin",
|
||||
0,
|
||||
300,
|
||||
0,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.right_margin,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_right_margin",
|
||||
0,
|
||||
300,
|
||||
0,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.status_bar_clock_format)
|
||||
|
||||
|
||||
val customClockPresetBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getInt(
|
||||
"custom_clock_mode",
|
||||
0
|
||||
) == 1
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
val customClockGeekBinding =
|
||||
GetDataBinding({ MIUIActivity.safeSP.getInt("custom_clock_mode", 0) == 2 }
|
||||
|
||||
) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
val customClockMode: HashMap<Int, String> = hashMapOf<Int, String>().also {
|
||||
it[0] = getString(R.string.off)
|
||||
it[1] = getString(R.string.preset)
|
||||
it[2] = getString(R.string.geek)
|
||||
}
|
||||
TextWithSpinner(
|
||||
TextV(textId = R.string.custom_clock_mode),
|
||||
SpinnerV(customClockMode[MIUIActivity.safeSP.getInt("custom_clock_mode", 0)].toString()) {
|
||||
add(customClockMode[0].toString()) {
|
||||
MIUIActivity.safeSP.putAny("custom_clock_mode", 0)
|
||||
customClockPresetBinding.binding.Send().send(false)
|
||||
customClockGeekBinding.binding.Send().send(false)
|
||||
}
|
||||
add(customClockMode[1].toString()) {
|
||||
MIUIActivity.safeSP.putAny("custom_clock_mode", 1)
|
||||
customClockPresetBinding.binding.Send().send(true)
|
||||
customClockGeekBinding.binding.Send().send(false)
|
||||
}
|
||||
add(customClockMode[2].toString()) {
|
||||
MIUIActivity.safeSP.putAny("custom_clock_mode", 2)
|
||||
customClockPresetBinding.binding.Send().send(false)
|
||||
customClockGeekBinding.binding.Send().send(true)
|
||||
}
|
||||
})
|
||||
|
||||
//预设模式起始
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_year),
|
||||
SwitchV("status_bar_time_year"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_month),
|
||||
SwitchV("status_bar_time_month"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_day),
|
||||
SwitchV("status_bar_time_day"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_week),
|
||||
SwitchV("status_bar_time_week"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_double_hour),
|
||||
SwitchV("status_bar_time_double_hour"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_period),
|
||||
SwitchV("status_bar_time_period", true),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_seconds),
|
||||
SwitchV("status_bar_time_seconds"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_hide_space),
|
||||
SwitchV("status_bar_time_hide_space"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_double_line),
|
||||
SwitchV("status_bar_time_double_line"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_double_line_center_align),
|
||||
SwitchV("status_bar_time_double_line_center_align"),
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.status_bar_clock_size,
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_clock_size",
|
||||
0,
|
||||
18,
|
||||
0,
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.status_bar_clock_double_line_size,
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_clock_double_line_size",
|
||||
0,
|
||||
9,
|
||||
0,
|
||||
dataBindingRecv = customClockPresetBinding.binding.getRecv(2)
|
||||
)
|
||||
//预设模式结束
|
||||
|
||||
//极客模式起始
|
||||
TextSummaryArrow(TextSummaryV(textId = R.string.custom_clock_format_geek) {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.custom_clock_format_geek)
|
||||
setEditText(MIUIActivity.safeSP.getString("custom_clock_format_geek", "HH:mm:ss"), "")
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText().isNotEmpty()) {
|
||||
try {
|
||||
MIUIActivity.safeSP.putAny("custom_clock_format_geek", getEditText())
|
||||
dismiss()
|
||||
return@setRButton
|
||||
} catch (_: Throwable) {
|
||||
}
|
||||
}
|
||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
}
|
||||
}.show()
|
||||
}, dataBindingRecv = customClockGeekBinding.binding.getRecv(2))
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.status_bar_time_double_line_center_align),
|
||||
SwitchV("status_bar_time_center_align_geek"),
|
||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.status_bar_clock_size,
|
||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_clock_size_geek",
|
||||
0,
|
||||
18,
|
||||
0,
|
||||
dataBindingRecv = customClockGeekBinding.binding.getRecv(2)
|
||||
)
|
||||
//极客模式结束
|
||||
|
||||
|
||||
Line()
|
||||
TitleText(textId = R.string.status_bar_icon)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.hide_icon,
|
||||
onClickListener = { showFragment("hide_icon") })
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.show_wifi_standard),
|
||||
SwitchV("show_wifi_standard")
|
||||
)
|
||||
val customMobileTypeTextBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"custom_mobile_type_text_switch",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.custom_mobile_type_text_switch),
|
||||
SwitchV(
|
||||
"custom_mobile_type_text_switch",
|
||||
dataBindingSend = customMobileTypeTextBinding.bindingSend
|
||||
)
|
||||
)
|
||||
TextSummaryArrow(TextSummaryV(textId = R.string.custom_mobile_type_text) {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.custom_mobile_type_text)
|
||||
setEditText(MIUIActivity.safeSP.getString("custom_mobile_type_text", "5G"), "")
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText().isNotEmpty()) {
|
||||
try {
|
||||
MIUIActivity.safeSP.putAny("custom_mobile_type_text", getEditText())
|
||||
dismiss()
|
||||
return@setRButton
|
||||
} catch (_: Throwable) {
|
||||
}
|
||||
}
|
||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
}
|
||||
}.show()
|
||||
}, dataBindingRecv = customMobileTypeTextBinding.binding.getRecv(2))
|
||||
val bigMobileTypeIconBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"big_mobile_type_icon",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.big_mobile_type_icon),
|
||||
SwitchV(
|
||||
"big_mobile_type_icon",
|
||||
dataBindingSend = bigMobileTypeIconBinding.bindingSend
|
||||
)
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.big_mobile_type_icon_bold),
|
||||
SwitchV("big_mobile_type_icon_bold", true),
|
||||
dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
||||
)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.big_mobile_type_icon_size,
|
||||
onClickListener = {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.big_mobile_type_icon_size)
|
||||
setEditText(
|
||||
"",
|
||||
"${activity.getString(R.string.def)}12.5, ${activity.getString(R.string.current)}${
|
||||
MIUIActivity.safeSP.getFloat("big_mobile_type_icon_size", 12.5f)
|
||||
}"
|
||||
)
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText() != "") {
|
||||
MIUIActivity.safeSP.putAny(
|
||||
"big_mobile_type_icon_size",
|
||||
getEditText().toFloat()
|
||||
)
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
}.show()
|
||||
}), dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
||||
)
|
||||
TextSummaryArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_up_and_down_position) {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.big_mobile_type_icon_up_and_down_position)
|
||||
setMessage("${activity.getString(R.string.range)} -15~15")
|
||||
setEditText(
|
||||
"",
|
||||
"${activity.getString(R.string.def)}0, ${activity.getString(R.string.current)}${
|
||||
MIUIActivity.safeSP.getInt("big_mobile_type_icon_up_and_down_position", 0)
|
||||
}"
|
||||
)
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText().isNotEmpty()) {
|
||||
try {
|
||||
val value = getEditText().toInt()
|
||||
if (value in (-15..15)) {
|
||||
MIUIActivity.safeSP.putAny(
|
||||
"big_mobile_type_icon_up_and_down_position",
|
||||
value
|
||||
)
|
||||
dismiss()
|
||||
return@setRButton
|
||||
}
|
||||
} catch (_: Throwable) {
|
||||
}
|
||||
}
|
||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
}
|
||||
}.show()
|
||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2))
|
||||
TextSummaryArrow(TextSummaryV(textId = R.string.big_mobile_type_icon_left_and_right_margins) {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.big_mobile_type_icon_left_and_right_margins)
|
||||
setMessage("${activity.getString(R.string.range)} 0~30")
|
||||
setEditText(
|
||||
"",
|
||||
"${activity.getString(R.string.def)}0, ${activity.getString(R.string.current)}${
|
||||
MIUIActivity.safeSP.getInt("big_mobile_type_icon_left_and_right_margins", 0)
|
||||
}"
|
||||
)
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText().isNotEmpty()) {
|
||||
try {
|
||||
val value = getEditText().toInt()
|
||||
if (value in (0..30)) {
|
||||
MIUIActivity.safeSP.putAny(
|
||||
"big_mobile_type_icon_left_and_right_margins",
|
||||
value
|
||||
)
|
||||
dismiss()
|
||||
return@setRButton
|
||||
}
|
||||
} catch (_: Throwable) {
|
||||
}
|
||||
}
|
||||
Toast.makeText(activity, R.string.input_error, Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
}
|
||||
}.show()
|
||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2))
|
||||
Text(textId = R.string.maximum_number_of_notification_icons)
|
||||
SeekBarWithText("maximum_number_of_notification_icons", 1, 30, 3)
|
||||
Text(textId = R.string.maximum_number_of_notification_dots)
|
||||
SeekBarWithText("maximum_number_of_notification_dots", 0, 4, 3)
|
||||
TextSummaryArrow(
|
||||
TextSummaryV(
|
||||
textId = R.string.battery_percentage_font_size,
|
||||
onClickListener = {
|
||||
MIUIDialog(activity) {
|
||||
setTitle(R.string.battery_percentage_font_size)
|
||||
setMessage(R.string.zero_do_no_change)
|
||||
setEditText(
|
||||
"", "${activity.getString(R.string.current)}${
|
||||
MIUIActivity.safeSP.getFloat("battery_percentage_font_size", 0f)
|
||||
}"
|
||||
)
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
setRButton(textId = R.string.Done) {
|
||||
if (getEditText() != "") {
|
||||
MIUIActivity.safeSP.putAny(
|
||||
"battery_percentage_font_size",
|
||||
getEditText().toFloat()
|
||||
)
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
}.show()
|
||||
})
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.hide_battery_percentage_icon,
|
||||
tipsId = R.string.hide_battery_percentage_icon_summary
|
||||
), SwitchV("hide_battery_percentage_icon")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.status_bar_network_speed)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.status_bar_network_speed_refresh_speed,
|
||||
tipsId = R.string.status_bar_network_speed_refresh_speed_summary
|
||||
), SwitchV("status_bar_network_speed_refresh_speed")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.hide_status_bar_network_speed_second,
|
||||
tipsId = R.string.hide_status_bar_network_speed_second_summary
|
||||
), SwitchV("hide_status_bar_network_speed_second")
|
||||
)
|
||||
TextWithSwitch(
|
||||
TextV(textId = R.string.hide_network_speed_splitter),
|
||||
SwitchV("hide_network_speed_splitter")
|
||||
)
|
||||
val statusBarDualRowNetworkSpeedBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"status_bar_dual_row_network_speed",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.status_bar_dual_row_network_speed,
|
||||
tipsId = R.string.status_bar_dual_row_network_speed_summary
|
||||
),
|
||||
SwitchV(
|
||||
"status_bar_dual_row_network_speed",
|
||||
dataBindingSend = statusBarDualRowNetworkSpeedBinding.bindingSend
|
||||
)
|
||||
)
|
||||
val align: HashMap<Int, String> = hashMapOf()
|
||||
align[0] = getString(R.string.left)
|
||||
align[1] = getString(R.string.right)
|
||||
TextWithSpinner(
|
||||
TextV(textId = R.string.status_bar_network_speed_dual_row_gravity),
|
||||
SpinnerV(
|
||||
align[MIUIActivity.safeSP.getInt(
|
||||
"status_bar_network_speed_dual_row_gravity",
|
||||
0
|
||||
)].toString()
|
||||
) {
|
||||
add(align[0].toString()) {
|
||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_gravity", 0)
|
||||
}
|
||||
add(align[1].toString()) {
|
||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_gravity", 1)
|
||||
|
||||
}
|
||||
},
|
||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
||||
)
|
||||
TextWithSpinner(
|
||||
TextV(textId = R.string.status_bar_network_speed_dual_row_icon),
|
||||
SpinnerV(
|
||||
MIUIActivity.safeSP.getString(
|
||||
"status_bar_network_speed_dual_row_icon",
|
||||
getString(R.string.none)
|
||||
)
|
||||
) {
|
||||
add(getString(R.string.none)) {
|
||||
MIUIActivity.safeSP.putAny(
|
||||
"status_bar_network_speed_dual_row_icon",
|
||||
getString(R.string.none)
|
||||
)
|
||||
}
|
||||
add("▲▼") {
|
||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_icon", "▲▼")
|
||||
}
|
||||
add("△▽") {
|
||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_icon", "△▽")
|
||||
}
|
||||
add("↑↓") {
|
||||
MIUIActivity.safeSP.putAny("status_bar_network_speed_dual_row_icon", "↑↓")
|
||||
}
|
||||
})
|
||||
Text(
|
||||
textId = R.string.status_bar_network_speed_dual_row_size,
|
||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"status_bar_network_speed_dual_row_size",
|
||||
0,
|
||||
9,
|
||||
0,
|
||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.notification_center)
|
||||
val showWeatherMainSwitchBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"notification_weather",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.show_weather_main_switch,
|
||||
colorId = R.color.purple_700
|
||||
),
|
||||
SwitchV(
|
||||
"notification_weather",
|
||||
dataBindingSend = showWeatherMainSwitchBinding.bindingSend
|
||||
)
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.show_city,
|
||||
),
|
||||
SwitchV("notification_weather_city"),
|
||||
dataBindingRecv = showWeatherMainSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.can_notification_slide,
|
||||
tipsId = R.string.can_notification_slide_summary,
|
||||
),
|
||||
SwitchV("can_notification_slide"),
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.control_center)
|
||||
val controlCenterWeatherBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"control_center_weather",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.show_weather_main_switch,
|
||||
colorId = R.color.purple_700,
|
||||
tipsId = R.string.control_center_weather_summary
|
||||
),
|
||||
SwitchV(
|
||||
"control_center_weather",
|
||||
dataBindingSend = controlCenterWeatherBinding.bindingSend
|
||||
)
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.show_city,
|
||||
),
|
||||
SwitchV("control_center_weather_city"),
|
||||
dataBindingRecv = controlCenterWeatherBinding.binding.getRecv(2)
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.lock_screen)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.lock_screen_clock_display_seconds,
|
||||
tipsId = R.string.only_official_default_themes_are_supported
|
||||
), SwitchV("lock_screen_clock_display_seconds")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.remove_the_left_side_of_the_lock_screen,
|
||||
tipsId = R.string.only_official_default_themes_are_supported
|
||||
), SwitchV("remove_the_left_side_of_the_lock_screen")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.remove_lock_screen_camera,
|
||||
tipsId = R.string.only_official_default_themes_are_supported
|
||||
), SwitchV("remove_lock_screen_camera")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(textId = R.string.enable_wave_charge_animation),
|
||||
SwitchV("enable_wave_charge_animation")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.lock_screen_charging_current,
|
||||
tipsId = R.string.only_official_default_themes_are_supported
|
||||
), SwitchV("lock_screen_charging_current")
|
||||
)
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.double_tap_to_sleep,
|
||||
tipsId = R.string.home_double_tap_to_sleep_summary
|
||||
), SwitchV("lock_screen_double_tap_to_sleep")
|
||||
)
|
||||
Line()
|
||||
TitleText(textId = R.string.old_quick_settings_panel)
|
||||
val oldQSCustomSwitchBinding = GetDataBinding({
|
||||
MIUIActivity.safeSP.getBoolean(
|
||||
"old_qs_custom_switch",
|
||||
false
|
||||
)
|
||||
}) { view, flags, data ->
|
||||
when (flags) {
|
||||
1 -> (view as Switch).isEnabled = data as Boolean
|
||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||
}
|
||||
}
|
||||
TextSummaryWithSwitch(
|
||||
TextSummaryV(
|
||||
textId = R.string.old_qs_custom_switch,
|
||||
colorId = R.color.purple_700
|
||||
),
|
||||
SwitchV(
|
||||
"old_qs_custom_switch",
|
||||
dataBindingSend = oldQSCustomSwitchBinding.bindingSend
|
||||
)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.qs_custom_rows,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"qs_custom_rows",
|
||||
1,
|
||||
6,
|
||||
3,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.qs_custom_rows_horizontal,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"qs_custom_rows_horizontal",
|
||||
1,
|
||||
3,
|
||||
2,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.qs_custom_columns,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"qs_custom_columns",
|
||||
1,
|
||||
7,
|
||||
4,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
Text(
|
||||
textId = R.string.qs_custom_columns_unexpanded,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
SeekBarWithText(
|
||||
"qs_custom_columns_unexpanded",
|
||||
1,
|
||||
7,
|
||||
5,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.android.*
|
||||
import com.lt2333.simplicitytools.hook.app.android.corepatch.CorePatchMainHook
|
||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object Android : AppRegister() {
|
||||
override val packageName: String = "android"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
//核心破解
|
||||
CorePatchMainHook().handleLoadPackage(lpparam)
|
||||
autoInitHooks(
|
||||
lpparam,
|
||||
DisableFlagSecure, //允许截图
|
||||
DeleteOnPostNotification, //上层显示
|
||||
RemoveSmallWindowRestrictions, //解除小窗限制
|
||||
MaxWallpaperScale, //壁纸缩放比例
|
||||
SystemPropertiesHook, //SystemPropertiesHook
|
||||
AllowUntrustedTouches, //允许不受信任的触摸
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.cast.ForceSupportSendApp
|
||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object Cast: AppRegister() {
|
||||
override val packageName: String = "com.milink.service"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
autoInitHooks(lpparam,
|
||||
ForceSupportSendApp, //强制允许所有应用接力
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.mediaeditor.UnlockUnlimitedCropping
|
||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object MediaEditor: AppRegister() {
|
||||
override val packageName: String = "com.miui.mediaeditor"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
autoInitHooks(lpparam,
|
||||
UnlockUnlimitedCropping, //解锁裁切最小值
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.miuihome.AlwaysDisplayTime
|
||||
import com.lt2333.simplicitytools.hook.app.miuihome.DoubleTapToSleep
|
||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object MiuiHome: AppRegister() {
|
||||
override val packageName: String = "com.miui.home"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
autoInitHooks(lpparam,
|
||||
AlwaysDisplayTime, //时钟显示时钟
|
||||
DoubleTapToSleep, //双击锁屏
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.powerkeeper.DoNotClearApp
|
||||
import com.lt2333.simplicitytools.hook.app.powerkeeper.LockMaxFps
|
||||
import com.lt2333.simplicitytools.hook.app.powerkeeper.MakeMilletMoreAggressive
|
||||
import com.lt2333.simplicitytools.hook.app.powerkeeper.PreventRecoveryOfBatteryOptimizationWhitelist
|
||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object PowerKeeper: AppRegister() {
|
||||
override val packageName: String = "com.miui.powerkeeper"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
autoInitHooks(lpparam,
|
||||
LockMaxFps, //锁定最高刷新率
|
||||
PreventRecoveryOfBatteryOptimizationWhitelist, //防止恢复电池优化白名单
|
||||
DoNotClearApp,//阻止杀后台
|
||||
MakeMilletMoreAggressive,//使 Millet 更激进
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.reardisplay.RearDisplayWeather
|
||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object RearDisplay: AppRegister() {
|
||||
override val packageName: String = "com.xiaomi.misubscreenui"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
autoInitHooks(lpparam,
|
||||
RearDisplayWeather, //背屏显示天气
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.screenshot.UnlockUnlimitedCropping
|
||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object ScreenShot: AppRegister() {
|
||||
override val packageName: String = "com.miui.screenshot"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
autoInitHooks(lpparam,
|
||||
UnlockUnlimitedCropping, //锁定最高刷新率
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.securitycenter.*
|
||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object SecurityCenter: AppRegister() {
|
||||
override val packageName: String = "com.miui.securitycenter"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
autoInitHooks(lpparam,
|
||||
SkipWaitingTime, //跳过 5/10秒等待时间
|
||||
LockOneHundred, //锁定 100分
|
||||
RemoveMacroBlacklist, //去除自动连招黑名单
|
||||
ShowBatteryTemperature, //显示电池温度
|
||||
RemoveOpenAppConfirmationPopup, //去除打开应用弹窗
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.settings.ShowNotificationImportance
|
||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object Settings: AppRegister() {
|
||||
override val packageName: String = "com.android.settings"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
autoInitHooks(lpparam,
|
||||
ShowNotificationImportance, //显示通知重要程度
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.systemui.*
|
||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object SystemUI: AppRegister() {
|
||||
override val packageName: String = "com.android.systemui"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
autoInitHooks(lpparam,
|
||||
HideStatusBarIcon, //隐藏状态栏图标
|
||||
HideBatteryIcon, //隐藏电池
|
||||
HideHDIcon, //隐藏HD图标
|
||||
HideSimIcon, //隐藏SIM卡图标
|
||||
HideMobileActivityIcon, //隐藏移动箭头图标
|
||||
HideMobileTypeIcon, //隐藏移动类型图标
|
||||
HideStatusBarNetworkSpeedSecond, //隐藏状态栏网速/s
|
||||
HideWifiActivityIcon, //隐藏WIFI活动箭头图标
|
||||
MaximumNumberOfNotificationIcons, //通知图标上限
|
||||
StatusBarNetworkSpeedRefreshSpeed, //状态栏网速秒刷新
|
||||
StatusBarTimeCustomization, //状态栏时钟自定义
|
||||
RemoveTheLeftSideOfTheLockScreen, //移除锁屏负一屏功能
|
||||
RemoveLockScreenCamera, //移除锁屏相机功能
|
||||
NotificationWeather, //通知面板天气
|
||||
NewNotificationWeather, // 新控制中心天气
|
||||
OldNotificationWeather,
|
||||
ControlCenterWeather, //控制中心天气
|
||||
//StatusBarCurrent, //TODO:状态栏电流
|
||||
StatusBarLayout, //状态栏布局
|
||||
HideNetworkSpeedSplitter, //隐藏时钟与实时网速之间的分隔符
|
||||
WaveCharge, //Alpha充电动画
|
||||
LockScreenCurrent, //锁屏电流
|
||||
LockScreenDoubleTapToSleep, //锁屏下双击锁屏
|
||||
StatusBarDoubleTapToSleep, //双击状态栏锁屏
|
||||
OldQSCustom, //旧版快速设置自定义
|
||||
DoubleLineNetworkSpeed, //双排网速
|
||||
StatusBarBigMobileTypeIcon, //大移动类型
|
||||
BatteryPercentage, //电量百分比
|
||||
CustomMobileTypeText, //自定义移动类型文本
|
||||
CanNotificationSlide, //允许下滑通知打开小窗
|
||||
LockScreenClockDisplaySeconds, // 锁屏时钟显示秒
|
||||
ShowWifiStandard, // 显示 WIFI 角标
|
||||
NoPasswordHook, // 显示 WIFI 角标
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
import com.lt2333.simplicitytools.hook.app.thememanager.RemoveAds
|
||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object ThemeManager: AppRegister() {
|
||||
override val packageName: String = "com.android.thememanager"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
autoInitHooks(lpparam,
|
||||
RemoveAds, //移除主题壁纸的广告
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android.corepatch;
|
||||
|
||||
public class CorePatchForSv2 extends CorePatchForS{
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
package com.lt2333.simplicitytools.hook
|
||||
package com.lt2333.simplicitytools.hooks
|
||||
|
||||
import com.lt2333.simplicitytools.BuildConfig
|
||||
import com.lt2333.simplicitytools.hook.app.*
|
||||
import com.lt2333.simplicitytools.hook.app.android.corepatch.CorePatchMainHook
|
||||
import com.lt2333.simplicitytools.util.xposed.EasyXposedInit
|
||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||
import com.lt2333.simplicitytools.hooks.apps.*
|
||||
import com.lt2333.simplicitytools.hooks.rules.all.CorePatchMainHook
|
||||
import com.lt2333.simplicitytools.utils.xposed.EasyXposedInit
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.IXposedHookZygoteInit
|
||||
import de.robv.android.xposed.XSharedPreferences
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
class XposedEntry : EasyXposedInit() {
|
||||
class MainHook : EasyXposedInit() {
|
||||
private var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "config")
|
||||
|
||||
override val registeredApp: List<AppRegister> = listOf(
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.lt2333.simplicitytools.hooks.apps
|
||||
|
||||
import android.os.Build
|
||||
import com.lt2333.simplicitytools.hooks.rules.all.CorePatchMainHook
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.android.*
|
||||
import com.lt2333.simplicitytools.hooks.rules.t.android.MaxWallpaperScaleForT
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object Android : AppRegister() {
|
||||
override val packageName: String = "android"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
//核心破解
|
||||
CorePatchMainHook().handleLoadPackage(lpparam)
|
||||
when (Build.VERSION.SDK_INT) {
|
||||
Build.VERSION_CODES.TIRAMISU -> {
|
||||
autoInitHooks(
|
||||
lpparam,
|
||||
DisableFlagSecureForS, //允许截图
|
||||
DeleteOnPostNotificationForS, //上层显示
|
||||
RemoveSmallWindowRestrictionsForS, //解除小窗限制
|
||||
MaxWallpaperScaleForT, //壁纸缩放比例
|
||||
SystemPropertiesHookForS, //SystemPropertiesHook
|
||||
AllowUntrustedTouchesForS, //允许不受信任的触摸
|
||||
)
|
||||
}
|
||||
Build.VERSION_CODES.S -> {
|
||||
autoInitHooks(
|
||||
lpparam,
|
||||
DisableFlagSecureForS, //允许截图
|
||||
DeleteOnPostNotificationForS, //上层显示
|
||||
RemoveSmallWindowRestrictionsForS, //解除小窗限制
|
||||
MaxWallpaperScaleForS, //壁纸缩放比例
|
||||
SystemPropertiesHookForS, //SystemPropertiesHook
|
||||
AllowUntrustedTouchesForS, //允许不受信任的触摸
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.lt2333.simplicitytools.hooks.apps
|
||||
|
||||
import android.os.Build
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.cast.ForceSupportSendAppForS
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object Cast: AppRegister() {
|
||||
override val packageName: String = "com.milink.service"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
when (Build.VERSION.SDK_INT) {
|
||||
Build.VERSION_CODES.TIRAMISU -> {
|
||||
autoInitHooks(lpparam,
|
||||
ForceSupportSendAppForS, //强制允许所有应用接力
|
||||
)
|
||||
}
|
||||
Build.VERSION_CODES.S -> {
|
||||
autoInitHooks(lpparam,
|
||||
ForceSupportSendAppForS, //强制允许所有应用接力
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.lt2333.simplicitytools.hooks.apps
|
||||
|
||||
import android.os.Build
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.mediaeditor.UnlockUnlimitedCroppingForS
|
||||
import com.lt2333.simplicitytools.hooks.rules.t.mediaeditor.UnlockUnlimitedCroppingForT
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object MediaEditor : AppRegister() {
|
||||
override val packageName: String = "com.miui.mediaeditor"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
when (Build.VERSION.SDK_INT) {
|
||||
Build.VERSION_CODES.TIRAMISU -> {
|
||||
autoInitHooks(
|
||||
lpparam,
|
||||
UnlockUnlimitedCroppingForT, //解锁裁切最小值
|
||||
)
|
||||
}
|
||||
Build.VERSION_CODES.S -> {
|
||||
autoInitHooks(
|
||||
lpparam,
|
||||
UnlockUnlimitedCroppingForS, //解锁裁切最小值
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.lt2333.simplicitytools.hooks.apps
|
||||
|
||||
import android.os.Build
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.miuihome.AlwaysDisplayTimeForS
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.miuihome.DoubleTapToSleepForS
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object MiuiHome : AppRegister() {
|
||||
override val packageName: String = "com.miui.home"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
when (Build.VERSION.SDK_INT) {
|
||||
Build.VERSION_CODES.TIRAMISU -> {
|
||||
autoInitHooks(
|
||||
lpparam,
|
||||
AlwaysDisplayTimeForS, //时钟显示时钟
|
||||
DoubleTapToSleepForS, //双击锁屏
|
||||
)
|
||||
}
|
||||
Build.VERSION_CODES.S -> {
|
||||
autoInitHooks(
|
||||
lpparam,
|
||||
AlwaysDisplayTimeForS, //时钟显示时钟
|
||||
DoubleTapToSleepForS, //双击锁屏
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.lt2333.simplicitytools.hooks.apps
|
||||
|
||||
import android.os.Build
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.powerkeeper.DoNotClearAppForS
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.powerkeeper.LockMaxFpsForS
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.powerkeeper.MakeMilletMoreAggressiveForS
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.powerkeeper.PreventRecoveryOfBatteryOptimizationWhitelistForS
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object PowerKeeper: AppRegister() {
|
||||
override val packageName: String = "com.miui.powerkeeper"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
when (Build.VERSION.SDK_INT) {
|
||||
Build.VERSION_CODES.TIRAMISU -> {
|
||||
autoInitHooks(lpparam,
|
||||
LockMaxFpsForS, //锁定最高刷新率
|
||||
PreventRecoveryOfBatteryOptimizationWhitelistForS, //防止恢复电池优化白名单
|
||||
DoNotClearAppForS,//阻止杀后台
|
||||
MakeMilletMoreAggressiveForS,//使 Millet 更激进
|
||||
)
|
||||
}
|
||||
Build.VERSION_CODES.S -> {
|
||||
autoInitHooks(lpparam,
|
||||
LockMaxFpsForS, //锁定最高刷新率
|
||||
PreventRecoveryOfBatteryOptimizationWhitelistForS, //防止恢复电池优化白名单
|
||||
DoNotClearAppForS,//阻止杀后台
|
||||
MakeMilletMoreAggressiveForS,//使 Millet 更激进
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.lt2333.simplicitytools.hooks.apps
|
||||
|
||||
import android.os.Build
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.reardisplay.RearDisplayWeatherForS
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object RearDisplay: AppRegister() {
|
||||
override val packageName: String = "com.xiaomi.misubscreenui"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
when (Build.VERSION.SDK_INT) {
|
||||
Build.VERSION_CODES.TIRAMISU -> {
|
||||
autoInitHooks(lpparam,
|
||||
RearDisplayWeatherForS, //背屏显示天气
|
||||
)
|
||||
}
|
||||
Build.VERSION_CODES.S -> {
|
||||
autoInitHooks(lpparam,
|
||||
RearDisplayWeatherForS, //背屏显示天气
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.lt2333.simplicitytools.hooks.apps
|
||||
|
||||
import android.os.Build
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.screenshot.UnlockUnlimitedCroppingForS
|
||||
import com.lt2333.simplicitytools.hooks.rules.t.mediaeditor.UnlockUnlimitedCroppingForT
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object ScreenShot: AppRegister() {
|
||||
override val packageName: String = "com.miui.screenshot"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
when (Build.VERSION.SDK_INT) {
|
||||
Build.VERSION_CODES.TIRAMISU -> {
|
||||
autoInitHooks(lpparam,
|
||||
UnlockUnlimitedCroppingForT, //解锁裁切限制
|
||||
)
|
||||
}
|
||||
Build.VERSION_CODES.S -> {
|
||||
autoInitHooks(lpparam,
|
||||
UnlockUnlimitedCroppingForS, //解锁裁切限制
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.lt2333.simplicitytools.hooks.apps
|
||||
|
||||
import android.os.Build
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.securitycenter.*
|
||||
import com.lt2333.simplicitytools.hooks.rules.t.securitycenter.ShowBatteryTemperatureForT
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object SecurityCenter: AppRegister() {
|
||||
override val packageName: String = "com.miui.securitycenter"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
when (Build.VERSION.SDK_INT) {
|
||||
Build.VERSION_CODES.TIRAMISU -> {
|
||||
autoInitHooks(lpparam,
|
||||
SkipWaitingTimeForS, //跳过 5/10秒等待时间
|
||||
LockOneHundredForS, //锁定 100分
|
||||
RemoveMacroBlacklistForS, //去除自动连招黑名单
|
||||
ShowBatteryTemperatureForT, //显示电池温度
|
||||
RemoveOpenAppConfirmationPopupForS, //去除打开应用弹窗
|
||||
)
|
||||
}
|
||||
Build.VERSION_CODES.S -> {
|
||||
autoInitHooks(lpparam,
|
||||
SkipWaitingTimeForS, //跳过 5/10秒等待时间
|
||||
LockOneHundredForS, //锁定 100分
|
||||
RemoveMacroBlacklistForS, //去除自动连招黑名单
|
||||
ShowBatteryTemperatureForS, //显示电池温度
|
||||
RemoveOpenAppConfirmationPopupForS, //去除打开应用弹窗
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.lt2333.simplicitytools.hooks.apps
|
||||
|
||||
import android.os.Build
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.settings.ShowNotificationImportanceForS
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object Settings: AppRegister() {
|
||||
override val packageName: String = "com.android.settings"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
when (Build.VERSION.SDK_INT) {
|
||||
Build.VERSION_CODES.TIRAMISU -> {
|
||||
autoInitHooks(lpparam,
|
||||
ShowNotificationImportanceForS, //显示通知重要程度
|
||||
)
|
||||
}
|
||||
Build.VERSION_CODES.S -> {
|
||||
autoInitHooks(lpparam,
|
||||
ShowNotificationImportanceForS, //显示通知重要程度
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.lt2333.simplicitytools.hooks.apps
|
||||
|
||||
import android.os.Build
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.systemui.*
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object SystemUI: AppRegister() {
|
||||
override val packageName: String = "com.android.systemui"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
when (Build.VERSION.SDK_INT) {
|
||||
Build.VERSION_CODES.TIRAMISU -> {
|
||||
autoInitHooks(lpparam,
|
||||
HideStatusBarIconForS, //隐藏状态栏图标
|
||||
HideBatteryIconForS, //隐藏电池
|
||||
HideHDIconForS, //隐藏HD图标
|
||||
HideSimIconForS, //隐藏SIM卡图标
|
||||
HideMobileActivityIconForS, //隐藏移动箭头图标
|
||||
HideMobileTypeIconForS, //隐藏移动类型图标
|
||||
HideStatusBarNetworkSpeedSecondForS, //隐藏状态栏网速/s
|
||||
HideWifiActivityIconForS, //隐藏WIFI活动箭头图标
|
||||
MaximumNumberOfNotificationIconsForS, //通知图标上限
|
||||
StatusBarNetworkSpeedRefreshSpeedForS, //状态栏网速秒刷新
|
||||
StatusBarTimeCustomizationForS, //状态栏时钟自定义
|
||||
RemoveTheLeftSideOfTheLockScreenForS, //移除锁屏负一屏功能
|
||||
RemoveLockScreenCameraForS, //移除锁屏相机功能
|
||||
NotificationWeatherForS, //通知面板天气
|
||||
NewNotificationWeatherForS, // 新控制中心天气
|
||||
OldNotificationWeatherForS,
|
||||
ControlCenterWeatherForS, //控制中心天气
|
||||
//StatusBarCurrent, //TODO:状态栏电流
|
||||
StatusBarLayoutForS, //状态栏布局
|
||||
HideNetworkSpeedSplitterForS, //隐藏时钟与实时网速之间的分隔符
|
||||
WaveChargeForS, //Alpha充电动画
|
||||
LockScreenCurrentForS, //锁屏电流
|
||||
LockScreenDoubleTapToSleepForS, //锁屏下双击锁屏
|
||||
StatusBarDoubleTapToSleepForS, //双击状态栏锁屏
|
||||
OldQSCustomForS, //旧版快速设置自定义
|
||||
DoubleLineNetworkSpeedForS, //双排网速
|
||||
StatusBarBigMobileTypeIconForS, //大移动类型
|
||||
BatteryPercentageForS, //电量百分比
|
||||
CustomMobileTypeTextForS, //自定义移动类型文本
|
||||
CanNotificationSlideForS, //允许下滑通知打开小窗
|
||||
LockScreenClockDisplaySecondsForS, // 锁屏时钟显示秒
|
||||
ShowWifiStandardForS, // 显示 WIFI 角标
|
||||
NoPasswordHookForS, // 显示 WIFI 角标
|
||||
)
|
||||
}
|
||||
Build.VERSION_CODES.S -> {
|
||||
autoInitHooks(lpparam,
|
||||
HideStatusBarIconForS, //隐藏状态栏图标
|
||||
HideBatteryIconForS, //隐藏电池
|
||||
HideHDIconForS, //隐藏HD图标
|
||||
HideSimIconForS, //隐藏SIM卡图标
|
||||
HideMobileActivityIconForS, //隐藏移动箭头图标
|
||||
HideMobileTypeIconForS, //隐藏移动类型图标
|
||||
HideStatusBarNetworkSpeedSecondForS, //隐藏状态栏网速/s
|
||||
HideWifiActivityIconForS, //隐藏WIFI活动箭头图标
|
||||
MaximumNumberOfNotificationIconsForS, //通知图标上限
|
||||
StatusBarNetworkSpeedRefreshSpeedForS, //状态栏网速秒刷新
|
||||
StatusBarTimeCustomizationForS, //状态栏时钟自定义
|
||||
RemoveTheLeftSideOfTheLockScreenForS, //移除锁屏负一屏功能
|
||||
RemoveLockScreenCameraForS, //移除锁屏相机功能
|
||||
NotificationWeatherForS, //通知面板天气
|
||||
NewNotificationWeatherForS, // 新控制中心天气
|
||||
OldNotificationWeatherForS,
|
||||
ControlCenterWeatherForS, //控制中心天气
|
||||
//StatusBarCurrent, //TODO:状态栏电流
|
||||
StatusBarLayoutForS, //状态栏布局
|
||||
HideNetworkSpeedSplitterForS, //隐藏时钟与实时网速之间的分隔符
|
||||
WaveChargeForS, //Alpha充电动画
|
||||
LockScreenCurrentForS, //锁屏电流
|
||||
LockScreenDoubleTapToSleepForS, //锁屏下双击锁屏
|
||||
StatusBarDoubleTapToSleepForS, //双击状态栏锁屏
|
||||
OldQSCustomForS, //旧版快速设置自定义
|
||||
DoubleLineNetworkSpeedForS, //双排网速
|
||||
StatusBarBigMobileTypeIconForS, //大移动类型
|
||||
BatteryPercentageForS, //电量百分比
|
||||
CustomMobileTypeTextForS, //自定义移动类型文本
|
||||
CanNotificationSlideForS, //允许下滑通知打开小窗
|
||||
LockScreenClockDisplaySecondsForS, // 锁屏时钟显示秒
|
||||
ShowWifiStandardForS, // 显示 WIFI 角标
|
||||
NoPasswordHookForS, // 显示 WIFI 角标
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.lt2333.simplicitytools.hooks.apps
|
||||
|
||||
import android.os.Build
|
||||
import com.lt2333.simplicitytools.hooks.rules.s.thememanager.RemoveAdsForS
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object ThemeManager: AppRegister() {
|
||||
override val packageName: String = "com.android.thememanager"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
when (Build.VERSION.SDK_INT) {
|
||||
Build.VERSION_CODES.TIRAMISU -> {
|
||||
autoInitHooks(lpparam,
|
||||
RemoveAdsForS, //移除主题壁纸的广告
|
||||
)
|
||||
}
|
||||
Build.VERSION_CODES.S -> {
|
||||
autoInitHooks(lpparam,
|
||||
RemoveAdsForS, //移除主题壁纸的广告
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
package com.lt2333.simplicitytools.hooks.apps
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
|
||||
import com.github.kyuubiran.ezxhelper.utils.loadClassOrNull
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.AppRegister
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
object Updater : AppRegister() {
|
||||
override val packageName: String = "com.android.updater"
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android.corepatch;
|
||||
package com.lt2333.simplicitytools.hooks.rules.all;
|
||||
|
||||
|
||||
import android.content.pm.ApplicationInfo;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android.corepatch;
|
||||
package com.lt2333.simplicitytools.hooks.rules.all;
|
||||
|
||||
|
||||
import android.app.AndroidAppHelper;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android.corepatch;
|
||||
package com.lt2333.simplicitytools.hooks.rules.all;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hooks.rules.all;
|
||||
|
||||
public class CorePatchForSv2 extends CorePatchForS{
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android.corepatch;
|
||||
package com.lt2333.simplicitytools.hooks.rules.all;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android.corepatch;
|
||||
package com.lt2333.simplicitytools.hooks.rules.all;
|
||||
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android.corepatch;
|
||||
package com.lt2333.simplicitytools.hooks.rules.all;
|
||||
|
||||
import de.robv.android.xposed.XC_MethodHook;
|
||||
import de.robv.android.xposed.XSharedPreferences;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android.corepatch;
|
||||
package com.lt2333.simplicitytools.hooks.rules.all;
|
||||
|
||||
import com.lt2333.simplicitytools.BuildConfig;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.android
|
||||
|
||||
import android.content.Context
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object AllowUntrustedTouches : HookRegister() {
|
||||
object AllowUntrustedTouchesForS : HookRegister() {
|
||||
override fun init() = hasEnable("allow_untrusted_touches") {
|
||||
findMethod("android.hardware.input.InputManager") {
|
||||
name == "getBlockUntrustedTouchesMode" && parameterTypes[0] == Context::class.java
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.android
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object DeleteOnPostNotification : HookRegister() {
|
||||
object DeleteOnPostNotificationForS : HookRegister() {
|
||||
override fun init() {
|
||||
findMethod("com.android.server.wm.AlertWindowNotification") {
|
||||
name == "onPostNotification"
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.android
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object DisableFlagSecure : HookRegister() {
|
||||
object DisableFlagSecureForS : HookRegister() {
|
||||
override fun init() {
|
||||
findMethod("com.android.server.wm.WindowState") {
|
||||
name == "isSecureLocked"
|
||||
@@ -1,22 +1,17 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.android
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAllConstructorAfter
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.github.kyuubiran.ezxhelper.utils.putObject
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object MaxWallpaperScale : HookRegister() {
|
||||
object MaxWallpaperScaleForS : HookRegister() {
|
||||
override fun init() {
|
||||
findMethod("com.android.server.wm.WallpaperController") {
|
||||
name == "zoomOutToScale" && parameterTypes[0] == Float::class.java
|
||||
}.hookBefore {
|
||||
val value = XSPUtils.getFloat("max_wallpaper_scale", 1.2f)
|
||||
it.thisObject.putObject("mMaxWallpaperScale", value)
|
||||
}
|
||||
hookAllConstructorAfter("com.android.server.wm.WallpaperController") {
|
||||
val value = XSPUtils.getFloat("max_wallpaper_scale", 1.2f)
|
||||
val value = XSPUtils.getFloat("max_wallpaper_scale", 1.1f)
|
||||
it.thisObject.putObject("mMaxWallpaperScale", value)
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.android
|
||||
|
||||
import android.content.Context
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object RemoveSmallWindowRestrictions : HookRegister() {
|
||||
object RemoveSmallWindowRestrictionsForS : HookRegister() {
|
||||
override fun init() {
|
||||
// 强制所有活动设为可以调整大小
|
||||
findMethod("com.android.server.wm.Task") {
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.android
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.android
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object SystemPropertiesHook : HookRegister() {
|
||||
object SystemPropertiesHookForS : HookRegister() {
|
||||
override fun init() {
|
||||
val mediaStepsSwitch = XSPUtils.getBoolean("media_volume_steps_switch", false)
|
||||
val mediaSteps = XSPUtils.getInt("media_volume_steps", 15)
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.cast
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.cast
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object ForceSupportSendApp : HookRegister() {
|
||||
object ForceSupportSendAppForS : HookRegister() {
|
||||
|
||||
override fun init() = hasEnable("force_support_send_app") {
|
||||
findMethod("com.xiaomi.mirror.synergy.MiuiSynergySdk") {
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.mediaeditor
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object UnlockUnlimitedCroppingForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
//解锁图库裁切最小值
|
||||
findMethod("com.miui.gallery.editor.photo.core.imports.obsoletes.Crop\$ResizeDetector") {
|
||||
name == "calculateMinSize"
|
||||
}.hookBefore {
|
||||
hasEnable("unlock_unlimited_cropping") {
|
||||
it.result = 0
|
||||
}
|
||||
}
|
||||
//截图无限裁切
|
||||
findMethod("com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$ResizeDetector") {
|
||||
name == "calculateMinSize"
|
||||
}.hookBefore {
|
||||
hasEnable("unlock_unlimited_cropping") {
|
||||
it.result = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.miuihome
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.miuihome
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object AlwaysDisplayTime : HookRegister() {
|
||||
object AlwaysDisplayTimeForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("com.miui.home.launcher.Workspace") {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.miuihome
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.miuihome
|
||||
|
||||
import android.content.Context
|
||||
import android.os.SystemClock
|
||||
@@ -6,7 +6,7 @@ import android.view.MotionEvent
|
||||
import android.view.ViewConfiguration
|
||||
import kotlin.math.abs
|
||||
|
||||
class DoubleTapController internal constructor(mContext: Context) {
|
||||
class DoubleTapControllerForS internal constructor(mContext: Context) {
|
||||
|
||||
private val maxDuration: Long = 500
|
||||
private var mActionDownRawX: Float = 0f
|
||||
@@ -1,21 +1,21 @@
|
||||
package com.lt2333.simplicitytools.hook.app.miuihome
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.miuihome
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.view.MotionEvent
|
||||
import com.github.kyuubiran.ezxhelper.utils.*
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
|
||||
object DoubleTapToSleep : HookRegister() {
|
||||
object DoubleTapToSleepForS : HookRegister() {
|
||||
|
||||
override fun init() = hasEnable("double_tap_to_sleep") {
|
||||
hookAllConstructorAfter("com.miui.home.launcher.Workspace") {
|
||||
var mDoubleTapControllerEx =
|
||||
XposedHelpers.getAdditionalInstanceField(it.thisObject, "mDoubleTapControllerEx")
|
||||
if (mDoubleTapControllerEx != null) return@hookAllConstructorAfter
|
||||
mDoubleTapControllerEx = DoubleTapController((it.args[0] as Context))
|
||||
mDoubleTapControllerEx = DoubleTapControllerForS((it.args[0] as Context))
|
||||
XposedHelpers.setAdditionalInstanceField(
|
||||
it.thisObject,
|
||||
"mDoubleTapControllerEx",
|
||||
@@ -28,7 +28,7 @@ object DoubleTapToSleep : HookRegister() {
|
||||
val mDoubleTapControllerEx = XposedHelpers.getAdditionalInstanceField(
|
||||
it.thisObject,
|
||||
"mDoubleTapControllerEx"
|
||||
) as DoubleTapController
|
||||
) as DoubleTapControllerForS
|
||||
if (!mDoubleTapControllerEx.isDoubleTapEvent(it.args[0] as MotionEvent)) return@hookBefore
|
||||
val mCurrentScreenIndex = it.thisObject.getObject("mCurrentScreenIndex") as Int
|
||||
val cellLayout = it.thisObject.invokeMethodAuto("getCellLayout", mCurrentScreenIndex)
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.powerkeeper
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.powerkeeper
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object DoNotClearApp : HookRegister() {
|
||||
object DoNotClearAppForS : HookRegister() {
|
||||
override fun init() {
|
||||
findMethod("com.miui.powerkeeper.statemachine.SleepModeControllerNew") {
|
||||
name == "clearApp"
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.powerkeeper
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.powerkeeper
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object LockMaxFps : HookRegister() {
|
||||
object LockMaxFpsForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("com.miui.powerkeeper.statemachine.DisplayFrameSetting") {
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.powerkeeper
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.powerkeeper
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object MakeMilletMoreAggressive : HookRegister() {
|
||||
object MakeMilletMoreAggressiveForS : HookRegister() {
|
||||
override fun init() {
|
||||
findMethod("com.miui.powerkeeper.controller.FrozenAppController") {
|
||||
name == "appIsAllowToFrozen"
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.powerkeeper
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.powerkeeper
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object PreventRecoveryOfBatteryOptimizationWhitelist : HookRegister() {
|
||||
object PreventRecoveryOfBatteryOptimizationWhitelistForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod(
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.reardisplay
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.reardisplay
|
||||
|
||||
import android.graphics.Typeface
|
||||
import android.util.TypedValue
|
||||
@@ -11,11 +11,11 @@ import cn.fkj233.ui.activity.dp2px
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.view.WeatherView
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.views.WeatherView
|
||||
|
||||
object RearDisplayWeather : HookRegister() {
|
||||
object RearDisplayWeatherForS : HookRegister() {
|
||||
|
||||
override fun init() = hasEnable("rear_show_weather") {
|
||||
findMethod("com.xiaomi.misubscreenui.light.aod.view.VerticalClockView") {
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.screenshot
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.screenshot
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object UnlockUnlimitedCropping : HookRegister() {
|
||||
object UnlockUnlimitedCroppingForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
//截图无限裁切
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.securitycenter
|
||||
|
||||
import android.view.View
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object LockOneHundred : HookRegister() {
|
||||
object LockOneHundredForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
//防止点击重新检测
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.securitycenter
|
||||
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import de.robv.android.xposed.XC_MethodHook
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
|
||||
object RemoveMacroBlacklist : HookRegister() {
|
||||
object RemoveMacroBlacklistForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
if (XSPUtils.getBoolean("remove_macro_blacklist", false)) {
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.securitycenter
|
||||
|
||||
import android.widget.TextView
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object RemoveOpenAppConfirmationPopup : HookRegister() {
|
||||
object RemoveOpenAppConfirmationPopupForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("android.widget.TextView") {
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.securitycenter
|
||||
|
||||
import android.app.AndroidAppHelper
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.IntentFilter
|
||||
import android.content.res.Configuration
|
||||
import android.graphics.Color
|
||||
import android.graphics.Typeface
|
||||
import android.util.TypedValue
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import cn.fkj233.ui.activity.dp2px
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
object ShowBatteryTemperatureForS : HookRegister() {
|
||||
private fun getBatteryTemperature(context: Context): Int {
|
||||
return context.registerReceiver(
|
||||
null as BroadcastReceiver?,
|
||||
IntentFilter("android.intent.action.BATTERY_CHANGED")
|
||||
)!!.getIntExtra("temperature", 0) / 10
|
||||
}
|
||||
|
||||
override fun init() = hasEnable("battery_life_function") {
|
||||
try {
|
||||
findMethod("com.miui.powercenter.a") {
|
||||
name == "b" && parameterTypes[0] == Context::class.java
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
findMethod("com.miui.powercenter.BatteryFragment") {
|
||||
name == "b" && parameterTypes[0] == Context::class.java
|
||||
}
|
||||
}.hookBefore {
|
||||
it.result = getBatteryTemperature(it.args[0] as Context).toString()
|
||||
}
|
||||
try {
|
||||
findMethod("com.miui.powercenter.a\$a") {
|
||||
name == "run"
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
findMethod("com.miui.powercenter.BatteryFragment\$a") {
|
||||
name == "run"
|
||||
}
|
||||
}.hookAfter {
|
||||
val context = AndroidAppHelper.currentApplication().applicationContext
|
||||
val isDarkMode =
|
||||
context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES
|
||||
val currentTemperatureValue = context.resources.getIdentifier(
|
||||
"current_temperature_value",
|
||||
"id",
|
||||
"com.miui.securitycenter"
|
||||
)
|
||||
|
||||
val view = it.thisObject.getObjectAs<View>("a")
|
||||
|
||||
val textView = view.findViewById<TextView>(currentTemperatureValue)
|
||||
textView.apply {
|
||||
(layoutParams as LinearLayout.LayoutParams).marginStart = dp2px(context, 25f)
|
||||
(layoutParams as LinearLayout.LayoutParams).topMargin = 0
|
||||
setTextSize(TypedValue.COMPLEX_UNIT_DIP, 36.399998f)
|
||||
setPadding(0, 0, 0, 0)
|
||||
gravity = Gravity.NO_GRAVITY
|
||||
typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
|
||||
height = dp2px(context, 49.099983f)
|
||||
textAlignment = View.TEXT_ALIGNMENT_VIEW_START
|
||||
}
|
||||
|
||||
val tempView = TextView(context)
|
||||
tempView.apply {
|
||||
layoutParams = LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
dp2px(context, 49.099983f)
|
||||
)
|
||||
(layoutParams as LinearLayout.LayoutParams).marginStart =
|
||||
dp2px(context, 3.599976f)
|
||||
setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13.099977f)
|
||||
setTextColor(Color.parseColor(if (isDarkMode) "#e6e6e6" else "#333333"))
|
||||
setPadding(0, dp2px(context, 25f), 0, 0)
|
||||
text = "℃"
|
||||
typeface = Typeface.create(null, 500, false)
|
||||
textAlignment = View.TEXT_ALIGNMENT_VIEW_START
|
||||
}
|
||||
|
||||
val tempeValueContainer = context.resources.getIdentifier(
|
||||
"tempe_value_container",
|
||||
"id",
|
||||
"com.miui.securitycenter"
|
||||
)
|
||||
|
||||
val linearLayout = view.findViewById<LinearLayout>(tempeValueContainer)
|
||||
linearLayout.addView(tempView)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.securitycenter
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object SkipWaitingTime : HookRegister() {
|
||||
object SkipWaitingTimeForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("android.widget.TextView") {
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.lt2333.simplicitytools.hook.app.settings
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.settings
|
||||
|
||||
import android.app.NotificationChannel
|
||||
import com.github.kyuubiran.ezxhelper.utils.*
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
|
||||
object ShowNotificationImportance : HookRegister() {
|
||||
object ShowNotificationImportanceForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("com.android.settings.notification.ChannelNotificationSettings") {
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.util.TypedValue
|
||||
import android.widget.TextView
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object BatteryPercentage : HookRegister() {
|
||||
object BatteryPercentageForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
val size = XSPUtils.getFloat("battery_percentage_font_size", 0f)
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object CanNotificationSlide: HookRegister() {
|
||||
object CanNotificationSlideForS: HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("com.android.systemui.statusbar.notification.NotificationSettingsManager") {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Intent
|
||||
@@ -10,13 +10,13 @@ import android.widget.Toast
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import cn.fkj233.ui.activity.dp2px
|
||||
import com.github.kyuubiran.ezxhelper.utils.*
|
||||
import com.lt2333.simplicitytools.util.SystemProperties
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.view.WeatherView
|
||||
import com.lt2333.simplicitytools.utils.SystemProperties
|
||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.views.WeatherView
|
||||
|
||||
object ControlCenterWeather : HookRegister() {
|
||||
object ControlCenterWeatherForS : HookRegister() {
|
||||
|
||||
override fun init() = hasEnable("control_center_weather") {
|
||||
var mWeatherView: TextView? = null
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object CustomMobileTypeText : HookRegister() {
|
||||
object CustomMobileTypeTextForS : HookRegister() {
|
||||
|
||||
override fun init() = hasEnable("custom_mobile_type_text_switch") {
|
||||
findMethod("com.android.systemui.statusbar.policy.MobileSignalController") {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.content.Context
|
||||
import android.net.TrafficStats
|
||||
@@ -11,12 +11,12 @@ import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.R
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import java.text.DecimalFormat
|
||||
|
||||
object DoubleLineNetworkSpeed : HookRegister() {
|
||||
object DoubleLineNetworkSpeedForS : HookRegister() {
|
||||
|
||||
private var mLastTotalUp: Long = 0
|
||||
private var mLastTotalDown: Long = 0
|
||||
@@ -60,11 +60,11 @@ object DoubleLineNetworkSpeed : HookRegister() {
|
||||
name == "formatSpeed" && parameterCount == 2
|
||||
}.hookBefore {
|
||||
if (getDualAlign == 0) {
|
||||
it.result = "$upIcon ${getTotalUpSpeed(it.args[0] as Context)}\n${downIcon} ${
|
||||
it.result = "$upIcon ${getTotalUpSpeed(it.args[0] as Context)}\n$downIcon ${
|
||||
getTotalDownloadSpeed(it.args[0] as Context)
|
||||
}"
|
||||
} else {
|
||||
it.result = "${getTotalUpSpeed(it.args[0] as Context)} ${upIcon}\n${
|
||||
it.result = "${getTotalUpSpeed(it.args[0] as Context)} $upIcon\n${
|
||||
getTotalDownloadSpeed(it.args[0] as Context)
|
||||
} $downIcon"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
@@ -8,10 +8,10 @@ import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.getObject
|
||||
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object HideBatteryIcon : HookRegister() {
|
||||
object HideBatteryIconForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") {
|
||||
@@ -1,15 +1,13 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.util.Log
|
||||
import com.github.kyuubiran.ezxhelper.utils.*
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import de.robv.android.xposed.XC_MethodHook
|
||||
|
||||
object HideHDIcon : HookRegister() {
|
||||
object HideHDIconForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import de.robv.android.xposed.XC_MethodHook
|
||||
|
||||
object HideMobileActivityIcon : HookRegister() {
|
||||
object HideMobileActivityIconForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
@@ -6,12 +6,12 @@ import android.widget.TextView
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import de.robv.android.xposed.XC_MethodHook
|
||||
|
||||
object HideMobileTypeIcon : HookRegister() {
|
||||
object HideMobileTypeIconForS : HookRegister() {
|
||||
|
||||
private val isBigType = XSPUtils.getBoolean("big_mobile_type_icon", false)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.widget.TextView
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object HideNetworkSpeedSplitter : HookRegister() {
|
||||
object HideNetworkSpeedSplitterForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("com.android.systemui.statusbar.views.NetworkSpeedSplitter") {
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object HideSimIcon : HookRegister() {
|
||||
object HideSimIconForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy") {
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import de.robv.android.xposed.XC_MethodHook
|
||||
|
||||
object HideStatusBarIcon : HookRegister() {
|
||||
object HideStatusBarIconForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("com.android.systemui.statusbar.phone.StatusBarIconControllerImpl") {
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object HideStatusBarNetworkSpeedSecond : HookRegister() {
|
||||
object HideStatusBarNetworkSpeedSecondForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("com.android.systemui.statusbar.views.NetworkSpeedView") {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
@@ -6,11 +6,11 @@ import android.widget.TextView
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import de.robv.android.xposed.XC_MethodHook
|
||||
|
||||
object HideWifiActivityIcon : HookRegister() {
|
||||
object HideWifiActivityIconForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("com.android.systemui.statusbar.StatusBarWifiView") {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
@@ -8,14 +8,14 @@ import android.util.Log
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import com.github.kyuubiran.ezxhelper.utils.*
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import de.robv.android.xposed.XC_MethodHook
|
||||
import java.lang.reflect.Method
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
object LockScreenClockDisplaySeconds : HookRegister() {
|
||||
object LockScreenClockDisplaySecondsForS : HookRegister() {
|
||||
|
||||
private var nowTime: Date = Calendar.getInstance().time
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
|
||||
import android.app.AndroidAppHelper
|
||||
@@ -10,13 +10,13 @@ import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.getObject
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.lt2333.simplicitytools.R
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import java.io.BufferedReader
|
||||
import java.io.FileReader
|
||||
import kotlin.math.abs
|
||||
|
||||
object LockScreenCurrent : HookRegister() {
|
||||
object LockScreenCurrentForS : HookRegister() {
|
||||
|
||||
override fun init() = hasEnable("lock_screen_charging_current") {
|
||||
findMethod("com.android.keyguard.charge.ChargeUtils") {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.app.KeyguardManager
|
||||
import android.content.Context
|
||||
@@ -8,12 +8,12 @@ import android.view.View
|
||||
import android.view.View.OnTouchListener
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
import kotlin.math.abs
|
||||
|
||||
object LockScreenDoubleTapToSleep : HookRegister() {
|
||||
object LockScreenDoubleTapToSleepForS : HookRegister() {
|
||||
|
||||
override fun init() = hasEnable("lock_screen_double_tap_to_sleep") {
|
||||
findMethod("com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer") {
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookReplace
|
||||
import com.github.kyuubiran.ezxhelper.utils.invokeMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.putObject
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object MaximumNumberOfNotificationIcons : HookRegister() {
|
||||
object MaximumNumberOfNotificationIconsForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
val icons = XSPUtils.getInt("maximum_number_of_notification_icons", 3)
|
||||
@@ -1,17 +1,17 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.pm.ApplicationInfo
|
||||
import android.widget.TextView
|
||||
import com.github.kyuubiran.ezxhelper.utils.*
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.view.WeatherData
|
||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.views.WeatherData
|
||||
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object NewNotificationWeather : HookRegister() {
|
||||
object NewNotificationWeatherForS : HookRegister() {
|
||||
lateinit var weather: WeatherData
|
||||
var clockId: Int = -2
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object NoPasswordHook : HookRegister() {
|
||||
object NoPasswordHookForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
hasEnable("no_need_to_enter_password_when_power_on") {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Intent
|
||||
@@ -10,13 +10,13 @@ import android.widget.Toast
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import cn.fkj233.ui.activity.dp2px
|
||||
import com.github.kyuubiran.ezxhelper.utils.*
|
||||
import com.lt2333.simplicitytools.util.SystemProperties
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.view.WeatherView
|
||||
import com.lt2333.simplicitytools.utils.SystemProperties
|
||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.views.WeatherView
|
||||
|
||||
object NotificationWeather : HookRegister() {
|
||||
object NotificationWeatherForS : HookRegister() {
|
||||
|
||||
override fun init() = hasEnable("notification_weather") {
|
||||
var mWeatherView: TextView? = null
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Intent
|
||||
@@ -7,12 +7,12 @@ import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import com.github.kyuubiran.ezxhelper.utils.*
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.view.WeatherView
|
||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.views.WeatherView
|
||||
|
||||
object OldNotificationWeather : HookRegister() {
|
||||
object OldNotificationWeatherForS : HookRegister() {
|
||||
|
||||
override fun init() = hasEnable("notification_weather") {
|
||||
var mWeatherView: TextView? = null
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.content.res.Configuration
|
||||
import android.view.ViewGroup
|
||||
@@ -6,11 +6,11 @@ import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.github.kyuubiran.ezxhelper.utils.putObject
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.XSPUtils
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object OldQSCustom : HookRegister() {
|
||||
object OldQSCustomForS : HookRegister() {
|
||||
|
||||
override fun init() = hasEnable("old_qs_custom_switch") {
|
||||
val mRows = XSPUtils.getInt("qs_custom_rows", 3)
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
@@ -6,10 +6,10 @@ import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.getObject
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookAfter
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object RemoveLockScreenCamera : HookRegister() {
|
||||
object RemoveLockScreenCameraForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
//屏蔽右下角组件显示
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object RemoveTheLeftSideOfTheLockScreen : HookRegister() {
|
||||
object RemoveTheLeftSideOfTheLockScreenForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("com.android.keyguard.negative.MiuiKeyguardMoveLeftViewContainer") {
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
package com.lt2333.simplicitytools.hooks.rules.s.systemui
|
||||
|
||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||
import com.github.kyuubiran.ezxhelper.utils.getObjectAs
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.github.kyuubiran.ezxhelper.utils.putObject
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object ShowWifiStandard : HookRegister() {
|
||||
object ShowWifiStandardForS : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
findMethod("com.android.systemui.statusbar.StatusBarWifiView") {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user