mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-13 20:01:17 +08:00
Compare commits
5 Commits
320a393a7c
...
396e9bf453
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
396e9bf453 | ||
|
|
8e6485cd0f | ||
|
|
afb3316595 | ||
|
|
432ec13c05 | ||
|
|
f2f133c5b9 |
@@ -12,8 +12,8 @@ android {
|
|||||||
applicationId = "com.lt2333.simplicitytools"
|
applicationId = "com.lt2333.simplicitytools"
|
||||||
minSdk = 31
|
minSdk = 31
|
||||||
targetSdk = 32
|
targetSdk = 32
|
||||||
versionCode = 62
|
versionCode = 63
|
||||||
versionName = "1.6.1"
|
versionName = "1.6.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@@ -390,11 +390,11 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
return getSP().getBoolean("big_mobile_type_icon", false)
|
return getSP().getBoolean("big_mobile_type_icon", false)
|
||||||
}
|
}
|
||||||
}) { view, flags, data ->
|
}) { view, flags, data ->
|
||||||
when (flags) {
|
when (flags) {
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
1 -> (view as Switch).isEnabled = data as Boolean
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.big_mobile_type_icon
|
textId = R.string.big_mobile_type_icon
|
||||||
@@ -620,11 +620,11 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
return getSP().getBoolean("status_bar_dual_row_network_speed", false)
|
return getSP().getBoolean("status_bar_dual_row_network_speed", false)
|
||||||
}
|
}
|
||||||
}) { view, flags, data ->
|
}) { view, flags, data ->
|
||||||
when (flags) {
|
when (flags) {
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
1 -> (view as Switch).isEnabled = data as Boolean
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.status_bar_dual_row_network_speed,
|
textId = R.string.status_bar_dual_row_network_speed,
|
||||||
@@ -724,11 +724,11 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
return getSP().getBoolean("notification_weather", false)
|
return getSP().getBoolean("notification_weather", false)
|
||||||
}
|
}
|
||||||
}) { view, flags, data ->
|
}) { view, flags, data ->
|
||||||
when (flags) {
|
when (flags) {
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
1 -> (view as Switch).isEnabled = data as Boolean
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.show_weather_main_switch, colorId = R.color.purple_700
|
textId = R.string.show_weather_main_switch, colorId = R.color.purple_700
|
||||||
@@ -752,11 +752,11 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
return getSP().getBoolean("control_center_weather", false)
|
return getSP().getBoolean("control_center_weather", false)
|
||||||
}
|
}
|
||||||
}) { view, flags, data ->
|
}) { view, flags, data ->
|
||||||
when (flags) {
|
when (flags) {
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
1 -> (view as Switch).isEnabled = data as Boolean
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.show_weather_main_switch,
|
textId = R.string.show_weather_main_switch,
|
||||||
@@ -824,11 +824,11 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
return getSP().getBoolean("old_qs_custom_switch", false)
|
return getSP().getBoolean("old_qs_custom_switch", false)
|
||||||
}
|
}
|
||||||
}) { view, flags, data ->
|
}) { view, flags, data ->
|
||||||
when (flags) {
|
when (flags) {
|
||||||
1 -> (view as Switch).isEnabled = data as Boolean
|
1 -> (view as Switch).isEnabled = data as Boolean
|
||||||
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
2 -> view.visibility = if (data as Boolean) View.VISIBLE else View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
TextSummaryWithSwitch(
|
TextSummaryWithSwitch(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
textId = R.string.old_qs_custom_switch,
|
textId = R.string.old_qs_custom_switch,
|
||||||
@@ -974,16 +974,42 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
}.show()
|
}.show()
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
TextSummaryWithSwitch(
|
||||||
|
TextSummaryV(
|
||||||
|
textId = R.string.allow_untrusted_touches,
|
||||||
|
tipsId = R.string.take_effect_after_reboot
|
||||||
|
),
|
||||||
|
SwitchV("allow_untrusted_touches")
|
||||||
|
)
|
||||||
Line()
|
Line()
|
||||||
TitleText(resId = R.string.sound)
|
TitleText(resId = R.string.sound)
|
||||||
Text(
|
val mediaVolumeStepsSwitchBinding = GetDataBinding(
|
||||||
resId = R.string.media_volume_steps,
|
object : DefValue {
|
||||||
|
override fun getValue(): Any {
|
||||||
|
return getSP().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(
|
SeekBarWithText(
|
||||||
"media_volume_steps",
|
"media_volume_steps",
|
||||||
15,
|
15,
|
||||||
29,
|
29,
|
||||||
15
|
15, dataBindingRecv = mediaVolumeStepsSwitchBinding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
register("scope_other", getString(R.string.scope_other), false) {
|
register("scope_other", getString(R.string.scope_other), false) {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ object Android : AppRegister() {
|
|||||||
RemoveSmallWindowRestrictions, //解除小窗限制
|
RemoveSmallWindowRestrictions, //解除小窗限制
|
||||||
MaxWallpaperScale, //壁纸缩放比例
|
MaxWallpaperScale, //壁纸缩放比例
|
||||||
SystemPropertiesHook, //SystemPropertiesHook
|
SystemPropertiesHook, //SystemPropertiesHook
|
||||||
|
AllowUntrustedTouches, //允许不受信任的触摸
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.android
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
|
object AllowUntrustedTouches : HookRegister() {
|
||||||
|
|
||||||
|
override fun init() {
|
||||||
|
hasEnable("allow_untrusted_touches") {
|
||||||
|
"android.hardware.input.InputManager".hookBeforeMethod(
|
||||||
|
getDefaultClassLoader(),
|
||||||
|
"getBlockUntrustedTouchesMode",
|
||||||
|
Context::class.java
|
||||||
|
) {
|
||||||
|
it.result = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,8 +5,10 @@ import com.lt2333.simplicitytools.util.hookBeforeMethod
|
|||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||||
|
|
||||||
object SystemPropertiesHook : HookRegister() {
|
object SystemPropertiesHook : HookRegister() {
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
val mediaStepsSwitch = XSPUtils.getBoolean("media_volume_steps_switch", false)
|
||||||
|
val mediaSteps = XSPUtils.getInt("media_volume_steps", 15)
|
||||||
|
|
||||||
"android.os.SystemProperties".hookBeforeMethod(
|
"android.os.SystemProperties".hookBeforeMethod(
|
||||||
getDefaultClassLoader(),
|
getDefaultClassLoader(),
|
||||||
"getInt",
|
"getInt",
|
||||||
@@ -14,8 +16,9 @@ object SystemPropertiesHook : HookRegister() {
|
|||||||
Int::class.java
|
Int::class.java
|
||||||
) {
|
) {
|
||||||
when (it.args[0] as String) {
|
when (it.args[0] as String) {
|
||||||
"ro.config.media_vol_steps" -> it.result = XSPUtils.getInt("media_volume_steps",15)
|
"ro.config.media_vol_steps" -> if (mediaStepsSwitch) it.result = mediaSteps
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -210,4 +210,5 @@
|
|||||||
<string name="enhancedMode_summary">Pasar algunas validaciones en la aplicación</string>
|
<string name="enhancedMode_summary">Pasar algunas validaciones en la aplicación</string>
|
||||||
<string name="rear_display">Pantalla trasera (11Ultra)</string>
|
<string name="rear_display">Pantalla trasera (11Ultra)</string>
|
||||||
<string name="lock_screen_clock_display_seconds">Mostrar segundos en el reloj</string>
|
<string name="lock_screen_clock_display_seconds">Mostrar segundos en el reloj</string>
|
||||||
|
<string name="sound">Sonido</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -210,4 +210,5 @@
|
|||||||
<string name="enhancedMode_summary">Trece o anumită validare în aplicație</string>
|
<string name="enhancedMode_summary">Trece o anumită validare în aplicație</string>
|
||||||
<string name="rear_display">Afișaj spate (11Ultra)</string>
|
<string name="rear_display">Afișaj spate (11Ultra)</string>
|
||||||
<string name="lock_screen_clock_display_seconds">Afișare secunde ceas</string>
|
<string name="lock_screen_clock_display_seconds">Afișare secunde ceas</string>
|
||||||
|
<string name="sound">Sunet</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -214,4 +214,5 @@
|
|||||||
<string name="enhancedMode_summary">Пройдите проверку в приложении</string>
|
<string name="enhancedMode_summary">Пройдите проверку в приложении</string>
|
||||||
<string name="rear_display">Индикация задней части (11Ultra)</string>
|
<string name="rear_display">Индикация задней части (11Ultra)</string>
|
||||||
<string name="lock_screen_clock_display_seconds">Часы отображают секунды</string>
|
<string name="lock_screen_clock_display_seconds">Часы отображают секунды</string>
|
||||||
|
<string name="sound">Звук</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -211,5 +211,8 @@
|
|||||||
<string name="rear_display">背屏 (11Ultra)</string>
|
<string name="rear_display">背屏 (11Ultra)</string>
|
||||||
<string name="lock_screen_clock_display_seconds">时钟显示秒数</string>
|
<string name="lock_screen_clock_display_seconds">时钟显示秒数</string>
|
||||||
<string name="sound">声音</string>
|
<string name="sound">声音</string>
|
||||||
<string name="media_volume_steps">媒体音量步数 (重启后生效)</string>
|
<string name="media_volume_steps_switch">媒体音量阶数</string>
|
||||||
|
<string name="allow_untrusted_touches">允许不受信任的触摸</string>
|
||||||
|
<string name="take_effect_after_reboot">重新启动后生效</string>
|
||||||
|
<string name="media_volume_steps_summary">打开可能会导致音量条的滚动卡顿或蓝牙音量异常。</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -210,4 +210,5 @@
|
|||||||
<string name="enhancedMode_summary">可以解決一些應用內部的完整性較驗,一般不需要開啟</string>
|
<string name="enhancedMode_summary">可以解決一些應用內部的完整性較驗,一般不需要開啟</string>
|
||||||
<string name="rear_display">後螢幕(11Ultra)</string>
|
<string name="rear_display">後螢幕(11Ultra)</string>
|
||||||
<string name="lock_screen_clock_display_seconds">時鐘顯示秒數</string>
|
<string name="lock_screen_clock_display_seconds">時鐘顯示秒數</string>
|
||||||
|
<string name="sound">聲音</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -215,5 +215,8 @@
|
|||||||
<string name="rear_display">Rear Display (11Ultra)</string>
|
<string name="rear_display">Rear Display (11Ultra)</string>
|
||||||
<string name="lock_screen_clock_display_seconds">Clock display seconds</string>
|
<string name="lock_screen_clock_display_seconds">Clock display seconds</string>
|
||||||
<string name="sound">Sound</string>
|
<string name="sound">Sound</string>
|
||||||
<string name="media_volume_steps">Media volume steps (Take effect after reboot)</string>
|
<string name="media_volume_steps_switch">Media volume steps</string>
|
||||||
|
<string name="allow_untrusted_touches">Allow untrusted touches</string>
|
||||||
|
<string name="take_effect_after_reboot">Take effect after reboot</string>
|
||||||
|
<string name="media_volume_steps_summary">Turning on may cause the scrolling of the volume bar to freeze or the Bluetooth volume to be abnormal</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user