mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-15 04:41:18 +08:00
Compare commits
5 Commits
ebb5e1435b
...
5b3ad4dd6a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b3ad4dd6a | ||
|
|
b781f59486 | ||
|
|
5a74882005 | ||
|
|
0c71f68362 | ||
|
|
f39d7d601d |
@@ -248,7 +248,7 @@ class SystemUIPageForS : BasePage() {
|
||||
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"), "")
|
||||
setEditText(MIUIActivity.safeSP.getString("custom_clock_format_geek", "HH:mm:ss"), "", isSingleLine = false)
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ class SystemUIPageForT : BasePage() {
|
||||
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"), "")
|
||||
setEditText(MIUIActivity.safeSP.getString("custom_clock_format_geek", "HH:mm:ss"), "", isSingleLine = false)
|
||||
setLButton(textId = R.string.cancel) {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
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.hookAllConstructorBefore
|
||||
import com.github.kyuubiran.ezxhelper.utils.hookBefore
|
||||
import com.lt2333.simplicitytools.utils.hasEnable
|
||||
import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
|
||||
object DisableFlagSecureForAll : HookRegister() {
|
||||
override fun init() {
|
||||
// TODO: 23.1.30及之后的版本无法在部分场景生效,疑似MIUI做了修改
|
||||
findMethod("com.android.server.wm.WindowState") {
|
||||
name == "isSecureLocked"
|
||||
}.hookBefore {
|
||||
@@ -15,6 +16,19 @@ object DisableFlagSecureForAll : HookRegister() {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,7 @@ import com.lt2333.simplicitytools.utils.xposed.base.HookRegister
|
||||
object CustomMobileTypeTextForT : HookRegister() {
|
||||
|
||||
override fun init() = hasEnable("custom_mobile_type_text_switch") {
|
||||
// TODO: Android13自定义网络类型文本不可用
|
||||
findMethod("com.android.systemui.statusbar.policy.MobileSignalController") {
|
||||
findMethod("com.android.systemui.statusbar.connectivity.MobileSignalController") {
|
||||
name == "getMobileTypeName" && parameterTypes[0] == Int::class.java
|
||||
}.hookAfter {
|
||||
it.result = XSPUtils.getString("custom_mobile_type_text", "5G")
|
||||
|
||||
@@ -32,14 +32,14 @@ object HideMobileTypeIconForT : HookRegister() {
|
||||
private fun hideMobileTypeIcon(it: XC_MethodHook.MethodHookParam) {
|
||||
hasEnable("hide_mobile_type_icon") {
|
||||
if (isBigType) {
|
||||
(it.thisObject.getObjectAs<TextView>("mMobileType")).visibility =
|
||||
(it.thisObject.getObjectAs<ImageView>("mMobileType")).visibility =
|
||||
View.GONE
|
||||
(it.thisObject.getObjectAs<ImageView>("mMobileTypeImage")).visibility =
|
||||
View.GONE
|
||||
(it.thisObject.getObjectAs<TextView>("mMobileTypeSingle")).visibility =
|
||||
View.GONE
|
||||
} else {
|
||||
(it.thisObject.getObjectAs<TextView>("mMobileType")).visibility =
|
||||
(it.thisObject.getObjectAs<ImageView>("mMobileType")).visibility =
|
||||
View.INVISIBLE
|
||||
(it.thisObject.getObjectAs<ImageView>("mMobileTypeImage")).visibility =
|
||||
View.INVISIBLE
|
||||
|
||||
@@ -110,16 +110,12 @@ object StatusBarTimeCustomizationForT : HookRegister() {
|
||||
}
|
||||
|
||||
if (isCenterAlign) {
|
||||
// TODO: Android13时间居中对齐不可用
|
||||
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") {
|
||||
name == "onViewCreated" && parameterCount == 2
|
||||
findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
|
||||
paramCount == 3
|
||||
}.hookAfter {
|
||||
val miuiPhoneStatusBarView =
|
||||
it.thisObject.getObject("mStatusBar") as ViewGroup
|
||||
val res: Resources = miuiPhoneStatusBarView.resources
|
||||
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||
val clock: TextView = miuiPhoneStatusBarView.findViewById(clockId)
|
||||
clock.gravity = Gravity.CENTER
|
||||
c = it.args[0] as Context
|
||||
val textV = it.thisObject as TextView
|
||||
textV.gravity = Gravity.CENTER
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,15 +171,12 @@ object StatusBarTimeCustomizationForT : HookRegister() {
|
||||
}
|
||||
|
||||
if (isGeekCenterAlign) {
|
||||
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") {
|
||||
name == "onViewCreated" && parameterCount == 2
|
||||
findConstructor("com.android.systemui.statusbar.views.MiuiClock") {
|
||||
paramCount == 3
|
||||
}.hookAfter {
|
||||
val miuiPhoneStatusBarView =
|
||||
it.thisObject.getObject("mStatusBar") as ViewGroup
|
||||
val res: Resources = miuiPhoneStatusBarView.resources
|
||||
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||
val clock: TextView = miuiPhoneStatusBarView.findViewById(clockId)
|
||||
clock.gravity = Gravity.CENTER
|
||||
c = it.args[0] as Context
|
||||
val textV = it.thisObject as TextView
|
||||
textV.gravity = Gravity.CENTER
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user