mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-15 04:41:18 +08:00
Compare commits
10 Commits
1af19eb7ea
...
a6e30cfadb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6e30cfadb | ||
|
|
5786d3bb18 | ||
|
|
c6431f4724 | ||
|
|
91b77bc4c8 | ||
|
|
7b20d1662b | ||
|
|
de1bb7482f | ||
|
|
0ff0f43f13 | ||
|
|
1836176853 | ||
|
|
06065b58c1 | ||
|
|
6f78f83da1 |
@@ -15,7 +15,8 @@
|
|||||||
|
|
||||||
### 模块说明
|
### 模块说明
|
||||||
|
|
||||||
仅支持MIUI13(Android12),其余版本无法使用。
|
仅支持MIUI13(Android12)。其余版本可能无效,请不要安装使用。
|
||||||
|
目前处于开发初期阶段,功能较少,后续将逐步完善。
|
||||||
|
|
||||||
开发者:[酷安@乌堆小透明](http://www.coolapk.com/u/883441)
|
开发者:[酷安@乌堆小透明](http://www.coolapk.com/u/883441)
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,8 @@
|
|||||||
|
|
||||||
### Description
|
### Description
|
||||||
|
|
||||||
Only MIUI13 (Android12) is supported. The rest of the versions not be valid.
|
Only MIUI13 (Android12) is supported. The rest of the versions may not be valid, please do not install and use.
|
||||||
|
It is in the early stage of development, with fewer functions, and will be improved gradually.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ android {
|
|||||||
applicationId = "com.lt2333.simplicitytools"
|
applicationId = "com.lt2333.simplicitytools"
|
||||||
minSdk = 31
|
minSdk = 31
|
||||||
targetSdk = 32
|
targetSdk = 32
|
||||||
versionCode = 56
|
versionCode = 55
|
||||||
versionName = "1.5.5"
|
versionName = "1.5.4"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
2
app/proguard-rules.pro
vendored
2
app/proguard-rules.pro
vendored
@@ -27,8 +27,6 @@
|
|||||||
public void *(de.robv.android.xposed.IXposedHookZygoteInit$StartupParam);
|
public void *(de.robv.android.xposed.IXposedHookZygoteInit$StartupParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
-keep class * extends com.lt2333.simplicitytools.util.xposed.EasyXposedInit
|
|
||||||
|
|
||||||
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
|
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
|
||||||
public static void check*(...);
|
public static void check*(...);
|
||||||
public static void throw*(...);
|
public static void throw*(...);
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
com.lt2333.simplicitytools.hook.XposedEntry
|
com.lt2333.simplicitytools.hook.MainHook
|
||||||
@@ -194,8 +194,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
"killall com.miui.powerkeeper",
|
"killall com.miui.powerkeeper",
|
||||||
"killall com.android.updater",
|
"killall com.android.updater",
|
||||||
"killall com.miui.mediaeditor",
|
"killall com.miui.mediaeditor",
|
||||||
"killall com.miui.screenshot",
|
"killall com.miui.screenshot"
|
||||||
"killall com.milink.service"
|
|
||||||
)
|
)
|
||||||
ShellUtils.execCommand(command, true)
|
ShellUtils.execCommand(command, true)
|
||||||
dismiss()
|
dismiss()
|
||||||
@@ -517,7 +516,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
SwitchV("status_bar_time_center")
|
SwitchV("status_bar_time_center")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
val layoutCompatibilityModeBinding = getDataBinding(
|
val layout_compatibility_mode_binding = getDataBinding(
|
||||||
SPUtils.getBoolean(
|
SPUtils.getBoolean(
|
||||||
activity,
|
activity,
|
||||||
"layout_compatibility_mode",
|
"layout_compatibility_mode",
|
||||||
@@ -537,7 +536,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
),
|
),
|
||||||
SwitchV(
|
SwitchV(
|
||||||
"layout_compatibility_mode",
|
"layout_compatibility_mode",
|
||||||
dataBindingSend = layoutCompatibilityModeBinding.bindingSend
|
dataBindingSend = layout_compatibility_mode_binding.bindingSend
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -546,7 +545,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
add(
|
add(
|
||||||
TextV(
|
TextV(
|
||||||
resId = R.string.left_margin,
|
resId = R.string.left_margin,
|
||||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
dataBindingRecv = layout_compatibility_mode_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
@@ -555,14 +554,14 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
0,
|
0,
|
||||||
300,
|
300,
|
||||||
0,
|
0,
|
||||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
dataBindingRecv = layout_compatibility_mode_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
add(
|
add(
|
||||||
TextV(
|
TextV(
|
||||||
resId = R.string.right_margin,
|
resId = R.string.right_margin,
|
||||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
dataBindingRecv = layout_compatibility_mode_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
@@ -571,7 +570,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
0,
|
0,
|
||||||
300,
|
300,
|
||||||
0,
|
0,
|
||||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
dataBindingRecv = layout_compatibility_mode_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -579,7 +578,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
add(LineV())
|
add(LineV())
|
||||||
add(TitleTextV(resId = R.string.status_bar_clock_format))
|
add(TitleTextV(resId = R.string.status_bar_clock_format))
|
||||||
|
|
||||||
val customClockBinding = getDataBinding(
|
val custom_clock_binding = getDataBinding(
|
||||||
SPUtils.getBoolean(
|
SPUtils.getBoolean(
|
||||||
activity,
|
activity,
|
||||||
"custom_clock_switch",
|
"custom_clock_switch",
|
||||||
@@ -598,7 +597,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
TextV(resId = R.string.custom_clock_switch, colorId = R.color.purple_700),
|
TextV(resId = R.string.custom_clock_switch, colorId = R.color.purple_700),
|
||||||
SwitchV(
|
SwitchV(
|
||||||
"custom_clock_switch",
|
"custom_clock_switch",
|
||||||
dataBindingSend = customClockBinding.bindingSend
|
dataBindingSend = custom_clock_binding.bindingSend
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -606,94 +605,87 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
TextWithSwitchV(
|
TextWithSwitchV(
|
||||||
TextV(resId = R.string.status_bar_time_year),
|
TextV(resId = R.string.status_bar_time_year),
|
||||||
SwitchV("status_bar_time_year"),
|
SwitchV("status_bar_time_year"),
|
||||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
TextWithSwitchV(
|
TextWithSwitchV(
|
||||||
TextV(resId = R.string.status_bar_time_month),
|
TextV(resId = R.string.status_bar_time_month),
|
||||||
SwitchV("status_bar_time_month"),
|
SwitchV("status_bar_time_month"),
|
||||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
TextWithSwitchV(
|
TextWithSwitchV(
|
||||||
TextV(resId = R.string.status_bar_time_day),
|
TextV(resId = R.string.status_bar_time_day),
|
||||||
SwitchV("status_bar_time_day"),
|
SwitchV("status_bar_time_day"),
|
||||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
TextWithSwitchV(
|
TextWithSwitchV(
|
||||||
TextV(resId = R.string.status_bar_time_week),
|
TextV(resId = R.string.status_bar_time_week),
|
||||||
SwitchV("status_bar_time_week"),
|
SwitchV("status_bar_time_week"),
|
||||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
TextWithSwitchV(
|
TextWithSwitchV(
|
||||||
TextV(resId = R.string.status_bar_time_double_hour),
|
TextV(resId = R.string.status_bar_time_double_hour),
|
||||||
SwitchV("status_bar_time_double_hour"),
|
SwitchV("status_bar_time_double_hour"),
|
||||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
TextWithSwitchV(
|
TextWithSwitchV(
|
||||||
TextV(resId = R.string.status_bar_time_period),
|
TextV(resId = R.string.status_bar_time_period),
|
||||||
SwitchV("status_bar_time_period", true),
|
SwitchV("status_bar_time_period", true),
|
||||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
TextWithSwitchV(
|
TextWithSwitchV(
|
||||||
TextV(resId = R.string.status_bar_time_seconds),
|
TextV(resId = R.string.status_bar_time_seconds),
|
||||||
SwitchV("status_bar_time_seconds"),
|
SwitchV("status_bar_time_seconds"),
|
||||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
TextWithSwitchV(
|
TextWithSwitchV(
|
||||||
TextV(resId = R.string.status_bar_time_hide_space),
|
TextV(resId = R.string.status_bar_time_hide_space),
|
||||||
SwitchV("status_bar_time_hide_space"),
|
SwitchV("status_bar_time_hide_space"),
|
||||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
TextWithSwitchV(
|
TextWithSwitchV(
|
||||||
TextV(resId = R.string.status_bar_time_double_line),
|
TextV(resId = R.string.status_bar_time_double_line),
|
||||||
SwitchV("status_bar_time_double_line"),
|
SwitchV("status_bar_time_double_line"),
|
||||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||||
)
|
|
||||||
)
|
|
||||||
add(
|
|
||||||
TextWithSwitchV(
|
|
||||||
TextV(resId = R.string.status_bar_time_double_line_center_align),
|
|
||||||
SwitchV("status_bar_time_double_line_center_align"),
|
|
||||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
TextV(
|
TextV(
|
||||||
resId = R.string.status_bar_clock_size,
|
resId = R.string.status_bar_clock_size,
|
||||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
SeekBarWithTextV(
|
SeekBarWithTextV(
|
||||||
"status_bar_clock_size", 0, 18, 0,
|
"status_bar_clock_size", 0, 18, 0,
|
||||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
TextV(
|
TextV(
|
||||||
resId = R.string.status_bar_clock_double_line_size,
|
resId = R.string.status_bar_clock_double_line_size,
|
||||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
SeekBarWithTextV(
|
SeekBarWithTextV(
|
||||||
"status_bar_clock_double_line_size", 0, 9, 0,
|
"status_bar_clock_double_line_size", 0, 9, 0,
|
||||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -707,7 +699,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
val bigMobileTypeIconBinding = getDataBinding(
|
val big_mobile_type_icon_binding = getDataBinding(
|
||||||
SPUtils.getBoolean(
|
SPUtils.getBoolean(
|
||||||
activity,
|
activity,
|
||||||
"big_mobile_type_icon",
|
"big_mobile_type_icon",
|
||||||
@@ -726,7 +718,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
),
|
),
|
||||||
SwitchV(
|
SwitchV(
|
||||||
"big_mobile_type_icon",
|
"big_mobile_type_icon",
|
||||||
dataBindingSend = bigMobileTypeIconBinding.bindingSend
|
dataBindingSend = big_mobile_type_icon_binding.bindingSend
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -736,7 +728,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
textId = R.string.big_mobile_type_icon_bold
|
textId = R.string.big_mobile_type_icon_bold
|
||||||
),
|
),
|
||||||
SwitchV("big_mobile_type_icon_bold", true),
|
SwitchV("big_mobile_type_icon_bold", true),
|
||||||
dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
dataBindingRecv = big_mobile_type_icon_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
@@ -772,7 +764,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
}
|
}
|
||||||
show()
|
show()
|
||||||
}
|
}
|
||||||
}), dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
}), dataBindingRecv = big_mobile_type_icon_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
@@ -821,7 +813,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
}
|
}
|
||||||
show()
|
show()
|
||||||
}
|
}
|
||||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
}, dataBindingRecv = big_mobile_type_icon_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
@@ -870,7 +862,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
}
|
}
|
||||||
show()
|
show()
|
||||||
}
|
}
|
||||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
}, dataBindingRecv = big_mobile_type_icon_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
@@ -955,7 +947,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
val statusBarDualRowNetworkSpeedBinding = getDataBinding(
|
val status_bar_dual_row_network_speed_binding = getDataBinding(
|
||||||
SPUtils.getBoolean(
|
SPUtils.getBoolean(
|
||||||
activity,
|
activity,
|
||||||
"status_bar_dual_row_network_speed",
|
"status_bar_dual_row_network_speed",
|
||||||
@@ -975,7 +967,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
),
|
),
|
||||||
SwitchV(
|
SwitchV(
|
||||||
"status_bar_dual_row_network_speed",
|
"status_bar_dual_row_network_speed",
|
||||||
dataBindingSend = statusBarDualRowNetworkSpeedBinding.bindingSend
|
dataBindingSend = status_bar_dual_row_network_speed_binding.bindingSend
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -1010,7 +1002,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
0
|
0
|
||||||
)].toString()
|
)].toString()
|
||||||
),
|
),
|
||||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
dataBindingRecv = status_bar_dual_row_network_speed_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
@@ -1052,13 +1044,13 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
)
|
)
|
||||||
}"
|
}"
|
||||||
),
|
),
|
||||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
dataBindingRecv = status_bar_dual_row_network_speed_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
TextV(
|
TextV(
|
||||||
resId = R.string.status_bar_network_speed_dual_row_size,
|
resId = R.string.status_bar_network_speed_dual_row_size,
|
||||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
dataBindingRecv = status_bar_dual_row_network_speed_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
@@ -1067,14 +1059,14 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
0,
|
0,
|
||||||
9,
|
9,
|
||||||
0,
|
0,
|
||||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
dataBindingRecv = status_bar_dual_row_network_speed_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
add(LineV())
|
add(LineV())
|
||||||
add(TitleTextV(resId = R.string.notification_center))
|
add(TitleTextV(resId = R.string.notification_center))
|
||||||
val showWeatherMainSwitchBinding = getDataBinding(
|
val show_weather_main_switch_binding = getDataBinding(
|
||||||
SPUtils.getBoolean(
|
SPUtils.getBoolean(
|
||||||
activity,
|
activity,
|
||||||
"notification_weather",
|
"notification_weather",
|
||||||
@@ -1093,7 +1085,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
),
|
),
|
||||||
SwitchV(
|
SwitchV(
|
||||||
"notification_weather",
|
"notification_weather",
|
||||||
dataBindingSend = showWeatherMainSwitchBinding.bindingSend
|
dataBindingSend = show_weather_main_switch_binding.bindingSend
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -1103,14 +1095,14 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
textId = R.string.show_city,
|
textId = R.string.show_city,
|
||||||
),
|
),
|
||||||
SwitchV("notification_weather_city"),
|
SwitchV("notification_weather_city"),
|
||||||
dataBindingRecv = showWeatherMainSwitchBinding.binding.getRecv(2)
|
dataBindingRecv = show_weather_main_switch_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
add(LineV())
|
add(LineV())
|
||||||
add(TitleTextV(resId = R.string.control_center))
|
add(TitleTextV(resId = R.string.control_center))
|
||||||
val controlCenterWeatherBinding = getDataBinding(
|
val control_center_weather_binding = getDataBinding(
|
||||||
SPUtils.getBoolean(
|
SPUtils.getBoolean(
|
||||||
activity,
|
activity,
|
||||||
"control_center_weather",
|
"control_center_weather",
|
||||||
@@ -1131,7 +1123,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
),
|
),
|
||||||
SwitchV(
|
SwitchV(
|
||||||
"control_center_weather",
|
"control_center_weather",
|
||||||
dataBindingSend = controlCenterWeatherBinding.bindingSend
|
dataBindingSend = control_center_weather_binding.bindingSend
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -1141,7 +1133,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
textId = R.string.show_city,
|
textId = R.string.show_city,
|
||||||
),
|
),
|
||||||
SwitchV("control_center_weather_city"),
|
SwitchV("control_center_weather_city"),
|
||||||
dataBindingRecv = controlCenterWeatherBinding.binding.getRecv(2)
|
dataBindingRecv = control_center_weather_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1193,7 +1185,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
|
|
||||||
add(LineV())
|
add(LineV())
|
||||||
add(TitleTextV(resId = R.string.old_quick_settings_panel))
|
add(TitleTextV(resId = R.string.old_quick_settings_panel))
|
||||||
val oldQSCustomSwitchBinding = getDataBinding(
|
val old_qs_custom_switch_binding = getDataBinding(
|
||||||
SPUtils.getBoolean(
|
SPUtils.getBoolean(
|
||||||
activity,
|
activity,
|
||||||
"old_qs_custom_switch",
|
"old_qs_custom_switch",
|
||||||
@@ -1213,7 +1205,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
),
|
),
|
||||||
SwitchV(
|
SwitchV(
|
||||||
"old_qs_custom_switch",
|
"old_qs_custom_switch",
|
||||||
dataBindingSend = oldQSCustomSwitchBinding.bindingSend
|
dataBindingSend = old_qs_custom_switch_binding.bindingSend
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -1221,7 +1213,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
add(
|
add(
|
||||||
TextV(
|
TextV(
|
||||||
resId = R.string.qs_custom_rows,
|
resId = R.string.qs_custom_rows,
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
@@ -1230,7 +1222,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
1,
|
1,
|
||||||
6,
|
6,
|
||||||
3,
|
3,
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1238,7 +1230,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
add(
|
add(
|
||||||
TextV(
|
TextV(
|
||||||
resId = R.string.qs_custom_rows_horizontal,
|
resId = R.string.qs_custom_rows_horizontal,
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
@@ -1247,14 +1239,14 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
1,
|
1,
|
||||||
3,
|
3,
|
||||||
2,
|
2,
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
add(
|
add(
|
||||||
TextV(
|
TextV(
|
||||||
resId = R.string.qs_custom_columns,
|
resId = R.string.qs_custom_columns,
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
@@ -1263,13 +1255,13 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
1,
|
1,
|
||||||
7,
|
7,
|
||||||
4,
|
4,
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
TextV(
|
TextV(
|
||||||
resId = R.string.qs_custom_columns_unexpanded,
|
resId = R.string.qs_custom_columns_unexpanded,
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(
|
add(
|
||||||
@@ -1278,7 +1270,7 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
1,
|
1,
|
||||||
7,
|
7,
|
||||||
5,
|
5,
|
||||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1428,16 +1420,6 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
add(LineV())
|
add(LineV())
|
||||||
add(TitleTextV(resId = R.string.cast))
|
|
||||||
add(
|
|
||||||
TextSummaryWithSwitchV(
|
|
||||||
TextSummaryV(
|
|
||||||
textId = R.string.force_support_send_app,
|
|
||||||
),
|
|
||||||
SwitchV("force_support_send_app")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
add(LineV())
|
|
||||||
add(TitleTextV(resId = R.string.remove_ad))
|
add(TitleTextV(resId = R.string.remove_ad))
|
||||||
add(
|
add(
|
||||||
TextSummaryWithSwitchV(
|
TextSummaryWithSwitchV(
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook
|
||||||
|
|
||||||
|
import com.github.kyuubiran.ezxhelper.init.EzXHelperInit
|
||||||
|
import com.lt2333.simplicitytools.BuildConfig
|
||||||
|
import com.lt2333.simplicitytools.hook.app.*
|
||||||
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.IXposedHookZygoteInit
|
||||||
|
import de.robv.android.xposed.XSharedPreferences
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||||
|
|
||||||
|
class MainHook : IXposedHookLoadPackage,IXposedHookZygoteInit {
|
||||||
|
private var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "config")
|
||||||
|
|
||||||
|
override fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam) {
|
||||||
|
EzXHelperInit.initZygote(startupParam)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||||
|
if (prefs.getBoolean("main_switch", true)) {
|
||||||
|
EzXHelperInit.initHandleLoadPackage(lpparam)
|
||||||
|
EzXHelperInit.setEzClassLoader(lpparam.classLoader)
|
||||||
|
when (lpparam.packageName) {
|
||||||
|
//Android
|
||||||
|
"android" -> Android().handleLoadPackage(lpparam)
|
||||||
|
//系统界面
|
||||||
|
"com.android.systemui" -> SystemUI().handleLoadPackage(lpparam)
|
||||||
|
//电量与性能
|
||||||
|
"com.miui.powerkeeper" -> PowerKeeper().handleLoadPackage(lpparam)
|
||||||
|
//桌面
|
||||||
|
"com.miui.home" -> MiuiHome().handleLoadPackage(lpparam)
|
||||||
|
//手机管家
|
||||||
|
"com.miui.securitycenter" -> SecurityCenter().handleLoadPackage(lpparam)
|
||||||
|
//相册编辑
|
||||||
|
"com.miui.mediaeditor" -> MediaEditor().handleLoadPackage(lpparam)
|
||||||
|
//系统更新
|
||||||
|
"com.android.updater" -> Updater().handleLoadPackage(lpparam)
|
||||||
|
//设置
|
||||||
|
"com.android.settings" -> Settings().handleLoadPackage(lpparam)
|
||||||
|
//主题壁纸
|
||||||
|
"com.android.thememanager" -> ThemeManager().handleLoadPackage(lpparam)
|
||||||
|
//截屏
|
||||||
|
"com.miui.screenshot" -> ScreenShot().handleLoadPackage(lpparam)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hook
|
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.BuildConfig
|
|
||||||
import com.lt2333.simplicitytools.hook.app.*
|
|
||||||
import com.lt2333.simplicitytools.util.xposed.EasyXposedInit
|
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
|
||||||
import de.robv.android.xposed.IXposedHookZygoteInit
|
|
||||||
import de.robv.android.xposed.XSharedPreferences
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
class XposedEntry: EasyXposedInit() {
|
|
||||||
private var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "config")
|
|
||||||
|
|
||||||
override val registeredApp: List<AppRegister> = listOf(
|
|
||||||
Android, // Android
|
|
||||||
SystemUI, // 系统界面
|
|
||||||
PowerKeeper, // 电量与性能
|
|
||||||
MiuiHome, // 桌面
|
|
||||||
SecurityCenter, // 手机管家
|
|
||||||
MediaEditor, // 相册编辑
|
|
||||||
Updater, // 系统更新
|
|
||||||
Settings, // 设置
|
|
||||||
ThemeManager, // 主题壁纸
|
|
||||||
ScreenShot, // 截屏
|
|
||||||
Cast, //投屏
|
|
||||||
)
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
|
|
||||||
if (prefs.getBoolean("main_switch", true)) {
|
|
||||||
super.handleLoadPackage(lpparam)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam?) {
|
|
||||||
super.initZygote(startupParam)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -5,25 +5,22 @@ import com.lt2333.simplicitytools.hook.app.android.DisableFlagSecure
|
|||||||
import com.lt2333.simplicitytools.hook.app.android.MaxWallpaperScale
|
import com.lt2333.simplicitytools.hook.app.android.MaxWallpaperScale
|
||||||
import com.lt2333.simplicitytools.hook.app.android.RemoveSmallWindowRestrictions
|
import com.lt2333.simplicitytools.hook.app.android.RemoveSmallWindowRestrictions
|
||||||
import com.lt2333.simplicitytools.hook.app.android.corepatch.CorePatch
|
import com.lt2333.simplicitytools.hook.app.android.corepatch.CorePatch
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedBridge
|
import de.robv.android.xposed.XposedBridge
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object Android: AppRegister() {
|
class Android : IXposedHookLoadPackage {
|
||||||
override val packageName: String = "android"
|
|
||||||
override val processName: List<String> = emptyList()
|
|
||||||
override val logTag: String = "Simplicitytools"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||||
//核心破解
|
//核心破解
|
||||||
CorePatch().handleLoadPackage(lpparam)
|
CorePatch().handleLoadPackage(lpparam)
|
||||||
|
//允许截图
|
||||||
autoInitHooks(lpparam,
|
DisableFlagSecure().handleLoadPackage(lpparam)
|
||||||
DisableFlagSecure, //允许截图
|
//上层显示
|
||||||
DeleteOnPostNotification, //上层显示
|
DeleteOnPostNotification().handleLoadPackage(lpparam)
|
||||||
RemoveSmallWindowRestrictions, //解除小窗限制
|
//解除小窗限制
|
||||||
MaxWallpaperScale, //壁纸缩放比例
|
RemoveSmallWindowRestrictions().handleLoadPackage(lpparam)
|
||||||
)
|
//壁纸缩放比例
|
||||||
|
MaxWallpaperScale().handleLoadPackage(lpparam)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app
|
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.hook.app.cast.ForceSupportSendApp
|
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
|
||||||
import de.robv.android.xposed.XposedBridge
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
object Cast: AppRegister() {
|
|
||||||
override val packageName: String = "com.milink.service"
|
|
||||||
override val processName: List<String> = emptyList()
|
|
||||||
override val logTag: String = "Simplicitytools"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
|
||||||
autoInitHooks(lpparam,
|
|
||||||
ForceSupportSendApp, //强制允许所有应用接力
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +1,14 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.hook.app.mediaeditor.UnlockUnlimitedCropping
|
import com.lt2333.simplicitytools.hook.app.mediaeditor.UnlockUnlimitedCropping
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedBridge
|
import de.robv.android.xposed.XposedBridge
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||||
|
|
||||||
object MediaEditor: AppRegister() {
|
class MediaEditor : IXposedHookLoadPackage {
|
||||||
override val packageName: String = "com.miui.mediaeditor"
|
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||||
override val processName: List<String> = emptyList()
|
|
||||||
override val logTag: String = "Simplicitytools"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||||
autoInitHooks(lpparam,
|
//解锁裁切最小值
|
||||||
UnlockUnlimitedCropping, //解锁裁切最小值
|
UnlockUnlimitedCropping().handleLoadPackage(lpparam)
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,20 +2,16 @@ package com.lt2333.simplicitytools.hook.app
|
|||||||
|
|
||||||
import com.lt2333.simplicitytools.hook.app.miuihome.AlwaysDisplayTime
|
import com.lt2333.simplicitytools.hook.app.miuihome.AlwaysDisplayTime
|
||||||
import com.lt2333.simplicitytools.hook.app.miuihome.DoubleTapToSleep
|
import com.lt2333.simplicitytools.hook.app.miuihome.DoubleTapToSleep
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedBridge
|
import de.robv.android.xposed.XposedBridge
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||||
|
|
||||||
object MiuiHome: AppRegister() {
|
class MiuiHome : IXposedHookLoadPackage {
|
||||||
override val packageName: String = "com.miui.home"
|
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||||
override val processName: List<String> = emptyList()
|
|
||||||
override val logTag: String = "Simplicitytools"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||||
autoInitHooks(lpparam,
|
//时钟显示时钟
|
||||||
AlwaysDisplayTime, //时钟显示时钟
|
AlwaysDisplayTime().handleLoadPackage(lpparam)
|
||||||
DoubleTapToSleep, //双击锁屏
|
//双击锁屏
|
||||||
)
|
DoubleTapToSleep().handleLoadPackage(lpparam)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,20 +2,18 @@ package com.lt2333.simplicitytools.hook.app
|
|||||||
|
|
||||||
import com.lt2333.simplicitytools.hook.app.powerkeeper.LockMaxFps
|
import com.lt2333.simplicitytools.hook.app.powerkeeper.LockMaxFps
|
||||||
import com.lt2333.simplicitytools.hook.app.powerkeeper.PreventRecoveryOfBatteryOptimizationWhitelist
|
import com.lt2333.simplicitytools.hook.app.powerkeeper.PreventRecoveryOfBatteryOptimizationWhitelist
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedBridge
|
import de.robv.android.xposed.XposedBridge
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||||
|
|
||||||
object PowerKeeper: AppRegister() {
|
class PowerKeeper : IXposedHookLoadPackage {
|
||||||
override val packageName: String = "com.miui.powerkeeper"
|
|
||||||
override val processName: List<String> = emptyList()
|
|
||||||
override val logTag: String = "Simplicitytools"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||||
autoInitHooks(lpparam,
|
//锁定最高刷新率
|
||||||
LockMaxFps, //锁定最高刷新率
|
LockMaxFps().handleLoadPackage(lpparam)
|
||||||
PreventRecoveryOfBatteryOptimizationWhitelist, //防止恢复电池优化白名单
|
//防止恢复电池优化白名单
|
||||||
)
|
PreventRecoveryOfBatteryOptimizationWhitelist().handleLoadPackage(lpparam)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,15 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.hook.app.screenshot.UnlockUnlimitedCropping
|
import com.lt2333.simplicitytools.hook.app.screenshot.UnlockUnlimitedCropping
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedBridge
|
import de.robv.android.xposed.XposedBridge
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||||
|
|
||||||
object ScreenShot: AppRegister() {
|
class ScreenShot : IXposedHookLoadPackage {
|
||||||
override val packageName: String = "com.miui.screenshot"
|
|
||||||
override val processName: List<String> = emptyList()
|
|
||||||
override val logTag: String = "Simplicitytools"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||||
XposedBridge.log("Simplicitytools: 成功 Hook " + javaClass.simpleName)
|
XposedBridge.log("Simplicitytools: 成功 Hook " + javaClass.simpleName)
|
||||||
autoInitHooks(lpparam,
|
//锁定最高刷新率
|
||||||
UnlockUnlimitedCropping, //锁定最高刷新率
|
UnlockUnlimitedCropping().handleLoadPackage(lpparam)
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.hook.app.securitycenter.*
|
import com.lt2333.simplicitytools.hook.app.securitycenter.*
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedBridge
|
import de.robv.android.xposed.XposedBridge
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||||
|
|
||||||
object SecurityCenter: AppRegister() {
|
class SecurityCenter : IXposedHookLoadPackage {
|
||||||
override val packageName: String = "com.miui.securitycenter"
|
|
||||||
override val processName: List<String> = emptyList()
|
|
||||||
override val logTag: String = "Simplicitytools"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||||
XposedBridge.log("Simplicitytools: 成功 Hook " + javaClass.simpleName)
|
XposedBridge.log("Simplicitytools: 成功 Hook " + javaClass.simpleName)
|
||||||
autoInitHooks(lpparam,
|
//跳过 5/10秒等待时间
|
||||||
SkipWaitingTime, //跳过 5/10秒等待时间
|
SkipWaitingTime().handleLoadPackage(lpparam)
|
||||||
LockOneHundred, //锁定 100分
|
//锁定 100分
|
||||||
RemoveMacroBlacklist, //去除自动连招黑名单
|
LockOneHundred().handleLoadPackage(lpparam)
|
||||||
ShowBatteryTemperature, //显示电池温度
|
//去除自动连招黑名单
|
||||||
RemoveOpenAppConfirmationPopup, //去除打开应用弹窗
|
RemoveMacroBlacklist().handleLoadPackage(lpparam)
|
||||||
)
|
//显示电池温度
|
||||||
|
ShowBatteryTemperature().handleLoadPackage(lpparam)
|
||||||
|
//去除打开应用弹窗
|
||||||
|
RemoveOpenAppConfirmationPopup().handleLoadPackage(lpparam)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,13 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.hook.app.settings.ShowNotificationImportance
|
import com.lt2333.simplicitytools.hook.app.settings.ShowNotificationImportance
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedBridge
|
import de.robv.android.xposed.XposedBridge
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object Settings: AppRegister() {
|
class Settings: IXposedHookLoadPackage {
|
||||||
override val packageName: String = "com.android.settings"
|
|
||||||
override val processName: List<String> = emptyList()
|
|
||||||
override val logTag: String = "Simplicitytools"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||||
autoInitHooks(lpparam,
|
ShowNotificationImportance().handleLoadPackage(lpparam)
|
||||||
ShowNotificationImportance, //显示通知重要程度
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,45 +1,67 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.hook.app.systemui.*
|
import com.lt2333.simplicitytools.hook.app.systemui.*
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedBridge
|
import de.robv.android.xposed.XposedBridge
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||||
|
|
||||||
object SystemUI: AppRegister() {
|
class SystemUI : IXposedHookLoadPackage {
|
||||||
override val packageName: String = "com.android.systemui"
|
|
||||||
override val processName: List<String> = emptyList()
|
|
||||||
override val logTag: String = "Simplicitytools"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||||
autoInitHooks(lpparam,
|
//隐藏状态栏图标
|
||||||
HideStatusBarIcon, //隐藏状态栏图标
|
HideStatusBarIcon().handleLoadPackage(lpparam)
|
||||||
HideBatteryIcon, //隐藏电池
|
//隐藏电池
|
||||||
HideHDIcon, //隐藏HD图标
|
HideBatteryIcon().handleLoadPackage(lpparam)
|
||||||
HideSimIcon, //隐藏SIM卡图标
|
//隐藏HD图标
|
||||||
HideMobileActivityIcon, //隐藏移动箭头图标
|
HideHDIcon().handleLoadPackage(lpparam)
|
||||||
HideMobileTypeIcon, //隐藏移动类型图标
|
//隐藏SIM卡图标
|
||||||
HideStatusBarNetworkSpeedSecond, //隐藏状态栏网速/s
|
HideSimIcon().handleLoadPackage(lpparam)
|
||||||
HideWifiActivityIcon, //隐藏WIFI活动箭头图标
|
//隐藏移动箭头图标
|
||||||
RemoveTheMaximumNumberOfNotificationIcons, //移除通知图标上限
|
HideMobileActivityIcon().handleLoadPackage(lpparam)
|
||||||
StatusBarNetworkSpeedRefreshSpeed, //状态栏网速秒刷新
|
//隐藏移动类型图标
|
||||||
StatusBarTimeCustomization, //状态栏时钟自定义
|
HideMobileTypeIcon().handleLoadPackage(lpparam)
|
||||||
RemoveTheLeftSideOfTheLockScreen, //移除锁屏负一屏功能
|
//隐藏状态栏网速/s
|
||||||
RemoveLockScreenCamera, //移除锁屏相机功能
|
HideStatusBarNetworkSpeedSecond().handleLoadPackage(lpparam)
|
||||||
NotificationWeather, //通知面板天气
|
//隐藏WIFI活动箭头图标
|
||||||
OldNotificationWeather,
|
HideWifiActivityIcon().handleLoadPackage(lpparam)
|
||||||
ControlCenterWeather, //控制中心天气
|
//移除通知图标上限
|
||||||
//StatusBarCurrent, //TODO:状态栏电流
|
RemoveTheMaximumNumberOfNotificationIcons().handleLoadPackage(lpparam)
|
||||||
StatusBarLayout, //状态栏布局
|
//状态栏网速秒刷新
|
||||||
HideNetworkSpeedSplitter, //隐藏时钟与实时网速之间的分隔符
|
StatusBarNetworkSpeedRefreshSpeed().handleLoadPackage(lpparam)
|
||||||
WaveCharge, //Alpha充电动画
|
//状态栏时钟自定义
|
||||||
LockScreenCurrent, //锁屏电流
|
StatusBarTimeCustomization().handleLoadPackage(lpparam)
|
||||||
LockScreenDoubleTapToSleep, //锁屏下双击锁屏
|
//移除锁屏负一屏功能
|
||||||
StatusBarDoubleTapToSleep, //双击状态栏锁屏
|
RemoveTheLeftSideOfTheLockScreen().handleLoadPackage(lpparam)
|
||||||
OldQSCustom, //旧版快速设置自定义
|
//移除锁屏相机功能
|
||||||
DoubleLineNetworkSpeed, //双排网速
|
RemoveLockScreenCamera().handleLoadPackage(lpparam)
|
||||||
StatusBarBigMobileTypeIcon, //大移动类型
|
//通知面板天气
|
||||||
BatteryPercentage, //电量百分比
|
NotificationWeather().handleLoadPackage(lpparam)
|
||||||
)
|
OldNotificationWeather().handleLoadPackage(lpparam)
|
||||||
|
//控制中心天气
|
||||||
|
ControlCenterWeather().handleLoadPackage(lpparam)
|
||||||
|
//TODO:状态栏电流
|
||||||
|
//StatusBarCurrent().handleLoadPackage(lpparam)
|
||||||
|
//状态栏布局
|
||||||
|
StatusBarLayout().handleLoadPackage(lpparam)
|
||||||
|
//隐藏时钟与实时网速之间的分隔符
|
||||||
|
HideNetworkSpeedSplitter().handleLoadPackage(lpparam)
|
||||||
|
//Alpha充电动画
|
||||||
|
WaveCharge().handleLoadPackage(lpparam)
|
||||||
|
//锁屏电流
|
||||||
|
LockScreenCurrent().handleLoadPackage(lpparam)
|
||||||
|
//锁屏下双击锁屏
|
||||||
|
LockScreenDoubleTapToSleep().handleLoadPackage(lpparam)
|
||||||
|
//双击状态栏锁屏
|
||||||
|
StatusBarDoubleTapToSleep().handleLoadPackage(lpparam)
|
||||||
|
//旧版快速设置自定义
|
||||||
|
OldQSCustom().handleLoadPackage(lpparam)
|
||||||
|
//双排网速
|
||||||
|
DoubleLineNetworkSpeed().handleLoadPackage(lpparam)
|
||||||
|
//大移动类型
|
||||||
|
StatusBarBigMobileTypeIcon().handleLoadPackage(lpparam)
|
||||||
|
//电量百分比
|
||||||
|
BatteryPercentage().handleLoadPackage(lpparam)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,14 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.hook.app.thememanager.RemoveAds
|
import com.lt2333.simplicitytools.hook.app.thememanager.RemoveAds
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedBridge
|
import de.robv.android.xposed.XposedBridge
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||||
|
|
||||||
object ThemeManager: AppRegister() {
|
class ThemeManager : IXposedHookLoadPackage {
|
||||||
override val packageName: String = "com.android.thememanager"
|
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||||
override val processName: List<String> = emptyList()
|
|
||||||
override val logTag: String = "Simplicitytools"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||||
autoInitHooks(lpparam,
|
//移除主题壁纸的广告
|
||||||
RemoveAds, //移除主题壁纸的广告
|
RemoveAds().handleLoadPackage(lpparam)
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,15 +2,11 @@ package com.lt2333.simplicitytools.hook.app
|
|||||||
|
|
||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object Updater: AppRegister() {
|
class Updater : IXposedHookLoadPackage {
|
||||||
override val packageName: String = "com.android.updater"
|
|
||||||
override val processName: List<String> = emptyList()
|
|
||||||
override val logTag: String = "Simplicitytools"
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
if (XSPUtils.getBoolean("remove_ota_validate", false)) {
|
if (XSPUtils.getBoolean("remove_ota_validate", false)) {
|
||||||
var letter = 'a'
|
var letter = 'a'
|
||||||
|
|||||||
@@ -2,16 +2,15 @@ package com.lt2333.simplicitytools.hook.app.android
|
|||||||
|
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object DeleteOnPostNotification : HookRegister() {
|
class DeleteOnPostNotification : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
"com.android.server.wm.AlertWindowNotification".hookBeforeMethod(lpparam.classLoader, "onPostNotification") {
|
||||||
"com.android.server.wm.AlertWindowNotification".hookBeforeMethod(getDefaultClassLoader(), "onPostNotification") {
|
|
||||||
hasEnable("delete_on_post_notification") {
|
hasEnable("delete_on_post_notification") {
|
||||||
it.result = null
|
it.result = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,16 +2,15 @@ package com.lt2333.simplicitytools.hook.app.android
|
|||||||
|
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object DisableFlagSecure : HookRegister() {
|
class DisableFlagSecure : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
"com.android.server.wm.WindowState".hookBeforeMethod(lpparam.classLoader, "isSecureLocked") {
|
||||||
"com.android.server.wm.WindowState".hookBeforeMethod(getDefaultClassLoader(), "isSecureLocked") {
|
|
||||||
hasEnable("disable_flag_secure") {
|
hasEnable("disable_flag_secure") {
|
||||||
it.result = false
|
it.result = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,15 +3,15 @@ package com.lt2333.simplicitytools.hook.app.android
|
|||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.setFloatField
|
import com.lt2333.simplicitytools.util.setFloatField
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object MaxWallpaperScale : HookRegister() {
|
class MaxWallpaperScale : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
|
||||||
override fun init() {
|
"com.android.server.wm.WallpaperController".hookBeforeMethod(lpparam.classLoader, "zoomOutToScale", Float::class.java) {
|
||||||
"com.android.server.wm.WallpaperController".hookBeforeMethod(getDefaultClassLoader(), "zoomOutToScale", Float::class.java) {
|
|
||||||
val value = XSPUtils.getFloat("max_wallpaper_scale", 1.1f)
|
val value = XSPUtils.getFloat("max_wallpaper_scale", 1.1f)
|
||||||
it.thisObject.setFloatField("mMaxWallpaperScale", value)
|
it.thisObject.setFloatField("mMaxWallpaperScale", value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,35 +4,36 @@ import android.content.Context
|
|||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object RemoveSmallWindowRestrictions : HookRegister() {
|
class RemoveSmallWindowRestrictions : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
|
||||||
override fun init() {
|
|
||||||
// 强制所有活动设为可以调整大小
|
// 强制所有活动设为可以调整大小
|
||||||
"com.android.server.wm.Task".hookBeforeMethod(getDefaultClassLoader(), "isResizeable") {
|
"com.android.server.wm.Task".hookBeforeMethod(lpparam.classLoader, "isResizeable") {
|
||||||
hasEnable("remove_small_window_restrictions") {
|
hasEnable("remove_small_window_restrictions") {
|
||||||
it.result = true
|
it.result = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"android.util.MiuiMultiWindowAdapter".hookAfterMethod(getDefaultClassLoader(), "getFreeformBlackList") {
|
"android.util.MiuiMultiWindowAdapter".hookAfterMethod(lpparam.classLoader, "getFreeformBlackList") {
|
||||||
hasEnable("remove_small_window_restrictions") {
|
hasEnable("remove_small_window_restrictions") {
|
||||||
it.result = (it.result as MutableList<*>).apply { clear() }
|
it.result = (it.result as MutableList<*>).apply { clear() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"android.util.MiuiMultiWindowAdapter".hookAfterMethod(getDefaultClassLoader(), "getFreeformBlackListFromCloud", Context::class.java) {
|
"android.util.MiuiMultiWindowAdapter".hookAfterMethod(lpparam.classLoader, "getFreeformBlackListFromCloud", Context::class.java) {
|
||||||
hasEnable("remove_small_window_restrictions") {
|
hasEnable("remove_small_window_restrictions") {
|
||||||
it.result = (it.result as MutableList<*>).apply { clear() }
|
it.result = (it.result as MutableList<*>).apply { clear() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"android.util.MiuiMultiWindowUtils".hookAfterMethod(getDefaultClassLoader(), "supportFreeform") {
|
"android.util.MiuiMultiWindowUtils".hookAfterMethod(lpparam.classLoader, "supportFreeform") {
|
||||||
hasEnable("remove_small_window_restrictions") {
|
hasEnable("remove_small_window_restrictions") {
|
||||||
it.result = true
|
it.result = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app.cast
|
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookMethod
|
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
|
||||||
|
|
||||||
object ForceSupportSendApp: HookRegister() {
|
|
||||||
|
|
||||||
override fun init() {
|
|
||||||
findMethod("com.xiaomi.mirror.synergy.MiuiSynergySdk") {
|
|
||||||
name == "isSupportSendApp"
|
|
||||||
}.hookMethod {
|
|
||||||
after { param ->
|
|
||||||
hasEnable("force_support_send_app") {
|
|
||||||
param.result = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app.mediaeditor
|
package com.lt2333.simplicitytools.hook.app.mediaeditor
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object UnlockUnlimitedCropping : HookRegister() {
|
class UnlockUnlimitedCropping :IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
//解锁图库裁切最小值
|
//解锁图库裁切最小值
|
||||||
val classIfExists = XposedHelpers.findClassIfExists(
|
val classIfExists = XposedHelpers.findClassIfExists(
|
||||||
"com.miui.gallery.editor.photo.core.imports.obsoletes.Crop\$ResizeDetector",
|
"com.miui.gallery.editor.photo.core.imports.obsoletes.Crop\$ResizeDetector",
|
||||||
getDefaultClassLoader()
|
lpparam.classLoader
|
||||||
)
|
)
|
||||||
XposedHelpers.findAndHookMethod(
|
XposedHelpers.findAndHookMethod(
|
||||||
classIfExists,
|
classIfExists,
|
||||||
@@ -26,7 +26,7 @@ object UnlockUnlimitedCropping : HookRegister() {
|
|||||||
//截图无限裁切
|
//截图无限裁切
|
||||||
val classIfExists2 = XposedHelpers.findClassIfExists(
|
val classIfExists2 = XposedHelpers.findClassIfExists(
|
||||||
"com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$ResizeDetector",
|
"com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$ResizeDetector",
|
||||||
getDefaultClassLoader()
|
lpparam.classLoader
|
||||||
)
|
)
|
||||||
|
|
||||||
XposedHelpers.findAndHookMethod(
|
XposedHelpers.findAndHookMethod(
|
||||||
@@ -40,5 +40,4 @@ object UnlockUnlimitedCropping : HookRegister() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app.miuihome
|
package com.lt2333.simplicitytools.hook.app.miuihome
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object AlwaysDisplayTime : HookRegister() {
|
class AlwaysDisplayTime : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
val classIfExists = XposedHelpers.findClassIfExists(
|
val classIfExists = XposedHelpers.findClassIfExists(
|
||||||
"com.miui.home.launcher.Workspace",
|
"com.miui.home.launcher.Workspace",
|
||||||
getDefaultClassLoader()
|
lpparam.classLoader
|
||||||
)
|
)
|
||||||
XposedHelpers.findAndHookMethod(
|
XposedHelpers.findAndHookMethod(
|
||||||
classIfExists,
|
classIfExists,
|
||||||
@@ -23,5 +23,4 @@ object AlwaysDisplayTime : HookRegister() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,15 +4,15 @@ import android.content.Context
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
import com.lt2333.simplicitytools.util.*
|
import com.lt2333.simplicitytools.util.*
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
|
||||||
import com.yuk.miuihome.module.DoubleTapController
|
import com.yuk.miuihome.module.DoubleTapController
|
||||||
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object DoubleTapToSleep : HookRegister() {
|
class DoubleTapToSleep : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
hasEnable("double_tap_to_sleep") {
|
hasEnable("double_tap_to_sleep") {
|
||||||
"com.miui.home.launcher.Workspace".findClass(getDefaultClassLoader())
|
"com.miui.home.launcher.Workspace".findClass(lpparam.classLoader)
|
||||||
.hookAfterAllConstructors {
|
.hookAfterAllConstructors {
|
||||||
var mDoubleTapControllerEx =
|
var mDoubleTapControllerEx =
|
||||||
XposedHelpers.getAdditionalInstanceField(
|
XposedHelpers.getAdditionalInstanceField(
|
||||||
@@ -28,7 +28,7 @@ object DoubleTapToSleep : HookRegister() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
"com.miui.home.launcher.Workspace".findClass(getDefaultClassLoader()).hookBeforeMethod(
|
"com.miui.home.launcher.Workspace".findClass(lpparam.classLoader).hookBeforeMethod(
|
||||||
"dispatchTouchEvent", MotionEvent::class.java
|
"dispatchTouchEvent", MotionEvent::class.java
|
||||||
) {
|
) {
|
||||||
val mDoubleTapControllerEx = XposedHelpers.getAdditionalInstanceField(
|
val mDoubleTapControllerEx = XposedHelpers.getAdditionalInstanceField(
|
||||||
@@ -50,5 +50,4 @@ object DoubleTapToSleep : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app.powerkeeper
|
package com.lt2333.simplicitytools.hook.app.powerkeeper
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object LockMaxFps : HookRegister() {
|
class LockMaxFps : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
val classIfExists = XposedHelpers.findClassIfExists(
|
val classIfExists = XposedHelpers.findClassIfExists(
|
||||||
"com.miui.powerkeeper.statemachine.DisplayFrameSetting",
|
"com.miui.powerkeeper.statemachine.DisplayFrameSetting",
|
||||||
getDefaultClassLoader()
|
lpparam.classLoader
|
||||||
)
|
)
|
||||||
XposedHelpers.findAndHookMethod(
|
XposedHelpers.findAndHookMethod(
|
||||||
classIfExists,
|
classIfExists,
|
||||||
@@ -25,5 +25,4 @@ object LockMaxFps : HookRegister() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app.powerkeeper
|
package com.lt2333.simplicitytools.hook.app.powerkeeper
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object PreventRecoveryOfBatteryOptimizationWhitelist : HookRegister() {
|
class PreventRecoveryOfBatteryOptimizationWhitelist : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
val classIfExists = XposedHelpers.findClassIfExists(
|
val classIfExists = XposedHelpers.findClassIfExists(
|
||||||
"com.miui.powerkeeper.statemachine.ForceDozeController",
|
"com.miui.powerkeeper.statemachine.ForceDozeController",
|
||||||
getDefaultClassLoader()
|
lpparam.classLoader
|
||||||
)
|
)
|
||||||
XposedHelpers.findAndHookMethod(
|
XposedHelpers.findAndHookMethod(
|
||||||
classIfExists,
|
classIfExists,
|
||||||
@@ -28,5 +28,4 @@ object PreventRecoveryOfBatteryOptimizationWhitelist : HookRegister() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app.screenshot
|
package com.lt2333.simplicitytools.hook.app.screenshot
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object UnlockUnlimitedCropping : HookRegister() {
|
class UnlockUnlimitedCropping :IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
//截图无限裁切
|
//截图无限裁切
|
||||||
val classIfExists2 = XposedHelpers.findClassIfExists(
|
val classIfExists2 = XposedHelpers.findClassIfExists(
|
||||||
"com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$b",
|
"com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$b",
|
||||||
getDefaultClassLoader()
|
lpparam.classLoader
|
||||||
)
|
)
|
||||||
|
|
||||||
XposedHelpers.findAndHookMethod(
|
XposedHelpers.findAndHookMethod(
|
||||||
@@ -25,5 +25,4 @@ object UnlockUnlimitedCropping : HookRegister() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,13 +4,14 @@ import android.view.View
|
|||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.findClass
|
import com.lt2333.simplicitytools.util.findClass
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object LockOneHundred : HookRegister() {
|
class LockOneHundred : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
|
||||||
override fun init() {
|
|
||||||
//防止点击重新检测
|
//防止点击重新检测
|
||||||
val mainContentFrameClass = "com.miui.securityscan.ui.main.MainContentFrame".findClass(getDefaultClassLoader())
|
val mainContentFrameClass = "com.miui.securityscan.ui.main.MainContentFrame".findClass(lpparam.classLoader)
|
||||||
mainContentFrameClass.hookBeforeMethod("onClick", View::class.java) {
|
mainContentFrameClass.hookBeforeMethod("onClick", View::class.java) {
|
||||||
if (XSPUtils.getBoolean("lock_one_hundred", false)) {
|
if (XSPUtils.getBoolean("lock_one_hundred", false)) {
|
||||||
it.result = null
|
it.result = null
|
||||||
@@ -18,12 +19,11 @@ object LockOneHundred : HookRegister() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//锁定100分
|
//锁定100分
|
||||||
val scoreManagerClass = "com.miui.securityscan.scanner.ScoreManager".findClass(getDefaultClassLoader())
|
var scoreManagerClass = "com.miui.securityscan.scanner.ScoreManager".findClass(lpparam.classLoader)
|
||||||
scoreManagerClass.hookBeforeMethod("B") {
|
scoreManagerClass.hookBeforeMethod("B") {
|
||||||
if (XSPUtils.getBoolean("lock_one_hundred", false)) {
|
if (XSPUtils.getBoolean("lock_one_hundred", false)) {
|
||||||
it.result = 0
|
it.result = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app.securitycenter
|
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object RemoveMacroBlacklist : HookRegister() {
|
class RemoveMacroBlacklist : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
if (XSPUtils.getBoolean("remove_macro_blacklist", false)) {
|
if (XSPUtils.getBoolean("remove_macro_blacklist", false)) {
|
||||||
var letter = 'a'
|
var letter = 'a'
|
||||||
for (i in 0..25) {
|
for (i in 0..25) {
|
||||||
val classIfExists = XposedHelpers.findClassIfExists(
|
val classIfExists = XposedHelpers.findClassIfExists(
|
||||||
"com.miui.gamebooster.v.$letter" + "0", getDefaultClassLoader()
|
"com.miui.gamebooster.v.$letter" + "0", lpparam.classLoader
|
||||||
) ?: continue
|
) ?: continue
|
||||||
if (classIfExists.declaredMethods.size in 6..12 && classIfExists.fields.isEmpty() && classIfExists.declaredFields.size >= 2) {
|
if (classIfExists.declaredMethods.size in 6..12 && classIfExists.fields.isEmpty() && classIfExists.declaredFields.size >= 2) {
|
||||||
XposedHelpers.findAndHookMethod(classIfExists, "c", String::class.java,
|
XposedHelpers.findAndHookMethod(classIfExists, "c", String::class.java,
|
||||||
@@ -27,5 +27,4 @@ object RemoveMacroBlacklist : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,14 +4,12 @@ import android.widget.TextView
|
|||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.findClass
|
import com.lt2333.simplicitytools.util.findClass
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
|
||||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object RemoveOpenAppConfirmationPopup : HookRegister() {
|
class RemoveOpenAppConfirmationPopup : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
val textViewClass = "android.widget.TextView".findClass(lpparam.classLoader)
|
||||||
val textViewClass = "android.widget.TextView".findClass(getDefaultClassLoader())
|
|
||||||
textViewClass.hookAfterMethod(
|
textViewClass.hookAfterMethod(
|
||||||
"setText",
|
"setText",
|
||||||
CharSequence::class.java
|
CharSequence::class.java
|
||||||
@@ -33,5 +31,4 @@ object RemoveOpenAppConfirmationPopup : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,22 +17,16 @@ import com.lt2333.simplicitytools.util.XSPUtils
|
|||||||
import com.lt2333.simplicitytools.util.findClass
|
import com.lt2333.simplicitytools.util.findClass
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
import java.lang.reflect.Field
|
import java.lang.reflect.Field
|
||||||
|
|
||||||
object ShowBatteryTemperature: HookRegister() {
|
class ShowBatteryTemperature: IXposedHookLoadPackage {
|
||||||
|
|
||||||
private fun getBatteryTemperature(context: Context): Int {
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
return context.registerReceiver(
|
|
||||||
null as BroadcastReceiver?,
|
|
||||||
IntentFilter("android.intent.action.BATTERY_CHANGED")
|
|
||||||
)!!.getIntExtra("temperature", 0) / 10
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun init() {
|
|
||||||
if (!XSPUtils.getBoolean("battery_life_function", false)) return
|
if (!XSPUtils.getBoolean("battery_life_function", false)) return
|
||||||
val a = "com.miui.powercenter.a\$a".findClass(getDefaultClassLoader())
|
val a = "com.miui.powercenter.a\$a".findClass(lpparam.classLoader)
|
||||||
"com.miui.powercenter.a".hookBeforeMethod(getDefaultClassLoader(), "b", Context::class.java) {
|
"com.miui.powercenter.a".hookBeforeMethod(lpparam.classLoader, "b", Context::class.java) {
|
||||||
it.result = getBatteryTemperature(it.args[0] as Context).toString()
|
it.result = getBatteryTemperature(it.args[0] as Context).toString()
|
||||||
}
|
}
|
||||||
a.hookAfterMethod("run") {
|
a.hookAfterMethod("run") {
|
||||||
@@ -65,5 +59,10 @@ object ShowBatteryTemperature: HookRegister() {
|
|||||||
linearLayout.addView(tempView)
|
linearLayout.addView(tempView)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private fun getBatteryTemperature(context: Context): Int {
|
||||||
|
return context.registerReceiver(
|
||||||
|
null as BroadcastReceiver?,
|
||||||
|
IntentFilter("android.intent.action.BATTERY_CHANGED")
|
||||||
|
)!!.getIntExtra("temperature", 0) / 10
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4,12 +4,13 @@ import android.widget.TextView
|
|||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.findClass
|
import com.lt2333.simplicitytools.util.findClass
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object SkipWaitingTime : HookRegister() {
|
class SkipWaitingTime : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
|
||||||
override fun init() {
|
val textViewClass = "android.widget.TextView".findClass(lpparam.classLoader)
|
||||||
val textViewClass = "android.widget.TextView".findClass(getDefaultClassLoader())
|
|
||||||
textViewClass.hookBeforeMethod(
|
textViewClass.hookBeforeMethod(
|
||||||
"setText",
|
"setText",
|
||||||
CharSequence::class.java,
|
CharSequence::class.java,
|
||||||
@@ -34,5 +35,4 @@ object SkipWaitingTime : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,13 +2,13 @@ package com.lt2333.simplicitytools.hook.app.settings
|
|||||||
|
|
||||||
import android.app.NotificationChannel
|
import android.app.NotificationChannel
|
||||||
import com.lt2333.simplicitytools.util.*
|
import com.lt2333.simplicitytools.util.*
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object ShowNotificationImportance : HookRegister() {
|
class ShowNotificationImportance : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
val channelNotificationSettingsClass = "com.android.settings.notification.ChannelNotificationSettings".findClass(lpparam.classLoader)
|
||||||
val channelNotificationSettingsClass = "com.android.settings.notification.ChannelNotificationSettings".findClass(getDefaultClassLoader())
|
|
||||||
channelNotificationSettingsClass.hookBeforeMethod("removeDefaultPrefs") {
|
channelNotificationSettingsClass.hookBeforeMethod("removeDefaultPrefs") {
|
||||||
if (!XSPUtils.getBoolean("show_notification_importance", false)) return@hookBeforeMethod
|
if (!XSPUtils.getBoolean("show_notification_importance", false)) return@hookBeforeMethod
|
||||||
val importance = it.thisObject.callMethod("findPreference", "importance") ?: return@hookBeforeMethod
|
val importance = it.thisObject.callMethod("findPreference", "importance") ?: return@hookBeforeMethod
|
||||||
@@ -20,7 +20,7 @@ object ShowNotificationImportance : HookRegister() {
|
|||||||
it.result = null
|
it.result = null
|
||||||
}
|
}
|
||||||
|
|
||||||
val dropDownPreferenceClass = XposedHelpers.findClass("androidx.preference.Preference", getDefaultClassLoader())
|
val dropDownPreferenceClass = XposedHelpers.findClass("androidx.preference.Preference", lpparam.classLoader)
|
||||||
dropDownPreferenceClass.hookAfterMethod("callChangeListener", Any::class.java) {
|
dropDownPreferenceClass.hookAfterMethod("callChangeListener", Any::class.java) {
|
||||||
val channelNotificationSettings = XposedHelpers.getAdditionalInstanceField(it.thisObject, "channelNotificationSettings") ?: return@hookAfterMethod
|
val channelNotificationSettings = XposedHelpers.getAdditionalInstanceField(it.thisObject, "channelNotificationSettings") ?: return@hookAfterMethod
|
||||||
val mChannel = channelNotificationSettings.getObjectField("mChannel") as NotificationChannel
|
val mChannel = channelNotificationSettings.getObjectField("mChannel") as NotificationChannel
|
||||||
@@ -31,5 +31,4 @@ object ShowNotificationImportance : HookRegister() {
|
|||||||
mBackend.callMethod("updateChannel", mPkg, mUid, mChannel)
|
mBackend.callMethod("updateChannel", mPkg, mUid, mChannel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,15 +5,15 @@ import android.widget.TextView
|
|||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.getObjectField
|
import com.lt2333.simplicitytools.util.getObjectField
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object BatteryPercentage: HookRegister() {
|
class BatteryPercentage : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
val size = XSPUtils.getFloat("battery_percentage_font_size", 0f)
|
val size = XSPUtils.getFloat("battery_percentage_font_size", 0f)
|
||||||
if (size == 0f) return
|
if (size == 0f) return
|
||||||
"com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(
|
"com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"updateResources"
|
"updateResources"
|
||||||
) {
|
) {
|
||||||
(it.thisObject.getObjectField("mBatteryPercentView") as TextView).setTextSize(
|
(it.thisObject.getObjectField("mBatteryPercentView") as TextView).setTextSize(
|
||||||
@@ -21,5 +21,4 @@ object BatteryPercentage: HookRegister() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,18 +11,90 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
|||||||
import cn.fkj233.ui.activity.dp2px
|
import cn.fkj233.ui.activity.dp2px
|
||||||
import com.github.kyuubiran.ezxhelper.utils.loadClass
|
import com.github.kyuubiran.ezxhelper.utils.loadClass
|
||||||
import com.lt2333.simplicitytools.util.*
|
import com.lt2333.simplicitytools.util.*
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
|
||||||
import com.lt2333.simplicitytools.view.WeatherView
|
import com.lt2333.simplicitytools.view.WeatherView
|
||||||
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object ControlCenterWeather: HookRegister() {
|
class ControlCenterWeather : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
hasEnable("") {
|
||||||
|
var mWeatherView: TextView? = null
|
||||||
|
val isDisplayCity = XSPUtils.getBoolean("", false)
|
||||||
|
"com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView".hookAfterMethod(
|
||||||
|
lpparam.classLoader,
|
||||||
|
"onFinishInflate"
|
||||||
|
) {
|
||||||
|
val viewGroup = it.thisObject as ViewGroup
|
||||||
|
val context = viewGroup.context
|
||||||
|
val layoutParam =
|
||||||
|
loadClass("androidx.constraintlayout.widget.ConstraintLayout\$LayoutParams")
|
||||||
|
.getConstructor(Int::class.java, Int::class.java).newInstance(
|
||||||
|
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||||
|
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||||
|
) as ViewGroup.MarginLayoutParams
|
||||||
|
layoutParam.setObjectField(
|
||||||
|
"bottomToTop",
|
||||||
|
context.resources.getIdentifier("date_time", "id", context.packageName)
|
||||||
|
)
|
||||||
|
layoutParam.setObjectField(
|
||||||
|
"startToEnd",
|
||||||
|
context.resources.getIdentifier("big_time", "id", context.packageName)
|
||||||
|
)
|
||||||
|
|
||||||
override fun init() {
|
layoutParam.marginStart = context.resources.getDimensionPixelSize(
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"notification_panel_time_date_space",
|
||||||
|
"dimen",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
mWeatherView = WeatherView(context, isDisplayCity).apply {
|
||||||
|
setTextAppearance(
|
||||||
|
context.resources.getIdentifier(
|
||||||
|
"TextAppearance.QSControl.Date",
|
||||||
|
"style",
|
||||||
|
context.packageName
|
||||||
|
)
|
||||||
|
)
|
||||||
|
layoutParams = layoutParam
|
||||||
|
}
|
||||||
|
viewGroup.addView(mWeatherView)
|
||||||
|
|
||||||
|
(mWeatherView as WeatherView).setOnClickListener {
|
||||||
|
try {
|
||||||
|
val intent = Intent().apply {
|
||||||
|
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
|
component = ComponentName(
|
||||||
|
"com.miui.weather2",
|
||||||
|
"com.miui.weather2.ActivityWeatherMain"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
context.startActivity(intent)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Toast.makeText(context, "启动失败", Toast.LENGTH_LONG).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//解决横屏重叠
|
||||||
|
"com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView".hookAfterMethod(
|
||||||
|
lpparam.classLoader,
|
||||||
|
"updateLayout"
|
||||||
|
) {
|
||||||
|
val mOrientation = it.thisObject.getObjectField("mOrientation") as Int
|
||||||
|
if (mOrientation == 1) {
|
||||||
|
mWeatherView!!.visibility = View.VISIBLE
|
||||||
|
} else {
|
||||||
|
mWeatherView!!.visibility = View.GONE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
hasEnable("control_center_weather") {
|
hasEnable("control_center_weather") {
|
||||||
var mWeatherView: TextView? = null
|
var mWeatherView: TextView? = null
|
||||||
var mConstraintLayout: ConstraintLayout? = null
|
var mConstraintLayout: ConstraintLayout? = null
|
||||||
val isDisplayCity = XSPUtils.getBoolean("control_center_weather_city", false)
|
val isDisplayCity = XSPUtils.getBoolean("control_center_weather_city", false)
|
||||||
"com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView".hookAfterMethod(
|
"com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView".hookAfterMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"onFinishInflate"
|
"onFinishInflate"
|
||||||
) {
|
) {
|
||||||
val viewGroup = it.thisObject as ViewGroup
|
val viewGroup = it.thisObject as ViewGroup
|
||||||
@@ -185,7 +257,7 @@ object ControlCenterWeather: HookRegister() {
|
|||||||
}
|
}
|
||||||
//解决横屏重叠
|
//解决横屏重叠
|
||||||
"com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView".hookAfterMethod(
|
"com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView".hookAfterMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"updateLayout"
|
"updateLayout"
|
||||||
) {
|
) {
|
||||||
val viewGroup = it.thisObject as ViewGroup
|
val viewGroup = it.thisObject as ViewGroup
|
||||||
@@ -220,5 +292,4 @@ object ControlCenterWeather: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,11 @@ import android.widget.TextView
|
|||||||
import com.github.kyuubiran.ezxhelper.init.InitFields
|
import com.github.kyuubiran.ezxhelper.init.InitFields
|
||||||
import com.lt2333.simplicitytools.R
|
import com.lt2333.simplicitytools.R
|
||||||
import com.lt2333.simplicitytools.util.*
|
import com.lt2333.simplicitytools.util.*
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
import java.text.DecimalFormat
|
import java.text.DecimalFormat
|
||||||
|
|
||||||
object DoubleLineNetworkSpeed: HookRegister() {
|
class DoubleLineNetworkSpeed : IXposedHookLoadPackage {
|
||||||
|
|
||||||
private var mLastTotalUp: Long = 0
|
private var mLastTotalUp: Long = 0
|
||||||
private var mLastTotalDown: Long = 0
|
private var mLastTotalDown: Long = 0
|
||||||
@@ -26,7 +27,7 @@ object DoubleLineNetworkSpeed: HookRegister() {
|
|||||||
private val getDualSize = XSPUtils.getInt("status_bar_network_speed_dual_row_size", 0)
|
private val getDualSize = XSPUtils.getInt("status_bar_network_speed_dual_row_size", 0)
|
||||||
private val getDualAlign = XSPUtils.getInt("status_bar_network_speed_dual_row_gravity", 0)
|
private val getDualAlign = XSPUtils.getInt("status_bar_network_speed_dual_row_gravity", 0)
|
||||||
|
|
||||||
override fun init() {
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
|
||||||
val none = InitFields.moduleRes.getString(R.string.none)
|
val none = InitFields.moduleRes.getString(R.string.none)
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ object DoubleLineNetworkSpeed: HookRegister() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hasEnable("status_bar_dual_row_network_speed") {
|
hasEnable("status_bar_dual_row_network_speed") {
|
||||||
"com.android.systemui.statusbar.views.NetworkSpeedView".findClass(getDefaultClassLoader())
|
"com.android.systemui.statusbar.views.NetworkSpeedView".findClass(lpparam.classLoader)
|
||||||
.hookAfterConstructor(Context::class.java, AttributeSet::class.java) {
|
.hookAfterConstructor(Context::class.java, AttributeSet::class.java) {
|
||||||
val mView = it.thisObject as TextView
|
val mView = it.thisObject as TextView
|
||||||
mView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 7f)
|
mView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 7f)
|
||||||
@@ -55,24 +56,24 @@ object DoubleLineNetworkSpeed: HookRegister() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
"com.android.systemui.statusbar.policy.NetworkSpeedController".hookBeforeMethod(
|
"com.android.systemui.statusbar.policy.NetworkSpeedController".hookBeforeMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"formatSpeed",
|
"formatSpeed",
|
||||||
Context::class.java,
|
Context::class.java,
|
||||||
Long::class.java
|
Long::class.java
|
||||||
) {
|
) {
|
||||||
if (getDualAlign == 0) {
|
if (getDualAlign == 0) {
|
||||||
it.result =
|
it.result =
|
||||||
"$upIcon ${getTotalUpSpeed(it.args[0]as Context)}\n${downIcon} ${getTotalDownloadSpeed(it.args[0]as Context)}"
|
"${upIcon} ${getTotalUpSpeed(it.args[0]as Context)}\n${downIcon} ${getTotalDownloadSpeed(it.args[0]as Context)}"
|
||||||
} else {
|
} else {
|
||||||
it.result =
|
it.result =
|
||||||
"${getTotalUpSpeed(it.args[0]as Context)} ${upIcon}\n${getTotalDownloadSpeed(it.args[0]as Context)} $downIcon"
|
"${getTotalUpSpeed(it.args[0]as Context)} ${upIcon}\n${getTotalDownloadSpeed(it.args[0]as Context)} ${downIcon}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取总的上行速度
|
//获取总的上行速度
|
||||||
private fun getTotalUpSpeed(context: Context): String {
|
fun getTotalUpSpeed(context: Context): String {
|
||||||
var totalUpSpeed = 0F
|
var totalUpSpeed = 0F
|
||||||
|
|
||||||
val currentTotalTxBytes = TrafficStats.getTotalTxBytes()
|
val currentTotalTxBytes = TrafficStats.getTotalTxBytes()
|
||||||
@@ -97,15 +98,15 @@ object DoubleLineNetworkSpeed: HookRegister() {
|
|||||||
mLastTotalUp = currentTotalTxBytes
|
mLastTotalUp = currentTotalTxBytes
|
||||||
lastTimeStampTotalUp = nowTimeStampTotalUp
|
lastTimeStampTotalUp = nowTimeStampTotalUp
|
||||||
|
|
||||||
return if (totalUpSpeed >= 100) {
|
if (totalUpSpeed >= 100) {
|
||||||
"" + totalUpSpeed.toInt() + unit
|
return "" + totalUpSpeed.toInt() + unit
|
||||||
} else {
|
} else {
|
||||||
"" + totalUpSpeed + unit
|
return "" + totalUpSpeed + unit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取总的下行速度
|
//获取总的下行速度
|
||||||
private fun getTotalDownloadSpeed(context: Context): String {
|
fun getTotalDownloadSpeed(context: Context): String {
|
||||||
var totalDownSpeed = 0F
|
var totalDownSpeed = 0F
|
||||||
val currentTotalRxBytes = TrafficStats.getTotalRxBytes()
|
val currentTotalRxBytes = TrafficStats.getTotalRxBytes()
|
||||||
val nowTimeStampTotalDown = System.currentTimeMillis()
|
val nowTimeStampTotalDown = System.currentTimeMillis()
|
||||||
@@ -129,12 +130,13 @@ object DoubleLineNetworkSpeed: HookRegister() {
|
|||||||
mLastTotalDown = currentTotalRxBytes
|
mLastTotalDown = currentTotalRxBytes
|
||||||
lastTimeStampTotalDown = nowTimeStampTotalDown
|
lastTimeStampTotalDown = nowTimeStampTotalDown
|
||||||
|
|
||||||
return if (totalDownSpeed >= 100) {
|
if (totalDownSpeed >= 100) {
|
||||||
"" + totalDownSpeed.toInt() + unit
|
return "" + totalDownSpeed.toInt() + unit
|
||||||
} else {
|
} else {
|
||||||
"" + totalDownSpeed + unit
|
return "" + totalDownSpeed + unit
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,12 +7,12 @@ import android.widget.TextView
|
|||||||
import com.lt2333.simplicitytools.util.getObjectField
|
import com.lt2333.simplicitytools.util.getObjectField
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object HideBatteryIcon : HookRegister() {
|
class HideBatteryIcon : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
"com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(lpparam.classLoader, "updateResources") {
|
||||||
"com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(getDefaultClassLoader(), "updateResources") {
|
|
||||||
|
|
||||||
//隐藏电池图标
|
//隐藏电池图标
|
||||||
hasEnable("hide_battery_icon") {
|
hasEnable("hide_battery_icon") {
|
||||||
@@ -32,7 +32,7 @@ object HideBatteryIcon : HookRegister() {
|
|||||||
(it.thisObject.getObjectField("mBatteryPercentMarkView") as TextView).textSize = 0F
|
(it.thisObject.getObjectField("mBatteryPercentMarkView") as TextView).textSize = 0F
|
||||||
}
|
}
|
||||||
|
|
||||||
"com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(getDefaultClassLoader(), "updateChargeAndText") {
|
"com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(lpparam.classLoader, "updateChargeAndText") {
|
||||||
//隐藏电池充电图标
|
//隐藏电池充电图标
|
||||||
hasEnable("hide_battery_charging_icon") {
|
hasEnable("hide_battery_charging_icon") {
|
||||||
(it.thisObject.getObjectField("mBatteryChargingInView") as ImageView).visibility = View.GONE
|
(it.thisObject.getObjectField("mBatteryChargingInView") as ImageView).visibility = View.GONE
|
||||||
@@ -41,5 +41,4 @@ object HideBatteryIcon : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,13 +5,13 @@ import android.widget.ImageView
|
|||||||
import com.lt2333.simplicitytools.util.getObjectField
|
import com.lt2333.simplicitytools.util.getObjectField
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object HideHDIcon: HookRegister() {
|
class HideHDIcon :IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
|
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
|
||||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(getDefaultClassLoader(), "initViewState", iconState) {
|
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "initViewState", iconState) {
|
||||||
hasEnable("hide_big_hd_icon") {
|
hasEnable("hide_big_hd_icon") {
|
||||||
(it.thisObject.getObjectField("mVolte") as ImageView).visibility = View.GONE
|
(it.thisObject.getObjectField("mVolte") as ImageView).visibility = View.GONE
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@ object HideHDIcon: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(getDefaultClassLoader(), "updateState", iconState) {
|
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "updateState", iconState) {
|
||||||
hasEnable("hide_big_hd_icon") {
|
hasEnable("hide_big_hd_icon") {
|
||||||
(it.thisObject.getObjectField("mVolte") as ImageView).visibility = View.GONE
|
(it.thisObject.getObjectField("mVolte") as ImageView).visibility = View.GONE
|
||||||
}
|
}
|
||||||
@@ -35,5 +35,4 @@ object HideHDIcon: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,25 +5,24 @@ import android.widget.ImageView
|
|||||||
import com.lt2333.simplicitytools.util.getObjectField
|
import com.lt2333.simplicitytools.util.getObjectField
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object HideMobileActivityIcon: HookRegister() {
|
class HideMobileActivityIcon : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
|
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
|
||||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(getDefaultClassLoader(), "initViewState", iconState) {
|
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "initViewState", iconState) {
|
||||||
hasEnable("hide_mobile_activity_icon") {
|
hasEnable("hide_mobile_activity_icon") {
|
||||||
(it.thisObject.getObjectField("mLeftInOut") as ImageView).visibility = View.GONE
|
(it.thisObject.getObjectField("mLeftInOut") as ImageView).visibility = View.GONE
|
||||||
(it.thisObject.getObjectField("mRightInOut") as ImageView).visibility = View.GONE
|
(it.thisObject.getObjectField("mRightInOut") as ImageView).visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(getDefaultClassLoader(), "updateState", iconState) {
|
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(lpparam.classLoader, "updateState", iconState) {
|
||||||
hasEnable("hide_mobile_activity_icon") {
|
hasEnable("hide_mobile_activity_icon") {
|
||||||
(it.thisObject.getObjectField("mLeftInOut") as ImageView).visibility = View.GONE
|
(it.thisObject.getObjectField("mLeftInOut") as ImageView).visibility = View.GONE
|
||||||
(it.thisObject.getObjectField("mRightInOut") as ImageView).visibility = View.GONE
|
(it.thisObject.getObjectField("mRightInOut") as ImageView).visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,17 +7,17 @@ import com.lt2333.simplicitytools.util.XSPUtils
|
|||||||
import com.lt2333.simplicitytools.util.getObjectField
|
import com.lt2333.simplicitytools.util.getObjectField
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object HideMobileTypeIcon: HookRegister() {
|
class HideMobileTypeIcon : IXposedHookLoadPackage {
|
||||||
|
val isBigType=XSPUtils.getBoolean("big_mobile_type_icon", false)
|
||||||
private val isBigType = XSPUtils.getBoolean("big_mobile_type_icon", false)
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
val iconState =
|
||||||
override fun init() {
|
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
|
||||||
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
|
|
||||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
|
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"initViewState",
|
"initViewState",
|
||||||
iconState
|
iconState
|
||||||
) {
|
) {
|
||||||
@@ -25,7 +25,7 @@ object HideMobileTypeIcon: HookRegister() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
|
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"updateState",
|
"updateState",
|
||||||
iconState
|
iconState
|
||||||
) {
|
) {
|
||||||
@@ -33,7 +33,7 @@ object HideMobileTypeIcon: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hideMobileTypeIcon(it: XC_MethodHook.MethodHookParam) {
|
fun hideMobileTypeIcon(it: XC_MethodHook.MethodHookParam) {
|
||||||
hasEnable("hide_mobile_type_icon") {
|
hasEnable("hide_mobile_type_icon") {
|
||||||
if (isBigType) {
|
if (isBigType) {
|
||||||
(it.thisObject.getObjectField("mMobileType") as TextView).visibility =
|
(it.thisObject.getObjectField("mMobileType") as TextView).visibility =
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ import android.widget.TextView
|
|||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.findClass
|
import com.lt2333.simplicitytools.util.findClass
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object HideNetworkSpeedSplitter: HookRegister() {
|
class HideNetworkSpeedSplitter : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
val networkSpeedSplitterClass = "com.android.systemui.statusbar.views.NetworkSpeedSplitter".findClass(lpparam.classLoader)
|
||||||
val networkSpeedSplitterClass = "com.android.systemui.statusbar.views.NetworkSpeedSplitter".findClass(getDefaultClassLoader())
|
|
||||||
networkSpeedSplitterClass.hookAfterMethod("init") {
|
networkSpeedSplitterClass.hookAfterMethod("init") {
|
||||||
if (XSPUtils.getBoolean("hide_network_speed_splitter", false)) {
|
if (XSPUtils.getBoolean("hide_network_speed_splitter", false)) {
|
||||||
val textView = it.thisObject as TextView
|
val textView = it.thisObject as TextView
|
||||||
@@ -17,5 +17,4 @@ object HideNetworkSpeedSplitter: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ package com.lt2333.simplicitytools.hook.app.systemui
|
|||||||
|
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object HideSimIcon: HookRegister() {
|
class HideSimIcon :IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy".hookBeforeMethod(lpparam.classLoader, "hasCorrectSubs", MutableList::class.java) {
|
||||||
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy".hookBeforeMethod(getDefaultClassLoader(), "hasCorrectSubs", MutableList::class.java) {
|
|
||||||
val list = it.args[0] as MutableList<*>
|
val list = it.args[0] as MutableList<*>
|
||||||
val size = list.size
|
val size = list.size
|
||||||
hasEnable("hide_sim_two_icon", extraCondition = { size == 2 }) {
|
hasEnable("hide_sim_two_icon", extraCondition = { size == 2 }) {
|
||||||
@@ -18,5 +18,4 @@ object HideSimIcon: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,25 +2,27 @@ package com.lt2333.simplicitytools.hook.app.systemui
|
|||||||
|
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XC_MethodHook
|
import de.robv.android.xposed.XC_MethodHook
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object HideStatusBarIcon: HookRegister() {
|
class HideStatusBarIcon : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
|
||||||
override fun init() {
|
|
||||||
"com.android.systemui.statusbar.phone.StatusBarIconControllerImpl".hookBeforeMethod(
|
"com.android.systemui.statusbar.phone.StatusBarIconControllerImpl".hookBeforeMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"setIconVisibility",
|
"setIconVisibility",
|
||||||
String::class.java,
|
String::class.java,
|
||||||
Boolean::class.java
|
Boolean::class.java
|
||||||
) { hideIcon(it) }
|
) { hideIcon(it) }
|
||||||
|
|
||||||
"com.android.systemui.statusbar.phone.MiuiDripLeftStatusBarIconControllerImpl".hookBeforeMethod(
|
"com.android.systemui.statusbar.phone.MiuiDripLeftStatusBarIconControllerImpl".hookBeforeMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"setIconVisibility",
|
"setIconVisibility",
|
||||||
String::class.java,
|
String::class.java,
|
||||||
Boolean::class.java
|
Boolean::class.java
|
||||||
) { hideIcon(it) }
|
) { hideIcon(it) }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hideIcon(it: XC_MethodHook.MethodHookParam) {
|
private fun hideIcon(it: XC_MethodHook.MethodHookParam) {
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ package com.lt2333.simplicitytools.hook.app.systemui
|
|||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.isNonNull
|
import com.lt2333.simplicitytools.util.isNonNull
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object HideStatusBarNetworkSpeedSecond: HookRegister() {
|
class HideStatusBarNetworkSpeedSecond :IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
"com.android.systemui.statusbar.views.NetworkSpeedView".hookBeforeMethod(lpparam.classLoader, "setNetworkSpeed", String::class.java) {
|
||||||
"com.android.systemui.statusbar.views.NetworkSpeedView".hookBeforeMethod(getDefaultClassLoader(), "setNetworkSpeed", String::class.java) {
|
|
||||||
hasEnable("hide_status_bar_network_speed_second") {
|
hasEnable("hide_status_bar_network_speed_second") {
|
||||||
it.args[0].isNonNull { s ->
|
it.args[0].isNonNull { s ->
|
||||||
it.args[0] = (s as String)
|
it.args[0] = (s as String)
|
||||||
@@ -19,5 +19,4 @@ object HideStatusBarNetworkSpeedSecond: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,13 +6,13 @@ import android.widget.TextView
|
|||||||
import com.lt2333.simplicitytools.util.getObjectField
|
import com.lt2333.simplicitytools.util.getObjectField
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object HideWifiActivityIcon: HookRegister() {
|
class HideWifiActivityIcon : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState"
|
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState"
|
||||||
"com.android.systemui.statusbar.StatusBarWifiView".hookAfterMethod(getDefaultClassLoader(), "initViewState", iconState) {
|
"com.android.systemui.statusbar.StatusBarWifiView".hookAfterMethod(lpparam.classLoader, "initViewState", iconState) {
|
||||||
//隐藏WIFI箭头
|
//隐藏WIFI箭头
|
||||||
hasEnable("hide_wifi_activity_icon") {
|
hasEnable("hide_wifi_activity_icon") {
|
||||||
(it.thisObject.getObjectField("mWifiActivityView") as ImageView).visibility = View.INVISIBLE
|
(it.thisObject.getObjectField("mWifiActivityView") as ImageView).visibility = View.INVISIBLE
|
||||||
@@ -23,7 +23,7 @@ object HideWifiActivityIcon: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"com.android.systemui.statusbar.StatusBarWifiView".hookAfterMethod(getDefaultClassLoader(), "updateState", iconState) {
|
"com.android.systemui.statusbar.StatusBarWifiView".hookAfterMethod(lpparam.classLoader, "updateState", iconState) {
|
||||||
//隐藏WIFI箭头
|
//隐藏WIFI箭头
|
||||||
hasEnable("hide_wifi_activity_icon") {
|
hasEnable("hide_wifi_activity_icon") {
|
||||||
(it.thisObject.getObjectField("mWifiActivityView") as ImageView).visibility = View.INVISIBLE
|
(it.thisObject.getObjectField("mWifiActivityView") as ImageView).visibility = View.INVISIBLE
|
||||||
@@ -34,5 +34,4 @@ object HideWifiActivityIcon: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,18 +8,18 @@ import com.lt2333.simplicitytools.R
|
|||||||
import com.lt2333.simplicitytools.util.findClass
|
import com.lt2333.simplicitytools.util.findClass
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
import java.io.BufferedReader
|
import java.io.BufferedReader
|
||||||
import java.io.FileReader
|
import java.io.FileReader
|
||||||
import java.lang.reflect.Method
|
import java.lang.reflect.Method
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
object LockScreenCurrent : HookRegister() {
|
class LockScreenCurrent : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
hasEnable("lock_screen_charging_current") {
|
hasEnable("lock_screen_charging_current") {
|
||||||
"com.android.keyguard.charge.ChargeUtils".findClass(getDefaultClassLoader())
|
"com.android.keyguard.charge.ChargeUtils".findClass(lpparam.classLoader)
|
||||||
.hookAfterMethod(
|
.hookAfterMethod(
|
||||||
"getChargingHintText",
|
"getChargingHintText",
|
||||||
Context::class.java,
|
Context::class.java,
|
||||||
@@ -28,7 +28,7 @@ object LockScreenCurrent : HookRegister() {
|
|||||||
) {
|
) {
|
||||||
it.result = getCurrent() + "\n" + it.result
|
it.result = getCurrent() + "\n" + it.result
|
||||||
}
|
}
|
||||||
"com.android.systemui.statusbar.phone.KeyguardBottomAreaView".findClass(getDefaultClassLoader())
|
"com.android.systemui.statusbar.phone.KeyguardBottomAreaView".findClass(lpparam.classLoader)
|
||||||
.hookAfterMethod(
|
.hookAfterMethod(
|
||||||
"onFinishInflate"
|
"onFinishInflate"
|
||||||
) {
|
) {
|
||||||
@@ -105,5 +105,4 @@ object LockScreenCurrent : HookRegister() {
|
|||||||
}
|
}
|
||||||
return defaultValue
|
return defaultValue
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,16 +10,16 @@ import android.view.View.OnTouchListener
|
|||||||
import com.lt2333.simplicitytools.util.findClass
|
import com.lt2333.simplicitytools.util.findClass
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object LockScreenDoubleTapToSleep: HookRegister() {
|
class LockScreenDoubleTapToSleep : IXposedHookLoadPackage {
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
override fun init() {
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
hasEnable("lock_screen_double_tap_to_sleep") {
|
hasEnable("lock_screen_double_tap_to_sleep") {
|
||||||
"com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer".findClass(
|
"com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer".findClass(
|
||||||
getDefaultClassLoader()
|
lpparam.classLoader
|
||||||
).hookBeforeMethod("onFinishInflate") {
|
).hookBeforeMethod("onFinishInflate") {
|
||||||
val view = it.thisObject as View
|
val view = it.thisObject as View
|
||||||
XposedHelpers.setAdditionalInstanceField(view, "currentTouchTime", 0L)
|
XposedHelpers.setAdditionalInstanceField(view, "currentTouchTime", 0L)
|
||||||
@@ -68,5 +68,4 @@ object LockScreenDoubleTapToSleep: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,18 +11,20 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
|||||||
import cn.fkj233.ui.activity.dp2px
|
import cn.fkj233.ui.activity.dp2px
|
||||||
import com.github.kyuubiran.ezxhelper.utils.loadClass
|
import com.github.kyuubiran.ezxhelper.utils.loadClass
|
||||||
import com.lt2333.simplicitytools.util.*
|
import com.lt2333.simplicitytools.util.*
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
|
||||||
import com.lt2333.simplicitytools.view.WeatherView
|
import com.lt2333.simplicitytools.view.WeatherView
|
||||||
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object NotificationWeather: HookRegister() {
|
class NotificationWeather : IXposedHookLoadPackage {
|
||||||
|
|
||||||
override fun init() {
|
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
hasEnable("notification_weather") {
|
hasEnable("notification_weather") {
|
||||||
var mWeatherView: TextView? = null
|
var mWeatherView: TextView? = null
|
||||||
var mConstraintLayout: ConstraintLayout? = null
|
var mConstraintLayout: ConstraintLayout? = null
|
||||||
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
|
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
|
||||||
"com.android.systemui.qs.MiuiNotificationHeaderView".hookAfterMethod(
|
"com.android.systemui.qs.MiuiNotificationHeaderView".hookAfterMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"onFinishInflate"
|
"onFinishInflate"
|
||||||
) {
|
) {
|
||||||
val viewGroup = it.thisObject as ViewGroup
|
val viewGroup = it.thisObject as ViewGroup
|
||||||
@@ -185,7 +187,7 @@ object NotificationWeather: HookRegister() {
|
|||||||
}
|
}
|
||||||
//解决横屏重叠
|
//解决横屏重叠
|
||||||
"com.android.systemui.qs.MiuiNotificationHeaderView".hookAfterMethod(
|
"com.android.systemui.qs.MiuiNotificationHeaderView".hookAfterMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"updateLayout"
|
"updateLayout"
|
||||||
) {
|
) {
|
||||||
val viewGroup = it.thisObject as ViewGroup
|
val viewGroup = it.thisObject as ViewGroup
|
||||||
@@ -220,5 +222,4 @@ object NotificationWeather: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,17 +8,17 @@ import android.widget.TextView
|
|||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import com.github.kyuubiran.ezxhelper.utils.loadClass
|
import com.github.kyuubiran.ezxhelper.utils.loadClass
|
||||||
import com.lt2333.simplicitytools.util.*
|
import com.lt2333.simplicitytools.util.*
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
|
||||||
import com.lt2333.simplicitytools.view.WeatherView
|
import com.lt2333.simplicitytools.view.WeatherView
|
||||||
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object OldNotificationWeather: HookRegister() {
|
class OldNotificationWeather : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
hasEnable("notification_weather") {
|
hasEnable("notification_weather") {
|
||||||
var mWeatherView: TextView? = null
|
var mWeatherView: TextView? = null
|
||||||
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
|
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
|
||||||
"com.android.systemui.qs.MiuiQSHeaderView".hookAfterMethod(
|
"com.android.systemui.qs.MiuiQSHeaderView".hookAfterMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"onFinishInflate"
|
"onFinishInflate"
|
||||||
) {
|
) {
|
||||||
val viewGroup = it.thisObject as ViewGroup
|
val viewGroup = it.thisObject as ViewGroup
|
||||||
@@ -84,7 +84,7 @@ object OldNotificationWeather: HookRegister() {
|
|||||||
}
|
}
|
||||||
//解决横屏重叠
|
//解决横屏重叠
|
||||||
"com.android.systemui.qs.MiuiQSHeaderView".hookAfterMethod(
|
"com.android.systemui.qs.MiuiQSHeaderView".hookAfterMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"updateLayout"
|
"updateLayout"
|
||||||
) {
|
) {
|
||||||
val mOritation = it.thisObject.getObjectField("mOrientation") as Int
|
val mOritation = it.thisObject.getObjectField("mOrientation") as Int
|
||||||
@@ -96,6 +96,5 @@ object OldNotificationWeather: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import com.lt2333.simplicitytools.util.XSPUtils
|
|||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object OldQSCustom: HookRegister() {
|
class OldQSCustom : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
hasEnable("old_qs_custom_switch") {
|
hasEnable("old_qs_custom_switch") {
|
||||||
val mRows = XSPUtils.getInt("qs_custom_rows", 3)
|
val mRows = XSPUtils.getInt("qs_custom_rows", 3)
|
||||||
val mRowsHorizontal = XSPUtils.getInt("qs_custom_rows_horizontal", 2)
|
val mRowsHorizontal = XSPUtils.getInt("qs_custom_rows_horizontal", 2)
|
||||||
@@ -19,7 +19,7 @@ object OldQSCustom: HookRegister() {
|
|||||||
val mColumnsUnexpanded = XSPUtils.getInt("qs_custom_columns_unexpanded", 5)
|
val mColumnsUnexpanded = XSPUtils.getInt("qs_custom_columns_unexpanded", 5)
|
||||||
|
|
||||||
"com.android.systemui.qs.MiuiQuickQSPanel".hookBeforeMethod(
|
"com.android.systemui.qs.MiuiQuickQSPanel".hookBeforeMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"setMaxTiles", Int::class.java
|
"setMaxTiles", Int::class.java
|
||||||
) {
|
) {
|
||||||
//未展开时的列数
|
//未展开时的列数
|
||||||
@@ -27,14 +27,14 @@ object OldQSCustom: HookRegister() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
"com.android.systemui.qs.MiuiTileLayout".hookAfterMethod(
|
"com.android.systemui.qs.MiuiTileLayout".hookAfterMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"updateColumns"
|
"updateColumns"
|
||||||
) {
|
) {
|
||||||
//展开时的列数
|
//展开时的列数
|
||||||
XposedHelpers.setObjectField(it.thisObject, "mColumns", mColumns)
|
XposedHelpers.setObjectField(it.thisObject, "mColumns", mColumns)
|
||||||
}
|
}
|
||||||
"com.android.systemui.qs.MiuiTileLayout".hookAfterMethod(
|
"com.android.systemui.qs.MiuiTileLayout".hookAfterMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"updateResources"
|
"updateResources"
|
||||||
) {
|
) {
|
||||||
//展开时的行数
|
//展开时的行数
|
||||||
@@ -49,5 +49,4 @@ object OldQSCustom: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,30 +6,30 @@ import com.lt2333.simplicitytools.util.getObjectField
|
|||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object RemoveLockScreenCamera: HookRegister() {
|
class RemoveLockScreenCamera : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
|
||||||
override fun init() {
|
|
||||||
//屏蔽右下角组件显示
|
//屏蔽右下角组件显示
|
||||||
"com.android.systemui.statusbar.phone.KeyguardBottomAreaView".hookAfterMethod(getDefaultClassLoader(), "onFinishInflate") {
|
"com.android.systemui.statusbar.phone.KeyguardBottomAreaView".hookAfterMethod(lpparam.classLoader, "onFinishInflate") {
|
||||||
hasEnable("remove_lock_screen_camera") {
|
hasEnable("remove_lock_screen_camera") {
|
||||||
(it.thisObject.getObjectField("mRightAffordanceViewLayout") as LinearLayout).visibility = View.GONE
|
(it.thisObject.getObjectField("mRightAffordanceViewLayout") as LinearLayout).visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//屏蔽滑动撞墙动画
|
//屏蔽滑动撞墙动画
|
||||||
"com.android.keyguard.KeyguardMoveRightController".hookBeforeMethod(getDefaultClassLoader(), "onTouchMove", Float::class.java, Float::class.java) {
|
"com.android.keyguard.KeyguardMoveRightController".hookBeforeMethod(lpparam.classLoader, "onTouchMove", Float::class.java, Float::class.java) {
|
||||||
hasEnable("remove_lock_screen_camera") {
|
hasEnable("remove_lock_screen_camera") {
|
||||||
it.result = false
|
it.result = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"com.android.keyguard.KeyguardMoveRightController".hookBeforeMethod(getDefaultClassLoader(), "reset") {
|
"com.android.keyguard.KeyguardMoveRightController".hookBeforeMethod(lpparam.classLoader, "reset") {
|
||||||
hasEnable("remove_lock_screen_camera") {
|
hasEnable("remove_lock_screen_camera") {
|
||||||
it.result = null
|
it.result = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,16 +2,15 @@ package com.lt2333.simplicitytools.hook.app.systemui
|
|||||||
|
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object RemoveTheLeftSideOfTheLockScreen: HookRegister() {
|
class RemoveTheLeftSideOfTheLockScreen : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
"com.android.keyguard.negative.MiuiKeyguardMoveLeftViewContainer".hookBeforeMethod(lpparam.classLoader, "inflateLeftView") {
|
||||||
"com.android.keyguard.negative.MiuiKeyguardMoveLeftViewContainer".hookBeforeMethod(getDefaultClassLoader(), "inflateLeftView") {
|
|
||||||
hasEnable("remove_the_left_side_of_the_lock_screen") {
|
hasEnable("remove_the_left_side_of_the_lock_screen") {
|
||||||
it.result = null
|
it.result = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,13 +4,13 @@ import com.lt2333.simplicitytools.util.callMethod
|
|||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.replaceMethod
|
import com.lt2333.simplicitytools.util.replaceMethod
|
||||||
import com.lt2333.simplicitytools.util.setIntField
|
import com.lt2333.simplicitytools.util.setIntField
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object RemoveTheMaximumNumberOfNotificationIcons: HookRegister() {
|
class RemoveTheMaximumNumberOfNotificationIcons : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
|
||||||
hasEnable("remove_the_maximum_number_of_notification_icons") {
|
hasEnable("remove_the_maximum_number_of_notification_icons") {
|
||||||
"com.android.systemui.statusbar.phone.NotificationIconContainer".replaceMethod(getDefaultClassLoader(), "miuiShowNotificationIcons", Boolean::class.java) {
|
"com.android.systemui.statusbar.phone.NotificationIconContainer".replaceMethod(lpparam.classLoader, "miuiShowNotificationIcons", Boolean::class.java) {
|
||||||
if (it.args[0] as Boolean) {
|
if (it.args[0] as Boolean) {
|
||||||
it.thisObject.setIntField("MAX_DOTS", 30)
|
it.thisObject.setIntField("MAX_DOTS", 30)
|
||||||
it.thisObject.setIntField("MAX_STATIC_ICONS", 30)
|
it.thisObject.setIntField("MAX_STATIC_ICONS", 30)
|
||||||
@@ -24,5 +24,4 @@ object RemoveTheMaximumNumberOfNotificationIcons: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -13,57 +13,57 @@ import com.lt2333.simplicitytools.util.XSPUtils
|
|||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
|
|
||||||
object StatusBarBigMobileTypeIcon: HookRegister() {
|
class StatusBarBigMobileTypeIcon : IXposedHookLoadPackage {
|
||||||
|
val upAndDownPosition = XSPUtils.getInt("big_mobile_type_icon_up_and_down_position", 0)
|
||||||
|
val leftAndRightMargin = XSPUtils.getInt("big_mobile_type_icon_left_and_right_margins", 0)
|
||||||
|
val isBold = XSPUtils.getBoolean("big_mobile_type_icon_bold", true)
|
||||||
|
val size = XSPUtils.getFloat("big_mobile_type_icon_size", 12.5f)
|
||||||
|
|
||||||
private val upAndDownPosition = XSPUtils.getInt("big_mobile_type_icon_up_and_down_position", 0)
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
private val leftAndRightMargin = XSPUtils.getInt("big_mobile_type_icon_left_and_right_margins", 0)
|
|
||||||
private val isBold = XSPUtils.getBoolean("big_mobile_type_icon_bold", true)
|
|
||||||
private val size = XSPUtils.getFloat("big_mobile_type_icon_size", 12.5f)
|
|
||||||
|
|
||||||
override fun init() {
|
|
||||||
hasEnable("big_mobile_type_icon") {
|
hasEnable("big_mobile_type_icon") {
|
||||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
|
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"init"
|
"init"
|
||||||
) {
|
) {
|
||||||
val statusBarMobileView = it.thisObject as ViewGroup
|
val StatusBarMobileView = it.thisObject as ViewGroup
|
||||||
val context: Context = statusBarMobileView.context
|
val context: Context = StatusBarMobileView.context
|
||||||
val res: Resources = context.resources
|
val res: Resources = context.resources
|
||||||
|
|
||||||
//获取组件
|
//获取组件
|
||||||
val mobileContainerLeftId: Int =
|
val mobile_container_left_ID: Int =
|
||||||
res.getIdentifier("mobile_container_left", "id", "com.android.systemui")
|
res.getIdentifier("mobile_container_left", "id", "com.android.systemui")
|
||||||
val mobileContainerLeft =
|
val mobile_container_left =
|
||||||
statusBarMobileView.findViewById<ViewGroup>(mobileContainerLeftId)
|
StatusBarMobileView.findViewById<ViewGroup>(mobile_container_left_ID)
|
||||||
|
|
||||||
val mobileTypeId: Int =
|
val mobile_type_ID: Int =
|
||||||
res.getIdentifier("mobile_type", "id", "com.android.systemui")
|
res.getIdentifier("mobile_type", "id", "com.android.systemui")
|
||||||
val mobileType = statusBarMobileView.findViewById<TextView>(mobileTypeId)
|
val mobile_type = StatusBarMobileView.findViewById<TextView>(mobile_type_ID)
|
||||||
|
|
||||||
val mobileLeftMobileInoutId: Int = res.getIdentifier(
|
val mobile_left_mobile_inout_ID: Int = res.getIdentifier(
|
||||||
"mobile_left_mobile_inout",
|
"mobile_left_mobile_inout",
|
||||||
"id",
|
"id",
|
||||||
"com.android.systemui"
|
"com.android.systemui"
|
||||||
)
|
)
|
||||||
val mobileLeftMobileInout =
|
val mobile_left_mobile_inout =
|
||||||
statusBarMobileView.findViewById<ImageView>(mobileLeftMobileInoutId)
|
StatusBarMobileView.findViewById<ImageView>(mobile_left_mobile_inout_ID)
|
||||||
|
|
||||||
|
|
||||||
//获取插入位置
|
//获取插入位置
|
||||||
val mobileContainerRightId: Int = res.getIdentifier(
|
val mobile_container_right_ID: Int = res.getIdentifier(
|
||||||
"mobile_container_right",
|
"mobile_container_right",
|
||||||
"id",
|
"id",
|
||||||
"com.android.systemui"
|
"com.android.systemui"
|
||||||
)
|
)
|
||||||
val mobileContainerRight =
|
val mobile_container_right =
|
||||||
statusBarMobileView.findViewById<ViewGroup>(mobileContainerRightId)
|
StatusBarMobileView.findViewById<ViewGroup>(mobile_container_right_ID)
|
||||||
val rightParentLayout = mobileContainerRight.parent as ViewGroup
|
val RightParentLayout = mobile_container_right.parent as ViewGroup
|
||||||
val mobileContainerRightIndex =
|
val mobile_container_right_Index =
|
||||||
rightParentLayout.indexOfChild(mobileContainerRight)
|
RightParentLayout.indexOfChild(mobile_container_right)
|
||||||
|
|
||||||
//创建新布局
|
//创建新布局
|
||||||
val newLinearLayoutLP = LinearLayout.LayoutParams(
|
val newLinearLayoutLP = LinearLayout.LayoutParams(
|
||||||
@@ -74,50 +74,50 @@ object StatusBarBigMobileTypeIcon: HookRegister() {
|
|||||||
}
|
}
|
||||||
val newLinearlayout = LinearLayout(context).also {
|
val newLinearlayout = LinearLayout(context).also {
|
||||||
it.layoutParams = newLinearLayoutLP
|
it.layoutParams = newLinearLayoutLP
|
||||||
it.id = mobileContainerLeftId
|
it.id = mobile_container_left_ID
|
||||||
it.setPadding(leftAndRightMargin, 0, leftAndRightMargin, 0)
|
it.setPadding(leftAndRightMargin, 0, leftAndRightMargin, 0)
|
||||||
}
|
}
|
||||||
XposedHelpers.setObjectField(it.thisObject, "mMobileLeftContainer", newLinearlayout)
|
XposedHelpers.setObjectField(it.thisObject, "mMobileLeftContainer", newLinearlayout)
|
||||||
rightParentLayout.addView(
|
RightParentLayout.addView(
|
||||||
newLinearlayout,
|
newLinearlayout,
|
||||||
mobileContainerRightIndex
|
mobile_container_right_Index
|
||||||
)
|
)
|
||||||
|
|
||||||
//将组件插入新的布局
|
//将组件插入新的布局
|
||||||
(mobileType.parent as ViewGroup).removeView(mobileType)
|
(mobile_type.parent as ViewGroup).removeView(mobile_type)
|
||||||
(mobileLeftMobileInout.parent as ViewGroup).removeView(mobileLeftMobileInout)
|
(mobile_left_mobile_inout.parent as ViewGroup).removeView(mobile_left_mobile_inout)
|
||||||
(mobileContainerLeft.parent as ViewGroup).removeView(mobileContainerLeft)
|
(mobile_container_left.parent as ViewGroup).removeView(mobile_container_left)
|
||||||
|
|
||||||
|
|
||||||
newLinearlayout.addView(mobileType) //类型
|
newLinearlayout.addView(mobile_type) //类型
|
||||||
val mobileTypeLp = LinearLayout.LayoutParams(
|
val mobile_type_lp = LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
).also {
|
).also {
|
||||||
it.gravity = Gravity.CENTER_VERTICAL
|
it.gravity = Gravity.CENTER_VERTICAL
|
||||||
it.topMargin = upAndDownPosition
|
it.topMargin = upAndDownPosition
|
||||||
}
|
}
|
||||||
mobileType.also {
|
mobile_type.also {
|
||||||
it.setTextSize(TypedValue.COMPLEX_UNIT_DIP, size)
|
it.setTextSize(TypedValue.COMPLEX_UNIT_DIP, size)
|
||||||
if (isBold) {
|
if (isBold) {
|
||||||
it.typeface = Typeface.DEFAULT_BOLD
|
it.typeface = Typeface.DEFAULT_BOLD
|
||||||
}
|
}
|
||||||
it.layoutParams = mobileTypeLp
|
it.layoutParams = mobile_type_lp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
newLinearlayout.addView(mobileLeftMobileInout) //箭头
|
newLinearlayout.addView(mobile_left_mobile_inout) //箭头
|
||||||
val mobileLeftMobileInoutLp = LinearLayout.LayoutParams(
|
val mobile_left_mobile_inout_lp = LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT
|
LinearLayout.LayoutParams.MATCH_PARENT
|
||||||
)
|
)
|
||||||
mobileLeftMobileInout.also {
|
mobile_left_mobile_inout.also {
|
||||||
it.layoutParams = mobileLeftMobileInoutLp
|
it.layoutParams = mobile_left_mobile_inout_lp
|
||||||
}
|
}
|
||||||
|
|
||||||
//屏蔽更新布局
|
//屏蔽更新布局
|
||||||
"com.android.systemui.statusbar.StatusBarMobileView".hookBeforeMethod(
|
"com.android.systemui.statusbar.StatusBarMobileView".hookBeforeMethod(
|
||||||
getDefaultClassLoader(),
|
lpparam.classLoader,
|
||||||
"updateMobileTypeLayout", String::class.java
|
"updateMobileTypeLayout", String::class.java
|
||||||
) {
|
) {
|
||||||
it.result = null
|
it.result = null
|
||||||
@@ -125,5 +125,4 @@ object StatusBarBigMobileTypeIcon: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -9,16 +9,16 @@ import android.view.ViewGroup
|
|||||||
import com.lt2333.simplicitytools.util.findClass
|
import com.lt2333.simplicitytools.util.findClass
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object StatusBarDoubleTapToSleep: HookRegister() {
|
class StatusBarDoubleTapToSleep : IXposedHookLoadPackage {
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
override fun init() {
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
hasEnable("status_bar_double_tap_to_sleep") {
|
hasEnable("status_bar_double_tap_to_sleep") {
|
||||||
"com.android.systemui.statusbar.phone.MiuiPhoneStatusBarView".findClass(
|
"com.android.systemui.statusbar.phone.MiuiPhoneStatusBarView".findClass(
|
||||||
getDefaultClassLoader()
|
lpparam.classLoader
|
||||||
).hookBeforeMethod(
|
).hookBeforeMethod(
|
||||||
"onFinishInflate"
|
"onFinishInflate"
|
||||||
) {
|
) {
|
||||||
@@ -65,5 +65,4 @@ object StatusBarDoubleTapToSleep: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app.systemui
|
package com.lt2333.simplicitytools.hook.app.systemui
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
import android.content.res.Resources
|
import android.content.res.Resources
|
||||||
@@ -10,32 +9,31 @@ import android.view.View
|
|||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import android.widget.TextView
|
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import com.lt2333.simplicitytools.util.XSPUtils
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.findClass
|
import com.lt2333.simplicitytools.util.findClass
|
||||||
import com.lt2333.simplicitytools.util.getObjectField
|
import com.lt2333.simplicitytools.util.getObjectField
|
||||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
@SuppressLint("StaticFieldLeak")
|
class StatusBarLayout : IXposedHookLoadPackage {
|
||||||
object StatusBarLayout: HookRegister() {
|
|
||||||
|
|
||||||
private var mLeftLayout: LinearLayout? = null
|
private var mLeftLayout: LinearLayout? = null
|
||||||
private var mRightLayout: LinearLayout? = null
|
private var mRightLayout: LinearLayout? = null
|
||||||
private var mCenterLayout: LinearLayout? = null
|
private var mCenterLayout: LinearLayout? = null
|
||||||
private var statusBar: ViewGroup? = null
|
private var status_bar: ViewGroup? = null
|
||||||
|
|
||||||
private var statusBarLeft = 0
|
private var status_bar_left = 0
|
||||||
private var statusBarTop = 0
|
private var status_bar_top = 0
|
||||||
private var statusBarRight = 0
|
private var status_bar_right = 0
|
||||||
private var statusBarBottom = 0
|
private var status_bar_bottom = 0
|
||||||
|
|
||||||
override fun init() {
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
if (!XSPUtils.getBoolean("status_bar_time_center", false)) return
|
if (!XSPUtils.getBoolean("status_bar_time_center", false)) return
|
||||||
|
|
||||||
val collapsedStatusBarFragmentClass =
|
val collapsedStatusBarFragmentClass =
|
||||||
"com.android.systemui.statusbar.phone.CollapsedStatusBarFragment".findClass(getDefaultClassLoader())
|
"com.android.systemui.statusbar.phone.CollapsedStatusBarFragment".findClass(lpparam.classLoader)
|
||||||
|
|
||||||
collapsedStatusBarFragmentClass.hookAfterMethod(
|
collapsedStatusBarFragmentClass.hookAfterMethod(
|
||||||
"onViewCreated",
|
"onViewCreated",
|
||||||
@@ -46,36 +44,36 @@ object StatusBarLayout: HookRegister() {
|
|||||||
param.thisObject.getObjectField("mStatusBar") as ViewGroup
|
param.thisObject.getObjectField("mStatusBar") as ViewGroup
|
||||||
val context: Context = MiuiPhoneStatusBarView.context
|
val context: Context = MiuiPhoneStatusBarView.context
|
||||||
val res: Resources = MiuiPhoneStatusBarView.resources
|
val res: Resources = MiuiPhoneStatusBarView.resources
|
||||||
val statusBarId: Int = res.getIdentifier("status_bar", "id", "com.android.systemui")
|
val status_bar_ID: Int = res.getIdentifier("status_bar", "id", "com.android.systemui")
|
||||||
val statusBarContentsId: Int =
|
val status_bar_contents_ID: Int =
|
||||||
res.getIdentifier("status_bar_contents", "id", "com.android.systemui")
|
res.getIdentifier("status_bar_contents", "id", "com.android.systemui")
|
||||||
val systemIconAreaId: Int =
|
val system_icon_area_ID: Int =
|
||||||
res.getIdentifier("system_icon_area", "id", "com.android.systemui")
|
res.getIdentifier("system_icon_area", "id", "com.android.systemui")
|
||||||
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
val clock_ID: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||||
val phoneStatusBarLeftContainerId: Int =
|
val phone_status_bar_left_container_ID: Int =
|
||||||
res.getIdentifier("phone_status_bar_left_container", "id", "com.android.systemui")
|
res.getIdentifier("phone_status_bar_left_container", "id", "com.android.systemui")
|
||||||
val notificationIconAreaInnerId: Int =
|
val fullscreen_notification_icon_area_ID: Int =
|
||||||
res.getIdentifier("notification_icon_area_inner", "id", "com.android.systemui")
|
res.getIdentifier("fullscreen_notification_icon_area", "id", "com.android.systemui")
|
||||||
statusBar = MiuiPhoneStatusBarView.findViewById(statusBarId)
|
status_bar = MiuiPhoneStatusBarView.findViewById(status_bar_ID)
|
||||||
val statusBarContents: ViewGroup =
|
val status_bar_contents: ViewGroup =
|
||||||
MiuiPhoneStatusBarView.findViewById(statusBarContentsId)
|
MiuiPhoneStatusBarView.findViewById(status_bar_contents_ID)
|
||||||
if (statusBar == null) return@hookAfterMethod
|
if (status_bar == null) return@hookAfterMethod
|
||||||
val clock: TextView = MiuiPhoneStatusBarView.findViewById(clockId)
|
val Clock: View = MiuiPhoneStatusBarView.findViewById(clock_ID)
|
||||||
val phoneStatusBarLeftContainer: ViewGroup =
|
val phone_status_bar_left_container: ViewGroup =
|
||||||
MiuiPhoneStatusBarView.findViewById(phoneStatusBarLeftContainerId)
|
MiuiPhoneStatusBarView.findViewById(phone_status_bar_left_container_ID)
|
||||||
val notificationIconAreaInner: ViewGroup =
|
val fullscreen_notification_icon_area: ViewGroup =
|
||||||
MiuiPhoneStatusBarView.findViewById(notificationIconAreaInnerId)
|
MiuiPhoneStatusBarView.findViewById(fullscreen_notification_icon_area_ID)
|
||||||
val systemIconArea: ViewGroup =
|
val system_icon_area: ViewGroup =
|
||||||
MiuiPhoneStatusBarView.findViewById(systemIconAreaId)
|
MiuiPhoneStatusBarView.findViewById(system_icon_area_ID)
|
||||||
|
|
||||||
(clock.parent as ViewGroup).removeView(clock)
|
(Clock.parent as ViewGroup).removeView(Clock)
|
||||||
(phoneStatusBarLeftContainer.parent as ViewGroup).removeView(
|
(phone_status_bar_left_container.parent as ViewGroup).removeView(
|
||||||
phoneStatusBarLeftContainer
|
phone_status_bar_left_container
|
||||||
)
|
)
|
||||||
(notificationIconAreaInner.parent as ViewGroup).removeView(
|
(fullscreen_notification_icon_area.parent as ViewGroup).removeView(
|
||||||
notificationIconAreaInner
|
fullscreen_notification_icon_area
|
||||||
)
|
)
|
||||||
(systemIconArea.parent as ViewGroup).removeView(systemIconArea)
|
(system_icon_area.parent as ViewGroup).removeView(system_icon_area)
|
||||||
|
|
||||||
val mConstraintLayoutLp = ConstraintLayout.LayoutParams(
|
val mConstraintLayoutLp = ConstraintLayout.LayoutParams(
|
||||||
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
||||||
@@ -85,14 +83,14 @@ object StatusBarLayout: HookRegister() {
|
|||||||
val mConstraintLayout =
|
val mConstraintLayout =
|
||||||
ConstraintLayout(context).also { it.layoutParams = mConstraintLayoutLp }
|
ConstraintLayout(context).also { it.layoutParams = mConstraintLayoutLp }
|
||||||
|
|
||||||
mConstraintLayout.addView(notificationIconAreaInner)
|
mConstraintLayout.addView(fullscreen_notification_icon_area)
|
||||||
|
|
||||||
val fullscreen_notification_icon_area_lp = LinearLayout.LayoutParams(
|
val fullscreen_notification_icon_area_lp = FrameLayout.LayoutParams(
|
||||||
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
||||||
ConstraintLayout.LayoutParams.MATCH_PARENT
|
ConstraintLayout.LayoutParams.MATCH_PARENT
|
||||||
)
|
)
|
||||||
|
|
||||||
notificationIconAreaInner.layoutParams = fullscreen_notification_icon_area_lp
|
fullscreen_notification_icon_area.layoutParams = fullscreen_notification_icon_area_lp
|
||||||
|
|
||||||
//增加一个左对齐布局
|
//增加一个左对齐布局
|
||||||
mLeftLayout = LinearLayout(context)
|
mLeftLayout = LinearLayout(context)
|
||||||
@@ -114,30 +112,30 @@ object StatusBarLayout: HookRegister() {
|
|||||||
LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f)
|
LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f)
|
||||||
mRightLayout!!.layoutParams = RightLp
|
mRightLayout!!.layoutParams = RightLp
|
||||||
mRightLayout!!.gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
mRightLayout!!.gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
||||||
mLeftLayout!!.addView(phoneStatusBarLeftContainer)
|
mLeftLayout!!.addView(phone_status_bar_left_container)
|
||||||
mLeftLayout!!.addView(mConstraintLayout)
|
mLeftLayout!!.addView(mConstraintLayout)
|
||||||
|
|
||||||
mCenterLayout!!.addView(clock)
|
mCenterLayout!!.addView(Clock)
|
||||||
mRightLayout!!.addView(systemIconArea)
|
mRightLayout!!.addView(system_icon_area)
|
||||||
statusBarContents.addView(mLeftLayout, 0)
|
status_bar_contents.addView(mLeftLayout, 0)
|
||||||
statusBarContents.addView(mCenterLayout)
|
status_bar_contents.addView(mCenterLayout)
|
||||||
statusBarContents.addView(mRightLayout)
|
status_bar_contents.addView(mRightLayout)
|
||||||
|
|
||||||
statusBarLeft = statusBar!!.paddingLeft
|
status_bar_left = status_bar!!.paddingLeft
|
||||||
statusBarTop = statusBar!!.paddingTop
|
status_bar_top = status_bar!!.paddingTop
|
||||||
statusBarRight = statusBar!!.paddingRight
|
status_bar_right = status_bar!!.paddingRight
|
||||||
statusBarBottom = statusBar!!.paddingBottom
|
status_bar_bottom = status_bar!!.paddingBottom
|
||||||
|
|
||||||
|
|
||||||
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
|
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
|
||||||
val customLeftMargin = XSPUtils.getInt("status_bar_left_margin", 0)
|
val custom_left_margin = XSPUtils.getInt("status_bar_left_margin", 0)
|
||||||
if (customLeftMargin != 0) {
|
if (custom_left_margin != 0) {
|
||||||
statusBarLeft = customLeftMargin
|
status_bar_left = custom_left_margin
|
||||||
}
|
}
|
||||||
|
|
||||||
val customRightMargin = XSPUtils.getInt("status_bar_right_margin", 0)
|
val custom_right_margin = XSPUtils.getInt("status_bar_right_margin", 0)
|
||||||
if (customRightMargin != 0) {
|
if (custom_right_margin != 0) {
|
||||||
statusBarRight = customRightMargin
|
status_bar_right = custom_right_margin
|
||||||
}
|
}
|
||||||
updateLayout(context)
|
updateLayout(context)
|
||||||
}
|
}
|
||||||
@@ -145,7 +143,7 @@ object StatusBarLayout: HookRegister() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val phoneStatusBarViewClass =
|
val phoneStatusBarViewClass =
|
||||||
"com.android.systemui.statusbar.phone.PhoneStatusBarView".findClass(getDefaultClassLoader())
|
"com.android.systemui.statusbar.phone.PhoneStatusBarView".findClass(lpparam.classLoader)
|
||||||
|
|
||||||
phoneStatusBarViewClass.hookAfterMethod("updateLayoutForCutout") {
|
phoneStatusBarViewClass.hookAfterMethod("updateLayoutForCutout") {
|
||||||
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
|
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
|
||||||
@@ -153,32 +151,21 @@ object StatusBarLayout: HookRegister() {
|
|||||||
updateLayout(context)
|
updateLayout(context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val miuiPhoneStatusBarViewClass =
|
|
||||||
"com.android.systemui.statusbar.phone.MiuiPhoneStatusBarView".findClass(getDefaultClassLoader())
|
|
||||||
|
|
||||||
miuiPhoneStatusBarViewClass.hookAfterMethod("updateNotificationIconAreaInnnerParent") {
|
|
||||||
val viewGroup = it.thisObject as ViewGroup
|
|
||||||
val fullscreen_notification_icon_area_lp = FrameLayout.LayoutParams(
|
|
||||||
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
|
||||||
ConstraintLayout.LayoutParams.MATCH_PARENT
|
|
||||||
)
|
|
||||||
viewGroup.layoutParams = fullscreen_notification_icon_area_lp
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun updateLayout(context: Context) {
|
fun updateLayout(context: Context) {
|
||||||
//判断屏幕方向
|
//判断屏幕方向
|
||||||
val mConfiguration: Configuration = context.resources.configuration
|
val mConfiguration: Configuration = context.resources.configuration
|
||||||
if (mConfiguration.orientation == Configuration.ORIENTATION_PORTRAIT) {
|
if (mConfiguration.orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||||
mLeftLayout!!.setPadding(statusBarLeft, 0, 0, 0)
|
mLeftLayout!!.setPadding(status_bar_left, 0, 0, 0)
|
||||||
mRightLayout!!.setPadding(0, 0, statusBarRight, 0)
|
mRightLayout!!.setPadding(0, 0, status_bar_right, 0)
|
||||||
statusBar!!.setPadding(0, statusBarTop, 0, statusBarBottom)
|
status_bar!!.setPadding(0, status_bar_top, 0, status_bar_bottom)
|
||||||
} else {
|
} else {
|
||||||
//横屏状态
|
//横屏状态
|
||||||
mLeftLayout!!.setPadding(175, 0, 0, 0)
|
mLeftLayout!!.setPadding(175, 0, 0, 0)
|
||||||
mRightLayout!!.setPadding(0, 0, 175, 0)
|
mRightLayout!!.setPadding(0, 0, 175, 0)
|
||||||
statusBar!!.setPadding(0, statusBarTop, 0, statusBarBottom)
|
status_bar!!.setPadding(0, status_bar_top, 0, status_bar_bottom)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,16 +2,15 @@ package com.lt2333.simplicitytools.hook.app.systemui
|
|||||||
|
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object StatusBarNetworkSpeedRefreshSpeed: HookRegister() {
|
class StatusBarNetworkSpeedRefreshSpeed :IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
"com.android.systemui.statusbar.policy.NetworkSpeedController".hookBeforeMethod(lpparam.classLoader, "postUpdateNetworkSpeedDelay", Long::class.java) {
|
||||||
"com.android.systemui.statusbar.policy.NetworkSpeedController".hookBeforeMethod(getDefaultClassLoader(), "postUpdateNetworkSpeedDelay", Long::class.java) {
|
|
||||||
hasEnable("status_bar_network_speed_refresh_speed") {
|
hasEnable("status_bar_network_speed_refresh_speed") {
|
||||||
it.args[0] = 1000L
|
it.args[0] = 1000L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,23 +2,22 @@ package com.lt2333.simplicitytools.hook.app.systemui
|
|||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.res.Resources
|
|
||||||
import android.os.Bundle
|
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.util.TypedValue
|
import android.util.TypedValue
|
||||||
import android.view.Gravity
|
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.lt2333.simplicitytools.util.*
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import com.lt2333.simplicitytools.util.findClass
|
||||||
|
import com.lt2333.simplicitytools.util.hookAfterConstructor
|
||||||
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
import java.lang.reflect.Method
|
import java.lang.reflect.Method
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
object StatusBarTimeCustomization : HookRegister() {
|
class StatusBarTimeCustomization : IXposedHookLoadPackage {
|
||||||
|
|
||||||
private val isYear = XSPUtils.getBoolean("status_bar_time_year", false)
|
private val isYear = XSPUtils.getBoolean("status_bar_time_year", false)
|
||||||
private val isMonth = XSPUtils.getBoolean("status_bar_time_month", false)
|
private val isMonth = XSPUtils.getBoolean("status_bar_time_month", false)
|
||||||
@@ -31,18 +30,16 @@ object StatusBarTimeCustomization : HookRegister() {
|
|||||||
private val isPeriod = XSPUtils.getBoolean("status_bar_time_period", true)
|
private val isPeriod = XSPUtils.getBoolean("status_bar_time_period", true)
|
||||||
private val getClockSize = XSPUtils.getInt("status_bar_clock_size", 0)
|
private val getClockSize = XSPUtils.getInt("status_bar_clock_size", 0)
|
||||||
private val isOpen = XSPUtils.getBoolean("custom_clock_switch", false)
|
private val isOpen = XSPUtils.getBoolean("custom_clock_switch", false)
|
||||||
private val isCenterAlign =
|
|
||||||
XSPUtils.getBoolean("status_bar_time_double_line_center_align", false)
|
|
||||||
private val getClockDoubleSize = XSPUtils.getInt("status_bar_clock_double_line_size", 0)
|
private val getClockDoubleSize = XSPUtils.getInt("status_bar_clock_double_line_size", 0)
|
||||||
private var nowTime: Date? = null
|
private var now_time: Date? = null
|
||||||
private var str = ""
|
private var str = ""
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
override fun init() {
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
var c: Context? = null
|
var c: Context? = null
|
||||||
val miuiClockClass =
|
val miuiClockClass =
|
||||||
"com.android.systemui.statusbar.views.MiuiClock".findClass(getDefaultClassLoader())
|
"com.android.systemui.statusbar.views.MiuiClock".findClass(lpparam.classLoader)
|
||||||
miuiClockClass.hookAfterConstructor(
|
miuiClockClass.hookAfterConstructor(
|
||||||
Context::class.java,
|
Context::class.java,
|
||||||
AttributeSet::class.java,
|
AttributeSet::class.java,
|
||||||
@@ -55,16 +52,16 @@ object StatusBarTimeCustomization : HookRegister() {
|
|||||||
textV.isSingleLine = false
|
textV.isSingleLine = false
|
||||||
if (isDoubleLine) {
|
if (isDoubleLine) {
|
||||||
str = "\n"
|
str = "\n"
|
||||||
var clockDoubleLineSize = 7F
|
var clock_double_line_size = 7F
|
||||||
if (getClockDoubleSize != 0) {
|
if (getClockDoubleSize != 0) {
|
||||||
clockDoubleLineSize = getClockDoubleSize.toFloat()
|
clock_double_line_size = getClockDoubleSize.toFloat()
|
||||||
}
|
}
|
||||||
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockDoubleLineSize)
|
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clock_double_line_size)
|
||||||
textV.setLineSpacing(0F, 0.8F)
|
textV.setLineSpacing(0F, 0.8F)
|
||||||
} else {
|
} else {
|
||||||
if (getClockSize != 0) {
|
if (getClockSize != 0) {
|
||||||
val clockSize = getClockSize.toFloat()
|
val clock_size = getClockSize.toFloat()
|
||||||
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockSize)
|
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clock_size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val d: Method = textV.javaClass.getDeclaredMethod("updateTime")
|
val d: Method = textV.javaClass.getDeclaredMethod("updateTime")
|
||||||
@@ -72,7 +69,6 @@ object StatusBarTimeCustomization : HookRegister() {
|
|||||||
d.isAccessible = true
|
d.isAccessible = true
|
||||||
d.invoke(textV)
|
d.invoke(textV)
|
||||||
}
|
}
|
||||||
|
|
||||||
class T : TimerTask() {
|
class T : TimerTask() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
Handler(textV.context.mainLooper).post(r)
|
Handler(textV.context.mainLooper).post(r)
|
||||||
@@ -91,33 +87,16 @@ object StatusBarTimeCustomization : HookRegister() {
|
|||||||
Settings.System.TIME_12_24
|
Settings.System.TIME_12_24
|
||||||
)
|
)
|
||||||
val is24 = t == "24"
|
val is24 = t == "24"
|
||||||
nowTime = Calendar.getInstance().time
|
now_time = Calendar.getInstance().time
|
||||||
textV.text = getDate(c!!) + str + getTime(c!!, is24)
|
textV.text = getDate(c!!) + str + getTime(c!!, is24)
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isCenterAlign) {
|
|
||||||
val collapsedStatusBarFragmentClass =
|
|
||||||
"com.android.systemui.statusbar.phone.CollapsedStatusBarFragment".findClass(
|
|
||||||
getDefaultClassLoader()
|
|
||||||
)
|
|
||||||
collapsedStatusBarFragmentClass.hookAfterMethod(
|
|
||||||
"onViewCreated",
|
|
||||||
View::class.java,
|
|
||||||
Bundle::class.java
|
|
||||||
) {
|
|
||||||
val MiuiPhoneStatusBarView: ViewGroup =
|
|
||||||
it.thisObject.getObjectField("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_HORIZONTAL
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SuppressLint("SimpleDateFormat")
|
@SuppressLint("SimpleDateFormat")
|
||||||
private fun getDate(context: Context): String {
|
private fun getDate(context: Context): String {
|
||||||
var datePattern = ""
|
var datePattern = ""
|
||||||
@@ -155,7 +134,7 @@ object StatusBarTimeCustomization : HookRegister() {
|
|||||||
if (!isHideSpace) datePattern = "$datePattern "
|
if (!isHideSpace) datePattern = "$datePattern "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
datePattern = SimpleDateFormat(datePattern).format(nowTime)
|
datePattern = SimpleDateFormat(datePattern).format(now_time)
|
||||||
return datePattern
|
return datePattern
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +144,7 @@ object StatusBarTimeCustomization : HookRegister() {
|
|||||||
val isZh = isZh(context)
|
val isZh = isZh(context)
|
||||||
timePattern += if (t) "HH:mm" else "h:mm"
|
timePattern += if (t) "HH:mm" else "h:mm"
|
||||||
if (isSecond) timePattern += ":ss"
|
if (isSecond) timePattern += ":ss"
|
||||||
timePattern = SimpleDateFormat(timePattern).format(nowTime)
|
timePattern = SimpleDateFormat(timePattern).format(now_time)
|
||||||
if (isZh) timePattern = getPeriod(isZh) + timePattern else timePattern += getPeriod(isZh)
|
if (isZh) timePattern = getPeriod(isZh) + timePattern else timePattern += getPeriod(isZh)
|
||||||
timePattern = getDoubleHour() + timePattern
|
timePattern = getDoubleHour() + timePattern
|
||||||
return timePattern
|
return timePattern
|
||||||
@@ -176,7 +155,7 @@ object StatusBarTimeCustomization : HookRegister() {
|
|||||||
var period = ""
|
var period = ""
|
||||||
if (isPeriod) {
|
if (isPeriod) {
|
||||||
if (isZh) {
|
if (isZh) {
|
||||||
when (SimpleDateFormat("HH").format(nowTime)) {
|
when (SimpleDateFormat("HH").format(now_time)) {
|
||||||
"00", "01", "02", "03", "04", "05" -> {
|
"00", "01", "02", "03", "04", "05" -> {
|
||||||
period = "凌晨"
|
period = "凌晨"
|
||||||
}
|
}
|
||||||
@@ -197,7 +176,7 @@ object StatusBarTimeCustomization : HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
period = SimpleDateFormat("a").format(nowTime)
|
period = SimpleDateFormat("a").format(now_time)
|
||||||
if (!isHideSpace) {
|
if (!isHideSpace) {
|
||||||
period = " $period"
|
period = " $period"
|
||||||
}
|
}
|
||||||
@@ -211,7 +190,7 @@ object StatusBarTimeCustomization : HookRegister() {
|
|||||||
private fun getDoubleHour(): String {
|
private fun getDoubleHour(): String {
|
||||||
var doubleHour = ""
|
var doubleHour = ""
|
||||||
if (isDoubleHour) {
|
if (isDoubleHour) {
|
||||||
when (SimpleDateFormat("HH").format(nowTime)) {
|
when (SimpleDateFormat("HH").format(now_time)) {
|
||||||
"23", "00" -> {
|
"23", "00" -> {
|
||||||
doubleHour = "子时"
|
doubleHour = "子时"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ package com.lt2333.simplicitytools.hook.app.systemui
|
|||||||
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
import com.github.kyuubiran.ezxhelper.utils.findMethod
|
||||||
import com.github.kyuubiran.ezxhelper.utils.hookMethod
|
import com.github.kyuubiran.ezxhelper.utils.hookMethod
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedHelpers
|
import de.robv.android.xposed.XposedHelpers
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object WaveCharge: HookRegister() {
|
class WaveCharge : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
|
||||||
override fun init() {
|
|
||||||
hasEnable("enable_wave_charge_animation") {
|
hasEnable("enable_wave_charge_animation") {
|
||||||
findMethod("com.android.keyguard.charge.ChargeUtils") {
|
findMethod("com.android.keyguard.charge.ChargeUtils") {
|
||||||
name == "supportWaveChargeAnimation"
|
name == "supportWaveChargeAnimation"
|
||||||
@@ -41,5 +41,4 @@ object WaveCharge: HookRegister() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,16 +3,15 @@ package com.lt2333.simplicitytools.hook.app.thememanager
|
|||||||
import com.lt2333.simplicitytools.util.findClass
|
import com.lt2333.simplicitytools.util.findClass
|
||||||
import com.lt2333.simplicitytools.util.hasEnable
|
import com.lt2333.simplicitytools.util.hasEnable
|
||||||
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
import com.lt2333.simplicitytools.util.hookBeforeMethod
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
object RemoveAds : HookRegister() {
|
class RemoveAds : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
override fun init() {
|
"com.android.thememanager.basemodule.ad.model.AdInfoResponse".hookBeforeMethod(lpparam.classLoader, "isAdValid", "com.android.thememanager.basemodule.ad.model.AdInfo".findClass(lpparam.classLoader)) {
|
||||||
"com.android.thememanager.basemodule.ad.model.AdInfoResponse".hookBeforeMethod(getDefaultClassLoader(), "isAdValid", "com.android.thememanager.basemodule.ad.model.AdInfo".findClass(getDefaultClassLoader())) {
|
|
||||||
hasEnable("remove_thememanager_ads") {
|
hasEnable("remove_thememanager_ads") {
|
||||||
it.result = false
|
it.result = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.util.xposed
|
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.init.EzXHelperInit
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.Log.logexIfThrow
|
|
||||||
import com.lt2333.simplicitytools.util.xposed.base.AppRegister
|
|
||||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
|
||||||
import de.robv.android.xposed.IXposedHookZygoteInit
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
abstract class EasyXposedInit: IXposedHookLoadPackage, IXposedHookZygoteInit {
|
|
||||||
|
|
||||||
private lateinit var packageParam: XC_LoadPackage.LoadPackageParam
|
|
||||||
abstract val registeredApp: List<AppRegister>
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
|
|
||||||
packageParam = lpparam!!
|
|
||||||
registeredApp.forEach { app ->
|
|
||||||
if (app.packageName == lpparam.packageName && (lpparam.processName in app.processName || app.processName.isEmpty())) {
|
|
||||||
EzXHelperInit.initHandleLoadPackage(lpparam)
|
|
||||||
EzXHelperInit.setLogTag(app.logTag)
|
|
||||||
EzXHelperInit.setToastTag(app.logTag)
|
|
||||||
runCatching { app.handleLoadPackage(lpparam) }.logexIfThrow("Failed call handleLoadPackage, package: ${app.packageName}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam?) {
|
|
||||||
EzXHelperInit.initZygote(startupParam!!)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.util.xposed.base
|
|
||||||
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.Log
|
|
||||||
import com.github.kyuubiran.ezxhelper.utils.Log.logexIfThrow
|
|
||||||
import de.robv.android.xposed.IXposedHookInitPackageResources
|
|
||||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
|
||||||
import de.robv.android.xposed.callbacks.XC_InitPackageResources
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
abstract class AppRegister: IXposedHookLoadPackage {
|
|
||||||
|
|
||||||
abstract val packageName: String
|
|
||||||
abstract val processName: List<String>
|
|
||||||
abstract val logTag: String
|
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {}
|
|
||||||
|
|
||||||
protected fun autoInitHooks(lpparam: XC_LoadPackage.LoadPackageParam, vararg hook: HookRegister) {
|
|
||||||
hook.forEach {
|
|
||||||
runCatching {
|
|
||||||
if (it.isInit) return@forEach
|
|
||||||
it.setLoadPackageParam(lpparam)
|
|
||||||
it.init()
|
|
||||||
it.isInit = true
|
|
||||||
Log.i("Inited hook: ${it.javaClass.simpleName}")
|
|
||||||
}.logexIfThrow("Failed init hook: ${it.javaClass.simpleName}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package com.lt2333.simplicitytools.util.xposed.base
|
|
||||||
|
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
|
||||||
|
|
||||||
abstract class HookRegister {
|
|
||||||
private lateinit var lpparam: XC_LoadPackage.LoadPackageParam
|
|
||||||
var isInit: Boolean = false
|
|
||||||
abstract fun init()
|
|
||||||
|
|
||||||
fun setLoadPackageParam(loadPackageParam: XC_LoadPackage.LoadPackageParam) {
|
|
||||||
lpparam = loadPackageParam
|
|
||||||
}
|
|
||||||
|
|
||||||
protected fun getLoadPackageParam(): XC_LoadPackage.LoadPackageParam {
|
|
||||||
if (!this::lpparam.isInitialized) {
|
|
||||||
throw RuntimeException("lpparam should be initialized")
|
|
||||||
}
|
|
||||||
return lpparam
|
|
||||||
}
|
|
||||||
|
|
||||||
protected fun getDefaultClassLoader(): ClassLoader {
|
|
||||||
return getLoadPackageParam().classLoader
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -186,5 +186,4 @@
|
|||||||
<string name="input_error">Error de entrada</string>
|
<string name="input_error">Error de entrada</string>
|
||||||
<string name="range">Rango: </string>
|
<string name="range">Rango: </string>
|
||||||
<string name="big_mobile_type_icon_left_and_right_margins">Margen izquierdo y derecho del icono de red móvil grande</string>
|
<string name="big_mobile_type_icon_left_and_right_margins">Margen izquierdo y derecho del icono de red móvil grande</string>
|
||||||
<string name="cast">Transmitir</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -182,9 +182,4 @@
|
|||||||
<string name="zero_do_no_change">0: nu se modifică</string>
|
<string name="zero_do_no_change">0: nu se modifică</string>
|
||||||
<string name="big_mobile_type_icon_size">Dimensiune pictogramă tip mobil mare</string>
|
<string name="big_mobile_type_icon_size">Dimensiune pictogramă tip mobil mare</string>
|
||||||
<string name="big_mobile_type_icon_bold">Pictogramă tip mobil mare îngroșată</string>
|
<string name="big_mobile_type_icon_bold">Pictogramă tip mobil mare îngroșată</string>
|
||||||
<string name="big_mobile_type_icon_up_and_down_position">Poziție pictogramă mare tip date mobile sus/jos</string>
|
|
||||||
<string name="input_error">Eroare de intrare</string>
|
|
||||||
<string name="range">Interval: </string>
|
|
||||||
<string name="big_mobile_type_icon_left_and_right_margins">Pictogramă mare tip date mobil, marginile din stânga și din dreapta</string>
|
|
||||||
<string name="cast">Proiectare</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -191,6 +191,5 @@
|
|||||||
<string name="range">Диапазон: </string>
|
<string name="range">Диапазон: </string>
|
||||||
<string name="big_mobile_type_icon_left_and_right_margins">Положение типа сети по горизонтали</string>
|
<string name="big_mobile_type_icon_left_and_right_margins">Положение типа сети по горизонтали</string>
|
||||||
<string name="cast">Трансляция</string>
|
<string name="cast">Трансляция</string>
|
||||||
<string name="force_support_send_app">Принудительно открывать все приложения на другом устройстве</string>
|
<string name="force_support_send_app">Принудительно включить передачу всех приложений</string>
|
||||||
<string name="status_bar_time_double_line_center_align">Выравнивание по центру двойной строки</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -187,7 +187,4 @@
|
|||||||
<string name="input_error">Giriş hatası</string>
|
<string name="input_error">Giriş hatası</string>
|
||||||
<string name="range">Menzil:</string>
|
<string name="range">Menzil:</string>
|
||||||
<string name="big_mobile_type_icon_left_and_right_margins">Büyük mobil tip simgesi sol ve sağ kenar boşlukları</string>
|
<string name="big_mobile_type_icon_left_and_right_margins">Büyük mobil tip simgesi sol ve sağ kenar boşlukları</string>
|
||||||
<string name="cast">Yayınlama</string>
|
|
||||||
<string name="force_support_send_app">Tüm uygulama desteğini başka bir cihazda açmaya zorla</string>
|
|
||||||
<string name="status_bar_time_double_line_center_align">Çift sıralı merkez hizalama</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -187,4 +187,5 @@
|
|||||||
<string name="range">Phạm vi: </string>
|
<string name="range">Phạm vi: </string>
|
||||||
<string name="big_mobile_type_icon_left_and_right_margins">Căn lề biểu tượng mạng dữ liệu lớn</string>
|
<string name="big_mobile_type_icon_left_and_right_margins">Căn lề biểu tượng mạng dữ liệu lớn</string>
|
||||||
<string name="cast">Truyền</string>
|
<string name="cast">Truyền</string>
|
||||||
|
<string name="force_support_send_app">Buộc tất cả các ứng dụng hỗ trợ Handoff</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -187,6 +187,5 @@
|
|||||||
<string name="range">范围:</string>
|
<string name="range">范围:</string>
|
||||||
<string name="big_mobile_type_icon_left_and_right_margins">大移动类型图标左右边距</string>
|
<string name="big_mobile_type_icon_left_and_right_margins">大移动类型图标左右边距</string>
|
||||||
<string name="cast">投屏</string>
|
<string name="cast">投屏</string>
|
||||||
<string name="force_support_send_app">强制所有应用支持在另一个设备打开</string>
|
<string name="force_support_send_app">强制允许所有应用接力</string>
|
||||||
<string name="status_bar_time_double_line_center_align">双排居中对齐</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -186,7 +186,4 @@
|
|||||||
<string name="input_error">輸入錯誤</string>
|
<string name="input_error">輸入錯誤</string>
|
||||||
<string name="range">範圍:</string>
|
<string name="range">範圍:</string>
|
||||||
<string name="big_mobile_type_icon_left_and_right_margins">大行動網路圖示左右邊距</string>
|
<string name="big_mobile_type_icon_left_and_right_margins">大行動網路圖示左右邊距</string>
|
||||||
<string name="cast">投影</string>
|
|
||||||
<string name="force_support_send_app">強制所有應用支援在另一個裝置開啟</string>
|
|
||||||
<string name="status_bar_time_double_line_center_align">雙排居中對齊</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -11,6 +11,5 @@
|
|||||||
<item>com.android.settings</item>
|
<item>com.android.settings</item>
|
||||||
<item>com.android.thememanager</item>
|
<item>com.android.thememanager</item>
|
||||||
<item>com.miui.screenshot</item>
|
<item>com.miui.screenshot</item>
|
||||||
<item>com.milink.service</item>
|
|
||||||
</string-array>
|
</string-array>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -190,7 +190,4 @@
|
|||||||
<string name="input_error">Input error</string>
|
<string name="input_error">Input error</string>
|
||||||
<string name="range">Range: </string>
|
<string name="range">Range: </string>
|
||||||
<string name="big_mobile_type_icon_left_and_right_margins">Big mobile type icon left and right margins</string>
|
<string name="big_mobile_type_icon_left_and_right_margins">Big mobile type icon left and right margins</string>
|
||||||
<string name="cast">Cast</string>
|
|
||||||
<string name="force_support_send_app">Force all apps support open on another device</string>
|
|
||||||
<string name="status_bar_time_double_line_center_align">Dual row center align</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user