Compare commits

5 Commits

Author SHA1 Message Date
LittleTurtle2333
5b3ad4dd6a 修复A13隐藏网络类型图标不可用 2023-02-14 20:24:21 +08:00
LittleTurtle2333
b781f59486 修复A13自定义网络类型文本不可用 2023-02-14 19:38:03 +08:00
LittleTurtle2333
5a74882005 修复A13中双排时钟无法居中对齐 2023-02-14 18:51:26 +08:00
LittleTurtle2333
0c71f68362 修复时钟极客模式自定义无法换行 2023-02-14 18:50:24 +08:00
LittleTurtle2333
f39d7d601d 修复A13中部分场景无法强制截图 2023-02-14 17:30:51 +08:00
6 changed files with 31 additions and 25 deletions

View File

@@ -248,7 +248,7 @@ class SystemUIPageForS : BasePage() {
TextSummaryArrow(TextSummaryV(textId = R.string.custom_clock_format_geek) { TextSummaryArrow(TextSummaryV(textId = R.string.custom_clock_format_geek) {
MIUIDialog(activity) { MIUIDialog(activity) {
setTitle(R.string.custom_clock_format_geek) setTitle(R.string.custom_clock_format_geek)
setEditText(MIUIActivity.safeSP.getString("custom_clock_format_geek", "HH:mm:ss"), "") setEditText(MIUIActivity.safeSP.getString("custom_clock_format_geek", "HH:mm:ss"), "", isSingleLine = false)
setLButton(textId = R.string.cancel) { setLButton(textId = R.string.cancel) {
dismiss() dismiss()
} }

View File

@@ -248,7 +248,7 @@ class SystemUIPageForT : BasePage() {
TextSummaryArrow(TextSummaryV(textId = R.string.custom_clock_format_geek) { TextSummaryArrow(TextSummaryV(textId = R.string.custom_clock_format_geek) {
MIUIDialog(activity) { MIUIDialog(activity) {
setTitle(R.string.custom_clock_format_geek) setTitle(R.string.custom_clock_format_geek)
setEditText(MIUIActivity.safeSP.getString("custom_clock_format_geek", "HH:mm:ss"), "") setEditText(MIUIActivity.safeSP.getString("custom_clock_format_geek", "HH:mm:ss"), "", isSingleLine = false)
setLButton(textId = R.string.cancel) { setLButton(textId = R.string.cancel) {
dismiss() dismiss()
} }

View File

@@ -1,13 +1,14 @@
package com.lt2333.simplicitytools.hooks.rules.all.android package com.lt2333.simplicitytools.hooks.rules.all.android
import android.os.Build
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAllConstructorBefore
import com.github.kyuubiran.ezxhelper.utils.hookBefore import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.utils.hasEnable import com.lt2333.simplicitytools.utils.hasEnable
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
object DisableFlagSecureForAll : HookRegister() { object DisableFlagSecureForAll : HookRegister() {
override fun init() { override fun init() {
// TODO: 23.1.30及之后的版本无法在部分场景生效疑似MIUI做了修改
findMethod("com.android.server.wm.WindowState") { findMethod("com.android.server.wm.WindowState") {
name == "isSecureLocked" name == "isSecureLocked"
}.hookBefore { }.hookBefore {
@@ -15,6 +16,19 @@ object DisableFlagSecureForAll : HookRegister() {
it.result = false it.result = false
} }
} }
}
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU) {
findMethod("com.android.server.wm.WindowSurfaceController") {
name == "setSecure"
}.hookBefore {
it.args[0] = false
}
hookAllConstructorBefore("com.android.server.wm.WindowSurfaceController") {
var flags = it.args[2] as Int
val secureFlag = 128
flags = flags and secureFlag.inv()
it.args[2] = flags
}
}
}
} }

View File

@@ -9,8 +9,7 @@ import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
object CustomMobileTypeTextForT : HookRegister() { object CustomMobileTypeTextForT : HookRegister() {
override fun init() = hasEnable("custom_mobile_type_text_switch") { override fun init() = hasEnable("custom_mobile_type_text_switch") {
// TODO: Android13自定义网络类型文本不可用 findMethod("com.android.systemui.statusbar.connectivity.MobileSignalController") {
findMethod("com.android.systemui.statusbar.policy.MobileSignalController") {
name == "getMobileTypeName" && parameterTypes[0] == Int::class.java name == "getMobileTypeName" && parameterTypes[0] == Int::class.java
}.hookAfter { }.hookAfter {
it.result = XSPUtils.getString("custom_mobile_type_text", "5G") it.result = XSPUtils.getString("custom_mobile_type_text", "5G")

View File

@@ -32,14 +32,14 @@ object HideMobileTypeIconForT : HookRegister() {
private fun hideMobileTypeIcon(it: XC_MethodHook.MethodHookParam) { private fun hideMobileTypeIcon(it: XC_MethodHook.MethodHookParam) {
hasEnable("hide_mobile_type_icon") { hasEnable("hide_mobile_type_icon") {
if (isBigType) { if (isBigType) {
(it.thisObject.getObjectAs<TextView>("mMobileType")).visibility = (it.thisObject.getObjectAs<ImageView>("mMobileType")).visibility =
View.GONE View.GONE
(it.thisObject.getObjectAs<ImageView>("mMobileTypeImage")).visibility = (it.thisObject.getObjectAs<ImageView>("mMobileTypeImage")).visibility =
View.GONE View.GONE
(it.thisObject.getObjectAs<TextView>("mMobileTypeSingle")).visibility = (it.thisObject.getObjectAs<TextView>("mMobileTypeSingle")).visibility =
View.GONE View.GONE
} else { } else {
(it.thisObject.getObjectAs<TextView>("mMobileType")).visibility = (it.thisObject.getObjectAs<ImageView>("mMobileType")).visibility =
View.INVISIBLE View.INVISIBLE
(it.thisObject.getObjectAs<ImageView>("mMobileTypeImage")).visibility = (it.thisObject.getObjectAs<ImageView>("mMobileTypeImage")).visibility =
View.INVISIBLE View.INVISIBLE

View File

@@ -110,16 +110,12 @@ object StatusBarTimeCustomizationForT : HookRegister() {
} }
if (isCenterAlign) { if (isCenterAlign) {
// TODO: Android13时间居中对齐不可用 findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") { paramCount == 3
name == "onViewCreated" && parameterCount == 2
}.hookAfter { }.hookAfter {
val miuiPhoneStatusBarView = c = it.args[0] as Context
it.thisObject.getObject("mStatusBar") as ViewGroup val textV = it.thisObject as TextView
val res: Resources = miuiPhoneStatusBarView.resources textV.gravity = Gravity.CENTER
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
val clock: TextView = miuiPhoneStatusBarView.findViewById(clockId)
clock.gravity = Gravity.CENTER
} }
} }
} }
@@ -175,15 +171,12 @@ object StatusBarTimeCustomizationForT : HookRegister() {
} }
if (isGeekCenterAlign) { if (isGeekCenterAlign) {
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") { findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
name == "onViewCreated" && parameterCount == 2 paramCount == 3
}.hookAfter { }.hookAfter {
val miuiPhoneStatusBarView = c = it.args[0] as Context
it.thisObject.getObject("mStatusBar") as ViewGroup val textV = it.thisObject as TextView
val res: Resources = miuiPhoneStatusBarView.resources textV.gravity = Gravity.CENTER
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
val clock: TextView = miuiPhoneStatusBarView.findViewById(clockId)
clock.gravity = Gravity.CENTER
} }
} }
} }