Compare commits

5 Commits

Author SHA1 Message Date
乌堆小透明
396e9bf453 New Crowdin updates (#141)
* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin
2022-04-13 23:31:37 +08:00
LittleTurtle2333
8e6485cd0f Update version to 1.6.2 2022-04-13 23:28:46 +08:00
乌堆小透明
afb3316595 New Crowdin updates (#140)
* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Russian)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin

* New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin

* New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin

* New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin
2022-04-13 23:28:27 +08:00
LittleTurtle2333
432ec13c05 新增允许不受信任的触摸 2022-04-13 23:24:19 +08:00
LittleTurtle2333
f2f133c5b9 优化自定义媒体音量步数功能 2022-04-13 23:23:24 +08:00
11 changed files with 90 additions and 29 deletions

View File

@@ -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 {

View File

@@ -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) {

View File

@@ -23,6 +23,7 @@ object Android : AppRegister() {
RemoveSmallWindowRestrictions, //解除小窗限制 RemoveSmallWindowRestrictions, //解除小窗限制
MaxWallpaperScale, //壁纸缩放比例 MaxWallpaperScale, //壁纸缩放比例
SystemPropertiesHook, //SystemPropertiesHook SystemPropertiesHook, //SystemPropertiesHook
AllowUntrustedTouches, //允许不受信任的触摸
) )
} }

View File

@@ -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
}
}
}
}

View File

@@ -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
} }
} }
} }
} }

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>