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) {
|
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()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -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")
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user