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,8 +15,9 @@
|
||||
|
||||
### 模块说明
|
||||
|
||||
仅支持MIUI13(Android12),其余版本无法使用。
|
||||
|
||||
仅支持MIUI13(Android12)。其余版本可能无效,请不要安装使用。
|
||||
目前处于开发初期阶段,功能较少,后续将逐步完善。
|
||||
|
||||
开发者:[酷安@乌堆小透明](http://www.coolapk.com/u/883441)
|
||||
|
||||
---
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
|
||||
### 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"
|
||||
minSdk = 31
|
||||
targetSdk = 32
|
||||
versionCode = 56
|
||||
versionName = "1.5.5"
|
||||
versionCode = 55
|
||||
versionName = "1.5.4"
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
-keep class * extends com.lt2333.simplicitytools.util.xposed.EasyXposedInit
|
||||
|
||||
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
|
||||
public static void check*(...);
|
||||
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.android.updater",
|
||||
"killall com.miui.mediaeditor",
|
||||
"killall com.miui.screenshot",
|
||||
"killall com.milink.service"
|
||||
"killall com.miui.screenshot"
|
||||
)
|
||||
ShellUtils.execCommand(command, true)
|
||||
dismiss()
|
||||
@@ -517,7 +516,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
SwitchV("status_bar_time_center")
|
||||
)
|
||||
)
|
||||
val layoutCompatibilityModeBinding = getDataBinding(
|
||||
val layout_compatibility_mode_binding = getDataBinding(
|
||||
SPUtils.getBoolean(
|
||||
activity,
|
||||
"layout_compatibility_mode",
|
||||
@@ -537,7 +536,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
),
|
||||
SwitchV(
|
||||
"layout_compatibility_mode",
|
||||
dataBindingSend = layoutCompatibilityModeBinding.bindingSend
|
||||
dataBindingSend = layout_compatibility_mode_binding.bindingSend
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -546,7 +545,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
add(
|
||||
TextV(
|
||||
resId = R.string.left_margin,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
dataBindingRecv = layout_compatibility_mode_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
@@ -555,14 +554,14 @@ class SettingsActivity : MIUIActivity() {
|
||||
0,
|
||||
300,
|
||||
0,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
dataBindingRecv = layout_compatibility_mode_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
|
||||
add(
|
||||
TextV(
|
||||
resId = R.string.right_margin,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
dataBindingRecv = layout_compatibility_mode_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
@@ -571,7 +570,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
0,
|
||||
300,
|
||||
0,
|
||||
dataBindingRecv = layoutCompatibilityModeBinding.binding.getRecv(2)
|
||||
dataBindingRecv = layout_compatibility_mode_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -579,7 +578,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
add(LineV())
|
||||
add(TitleTextV(resId = R.string.status_bar_clock_format))
|
||||
|
||||
val customClockBinding = getDataBinding(
|
||||
val custom_clock_binding = getDataBinding(
|
||||
SPUtils.getBoolean(
|
||||
activity,
|
||||
"custom_clock_switch",
|
||||
@@ -598,7 +597,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
TextV(resId = R.string.custom_clock_switch, colorId = R.color.purple_700),
|
||||
SwitchV(
|
||||
"custom_clock_switch",
|
||||
dataBindingSend = customClockBinding.bindingSend
|
||||
dataBindingSend = custom_clock_binding.bindingSend
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -606,94 +605,87 @@ class SettingsActivity : MIUIActivity() {
|
||||
TextWithSwitchV(
|
||||
TextV(resId = R.string.status_bar_time_year),
|
||||
SwitchV("status_bar_time_year"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextWithSwitchV(
|
||||
TextV(resId = R.string.status_bar_time_month),
|
||||
SwitchV("status_bar_time_month"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextWithSwitchV(
|
||||
TextV(resId = R.string.status_bar_time_day),
|
||||
SwitchV("status_bar_time_day"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextWithSwitchV(
|
||||
TextV(resId = R.string.status_bar_time_week),
|
||||
SwitchV("status_bar_time_week"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextWithSwitchV(
|
||||
TextV(resId = R.string.status_bar_time_double_hour),
|
||||
SwitchV("status_bar_time_double_hour"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextWithSwitchV(
|
||||
TextV(resId = R.string.status_bar_time_period),
|
||||
SwitchV("status_bar_time_period", true),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextWithSwitchV(
|
||||
TextV(resId = R.string.status_bar_time_seconds),
|
||||
SwitchV("status_bar_time_seconds"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextWithSwitchV(
|
||||
TextV(resId = R.string.status_bar_time_hide_space),
|
||||
SwitchV("status_bar_time_hide_space"),
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextWithSwitchV(
|
||||
TextV(resId = R.string.status_bar_time_double_line),
|
||||
SwitchV("status_bar_time_double_line"),
|
||||
dataBindingRecv = customClockBinding.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)
|
||||
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextV(
|
||||
resId = R.string.status_bar_clock_size,
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
SeekBarWithTextV(
|
||||
"status_bar_clock_size", 0, 18, 0,
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextV(
|
||||
resId = R.string.status_bar_clock_double_line_size,
|
||||
dataBindingRecv = customClockBinding.binding.getRecv(2)
|
||||
dataBindingRecv = custom_clock_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
SeekBarWithTextV(
|
||||
"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(
|
||||
activity,
|
||||
"big_mobile_type_icon",
|
||||
@@ -726,7 +718,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
),
|
||||
SwitchV(
|
||||
"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
|
||||
),
|
||||
SwitchV("big_mobile_type_icon_bold", true),
|
||||
dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
||||
dataBindingRecv = big_mobile_type_icon_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
@@ -772,7 +764,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
}
|
||||
show()
|
||||
}
|
||||
}), dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
||||
}), dataBindingRecv = big_mobile_type_icon_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
@@ -821,7 +813,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
}
|
||||
show()
|
||||
}
|
||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
||||
}, dataBindingRecv = big_mobile_type_icon_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
@@ -870,7 +862,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
}
|
||||
show()
|
||||
}
|
||||
}, dataBindingRecv = bigMobileTypeIconBinding.binding.getRecv(2)
|
||||
}, dataBindingRecv = big_mobile_type_icon_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
@@ -955,7 +947,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
)
|
||||
)
|
||||
|
||||
val statusBarDualRowNetworkSpeedBinding = getDataBinding(
|
||||
val status_bar_dual_row_network_speed_binding = getDataBinding(
|
||||
SPUtils.getBoolean(
|
||||
activity,
|
||||
"status_bar_dual_row_network_speed",
|
||||
@@ -975,7 +967,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
),
|
||||
SwitchV(
|
||||
"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
|
||||
)].toString()
|
||||
),
|
||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
||||
dataBindingRecv = status_bar_dual_row_network_speed_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
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(
|
||||
TextV(
|
||||
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(
|
||||
@@ -1067,14 +1059,14 @@ class SettingsActivity : MIUIActivity() {
|
||||
0,
|
||||
9,
|
||||
0,
|
||||
dataBindingRecv = statusBarDualRowNetworkSpeedBinding.binding.getRecv(2)
|
||||
dataBindingRecv = status_bar_dual_row_network_speed_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
add(LineV())
|
||||
add(TitleTextV(resId = R.string.notification_center))
|
||||
val showWeatherMainSwitchBinding = getDataBinding(
|
||||
val show_weather_main_switch_binding = getDataBinding(
|
||||
SPUtils.getBoolean(
|
||||
activity,
|
||||
"notification_weather",
|
||||
@@ -1093,7 +1085,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
),
|
||||
SwitchV(
|
||||
"notification_weather",
|
||||
dataBindingSend = showWeatherMainSwitchBinding.bindingSend
|
||||
dataBindingSend = show_weather_main_switch_binding.bindingSend
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1103,14 +1095,14 @@ class SettingsActivity : MIUIActivity() {
|
||||
textId = R.string.show_city,
|
||||
),
|
||||
SwitchV("notification_weather_city"),
|
||||
dataBindingRecv = showWeatherMainSwitchBinding.binding.getRecv(2)
|
||||
dataBindingRecv = show_weather_main_switch_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
add(LineV())
|
||||
add(TitleTextV(resId = R.string.control_center))
|
||||
val controlCenterWeatherBinding = getDataBinding(
|
||||
val control_center_weather_binding = getDataBinding(
|
||||
SPUtils.getBoolean(
|
||||
activity,
|
||||
"control_center_weather",
|
||||
@@ -1131,7 +1123,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
),
|
||||
SwitchV(
|
||||
"control_center_weather",
|
||||
dataBindingSend = controlCenterWeatherBinding.bindingSend
|
||||
dataBindingSend = control_center_weather_binding.bindingSend
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1141,7 +1133,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
textId = R.string.show_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(TitleTextV(resId = R.string.old_quick_settings_panel))
|
||||
val oldQSCustomSwitchBinding = getDataBinding(
|
||||
val old_qs_custom_switch_binding = getDataBinding(
|
||||
SPUtils.getBoolean(
|
||||
activity,
|
||||
"old_qs_custom_switch",
|
||||
@@ -1213,7 +1205,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
),
|
||||
SwitchV(
|
||||
"old_qs_custom_switch",
|
||||
dataBindingSend = oldQSCustomSwitchBinding.bindingSend
|
||||
dataBindingSend = old_qs_custom_switch_binding.bindingSend
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1221,7 +1213,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
add(
|
||||
TextV(
|
||||
resId = R.string.qs_custom_rows,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
@@ -1230,7 +1222,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
1,
|
||||
6,
|
||||
3,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1238,7 +1230,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
add(
|
||||
TextV(
|
||||
resId = R.string.qs_custom_rows_horizontal,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
@@ -1247,14 +1239,14 @@ class SettingsActivity : MIUIActivity() {
|
||||
1,
|
||||
3,
|
||||
2,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
|
||||
add(
|
||||
TextV(
|
||||
resId = R.string.qs_custom_columns,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
@@ -1263,13 +1255,13 @@ class SettingsActivity : MIUIActivity() {
|
||||
1,
|
||||
7,
|
||||
4,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
TextV(
|
||||
resId = R.string.qs_custom_columns_unexpanded,
|
||||
dataBindingRecv = oldQSCustomSwitchBinding.binding.getRecv(2)
|
||||
dataBindingRecv = old_qs_custom_switch_binding.binding.getRecv(2)
|
||||
)
|
||||
)
|
||||
add(
|
||||
@@ -1278,7 +1270,7 @@ class SettingsActivity : MIUIActivity() {
|
||||
1,
|
||||
7,
|
||||
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(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(
|
||||
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.RemoveSmallWindowRestrictions
|
||||
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.callbacks.XC_LoadPackage
|
||||
|
||||
object Android: AppRegister() {
|
||||
override val packageName: String = "android"
|
||||
override val processName: List<String> = emptyList()
|
||||
override val logTag: String = "Simplicitytools"
|
||||
|
||||
class Android : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||
//核心破解
|
||||
CorePatch().handleLoadPackage(lpparam)
|
||||
|
||||
autoInitHooks(lpparam,
|
||||
DisableFlagSecure, //允许截图
|
||||
DeleteOnPostNotification, //上层显示
|
||||
RemoveSmallWindowRestrictions, //解除小窗限制
|
||||
MaxWallpaperScale, //壁纸缩放比例
|
||||
)
|
||||
//允许截图
|
||||
DisableFlagSecure().handleLoadPackage(lpparam)
|
||||
//上层显示
|
||||
DeleteOnPostNotification().handleLoadPackage(lpparam)
|
||||
//解除小窗限制
|
||||
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
|
||||
|
||||
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.callbacks.XC_LoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||
|
||||
object MediaEditor: AppRegister() {
|
||||
override val packageName: String = "com.miui.mediaeditor"
|
||||
override val processName: List<String> = emptyList()
|
||||
override val logTag: String = "Simplicitytools"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
class MediaEditor : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||
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.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.callbacks.XC_LoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||
|
||||
object MiuiHome: AppRegister() {
|
||||
override val packageName: String = "com.miui.home"
|
||||
override val processName: List<String> = emptyList()
|
||||
override val logTag: String = "Simplicitytools"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
class MiuiHome : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||
autoInitHooks(lpparam,
|
||||
AlwaysDisplayTime, //时钟显示时钟
|
||||
DoubleTapToSleep, //双击锁屏
|
||||
)
|
||||
//时钟显示时钟
|
||||
AlwaysDisplayTime().handleLoadPackage(lpparam)
|
||||
//双击锁屏
|
||||
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.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.callbacks.XC_LoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||
|
||||
object PowerKeeper: AppRegister() {
|
||||
override val packageName: String = "com.miui.powerkeeper"
|
||||
override val processName: List<String> = emptyList()
|
||||
override val logTag: String = "Simplicitytools"
|
||||
class PowerKeeper : IXposedHookLoadPackage {
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||
autoInitHooks(lpparam,
|
||||
LockMaxFps, //锁定最高刷新率
|
||||
PreventRecoveryOfBatteryOptimizationWhitelist, //防止恢复电池优化白名单
|
||||
)
|
||||
//锁定最高刷新率
|
||||
LockMaxFps().handleLoadPackage(lpparam)
|
||||
//防止恢复电池优化白名单
|
||||
PreventRecoveryOfBatteryOptimizationWhitelist().handleLoadPackage(lpparam)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,15 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
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.callbacks.XC_LoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||
|
||||
object ScreenShot: AppRegister() {
|
||||
override val packageName: String = "com.miui.screenshot"
|
||||
override val processName: List<String> = emptyList()
|
||||
override val logTag: String = "Simplicitytools"
|
||||
class ScreenShot : IXposedHookLoadPackage {
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook " + javaClass.simpleName)
|
||||
autoInitHooks(lpparam,
|
||||
UnlockUnlimitedCropping, //锁定最高刷新率
|
||||
)
|
||||
//锁定最高刷新率
|
||||
UnlockUnlimitedCropping().handleLoadPackage(lpparam)
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,23 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
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.callbacks.XC_LoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||
|
||||
object SecurityCenter: AppRegister() {
|
||||
override val packageName: String = "com.miui.securitycenter"
|
||||
override val processName: List<String> = emptyList()
|
||||
override val logTag: String = "Simplicitytools"
|
||||
class SecurityCenter : IXposedHookLoadPackage {
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook " + javaClass.simpleName)
|
||||
autoInitHooks(lpparam,
|
||||
SkipWaitingTime, //跳过 5/10秒等待时间
|
||||
LockOneHundred, //锁定 100分
|
||||
RemoveMacroBlacklist, //去除自动连招黑名单
|
||||
ShowBatteryTemperature, //显示电池温度
|
||||
RemoveOpenAppConfirmationPopup, //去除打开应用弹窗
|
||||
)
|
||||
//跳过 5/10秒等待时间
|
||||
SkipWaitingTime().handleLoadPackage(lpparam)
|
||||
//锁定 100分
|
||||
LockOneHundred().handleLoadPackage(lpparam)
|
||||
//去除自动连招黑名单
|
||||
RemoveMacroBlacklist().handleLoadPackage(lpparam)
|
||||
//显示电池温度
|
||||
ShowBatteryTemperature().handleLoadPackage(lpparam)
|
||||
//去除打开应用弹窗
|
||||
RemoveOpenAppConfirmationPopup().handleLoadPackage(lpparam)
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,13 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
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.callbacks.XC_LoadPackage
|
||||
|
||||
object Settings: AppRegister() {
|
||||
override val packageName: String = "com.android.settings"
|
||||
override val processName: List<String> = emptyList()
|
||||
override val logTag: String = "Simplicitytools"
|
||||
|
||||
class Settings: IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||
autoInitHooks(lpparam,
|
||||
ShowNotificationImportance, //显示通知重要程度
|
||||
)
|
||||
ShowNotificationImportance().handleLoadPackage(lpparam)
|
||||
}
|
||||
}
|
||||
@@ -1,45 +1,67 @@
|
||||
package com.lt2333.simplicitytools.hook.app
|
||||
|
||||
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.callbacks.XC_LoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||
|
||||
object SystemUI: AppRegister() {
|
||||
override val packageName: String = "com.android.systemui"
|
||||
override val processName: List<String> = emptyList()
|
||||
override val logTag: String = "Simplicitytools"
|
||||
class SystemUI : IXposedHookLoadPackage {
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
||||
autoInitHooks(lpparam,
|
||||
HideStatusBarIcon, //隐藏状态栏图标
|
||||
HideBatteryIcon, //隐藏电池
|
||||
HideHDIcon, //隐藏HD图标
|
||||
HideSimIcon, //隐藏SIM卡图标
|
||||
HideMobileActivityIcon, //隐藏移动箭头图标
|
||||
HideMobileTypeIcon, //隐藏移动类型图标
|
||||
HideStatusBarNetworkSpeedSecond, //隐藏状态栏网速/s
|
||||
HideWifiActivityIcon, //隐藏WIFI活动箭头图标
|
||||
RemoveTheMaximumNumberOfNotificationIcons, //移除通知图标上限
|
||||
StatusBarNetworkSpeedRefreshSpeed, //状态栏网速秒刷新
|
||||
StatusBarTimeCustomization, //状态栏时钟自定义
|
||||
RemoveTheLeftSideOfTheLockScreen, //移除锁屏负一屏功能
|
||||
RemoveLockScreenCamera, //移除锁屏相机功能
|
||||
NotificationWeather, //通知面板天气
|
||||
OldNotificationWeather,
|
||||
ControlCenterWeather, //控制中心天气
|
||||
//StatusBarCurrent, //TODO:状态栏电流
|
||||
StatusBarLayout, //状态栏布局
|
||||
HideNetworkSpeedSplitter, //隐藏时钟与实时网速之间的分隔符
|
||||
WaveCharge, //Alpha充电动画
|
||||
LockScreenCurrent, //锁屏电流
|
||||
LockScreenDoubleTapToSleep, //锁屏下双击锁屏
|
||||
StatusBarDoubleTapToSleep, //双击状态栏锁屏
|
||||
OldQSCustom, //旧版快速设置自定义
|
||||
DoubleLineNetworkSpeed, //双排网速
|
||||
StatusBarBigMobileTypeIcon, //大移动类型
|
||||
BatteryPercentage, //电量百分比
|
||||
)
|
||||
//隐藏状态栏图标
|
||||
HideStatusBarIcon().handleLoadPackage(lpparam)
|
||||
//隐藏电池
|
||||
HideBatteryIcon().handleLoadPackage(lpparam)
|
||||
//隐藏HD图标
|
||||
HideHDIcon().handleLoadPackage(lpparam)
|
||||
//隐藏SIM卡图标
|
||||
HideSimIcon().handleLoadPackage(lpparam)
|
||||
//隐藏移动箭头图标
|
||||
HideMobileActivityIcon().handleLoadPackage(lpparam)
|
||||
//隐藏移动类型图标
|
||||
HideMobileTypeIcon().handleLoadPackage(lpparam)
|
||||
//隐藏状态栏网速/s
|
||||
HideStatusBarNetworkSpeedSecond().handleLoadPackage(lpparam)
|
||||
//隐藏WIFI活动箭头图标
|
||||
HideWifiActivityIcon().handleLoadPackage(lpparam)
|
||||
//移除通知图标上限
|
||||
RemoveTheMaximumNumberOfNotificationIcons().handleLoadPackage(lpparam)
|
||||
//状态栏网速秒刷新
|
||||
StatusBarNetworkSpeedRefreshSpeed().handleLoadPackage(lpparam)
|
||||
//状态栏时钟自定义
|
||||
StatusBarTimeCustomization().handleLoadPackage(lpparam)
|
||||
//移除锁屏负一屏功能
|
||||
RemoveTheLeftSideOfTheLockScreen().handleLoadPackage(lpparam)
|
||||
//移除锁屏相机功能
|
||||
RemoveLockScreenCamera().handleLoadPackage(lpparam)
|
||||
//通知面板天气
|
||||
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
|
||||
|
||||
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.callbacks.XC_LoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||
|
||||
object ThemeManager: AppRegister() {
|
||||
override val packageName: String = "com.android.thememanager"
|
||||
override val processName: List<String> = emptyList()
|
||||
override val logTag: String = "Simplicitytools"
|
||||
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
class ThemeManager : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||
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.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.callbacks.XC_LoadPackage
|
||||
|
||||
object Updater: AppRegister() {
|
||||
override val packageName: String = "com.android.updater"
|
||||
override val processName: List<String> = emptyList()
|
||||
override val logTag: String = "Simplicitytools"
|
||||
|
||||
class Updater : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
if (XSPUtils.getBoolean("remove_ota_validate", false)) {
|
||||
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.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() {
|
||||
|
||||
override fun init() {
|
||||
"com.android.server.wm.AlertWindowNotification".hookBeforeMethod(getDefaultClassLoader(), "onPostNotification") {
|
||||
class DeleteOnPostNotification : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.server.wm.AlertWindowNotification".hookBeforeMethod(lpparam.classLoader, "onPostNotification") {
|
||||
hasEnable("delete_on_post_notification") {
|
||||
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.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() {
|
||||
|
||||
override fun init() {
|
||||
"com.android.server.wm.WindowState".hookBeforeMethod(getDefaultClassLoader(), "isSecureLocked") {
|
||||
class DisableFlagSecure : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.server.wm.WindowState".hookBeforeMethod(lpparam.classLoader, "isSecureLocked") {
|
||||
hasEnable("disable_flag_secure") {
|
||||
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.hookBeforeMethod
|
||||
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(getDefaultClassLoader(), "zoomOutToScale", Float::class.java) {
|
||||
"com.android.server.wm.WallpaperController".hookBeforeMethod(lpparam.classLoader, "zoomOutToScale", Float::class.java) {
|
||||
val value = XSPUtils.getFloat("max_wallpaper_scale", 1.1f)
|
||||
it.thisObject.setFloatField("mMaxWallpaperScale", value)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,35 +4,36 @@ import android.content.Context
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
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") {
|
||||
it.result = true
|
||||
}
|
||||
}
|
||||
|
||||
"android.util.MiuiMultiWindowAdapter".hookAfterMethod(getDefaultClassLoader(), "getFreeformBlackList") {
|
||||
"android.util.MiuiMultiWindowAdapter".hookAfterMethod(lpparam.classLoader, "getFreeformBlackList") {
|
||||
hasEnable("remove_small_window_restrictions") {
|
||||
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") {
|
||||
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") {
|
||||
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
|
||||
|
||||
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.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object UnlockUnlimitedCropping : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
class UnlockUnlimitedCropping :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
//解锁图库裁切最小值
|
||||
val classIfExists = XposedHelpers.findClassIfExists(
|
||||
"com.miui.gallery.editor.photo.core.imports.obsoletes.Crop\$ResizeDetector",
|
||||
getDefaultClassLoader()
|
||||
lpparam.classLoader
|
||||
)
|
||||
XposedHelpers.findAndHookMethod(
|
||||
classIfExists,
|
||||
@@ -26,7 +26,7 @@ object UnlockUnlimitedCropping : HookRegister() {
|
||||
//截图无限裁切
|
||||
val classIfExists2 = XposedHelpers.findClassIfExists(
|
||||
"com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$ResizeDetector",
|
||||
getDefaultClassLoader()
|
||||
lpparam.classLoader
|
||||
)
|
||||
|
||||
XposedHelpers.findAndHookMethod(
|
||||
@@ -40,5 +40,4 @@ object UnlockUnlimitedCropping : HookRegister() {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
package com.lt2333.simplicitytools.hook.app.miuihome
|
||||
|
||||
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.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object AlwaysDisplayTime : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
class AlwaysDisplayTime : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val classIfExists = XposedHelpers.findClassIfExists(
|
||||
"com.miui.home.launcher.Workspace",
|
||||
getDefaultClassLoader()
|
||||
lpparam.classLoader
|
||||
)
|
||||
XposedHelpers.findAndHookMethod(
|
||||
classIfExists,
|
||||
@@ -23,5 +23,4 @@ object AlwaysDisplayTime : HookRegister() {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,15 +4,15 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.view.MotionEvent
|
||||
import com.lt2333.simplicitytools.util.*
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.yuk.miuihome.module.DoubleTapController
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object DoubleTapToSleep : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
class DoubleTapToSleep : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
hasEnable("double_tap_to_sleep") {
|
||||
"com.miui.home.launcher.Workspace".findClass(getDefaultClassLoader())
|
||||
"com.miui.home.launcher.Workspace".findClass(lpparam.classLoader)
|
||||
.hookAfterAllConstructors {
|
||||
var mDoubleTapControllerEx =
|
||||
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
|
||||
) {
|
||||
val mDoubleTapControllerEx = XposedHelpers.getAdditionalInstanceField(
|
||||
@@ -50,5 +50,4 @@ object DoubleTapToSleep : HookRegister() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
package com.lt2333.simplicitytools.hook.app.powerkeeper
|
||||
|
||||
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.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object LockMaxFps : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
class LockMaxFps : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val classIfExists = XposedHelpers.findClassIfExists(
|
||||
"com.miui.powerkeeper.statemachine.DisplayFrameSetting",
|
||||
getDefaultClassLoader()
|
||||
lpparam.classLoader
|
||||
)
|
||||
XposedHelpers.findAndHookMethod(
|
||||
classIfExists,
|
||||
@@ -25,5 +25,4 @@ object LockMaxFps : HookRegister() {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
package com.lt2333.simplicitytools.hook.app.powerkeeper
|
||||
|
||||
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.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object PreventRecoveryOfBatteryOptimizationWhitelist : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
class PreventRecoveryOfBatteryOptimizationWhitelist : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val classIfExists = XposedHelpers.findClassIfExists(
|
||||
"com.miui.powerkeeper.statemachine.ForceDozeController",
|
||||
getDefaultClassLoader()
|
||||
lpparam.classLoader
|
||||
)
|
||||
XposedHelpers.findAndHookMethod(
|
||||
classIfExists,
|
||||
@@ -28,5 +28,4 @@ object PreventRecoveryOfBatteryOptimizationWhitelist : HookRegister() {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
package com.lt2333.simplicitytools.hook.app.screenshot
|
||||
|
||||
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.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object UnlockUnlimitedCropping : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
class UnlockUnlimitedCropping :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
//截图无限裁切
|
||||
val classIfExists2 = XposedHelpers.findClassIfExists(
|
||||
"com.miui.gallery.editor.photo.screen.crop.ScreenCropView\$b",
|
||||
getDefaultClassLoader()
|
||||
lpparam.classLoader
|
||||
)
|
||||
|
||||
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.findClass
|
||||
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) {
|
||||
if (XSPUtils.getBoolean("lock_one_hundred", false)) {
|
||||
it.result = null
|
||||
@@ -18,12 +19,11 @@ object LockOneHundred : HookRegister() {
|
||||
}
|
||||
|
||||
//锁定100分
|
||||
val scoreManagerClass = "com.miui.securityscan.scanner.ScoreManager".findClass(getDefaultClassLoader())
|
||||
var scoreManagerClass = "com.miui.securityscan.scanner.ScoreManager".findClass(lpparam.classLoader)
|
||||
scoreManagerClass.hookBeforeMethod("B") {
|
||||
if (XSPUtils.getBoolean("lock_one_hundred", false)) {
|
||||
it.result = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||
|
||||
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.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object RemoveMacroBlacklist : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
class RemoveMacroBlacklist : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
if (XSPUtils.getBoolean("remove_macro_blacklist", false)) {
|
||||
var letter = 'a'
|
||||
for (i in 0..25) {
|
||||
val classIfExists = XposedHelpers.findClassIfExists(
|
||||
"com.miui.gamebooster.v.$letter" + "0", getDefaultClassLoader()
|
||||
"com.miui.gamebooster.v.$letter" + "0", lpparam.classLoader
|
||||
) ?: continue
|
||||
if (classIfExists.declaredMethods.size in 6..12 && classIfExists.fields.isEmpty() && classIfExists.declaredFields.size >= 2) {
|
||||
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.findClass
|
||||
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 RemoveOpenAppConfirmationPopup : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
val textViewClass = "android.widget.TextView".findClass(getDefaultClassLoader())
|
||||
class RemoveOpenAppConfirmationPopup : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val textViewClass = "android.widget.TextView".findClass(lpparam.classLoader)
|
||||
textViewClass.hookAfterMethod(
|
||||
"setText",
|
||||
CharSequence::class.java
|
||||
@@ -33,5 +31,4 @@ object RemoveOpenAppConfirmationPopup : HookRegister() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,23 +17,17 @@ import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.findClass
|
||||
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||
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
|
||||
|
||||
object ShowBatteryTemperature: HookRegister() {
|
||||
class ShowBatteryTemperature: IXposedHookLoadPackage {
|
||||
|
||||
private fun getBatteryTemperature(context: Context): Int {
|
||||
return context.registerReceiver(
|
||||
null as BroadcastReceiver?,
|
||||
IntentFilter("android.intent.action.BATTERY_CHANGED")
|
||||
)!!.getIntExtra("temperature", 0) / 10
|
||||
}
|
||||
|
||||
override fun init() {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
if (!XSPUtils.getBoolean("battery_life_function", false)) return
|
||||
val a = "com.miui.powercenter.a\$a".findClass(getDefaultClassLoader())
|
||||
"com.miui.powercenter.a".hookBeforeMethod(getDefaultClassLoader(), "b", Context::class.java) {
|
||||
it.result = getBatteryTemperature(it.args[0] as Context).toString()
|
||||
val a = "com.miui.powercenter.a\$a".findClass(lpparam.classLoader)
|
||||
"com.miui.powercenter.a".hookBeforeMethod(lpparam.classLoader, "b", Context::class.java) {
|
||||
it.result = getBatteryTemperature(it.args[0] as Context).toString()
|
||||
}
|
||||
a.hookAfterMethod("run") {
|
||||
val context = AndroidAppHelper.currentApplication().applicationContext
|
||||
@@ -65,5 +59,10 @@ object ShowBatteryTemperature: HookRegister() {
|
||||
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.findClass
|
||||
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(getDefaultClassLoader())
|
||||
val textViewClass = "android.widget.TextView".findClass(lpparam.classLoader)
|
||||
textViewClass.hookBeforeMethod(
|
||||
"setText",
|
||||
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 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.callbacks.XC_LoadPackage
|
||||
|
||||
object ShowNotificationImportance : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
val channelNotificationSettingsClass = "com.android.settings.notification.ChannelNotificationSettings".findClass(getDefaultClassLoader())
|
||||
class ShowNotificationImportance : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val channelNotificationSettingsClass = "com.android.settings.notification.ChannelNotificationSettings".findClass(lpparam.classLoader)
|
||||
channelNotificationSettingsClass.hookBeforeMethod("removeDefaultPrefs") {
|
||||
if (!XSPUtils.getBoolean("show_notification_importance", false)) return@hookBeforeMethod
|
||||
val importance = it.thisObject.callMethod("findPreference", "importance") ?: return@hookBeforeMethod
|
||||
@@ -20,7 +20,7 @@ object ShowNotificationImportance : HookRegister() {
|
||||
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) {
|
||||
val channelNotificationSettings = XposedHelpers.getAdditionalInstanceField(it.thisObject, "channelNotificationSettings") ?: return@hookAfterMethod
|
||||
val mChannel = channelNotificationSettings.getObjectField("mChannel") as NotificationChannel
|
||||
@@ -31,5 +31,4 @@ object ShowNotificationImportance : HookRegister() {
|
||||
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.getObjectField
|
||||
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() {
|
||||
|
||||
override fun init() {
|
||||
class BatteryPercentage : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val size = XSPUtils.getFloat("battery_percentage_font_size", 0f)
|
||||
if (size == 0f) return
|
||||
"com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"updateResources"
|
||||
) {
|
||||
(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 com.github.kyuubiran.ezxhelper.utils.loadClass
|
||||
import com.lt2333.simplicitytools.util.*
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
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") {
|
||||
var mWeatherView: TextView? = null
|
||||
var mConstraintLayout: ConstraintLayout? = null
|
||||
val isDisplayCity = XSPUtils.getBoolean("control_center_weather_city", false)
|
||||
"com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView".hookAfterMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"onFinishInflate"
|
||||
) {
|
||||
val viewGroup = it.thisObject as ViewGroup
|
||||
@@ -185,7 +257,7 @@ object ControlCenterWeather: HookRegister() {
|
||||
}
|
||||
//解决横屏重叠
|
||||
"com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView".hookAfterMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"updateLayout"
|
||||
) {
|
||||
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.lt2333.simplicitytools.R
|
||||
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
|
||||
|
||||
object DoubleLineNetworkSpeed: HookRegister() {
|
||||
class DoubleLineNetworkSpeed : IXposedHookLoadPackage {
|
||||
|
||||
private var mLastTotalUp: 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 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)
|
||||
|
||||
@@ -38,7 +39,7 @@ object DoubleLineNetworkSpeed: HookRegister() {
|
||||
}
|
||||
|
||||
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) {
|
||||
val mView = it.thisObject as TextView
|
||||
mView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 7f)
|
||||
@@ -55,24 +56,24 @@ object DoubleLineNetworkSpeed: HookRegister() {
|
||||
}
|
||||
|
||||
"com.android.systemui.statusbar.policy.NetworkSpeedController".hookBeforeMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"formatSpeed",
|
||||
Context::class.java,
|
||||
Long::class.java
|
||||
) {
|
||||
if (getDualAlign == 0) {
|
||||
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 {
|
||||
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
|
||||
|
||||
val currentTotalTxBytes = TrafficStats.getTotalTxBytes()
|
||||
@@ -97,15 +98,15 @@ object DoubleLineNetworkSpeed: HookRegister() {
|
||||
mLastTotalUp = currentTotalTxBytes
|
||||
lastTimeStampTotalUp = nowTimeStampTotalUp
|
||||
|
||||
return if (totalUpSpeed >= 100) {
|
||||
"" + totalUpSpeed.toInt() + unit
|
||||
if (totalUpSpeed >= 100) {
|
||||
return "" + totalUpSpeed.toInt() + unit
|
||||
} else {
|
||||
"" + totalUpSpeed + unit
|
||||
return "" + totalUpSpeed + unit
|
||||
}
|
||||
}
|
||||
|
||||
//获取总的下行速度
|
||||
private fun getTotalDownloadSpeed(context: Context): String {
|
||||
fun getTotalDownloadSpeed(context: Context): String {
|
||||
var totalDownSpeed = 0F
|
||||
val currentTotalRxBytes = TrafficStats.getTotalRxBytes()
|
||||
val nowTimeStampTotalDown = System.currentTimeMillis()
|
||||
@@ -129,12 +130,13 @@ object DoubleLineNetworkSpeed: HookRegister() {
|
||||
mLastTotalDown = currentTotalRxBytes
|
||||
lastTimeStampTotalDown = nowTimeStampTotalDown
|
||||
|
||||
return if (totalDownSpeed >= 100) {
|
||||
"" + totalDownSpeed.toInt() + unit
|
||||
if (totalDownSpeed >= 100) {
|
||||
return "" + totalDownSpeed.toInt() + unit
|
||||
} 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.hasEnable
|
||||
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() {
|
||||
|
||||
override fun init() {
|
||||
"com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(getDefaultClassLoader(), "updateResources") {
|
||||
class HideBatteryIcon : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(lpparam.classLoader, "updateResources") {
|
||||
|
||||
//隐藏电池图标
|
||||
hasEnable("hide_battery_icon") {
|
||||
@@ -32,7 +32,7 @@ object HideBatteryIcon : HookRegister() {
|
||||
(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") {
|
||||
(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.hasEnable
|
||||
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() {
|
||||
|
||||
override fun init() {
|
||||
class HideHDIcon :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
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") {
|
||||
(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") {
|
||||
(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.hasEnable
|
||||
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() {
|
||||
|
||||
override fun init() {
|
||||
class HideMobileActivityIcon : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
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") {
|
||||
(it.thisObject.getObjectField("mLeftInOut") 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") {
|
||||
(it.thisObject.getObjectField("mLeftInOut") 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.hasEnable
|
||||
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.callbacks.XC_LoadPackage
|
||||
|
||||
object HideMobileTypeIcon: HookRegister() {
|
||||
|
||||
private val isBigType = XSPUtils.getBoolean("big_mobile_type_icon", false)
|
||||
|
||||
override fun init() {
|
||||
val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
|
||||
class HideMobileTypeIcon : IXposedHookLoadPackage {
|
||||
val isBigType=XSPUtils.getBoolean("big_mobile_type_icon", false)
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val iconState =
|
||||
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"initViewState",
|
||||
iconState
|
||||
) {
|
||||
@@ -25,7 +25,7 @@ object HideMobileTypeIcon: HookRegister() {
|
||||
}
|
||||
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"updateState",
|
||||
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") {
|
||||
if (isBigType) {
|
||||
(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.findClass
|
||||
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() {
|
||||
|
||||
override fun init() {
|
||||
val networkSpeedSplitterClass = "com.android.systemui.statusbar.views.NetworkSpeedSplitter".findClass(getDefaultClassLoader())
|
||||
class HideNetworkSpeedSplitter : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
val networkSpeedSplitterClass = "com.android.systemui.statusbar.views.NetworkSpeedSplitter".findClass(lpparam.classLoader)
|
||||
networkSpeedSplitterClass.hookAfterMethod("init") {
|
||||
if (XSPUtils.getBoolean("hide_network_speed_splitter", false)) {
|
||||
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.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() {
|
||||
|
||||
override fun init() {
|
||||
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy".hookBeforeMethod(getDefaultClassLoader(), "hasCorrectSubs", MutableList::class.java) {
|
||||
class HideSimIcon :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.phone.StatusBarSignalPolicy".hookBeforeMethod(lpparam.classLoader, "hasCorrectSubs", MutableList::class.java) {
|
||||
val list = it.args[0] as MutableList<*>
|
||||
val size = list.size
|
||||
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.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.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(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"setIconVisibility",
|
||||
String::class.java,
|
||||
Boolean::class.java
|
||||
) { hideIcon(it) }
|
||||
|
||||
"com.android.systemui.statusbar.phone.MiuiDripLeftStatusBarIconControllerImpl".hookBeforeMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"setIconVisibility",
|
||||
String::class.java,
|
||||
Boolean::class.java
|
||||
) { hideIcon(it) }
|
||||
|
||||
}
|
||||
|
||||
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.hookBeforeMethod
|
||||
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() {
|
||||
|
||||
override fun init() {
|
||||
"com.android.systemui.statusbar.views.NetworkSpeedView".hookBeforeMethod(getDefaultClassLoader(), "setNetworkSpeed", String::class.java) {
|
||||
class HideStatusBarNetworkSpeedSecond :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.views.NetworkSpeedView".hookBeforeMethod(lpparam.classLoader, "setNetworkSpeed", String::class.java) {
|
||||
hasEnable("hide_status_bar_network_speed_second") {
|
||||
it.args[0].isNonNull { s ->
|
||||
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.hasEnable
|
||||
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() {
|
||||
|
||||
override fun init() {
|
||||
class HideWifiActivityIcon : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
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箭头
|
||||
hasEnable("hide_wifi_activity_icon") {
|
||||
(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箭头
|
||||
hasEnable("hide_wifi_activity_icon") {
|
||||
(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.hasEnable
|
||||
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.callbacks.XC_LoadPackage
|
||||
import java.io.BufferedReader
|
||||
import java.io.FileReader
|
||||
import java.lang.reflect.Method
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
object LockScreenCurrent : HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
class LockScreenCurrent : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
hasEnable("lock_screen_charging_current") {
|
||||
"com.android.keyguard.charge.ChargeUtils".findClass(getDefaultClassLoader())
|
||||
"com.android.keyguard.charge.ChargeUtils".findClass(lpparam.classLoader)
|
||||
.hookAfterMethod(
|
||||
"getChargingHintText",
|
||||
Context::class.java,
|
||||
@@ -28,7 +28,7 @@ object LockScreenCurrent : HookRegister() {
|
||||
) {
|
||||
it.result = getCurrent() + "\n" + it.result
|
||||
}
|
||||
"com.android.systemui.statusbar.phone.KeyguardBottomAreaView".findClass(getDefaultClassLoader())
|
||||
"com.android.systemui.statusbar.phone.KeyguardBottomAreaView".findClass(lpparam.classLoader)
|
||||
.hookAfterMethod(
|
||||
"onFinishInflate"
|
||||
) {
|
||||
@@ -105,5 +105,4 @@ object LockScreenCurrent : HookRegister() {
|
||||
}
|
||||
return defaultValue
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,16 +10,16 @@ import android.view.View.OnTouchListener
|
||||
import com.lt2333.simplicitytools.util.findClass
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
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.callbacks.XC_LoadPackage
|
||||
|
||||
object LockScreenDoubleTapToSleep: HookRegister() {
|
||||
|
||||
class LockScreenDoubleTapToSleep : IXposedHookLoadPackage {
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun init() {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
hasEnable("lock_screen_double_tap_to_sleep") {
|
||||
"com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer".findClass(
|
||||
getDefaultClassLoader()
|
||||
lpparam.classLoader
|
||||
).hookBeforeMethod("onFinishInflate") {
|
||||
val view = it.thisObject as View
|
||||
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 com.github.kyuubiran.ezxhelper.utils.loadClass
|
||||
import com.lt2333.simplicitytools.util.*
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
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") {
|
||||
var mWeatherView: TextView? = null
|
||||
var mConstraintLayout: ConstraintLayout? = null
|
||||
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
|
||||
"com.android.systemui.qs.MiuiNotificationHeaderView".hookAfterMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"onFinishInflate"
|
||||
) {
|
||||
val viewGroup = it.thisObject as ViewGroup
|
||||
@@ -185,7 +187,7 @@ object NotificationWeather: HookRegister() {
|
||||
}
|
||||
//解决横屏重叠
|
||||
"com.android.systemui.qs.MiuiNotificationHeaderView".hookAfterMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"updateLayout"
|
||||
) {
|
||||
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 com.github.kyuubiran.ezxhelper.utils.loadClass
|
||||
import com.lt2333.simplicitytools.util.*
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.view.WeatherView
|
||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
|
||||
object OldNotificationWeather: HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
class OldNotificationWeather : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
hasEnable("notification_weather") {
|
||||
var mWeatherView: TextView? = null
|
||||
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
|
||||
"com.android.systemui.qs.MiuiQSHeaderView".hookAfterMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"onFinishInflate"
|
||||
) {
|
||||
val viewGroup = it.thisObject as ViewGroup
|
||||
@@ -84,7 +84,7 @@ object OldNotificationWeather: HookRegister() {
|
||||
}
|
||||
//解决横屏重叠
|
||||
"com.android.systemui.qs.MiuiQSHeaderView".hookAfterMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"updateLayout"
|
||||
) {
|
||||
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.hookAfterMethod
|
||||
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.callbacks.XC_LoadPackage
|
||||
|
||||
object OldQSCustom: HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
class OldQSCustom : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
hasEnable("old_qs_custom_switch") {
|
||||
val mRows = XSPUtils.getInt("qs_custom_rows", 3)
|
||||
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)
|
||||
|
||||
"com.android.systemui.qs.MiuiQuickQSPanel".hookBeforeMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"setMaxTiles", Int::class.java
|
||||
) {
|
||||
//未展开时的列数
|
||||
@@ -27,14 +27,14 @@ object OldQSCustom: HookRegister() {
|
||||
}
|
||||
|
||||
"com.android.systemui.qs.MiuiTileLayout".hookAfterMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"updateColumns"
|
||||
) {
|
||||
//展开时的列数
|
||||
XposedHelpers.setObjectField(it.thisObject, "mColumns", mColumns)
|
||||
}
|
||||
"com.android.systemui.qs.MiuiTileLayout".hookAfterMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"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.hookAfterMethod
|
||||
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") {
|
||||
(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") {
|
||||
it.result = false
|
||||
}
|
||||
}
|
||||
"com.android.keyguard.KeyguardMoveRightController".hookBeforeMethod(getDefaultClassLoader(), "reset") {
|
||||
"com.android.keyguard.KeyguardMoveRightController".hookBeforeMethod(lpparam.classLoader, "reset") {
|
||||
hasEnable("remove_lock_screen_camera") {
|
||||
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.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() {
|
||||
|
||||
override fun init() {
|
||||
"com.android.keyguard.negative.MiuiKeyguardMoveLeftViewContainer".hookBeforeMethod(getDefaultClassLoader(), "inflateLeftView") {
|
||||
class RemoveTheLeftSideOfTheLockScreen : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.keyguard.negative.MiuiKeyguardMoveLeftViewContainer".hookBeforeMethod(lpparam.classLoader, "inflateLeftView") {
|
||||
hasEnable("remove_the_left_side_of_the_lock_screen") {
|
||||
it.result = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,13 +4,13 @@ import com.lt2333.simplicitytools.util.callMethod
|
||||
import com.lt2333.simplicitytools.util.hasEnable
|
||||
import com.lt2333.simplicitytools.util.replaceMethod
|
||||
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() {
|
||||
|
||||
override fun init() {
|
||||
class RemoveTheMaximumNumberOfNotificationIcons : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
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) {
|
||||
it.thisObject.setIntField("MAX_DOTS", 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.hookAfterMethod
|
||||
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.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)
|
||||
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() {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
hasEnable("big_mobile_type_icon") {
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"init"
|
||||
) {
|
||||
val statusBarMobileView = it.thisObject as ViewGroup
|
||||
val context: Context = statusBarMobileView.context
|
||||
val StatusBarMobileView = it.thisObject as ViewGroup
|
||||
val context: Context = StatusBarMobileView.context
|
||||
val res: Resources = context.resources
|
||||
|
||||
//获取组件
|
||||
val mobileContainerLeftId: Int =
|
||||
val mobile_container_left_ID: Int =
|
||||
res.getIdentifier("mobile_container_left", "id", "com.android.systemui")
|
||||
val mobileContainerLeft =
|
||||
statusBarMobileView.findViewById<ViewGroup>(mobileContainerLeftId)
|
||||
val mobile_container_left =
|
||||
StatusBarMobileView.findViewById<ViewGroup>(mobile_container_left_ID)
|
||||
|
||||
val mobileTypeId: Int =
|
||||
val mobile_type_ID: Int =
|
||||
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",
|
||||
"id",
|
||||
"com.android.systemui"
|
||||
)
|
||||
val mobileLeftMobileInout =
|
||||
statusBarMobileView.findViewById<ImageView>(mobileLeftMobileInoutId)
|
||||
val mobile_left_mobile_inout =
|
||||
StatusBarMobileView.findViewById<ImageView>(mobile_left_mobile_inout_ID)
|
||||
|
||||
|
||||
//获取插入位置
|
||||
val mobileContainerRightId: Int = res.getIdentifier(
|
||||
val mobile_container_right_ID: Int = res.getIdentifier(
|
||||
"mobile_container_right",
|
||||
"id",
|
||||
"com.android.systemui"
|
||||
)
|
||||
val mobileContainerRight =
|
||||
statusBarMobileView.findViewById<ViewGroup>(mobileContainerRightId)
|
||||
val rightParentLayout = mobileContainerRight.parent as ViewGroup
|
||||
val mobileContainerRightIndex =
|
||||
rightParentLayout.indexOfChild(mobileContainerRight)
|
||||
val mobile_container_right =
|
||||
StatusBarMobileView.findViewById<ViewGroup>(mobile_container_right_ID)
|
||||
val RightParentLayout = mobile_container_right.parent as ViewGroup
|
||||
val mobile_container_right_Index =
|
||||
RightParentLayout.indexOfChild(mobile_container_right)
|
||||
|
||||
//创建新布局
|
||||
val newLinearLayoutLP = LinearLayout.LayoutParams(
|
||||
@@ -74,50 +74,50 @@ object StatusBarBigMobileTypeIcon: HookRegister() {
|
||||
}
|
||||
val newLinearlayout = LinearLayout(context).also {
|
||||
it.layoutParams = newLinearLayoutLP
|
||||
it.id = mobileContainerLeftId
|
||||
it.id = mobile_container_left_ID
|
||||
it.setPadding(leftAndRightMargin, 0, leftAndRightMargin, 0)
|
||||
}
|
||||
XposedHelpers.setObjectField(it.thisObject, "mMobileLeftContainer", newLinearlayout)
|
||||
rightParentLayout.addView(
|
||||
RightParentLayout.addView(
|
||||
newLinearlayout,
|
||||
mobileContainerRightIndex
|
||||
mobile_container_right_Index
|
||||
)
|
||||
|
||||
//将组件插入新的布局
|
||||
(mobileType.parent as ViewGroup).removeView(mobileType)
|
||||
(mobileLeftMobileInout.parent as ViewGroup).removeView(mobileLeftMobileInout)
|
||||
(mobileContainerLeft.parent as ViewGroup).removeView(mobileContainerLeft)
|
||||
(mobile_type.parent as ViewGroup).removeView(mobile_type)
|
||||
(mobile_left_mobile_inout.parent as ViewGroup).removeView(mobile_left_mobile_inout)
|
||||
(mobile_container_left.parent as ViewGroup).removeView(mobile_container_left)
|
||||
|
||||
|
||||
newLinearlayout.addView(mobileType) //类型
|
||||
val mobileTypeLp = LinearLayout.LayoutParams(
|
||||
newLinearlayout.addView(mobile_type) //类型
|
||||
val mobile_type_lp = LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
).also {
|
||||
it.gravity = Gravity.CENTER_VERTICAL
|
||||
it.topMargin = upAndDownPosition
|
||||
}
|
||||
mobileType.also {
|
||||
mobile_type.also {
|
||||
it.setTextSize(TypedValue.COMPLEX_UNIT_DIP, size)
|
||||
if (isBold) {
|
||||
it.typeface = Typeface.DEFAULT_BOLD
|
||||
}
|
||||
it.layoutParams = mobileTypeLp
|
||||
it.layoutParams = mobile_type_lp
|
||||
}
|
||||
|
||||
|
||||
newLinearlayout.addView(mobileLeftMobileInout) //箭头
|
||||
val mobileLeftMobileInoutLp = LinearLayout.LayoutParams(
|
||||
newLinearlayout.addView(mobile_left_mobile_inout) //箭头
|
||||
val mobile_left_mobile_inout_lp = LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
mobileLeftMobileInout.also {
|
||||
it.layoutParams = mobileLeftMobileInoutLp
|
||||
mobile_left_mobile_inout.also {
|
||||
it.layoutParams = mobile_left_mobile_inout_lp
|
||||
}
|
||||
|
||||
//屏蔽更新布局
|
||||
"com.android.systemui.statusbar.StatusBarMobileView".hookBeforeMethod(
|
||||
getDefaultClassLoader(),
|
||||
lpparam.classLoader,
|
||||
"updateMobileTypeLayout", String::class.java
|
||||
) {
|
||||
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.hasEnable
|
||||
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.callbacks.XC_LoadPackage
|
||||
|
||||
object StatusBarDoubleTapToSleep: HookRegister() {
|
||||
|
||||
class StatusBarDoubleTapToSleep : IXposedHookLoadPackage {
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun init() {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
hasEnable("status_bar_double_tap_to_sleep") {
|
||||
"com.android.systemui.statusbar.phone.MiuiPhoneStatusBarView".findClass(
|
||||
getDefaultClassLoader()
|
||||
lpparam.classLoader
|
||||
).hookBeforeMethod(
|
||||
"onFinishInflate"
|
||||
) {
|
||||
@@ -65,5 +65,4 @@ object StatusBarDoubleTapToSleep: HookRegister() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import android.content.res.Resources
|
||||
@@ -10,32 +9,31 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
import com.lt2333.simplicitytools.util.findClass
|
||||
import com.lt2333.simplicitytools.util.getObjectField
|
||||
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")
|
||||
object StatusBarLayout: HookRegister() {
|
||||
class StatusBarLayout : IXposedHookLoadPackage {
|
||||
|
||||
private var mLeftLayout: LinearLayout? = null
|
||||
private var mRightLayout: LinearLayout? = null
|
||||
private var mCenterLayout: LinearLayout? = null
|
||||
private var statusBar: ViewGroup? = null
|
||||
private var status_bar: ViewGroup? = null
|
||||
|
||||
private var statusBarLeft = 0
|
||||
private var statusBarTop = 0
|
||||
private var statusBarRight = 0
|
||||
private var statusBarBottom = 0
|
||||
private var status_bar_left = 0
|
||||
private var status_bar_top = 0
|
||||
private var status_bar_right = 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
|
||||
|
||||
val collapsedStatusBarFragmentClass =
|
||||
"com.android.systemui.statusbar.phone.CollapsedStatusBarFragment".findClass(getDefaultClassLoader())
|
||||
"com.android.systemui.statusbar.phone.CollapsedStatusBarFragment".findClass(lpparam.classLoader)
|
||||
|
||||
collapsedStatusBarFragmentClass.hookAfterMethod(
|
||||
"onViewCreated",
|
||||
@@ -46,36 +44,36 @@ object StatusBarLayout: HookRegister() {
|
||||
param.thisObject.getObjectField("mStatusBar") as ViewGroup
|
||||
val context: Context = MiuiPhoneStatusBarView.context
|
||||
val res: Resources = MiuiPhoneStatusBarView.resources
|
||||
val statusBarId: Int = res.getIdentifier("status_bar", "id", "com.android.systemui")
|
||||
val statusBarContentsId: Int =
|
||||
val status_bar_ID: Int = res.getIdentifier("status_bar", "id", "com.android.systemui")
|
||||
val status_bar_contents_ID: Int =
|
||||
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")
|
||||
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||
val phoneStatusBarLeftContainerId: Int =
|
||||
val clock_ID: Int = res.getIdentifier("clock", "id", "com.android.systemui")
|
||||
val phone_status_bar_left_container_ID: Int =
|
||||
res.getIdentifier("phone_status_bar_left_container", "id", "com.android.systemui")
|
||||
val notificationIconAreaInnerId: Int =
|
||||
res.getIdentifier("notification_icon_area_inner", "id", "com.android.systemui")
|
||||
statusBar = MiuiPhoneStatusBarView.findViewById(statusBarId)
|
||||
val statusBarContents: ViewGroup =
|
||||
MiuiPhoneStatusBarView.findViewById(statusBarContentsId)
|
||||
if (statusBar == null) return@hookAfterMethod
|
||||
val clock: TextView = MiuiPhoneStatusBarView.findViewById(clockId)
|
||||
val phoneStatusBarLeftContainer: ViewGroup =
|
||||
MiuiPhoneStatusBarView.findViewById(phoneStatusBarLeftContainerId)
|
||||
val notificationIconAreaInner: ViewGroup =
|
||||
MiuiPhoneStatusBarView.findViewById(notificationIconAreaInnerId)
|
||||
val systemIconArea: ViewGroup =
|
||||
MiuiPhoneStatusBarView.findViewById(systemIconAreaId)
|
||||
val fullscreen_notification_icon_area_ID: Int =
|
||||
res.getIdentifier("fullscreen_notification_icon_area", "id", "com.android.systemui")
|
||||
status_bar = MiuiPhoneStatusBarView.findViewById(status_bar_ID)
|
||||
val status_bar_contents: ViewGroup =
|
||||
MiuiPhoneStatusBarView.findViewById(status_bar_contents_ID)
|
||||
if (status_bar == null) return@hookAfterMethod
|
||||
val Clock: View = MiuiPhoneStatusBarView.findViewById(clock_ID)
|
||||
val phone_status_bar_left_container: ViewGroup =
|
||||
MiuiPhoneStatusBarView.findViewById(phone_status_bar_left_container_ID)
|
||||
val fullscreen_notification_icon_area: ViewGroup =
|
||||
MiuiPhoneStatusBarView.findViewById(fullscreen_notification_icon_area_ID)
|
||||
val system_icon_area: ViewGroup =
|
||||
MiuiPhoneStatusBarView.findViewById(system_icon_area_ID)
|
||||
|
||||
(clock.parent as ViewGroup).removeView(clock)
|
||||
(phoneStatusBarLeftContainer.parent as ViewGroup).removeView(
|
||||
phoneStatusBarLeftContainer
|
||||
(Clock.parent as ViewGroup).removeView(Clock)
|
||||
(phone_status_bar_left_container.parent as ViewGroup).removeView(
|
||||
phone_status_bar_left_container
|
||||
)
|
||||
(notificationIconAreaInner.parent as ViewGroup).removeView(
|
||||
notificationIconAreaInner
|
||||
(fullscreen_notification_icon_area.parent as ViewGroup).removeView(
|
||||
fullscreen_notification_icon_area
|
||||
)
|
||||
(systemIconArea.parent as ViewGroup).removeView(systemIconArea)
|
||||
(system_icon_area.parent as ViewGroup).removeView(system_icon_area)
|
||||
|
||||
val mConstraintLayoutLp = ConstraintLayout.LayoutParams(
|
||||
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
||||
@@ -85,14 +83,14 @@ object StatusBarLayout: HookRegister() {
|
||||
val mConstraintLayout =
|
||||
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
|
||||
)
|
||||
|
||||
notificationIconAreaInner.layoutParams = fullscreen_notification_icon_area_lp
|
||||
fullscreen_notification_icon_area.layoutParams = fullscreen_notification_icon_area_lp
|
||||
|
||||
//增加一个左对齐布局
|
||||
mLeftLayout = LinearLayout(context)
|
||||
@@ -114,30 +112,30 @@ object StatusBarLayout: HookRegister() {
|
||||
LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 1.0f)
|
||||
mRightLayout!!.layoutParams = RightLp
|
||||
mRightLayout!!.gravity = Gravity.END or Gravity.CENTER_VERTICAL
|
||||
mLeftLayout!!.addView(phoneStatusBarLeftContainer)
|
||||
mLeftLayout!!.addView(phone_status_bar_left_container)
|
||||
mLeftLayout!!.addView(mConstraintLayout)
|
||||
|
||||
mCenterLayout!!.addView(clock)
|
||||
mRightLayout!!.addView(systemIconArea)
|
||||
statusBarContents.addView(mLeftLayout, 0)
|
||||
statusBarContents.addView(mCenterLayout)
|
||||
statusBarContents.addView(mRightLayout)
|
||||
mCenterLayout!!.addView(Clock)
|
||||
mRightLayout!!.addView(system_icon_area)
|
||||
status_bar_contents.addView(mLeftLayout, 0)
|
||||
status_bar_contents.addView(mCenterLayout)
|
||||
status_bar_contents.addView(mRightLayout)
|
||||
|
||||
statusBarLeft = statusBar!!.paddingLeft
|
||||
statusBarTop = statusBar!!.paddingTop
|
||||
statusBarRight = statusBar!!.paddingRight
|
||||
statusBarBottom = statusBar!!.paddingBottom
|
||||
status_bar_left = status_bar!!.paddingLeft
|
||||
status_bar_top = status_bar!!.paddingTop
|
||||
status_bar_right = status_bar!!.paddingRight
|
||||
status_bar_bottom = status_bar!!.paddingBottom
|
||||
|
||||
|
||||
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
|
||||
val customLeftMargin = XSPUtils.getInt("status_bar_left_margin", 0)
|
||||
if (customLeftMargin != 0) {
|
||||
statusBarLeft = customLeftMargin
|
||||
val custom_left_margin = XSPUtils.getInt("status_bar_left_margin", 0)
|
||||
if (custom_left_margin != 0) {
|
||||
status_bar_left = custom_left_margin
|
||||
}
|
||||
|
||||
val customRightMargin = XSPUtils.getInt("status_bar_right_margin", 0)
|
||||
if (customRightMargin != 0) {
|
||||
statusBarRight = customRightMargin
|
||||
val custom_right_margin = XSPUtils.getInt("status_bar_right_margin", 0)
|
||||
if (custom_right_margin != 0) {
|
||||
status_bar_right = custom_right_margin
|
||||
}
|
||||
updateLayout(context)
|
||||
}
|
||||
@@ -145,7 +143,7 @@ object StatusBarLayout: HookRegister() {
|
||||
}
|
||||
|
||||
val phoneStatusBarViewClass =
|
||||
"com.android.systemui.statusbar.phone.PhoneStatusBarView".findClass(getDefaultClassLoader())
|
||||
"com.android.systemui.statusbar.phone.PhoneStatusBarView".findClass(lpparam.classLoader)
|
||||
|
||||
phoneStatusBarViewClass.hookAfterMethod("updateLayoutForCutout") {
|
||||
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
|
||||
@@ -153,32 +151,21 @@ object StatusBarLayout: HookRegister() {
|
||||
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
|
||||
if (mConfiguration.orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||
mLeftLayout!!.setPadding(statusBarLeft, 0, 0, 0)
|
||||
mRightLayout!!.setPadding(0, 0, statusBarRight, 0)
|
||||
statusBar!!.setPadding(0, statusBarTop, 0, statusBarBottom)
|
||||
mLeftLayout!!.setPadding(status_bar_left, 0, 0, 0)
|
||||
mRightLayout!!.setPadding(0, 0, status_bar_right, 0)
|
||||
status_bar!!.setPadding(0, status_bar_top, 0, status_bar_bottom)
|
||||
} else {
|
||||
//横屏状态
|
||||
mLeftLayout!!.setPadding(175, 0, 0, 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.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() {
|
||||
|
||||
override fun init() {
|
||||
"com.android.systemui.statusbar.policy.NetworkSpeedController".hookBeforeMethod(getDefaultClassLoader(), "postUpdateNetworkSpeedDelay", Long::class.java) {
|
||||
class StatusBarNetworkSpeedRefreshSpeed :IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.systemui.statusbar.policy.NetworkSpeedController".hookBeforeMethod(lpparam.classLoader, "postUpdateNetworkSpeedDelay", Long::class.java) {
|
||||
hasEnable("status_bar_network_speed_refresh_speed") {
|
||||
it.args[0] = 1000L
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,23 +2,22 @@ package com.lt2333.simplicitytools.hook.app.systemui
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.res.Resources
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.provider.Settings
|
||||
import android.util.AttributeSet
|
||||
import android.util.TypedValue
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import com.lt2333.simplicitytools.util.*
|
||||
import com.lt2333.simplicitytools.util.xposed.base.HookRegister
|
||||
import com.lt2333.simplicitytools.util.XSPUtils
|
||||
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.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
object StatusBarTimeCustomization : HookRegister() {
|
||||
class StatusBarTimeCustomization : IXposedHookLoadPackage {
|
||||
|
||||
private val isYear = XSPUtils.getBoolean("status_bar_time_year", 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 getClockSize = XSPUtils.getInt("status_bar_clock_size", 0)
|
||||
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 var nowTime: Date? = null
|
||||
private var now_time: Date? = null
|
||||
private var str = ""
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun init() {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
if (isOpen) {
|
||||
var c: Context? = null
|
||||
val miuiClockClass =
|
||||
"com.android.systemui.statusbar.views.MiuiClock".findClass(getDefaultClassLoader())
|
||||
"com.android.systemui.statusbar.views.MiuiClock".findClass(lpparam.classLoader)
|
||||
miuiClockClass.hookAfterConstructor(
|
||||
Context::class.java,
|
||||
AttributeSet::class.java,
|
||||
@@ -55,16 +52,16 @@ object StatusBarTimeCustomization : HookRegister() {
|
||||
textV.isSingleLine = false
|
||||
if (isDoubleLine) {
|
||||
str = "\n"
|
||||
var clockDoubleLineSize = 7F
|
||||
var clock_double_line_size = 7F
|
||||
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)
|
||||
} else {
|
||||
if (getClockSize != 0) {
|
||||
val clockSize = getClockSize.toFloat()
|
||||
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clockSize)
|
||||
val clock_size = getClockSize.toFloat()
|
||||
textV.setTextSize(TypedValue.COMPLEX_UNIT_DIP, clock_size)
|
||||
}
|
||||
}
|
||||
val d: Method = textV.javaClass.getDeclaredMethod("updateTime")
|
||||
@@ -72,7 +69,6 @@ object StatusBarTimeCustomization : HookRegister() {
|
||||
d.isAccessible = true
|
||||
d.invoke(textV)
|
||||
}
|
||||
|
||||
class T : TimerTask() {
|
||||
override fun run() {
|
||||
Handler(textV.context.mainLooper).post(r)
|
||||
@@ -91,33 +87,16 @@ object StatusBarTimeCustomization : HookRegister() {
|
||||
Settings.System.TIME_12_24
|
||||
)
|
||||
val is24 = t == "24"
|
||||
nowTime = Calendar.getInstance().time
|
||||
now_time = Calendar.getInstance().time
|
||||
textV.text = getDate(c!!) + str + getTime(c!!, is24)
|
||||
}
|
||||
} 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")
|
||||
private fun getDate(context: Context): String {
|
||||
var datePattern = ""
|
||||
@@ -155,7 +134,7 @@ object StatusBarTimeCustomization : HookRegister() {
|
||||
if (!isHideSpace) datePattern = "$datePattern "
|
||||
}
|
||||
}
|
||||
datePattern = SimpleDateFormat(datePattern).format(nowTime)
|
||||
datePattern = SimpleDateFormat(datePattern).format(now_time)
|
||||
return datePattern
|
||||
}
|
||||
|
||||
@@ -165,7 +144,7 @@ object StatusBarTimeCustomization : HookRegister() {
|
||||
val isZh = isZh(context)
|
||||
timePattern += if (t) "HH:mm" else "h:mm"
|
||||
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)
|
||||
timePattern = getDoubleHour() + timePattern
|
||||
return timePattern
|
||||
@@ -176,7 +155,7 @@ object StatusBarTimeCustomization : HookRegister() {
|
||||
var period = ""
|
||||
if (isPeriod) {
|
||||
if (isZh) {
|
||||
when (SimpleDateFormat("HH").format(nowTime)) {
|
||||
when (SimpleDateFormat("HH").format(now_time)) {
|
||||
"00", "01", "02", "03", "04", "05" -> {
|
||||
period = "凌晨"
|
||||
}
|
||||
@@ -197,7 +176,7 @@ object StatusBarTimeCustomization : HookRegister() {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
period = SimpleDateFormat("a").format(nowTime)
|
||||
period = SimpleDateFormat("a").format(now_time)
|
||||
if (!isHideSpace) {
|
||||
period = " $period"
|
||||
}
|
||||
@@ -211,7 +190,7 @@ object StatusBarTimeCustomization : HookRegister() {
|
||||
private fun getDoubleHour(): String {
|
||||
var doubleHour = ""
|
||||
if (isDoubleHour) {
|
||||
when (SimpleDateFormat("HH").format(nowTime)) {
|
||||
when (SimpleDateFormat("HH").format(now_time)) {
|
||||
"23", "00" -> {
|
||||
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.hookMethod
|
||||
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.callbacks.XC_LoadPackage
|
||||
|
||||
object WaveCharge: HookRegister() {
|
||||
|
||||
override fun init() {
|
||||
class WaveCharge : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?) {
|
||||
hasEnable("enable_wave_charge_animation") {
|
||||
findMethod("com.android.keyguard.charge.ChargeUtils") {
|
||||
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.hasEnable
|
||||
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() {
|
||||
|
||||
override fun init() {
|
||||
"com.android.thememanager.basemodule.ad.model.AdInfoResponse".hookBeforeMethod(getDefaultClassLoader(), "isAdValid", "com.android.thememanager.basemodule.ad.model.AdInfo".findClass(getDefaultClassLoader())) {
|
||||
class RemoveAds : IXposedHookLoadPackage {
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
"com.android.thememanager.basemodule.ad.model.AdInfoResponse".hookBeforeMethod(lpparam.classLoader, "isAdValid", "com.android.thememanager.basemodule.ad.model.AdInfo".findClass(lpparam.classLoader)) {
|
||||
hasEnable("remove_thememanager_ads") {
|
||||
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="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="cast">Transmitir</string>
|
||||
</resources>
|
||||
|
||||
@@ -182,9 +182,4 @@
|
||||
<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_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>
|
||||
|
||||
@@ -191,6 +191,5 @@
|
||||
<string name="range">Диапазон: </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>
|
||||
<string name="force_support_send_app">Принудительно включить передачу всех приложений</string>
|
||||
</resources>
|
||||
|
||||
@@ -187,7 +187,4 @@
|
||||
<string name="input_error">Giriş hatası</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="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>
|
||||
|
||||
@@ -187,4 +187,5 @@
|
||||
<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="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>
|
||||
|
||||
@@ -187,6 +187,5 @@
|
||||
<string name="range">范围:</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>
|
||||
<string name="force_support_send_app">强制允许所有应用接力</string>
|
||||
</resources>
|
||||
|
||||
@@ -186,7 +186,4 @@
|
||||
<string name="input_error">輸入錯誤</string>
|
||||
<string name="range">範圍:</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>
|
||||
|
||||
@@ -11,6 +11,5 @@
|
||||
<item>com.android.settings</item>
|
||||
<item>com.android.thememanager</item>
|
||||
<item>com.miui.screenshot</item>
|
||||
<item>com.milink.service</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
@@ -190,7 +190,4 @@
|
||||
<string name="input_error">Input error</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="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>
|
||||
|
||||
Reference in New Issue
Block a user