Compare commits

31 Commits

Author SHA1 Message Date
乌堆小透明
d01e195937 New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin
2022-04-22 23:06:47 +08:00
乌堆小透明
4701d895c0 New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin
2022-04-22 21:16:20 +08:00
乌堆小透明
9e1662a685 New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin
2022-04-22 15:57:15 +08:00
乌堆小透明
b395e3e1d0 New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin
2022-04-22 15:57:08 +08:00
乌堆小透明
adee31ee48 New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin
2022-04-19 16:08:45 +08:00
乌堆小透明
f5744f81ef New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin
2022-04-17 17:31:45 +08:00
乌堆小透明
0055a3f60b New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin
2022-04-17 17:31:38 +08:00
乌堆小透明
b3cf299fa4 New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin
2022-04-17 17:10:53 +08:00
乌堆小透明
030800021a New translations strings.xml (Russian)
[ci skip] New translations from Crowdin
2022-04-17 10:25:12 +08:00
乌堆小透明
7e5f248c26 New translations strings.xml (Polish)
[ci skip] New translations from Crowdin
2022-04-17 05:37:38 +08:00
乌堆小透明
2c0766008f New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin
2022-04-17 04:37:46 +08:00
乌堆小透明
c85363ccbe New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin
2022-04-17 04:37:45 +08:00
乌堆小透明
81119a58aa New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin
2022-04-17 03:25:41 +08:00
乌堆小透明
e44d886d8f New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin
2022-04-17 03:25:33 +08:00
乌堆小透明
acee1cf2f7 New translations strings.xml (Polish)
[ci skip] New translations from Crowdin
2022-04-17 03:25:29 +08:00
乌堆小透明
7c0d9a9ff5 New translations strings.xml (Portuguese)
[ci skip] New translations from Crowdin
2022-04-17 03:25:28 +08:00
乌堆小透明
e218612103 New translations strings.xml (Russian)
[ci skip] New translations from Crowdin
2022-04-17 03:25:27 +08:00
乌堆小透明
25ce374dad New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin
2022-04-17 03:25:24 +08:00
乌堆小透明
01b82d98ed New translations strings.xml (Chinese Simplified)
[ci skip] New translations from Crowdin
2022-04-17 03:25:23 +08:00
乌堆小透明
075cebe5ca New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin
2022-04-17 03:25:21 +08:00
乌堆小透明
11e830f35d New translations strings.xml (Vietnamese)
[ci skip] New translations from Crowdin
2022-04-17 03:25:20 +08:00
乌堆小透明
d55a226554 New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin
2022-04-17 03:25:16 +08:00
乌堆小透明
df1fcac870 New translations strings.xml (Portuguese, Brazilian)
[ci skip] New translations from Crowdin
2022-04-16 04:09:34 +08:00
乌堆小透明
8a206e2db9 New translations strings.xml (Polish)
[ci skip] New translations from Crowdin
2022-04-16 03:07:07 +08:00
乌堆小透明
9f3b5418e6 New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin
2022-04-15 22:12:17 +08:00
乌堆小透明
8f3504b9c2 New translations strings.xml (Japanese)
[ci skip] New translations from Crowdin
2022-04-15 20:49:31 +08:00
乌堆小透明
76f95fb9c1 New translations strings.xml (Chinese Traditional)
[ci skip] New translations from Crowdin
2022-04-14 17:37:57 +08:00
乌堆小透明
2a9c5fa9c9 New translations strings.xml (Romanian)
[ci skip] New translations from Crowdin
2022-04-14 14:34:53 +08:00
乌堆小透明
49698e0260 New translations strings.xml (Turkish)
[ci skip] New translations from Crowdin
2022-04-14 00:43:16 +08:00
乌堆小透明
b9b27e015c New translations strings.xml (Russian)
[ci skip] New translations from Crowdin
2022-04-14 00:43:15 +08:00
乌堆小透明
6315a286ce New translations strings.xml (Spanish)
[ci skip] New translations from Crowdin
2022-04-14 00:43:14 +08:00
94 changed files with 1888 additions and 1405 deletions

View File

@@ -1,6 +1,6 @@
<div align="center"> <div align="center">
<img width="160" src="https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/ic_launcher.png" alt="logo"> <img width="160" src="https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/ic_launcher.png" alt="logo">
<h1>WooBox For MIUI</h1> <h1>Simplicity Tools</h1>
<p> <p>
<b><a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/README_EN.md">English</a> 丨 简体中文</b> <b><a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/README_EN.md">English</a> 丨 简体中文</b>
</p> </p>

View File

@@ -1,6 +1,6 @@
<div align="center"> <div align="center">
<img width="160" src="https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/ic_launcher.png" alt="logo"> <img width="160" src="https://raw.githubusercontent.com/LittleTurtle2333/SimplicityTools/main/doc/ic_launcher.png" alt="logo">
<h1>WooBox For MIUI</h1> <h1>Simplicity Tools</h1>
<p> <p>
<b>English 丨 <a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/README.md">简体中文</a></b> <b>English 丨 <a href="https://github.com/LittleTurtle2333/SimplicityTools/blob/main/README.md">简体中文</a></b>
</p> </p>

View File

@@ -12,8 +12,8 @@ android {
applicationId = "com.lt2333.simplicitytools" applicationId = "com.lt2333.simplicitytools"
minSdk = 31 minSdk = 31
targetSdk = 32 targetSdk = 32
versionCode = 66 versionCode = 63
versionName = "1.6.5" versionName = "1.6.2"
} }
buildTypes { buildTypes {
@@ -45,20 +45,22 @@ android {
applicationVariants.all { applicationVariants.all {
outputs.all { outputs.all {
(this as BaseVariantOutputImpl).outputFileName = (this as BaseVariantOutputImpl).outputFileName =
"WooBoxForMIUI-$versionName-$name.apk" "Simplicity_Tools_Xposed-$versionName-$name.apk"
} }
} }
} }
dependencies { dependencies {
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
//API //API
compileOnly("de.robv.android.xposed:api:82") compileOnly("de.robv.android.xposed:api:82")
implementation("com.github.kyuubiran:EzXHelper:0.8.6")
//UI //UI
implementation(project(":blockmiui")) implementation(project(":blockmiui"))
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
//APP Center val appCenterSdkVersion = "4.3.1"
val appCenterSdkVersion = "4.4.3"
implementation("com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}") implementation("com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}")
implementation("com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}") implementation("com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}")
implementation("com.github.kyuubiran:EzXHelper:0.7.4")
} }

View File

@@ -13,7 +13,6 @@
<activity <activity
android:name=".activity.SettingsActivity" android:name=".activity.SettingsActivity"
android:exported="true" android:exported="true"
android:screenOrientation="portrait"
android:launchMode="singleTop"> android:launchMode="singleTop">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@@ -22,7 +21,6 @@
</activity> </activity>
<activity-alias <activity-alias
android:label="WooBox"
android:name=".launcher" android:name=".launcher"
android:enabled="true" android:enabled="true"
android:exported="true" android:exported="true"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 125 KiB

View File

@@ -745,13 +745,6 @@ class SettingsActivity : MIUIActivity() {
SwitchV("notification_weather_city"), SwitchV("notification_weather_city"),
dataBindingRecv = showWeatherMainSwitchBinding.binding.getRecv(2) dataBindingRecv = showWeatherMainSwitchBinding.binding.getRecv(2)
) )
TextSummaryWithSwitch(
TextSummaryV(
textId = R.string.can_notification_slide,
tipsId = R.string.can_notification_slide_summary,
),
SwitchV("can_notification_slide"),
)
Line() Line()
TitleText(resId = R.string.control_center) TitleText(resId = R.string.control_center)
val controlCenterWeatherBinding = GetDataBinding(object : DefValue { val controlCenterWeatherBinding = GetDataBinding(object : DefValue {

View File

@@ -9,10 +9,10 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
object Android : AppRegister() { object Android : AppRegister() {
override val packageName: String = "android" override val packageName: String = "android"
override val processName: List<String> = emptyList() override val processName: List<String> = emptyList()
override val logTag: String = "WooBox" override val logTag: String = "Simplicitytools"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("WooBox: 成功 Hook " + javaClass.simpleName) XposedBridge.log("Simplicitytools: 成功 Hook " + javaClass.simpleName)
//核心破解 //核心破解
CorePatch().handleLoadPackage(lpparam) CorePatch().handleLoadPackage(lpparam)

View File

@@ -8,10 +8,10 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
object Cast: AppRegister() { object Cast: AppRegister() {
override val packageName: String = "com.milink.service" override val packageName: String = "com.milink.service"
override val processName: List<String> = emptyList() override val processName: List<String> = emptyList()
override val logTag: String = "WooBox" override val logTag: String = "Simplicitytools"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName) XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
autoInitHooks(lpparam, autoInitHooks(lpparam,
ForceSupportSendApp, //强制允许所有应用接力 ForceSupportSendApp, //强制允许所有应用接力
) )

View File

@@ -8,10 +8,10 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
object MediaEditor: AppRegister() { object MediaEditor: AppRegister() {
override val packageName: String = "com.miui.mediaeditor" override val packageName: String = "com.miui.mediaeditor"
override val processName: List<String> = emptyList() override val processName: List<String> = emptyList()
override val logTag: String = "WooBox" override val logTag: String = "Simplicitytools"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName) XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
autoInitHooks(lpparam, autoInitHooks(lpparam,
UnlockUnlimitedCropping, //解锁裁切最小值 UnlockUnlimitedCropping, //解锁裁切最小值
) )

View File

@@ -9,10 +9,10 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
object MiuiHome: AppRegister() { object MiuiHome: AppRegister() {
override val packageName: String = "com.miui.home" override val packageName: String = "com.miui.home"
override val processName: List<String> = emptyList() override val processName: List<String> = emptyList()
override val logTag: String = "WooBox" override val logTag: String = "Simplicitytools"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName) XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
autoInitHooks(lpparam, autoInitHooks(lpparam,
AlwaysDisplayTime, //时钟显示时钟 AlwaysDisplayTime, //时钟显示时钟
DoubleTapToSleep, //双击锁屏 DoubleTapToSleep, //双击锁屏

View File

@@ -9,10 +9,10 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
object PowerKeeper: AppRegister() { object PowerKeeper: AppRegister() {
override val packageName: String = "com.miui.powerkeeper" override val packageName: String = "com.miui.powerkeeper"
override val processName: List<String> = emptyList() override val processName: List<String> = emptyList()
override val logTag: String = "WooBox" override val logTag: String = "Simplicitytools"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName) XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
autoInitHooks(lpparam, autoInitHooks(lpparam,
LockMaxFps, //锁定最高刷新率 LockMaxFps, //锁定最高刷新率
PreventRecoveryOfBatteryOptimizationWhitelist, //防止恢复电池优化白名单 PreventRecoveryOfBatteryOptimizationWhitelist, //防止恢复电池优化白名单

View File

@@ -8,10 +8,10 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
object RearDisplay: AppRegister() { object RearDisplay: AppRegister() {
override val packageName: String = "com.xiaomi.misubscreenui" override val packageName: String = "com.xiaomi.misubscreenui"
override val processName: List<String> = emptyList() override val processName: List<String> = emptyList()
override val logTag: String = "WooBox" override val logTag: String = "Simplicitytools"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName) XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
autoInitHooks(lpparam, autoInitHooks(lpparam,
RearDisplayWeather, //背屏显示天气 RearDisplayWeather, //背屏显示天气
) )

View File

@@ -8,10 +8,10 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
object ScreenShot: AppRegister() { object ScreenShot: AppRegister() {
override val packageName: String = "com.miui.screenshot" override val packageName: String = "com.miui.screenshot"
override val processName: List<String> = emptyList() override val processName: List<String> = emptyList()
override val logTag: String = "WooBox" override val logTag: String = "Simplicitytools"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("WooBox: 成功 Hook " + javaClass.simpleName) XposedBridge.log("Simplicitytools: 成功 Hook " + javaClass.simpleName)
autoInitHooks(lpparam, autoInitHooks(lpparam,
UnlockUnlimitedCropping, //锁定最高刷新率 UnlockUnlimitedCropping, //锁定最高刷新率
) )

View File

@@ -8,10 +8,10 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
object SecurityCenter: AppRegister() { object SecurityCenter: AppRegister() {
override val packageName: String = "com.miui.securitycenter" override val packageName: String = "com.miui.securitycenter"
override val processName: List<String> = emptyList() override val processName: List<String> = emptyList()
override val logTag: String = "WooBox" override val logTag: String = "Simplicitytools"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("WooBox: 成功 Hook " + javaClass.simpleName) XposedBridge.log("Simplicitytools: 成功 Hook " + javaClass.simpleName)
autoInitHooks(lpparam, autoInitHooks(lpparam,
SkipWaitingTime, //跳过 5/10秒等待时间 SkipWaitingTime, //跳过 5/10秒等待时间
LockOneHundred, //锁定 100分 LockOneHundred, //锁定 100分

View File

@@ -8,10 +8,10 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
object Settings: AppRegister() { object Settings: AppRegister() {
override val packageName: String = "com.android.settings" override val packageName: String = "com.android.settings"
override val processName: List<String> = emptyList() override val processName: List<String> = emptyList()
override val logTag: String = "WooBox" override val logTag: String = "Simplicitytools"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName) XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
autoInitHooks(lpparam, autoInitHooks(lpparam,
ShowNotificationImportance, //显示通知重要程度 ShowNotificationImportance, //显示通知重要程度
) )

View File

@@ -8,10 +8,10 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
object SystemUI: AppRegister() { object SystemUI: AppRegister() {
override val packageName: String = "com.android.systemui" override val packageName: String = "com.android.systemui"
override val processName: List<String> = emptyList() override val processName: List<String> = emptyList()
override val logTag: String = "WooBox" override val logTag: String = "Simplicitytools"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName) XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
autoInitHooks(lpparam, autoInitHooks(lpparam,
HideStatusBarIcon, //隐藏状态栏图标 HideStatusBarIcon, //隐藏状态栏图标
HideBatteryIcon, //隐藏电池 HideBatteryIcon, //隐藏电池
@@ -41,7 +41,6 @@ object SystemUI: AppRegister() {
StatusBarBigMobileTypeIcon, //大移动类型 StatusBarBigMobileTypeIcon, //大移动类型
BatteryPercentage, //电量百分比 BatteryPercentage, //电量百分比
CustomMobileTypeText, //自定义移动类型文本 CustomMobileTypeText, //自定义移动类型文本
CanNotificationSlide, //允许下滑通知打开小窗
LockScreenClockDisplaySeconds, // 锁屏时钟显示秒 LockScreenClockDisplaySeconds, // 锁屏时钟显示秒
) )
} }

View File

@@ -8,10 +8,10 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
object ThemeManager: AppRegister() { object ThemeManager: AppRegister() {
override val packageName: String = "com.android.thememanager" override val packageName: String = "com.android.thememanager"
override val processName: List<String> = emptyList() override val processName: List<String> = emptyList()
override val logTag: String = "WooBox" override val logTag: String = "Simplicitytools"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("WooBox: 成功 Hook "+javaClass.simpleName) XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
autoInitHooks(lpparam, autoInitHooks(lpparam,
RemoveAds, //移除主题壁纸的广告 RemoveAds, //移除主题壁纸的广告
) )

View File

@@ -1,27 +1,31 @@
package com.lt2333.simplicitytools.hook.app package com.lt2333.simplicitytools.hook.app
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.lt2333.simplicitytools.util.XSPUtils
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.github.kyuubiran.ezxhelper.utils.loadClassOrNull
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.AppRegister import com.lt2333.simplicitytools.util.xposed.base.AppRegister
import de.robv.android.xposed.XposedBridge import de.robv.android.xposed.XposedHelpers
import de.robv.android.xposed.callbacks.XC_LoadPackage import de.robv.android.xposed.callbacks.XC_LoadPackage
object Updater: AppRegister() { object Updater: AppRegister() {
override val packageName: String = "com.android.updater" override val packageName: String = "com.android.updater"
override val processName: List<String> = emptyList() override val processName: List<String> = emptyList()
override val logTag: String = "WooBox" override val logTag: String = "Simplicitytools"
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) { override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
XposedBridge.log("WooBox: 成功 Hook " + javaClass.simpleName) if (XSPUtils.getBoolean("remove_ota_validate", false)) {
var letter = 'a'
hasEnable("remove_ota_validate") { for (i in 0..25) {
Array(26) { "com.android.updater.common.utils.${'a' + it}" } val classIfExists = XposedHelpers.findClassIfExists(
.mapNotNull { loadClassOrNull(it) } "com.android.updater.common.utils.$letter", lpparam.classLoader
.firstOrNull() { it.declaredFields.size >= 9 && it.declaredMethods.size > 60 } ) ?: continue
?.findMethod { name == "T" && returnType == Boolean::class.java } if (classIfExists.declaredFields.size >= 9 && classIfExists.declaredMethods.size > 60) {
?.hookReturnConstant(false) classIfExists.hookBeforeMethod("T") {
it.result = false
}
return
}
letter++
}
} }
} }
} }

View File

@@ -1,15 +1,21 @@
package com.lt2333.simplicitytools.hook.app.android package com.lt2333.simplicitytools.hook.app.android
import android.content.Context import android.content.Context
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object AllowUntrustedTouches : HookRegister() { object AllowUntrustedTouches : HookRegister() {
override fun init() = hasEnable("allow_untrusted_touches") {
findMethod("android.hardware.input.InputManager") { override fun init() {
name == "getBlockUntrustedTouchesMode" && parameterTypes[0] == Context::class.java hasEnable("allow_untrusted_touches") {
}.hookReturnConstant(0) "android.hardware.input.InputManager".hookBeforeMethod(
getDefaultClassLoader(),
"getBlockUntrustedTouchesMode",
Context::class.java
) {
it.result = 0
}
}
} }
} }

View File

@@ -1,18 +1,17 @@
package com.lt2333.simplicitytools.hook.app.android package com.lt2333.simplicitytools.hook.app.android
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object DeleteOnPostNotification : HookRegister() { object DeleteOnPostNotification : HookRegister() {
override fun init() { override fun init() {
findMethod("com.android.server.wm.AlertWindowNotification") { "com.android.server.wm.AlertWindowNotification".hookBeforeMethod(getDefaultClassLoader(), "onPostNotification") {
name == "onPostNotification"
}.hookBefore {
hasEnable("delete_on_post_notification") { hasEnable("delete_on_post_notification") {
it.result = null it.result = null
} }
} }
} }
} }

View File

@@ -1,18 +1,17 @@
package com.lt2333.simplicitytools.hook.app.android package com.lt2333.simplicitytools.hook.app.android
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object DisableFlagSecure : HookRegister() { object DisableFlagSecure : HookRegister() {
override fun init() { override fun init() {
findMethod("com.android.server.wm.WindowState") { "com.android.server.wm.WindowState".hookBeforeMethod(getDefaultClassLoader(), "isSecureLocked") {
name == "isSecureLocked"
}.hookBefore {
hasEnable("disable_flag_secure") { hasEnable("disable_flag_secure") {
it.result = false it.result = false
} }
} }
} }
} }

View File

@@ -1,18 +1,17 @@
package com.lt2333.simplicitytools.hook.app.android package com.lt2333.simplicitytools.hook.app.android
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.github.kyuubiran.ezxhelper.utils.putObject
import com.lt2333.simplicitytools.util.XSPUtils 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 com.lt2333.simplicitytools.util.xposed.base.HookRegister
object MaxWallpaperScale : HookRegister() { object MaxWallpaperScale : HookRegister() {
override fun init() { override fun init() {
findMethod("com.android.server.wm.WallpaperController") { "com.android.server.wm.WallpaperController".hookBeforeMethod(getDefaultClassLoader(), "zoomOutToScale", Float::class.java) {
name == "zoomOutToScale" && parameterTypes[0] == Float::class.java
}.hookBefore {
val value = XSPUtils.getFloat("max_wallpaper_scale", 1.1f) val value = XSPUtils.getFloat("max_wallpaper_scale", 1.1f)
it.thisObject.putObject("mMaxWallpaperScale", value) it.thisObject.setFloatField("mMaxWallpaperScale", value)
} }
} }
} }

View File

@@ -1,45 +1,38 @@
package com.lt2333.simplicitytools.hook.app.android package com.lt2333.simplicitytools.hook.app.android
import android.content.Context import android.content.Context
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable 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 com.lt2333.simplicitytools.util.xposed.base.HookRegister
object RemoveSmallWindowRestrictions : HookRegister() { object RemoveSmallWindowRestrictions : HookRegister() {
override fun init() { override fun init() {
// 强制所有活动设为可以调整大小 // 强制所有活动设为可以调整大小
findMethod("com.android.server.wm.Task") { "com.android.server.wm.Task".hookBeforeMethod(getDefaultClassLoader(), "isResizeable") {
name == "isResizeable"
}.hookBefore {
hasEnable("remove_small_window_restrictions") { hasEnable("remove_small_window_restrictions") {
it.result = true it.result = true
} }
} }
findMethod("android.util.MiuiMultiWindowAdapter") { "android.util.MiuiMultiWindowAdapter".hookAfterMethod(getDefaultClassLoader(), "getFreeformBlackList") {
name == "getFreeformBlackList"
}.hookAfter {
hasEnable("remove_small_window_restrictions") { hasEnable("remove_small_window_restrictions") {
it.result = (it.result as MutableList<*>).apply { clear() } it.result = (it.result as MutableList<*>).apply { clear() }
} }
} }
findMethod("android.util.MiuiMultiWindowAdapter") { "android.util.MiuiMultiWindowAdapter".hookAfterMethod(getDefaultClassLoader(), "getFreeformBlackListFromCloud", Context::class.java) {
name == "getFreeformBlackListFromCloud" && parameterTypes[0] == Context::class.java
}.hookAfter {
hasEnable("remove_small_window_restrictions") { hasEnable("remove_small_window_restrictions") {
it.result = (it.result as MutableList<*>).apply { clear() } it.result = (it.result as MutableList<*>).apply { clear() }
} }
} }
findMethod("android.util.MiuiMultiWindowUtils") { "android.util.MiuiMultiWindowUtils".hookAfterMethod(getDefaultClassLoader(), "supportFreeform") {
name == "supportFreeform"
}.hookAfter {
hasEnable("remove_small_window_restrictions") { hasEnable("remove_small_window_restrictions") {
it.result = true it.result = true
} }
} }
} }
} }

View File

@@ -1,8 +1,7 @@
package com.lt2333.simplicitytools.hook.app.android package com.lt2333.simplicitytools.hook.app.android
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.XSPUtils import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object SystemPropertiesHook : HookRegister() { object SystemPropertiesHook : HookRegister() {
@@ -10,12 +9,16 @@ object SystemPropertiesHook : HookRegister() {
val mediaStepsSwitch = XSPUtils.getBoolean("media_volume_steps_switch", false) val mediaStepsSwitch = XSPUtils.getBoolean("media_volume_steps_switch", false)
val mediaSteps = XSPUtils.getInt("media_volume_steps", 15) val mediaSteps = XSPUtils.getInt("media_volume_steps", 15)
findMethod("android.os.SystemProperties") { "android.os.SystemProperties".hookBeforeMethod(
name == "getInt" && returnType == Int::class.java getDefaultClassLoader(),
}.hookBefore { "getInt",
String::class.java,
Int::class.java
) {
when (it.args[0] as String) { when (it.args[0] as String) {
"ro.config.media_vol_steps" -> if (mediaStepsSwitch) it.result = mediaSteps "ro.config.media_vol_steps" -> if (mediaStepsSwitch) it.result = mediaSteps
} }
} }
} }
} }

View File

@@ -3,21 +3,23 @@ package com.lt2333.simplicitytools.hook.app.miuihome
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.view.MotionEvent import android.view.MotionEvent
import com.github.kyuubiran.ezxhelper.utils.*
import com.lt2333.simplicitytools.util.* import com.lt2333.simplicitytools.util.*
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import com.yuk.miuihome.module.DoubleTapController import com.yuk.miuihome.module.DoubleTapController
import de.robv.android.xposed.XposedHelpers import de.robv.android.xposed.XposedHelpers
object DoubleTapToSleep : HookRegister() { object DoubleTapToSleep : HookRegister() {
override fun init() = hasEnable("double_tap_to_sleep") {
hookAllConstructorAfter("com.miui.home.launcher.Workspace") { override fun init() {
hasEnable("double_tap_to_sleep") {
"com.miui.home.launcher.Workspace".findClass(getDefaultClassLoader())
.hookAfterAllConstructors {
var mDoubleTapControllerEx = var mDoubleTapControllerEx =
XposedHelpers.getAdditionalInstanceField( XposedHelpers.getAdditionalInstanceField(
it.thisObject, it.thisObject,
"mDoubleTapControllerEx" "mDoubleTapControllerEx"
) )
if (mDoubleTapControllerEx != null) return@hookAllConstructorAfter if (mDoubleTapControllerEx != null) return@hookAfterAllConstructors
mDoubleTapControllerEx = DoubleTapController((it.args[0] as Context)) mDoubleTapControllerEx = DoubleTapController((it.args[0] as Context))
XposedHelpers.setAdditionalInstanceField( XposedHelpers.setAdditionalInstanceField(
it.thisObject, it.thisObject,
@@ -26,19 +28,19 @@ object DoubleTapToSleep : HookRegister() {
) )
} }
findMethod("com.miui.home.launcher.Workspace") { "com.miui.home.launcher.Workspace".findClass(getDefaultClassLoader()).hookBeforeMethod(
name == "dispatchTouchEvent" && parameterTypes[0] == MotionEvent::class.java "dispatchTouchEvent", MotionEvent::class.java
}.hookBefore { ) {
val mDoubleTapControllerEx = XposedHelpers.getAdditionalInstanceField( val mDoubleTapControllerEx = XposedHelpers.getAdditionalInstanceField(
it.thisObject, it.thisObject,
"mDoubleTapControllerEx" "mDoubleTapControllerEx"
) as DoubleTapController ) as DoubleTapController
if (!mDoubleTapControllerEx.isDoubleTapEvent(it.args[0] as MotionEvent)) return@hookBefore if (!mDoubleTapControllerEx.isDoubleTapEvent(it.args[0] as MotionEvent)) return@hookBeforeMethod
val mCurrentScreenIndex = it.thisObject.getObject("mCurrentScreenIndex") as Int val mCurrentScreenIndex = it.thisObject.getIntField("mCurrentScreenIndex")
val cellLayout = it.thisObject.invokeMethodAuto("getCellLayout", mCurrentScreenIndex) val cellLayout = it.thisObject.callMethod("getCellLayout", mCurrentScreenIndex)
if (cellLayout != null) if (cellLayout.invokeMethodAuto("lastDownOnOccupiedCell") as Boolean) return@hookBefore if (cellLayout != null) if (cellLayout.callMethod("lastDownOnOccupiedCell") as Boolean) return@hookBeforeMethod
if (it.thisObject.invokeMethodAuto("isInNormalEditingMode") as Boolean) return@hookBefore if (it.thisObject.callMethod("isInNormalEditingMode") as Boolean) return@hookBeforeMethod
val context = it.thisObject.invokeMethodAuto("getContext") as Context val context = it.thisObject.callMethod("getContext") as Context
context.sendBroadcast( context.sendBroadcast(
Intent("com.miui.app.ExtraStatusBarManager.action_TRIGGER_TOGGLE").putExtra( Intent("com.miui.app.ExtraStatusBarManager.action_TRIGGER_TOGGLE").putExtra(
"com.miui.app.ExtraStatusBarManager.extra_TOGGLE_ID", "com.miui.app.ExtraStatusBarManager.extra_TOGGLE_ID",
@@ -48,3 +50,5 @@ object DoubleTapToSleep : HookRegister() {
} }
} }
} }
}

View File

@@ -1,29 +1,29 @@
package com.lt2333.simplicitytools.hook.app.securitycenter package com.lt2333.simplicitytools.hook.app.securitycenter
import android.view.View import android.view.View
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.lt2333.simplicitytools.util.XSPUtils
import com.github.kyuubiran.ezxhelper.utils.hookBefore 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 com.lt2333.simplicitytools.util.xposed.base.HookRegister
object LockOneHundred : HookRegister() { object LockOneHundred : HookRegister() {
override fun init() { override fun init() {
//防止点击重新检测 //防止点击重新检测
findMethod("com.miui.securityscan.ui.main.MainContentFrame") { val mainContentFrameClass = "com.miui.securityscan.ui.main.MainContentFrame".findClass(getDefaultClassLoader())
name == "onClick" && parameterTypes[0] == View::class.java mainContentFrameClass.hookBeforeMethod("onClick", View::class.java) {
}.hookBefore { if (XSPUtils.getBoolean("lock_one_hundred", false)) {
hasEnable("lock_one_hundred") {
it.result = null it.result = null
} }
} }
//锁定100分 //锁定100分
findMethod("com.miui.securityscan.scanner.ScoreManager") { val scoreManagerClass = "com.miui.securityscan.scanner.ScoreManager".findClass(getDefaultClassLoader())
name == "B" scoreManagerClass.hookBeforeMethod("B") {
}.hookBefore { if (XSPUtils.getBoolean("lock_one_hundred", false)) {
hasEnable("lock_one_hundred") {
it.result = 0 it.result = 0
} }
} }
} }
} }

View File

@@ -1,17 +1,22 @@
package com.lt2333.simplicitytools.hook.app.securitycenter package com.lt2333.simplicitytools.hook.app.securitycenter
import android.widget.TextView import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.lt2333.simplicitytools.util.XSPUtils
import com.github.kyuubiran.ezxhelper.utils.hookAfter 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 com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.IXposedHookLoadPackage
import de.robv.android.xposed.callbacks.XC_LoadPackage
object RemoveOpenAppConfirmationPopup : HookRegister() { object RemoveOpenAppConfirmationPopup : HookRegister() {
override fun init() { override fun init() {
findMethod("android.widget.TextView") { val textViewClass = "android.widget.TextView".findClass(getDefaultClassLoader())
name == "setText" && parameterTypes[0] == CharSequence::class.java textViewClass.hookAfterMethod(
}.hookAfter { "setText",
hasEnable("remove_open_app_confirmation_popup") { CharSequence::class.java
) {
if (XSPUtils.getBoolean("remove_open_app_confirmation_popup", false)) {
val textView = it.thisObject as TextView val textView = it.thisObject as TextView
if (it.args.isNotEmpty() && it.args[0]?.toString().equals( if (it.args.isNotEmpty() && it.args[0]?.toString().equals(
textView.context.resources.getString( textView.context.resources.getString(
@@ -28,4 +33,5 @@ object RemoveOpenAppConfirmationPopup : HookRegister() {
} }
} }
} }
} }

View File

@@ -13,11 +13,10 @@ import android.view.View
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import cn.fkj233.ui.activity.dp2px import cn.fkj233.ui.activity.dp2px
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.lt2333.simplicitytools.util.XSPUtils
import com.github.kyuubiran.ezxhelper.utils.hookAfter import com.lt2333.simplicitytools.util.findClass
import com.github.kyuubiran.ezxhelper.utils.hookBefore import com.lt2333.simplicitytools.util.hookAfterMethod
import com.github.kyuubiran.ezxhelper.utils.loadClass import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.*
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import java.lang.reflect.Field import java.lang.reflect.Field
@@ -30,26 +29,17 @@ object ShowBatteryTemperature : HookRegister() {
)!!.getIntExtra("temperature", 0) / 10 )!!.getIntExtra("temperature", 0) / 10
} }
override fun init() = hasEnable("battery_life_function") { override fun init() {
findMethod("com.miui.powercenter.a") { if (!XSPUtils.getBoolean("battery_life_function", false)) return
name == "b" && parameterTypes[0] == Context::class.java val a = "com.miui.powercenter.a\$a".findClass(getDefaultClassLoader())
}.hookBefore { "com.miui.powercenter.a".hookBeforeMethod(getDefaultClassLoader(), "b", Context::class.java) {
it.result = getBatteryTemperature(it.args[0] as Context).toString() it.result = getBatteryTemperature(it.args[0] as Context).toString()
} }
a.hookAfterMethod("run") {
findMethod("com.miui.powercenter.a\$a") {
name == "run"
}.hookAfter {
val context = AndroidAppHelper.currentApplication().applicationContext val context = AndroidAppHelper.currentApplication().applicationContext
val isDarkMode = val isDarkMode = context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES
context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES val currentTemperatureValue = context.resources.getIdentifier("current_temperature_value", "id", "com.miui.securitycenter")
val currentTemperatureValue = context.resources.getIdentifier( val field = a.getDeclaredField("a") as Field
"current_temperature_value",
"id",
"com.miui.securitycenter"
)
val field = loadClass("com.miui.powercenter.a\$a").getDeclaredField("a") as Field
field.isAccessible = true field.isAccessible = true
val view = field.get(it.thisObject) as View val view = field.get(it.thisObject) as View
val textView = view.findViewById<TextView>(currentTemperatureValue) val textView = view.findViewById<TextView>(currentTemperatureValue)
@@ -62,25 +52,18 @@ object ShowBatteryTemperature : HookRegister() {
textView.height = dp2px(context, 49.099983f) textView.height = dp2px(context, 49.099983f)
textView.textAlignment = View.TEXT_ALIGNMENT_VIEW_START textView.textAlignment = View.TEXT_ALIGNMENT_VIEW_START
val tempView = TextView(context) val tempView = TextView(context)
tempView.layoutParams = LinearLayout.LayoutParams( tempView.layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, dp2px(context, 49.099983f))
LinearLayout.LayoutParams.MATCH_PARENT, (tempView.layoutParams as LinearLayout.LayoutParams).marginStart = dp2px(context, 3.599976f)
dp2px(context, 49.099983f)
)
(tempView.layoutParams as LinearLayout.LayoutParams).marginStart =
dp2px(context, 3.599976f)
tempView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13.099977f) tempView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13.099977f)
tempView.setTextColor(Color.parseColor(if (isDarkMode) "#e6e6e6" else "#333333")) tempView.setTextColor(Color.parseColor(if (isDarkMode) "#e6e6e6" else "#333333"))
tempView.setPadding(0, dp2px(context, 25f), 0, 0) tempView.setPadding(0, dp2px(context, 25f), 0, 0)
tempView.text = "" tempView.text = ""
tempView.typeface = Typeface.create(null, 500, false) tempView.typeface = Typeface.create(null, 500, false)
tempView.textAlignment = View.TEXT_ALIGNMENT_VIEW_START tempView.textAlignment = View.TEXT_ALIGNMENT_VIEW_START
val tempeValueContainer = context.resources.getIdentifier( val tempeValueContainer = context.resources.getIdentifier("tempe_value_container", "id", "com.miui.securitycenter")
"tempe_value_container",
"id",
"com.miui.securitycenter"
)
val linearLayout = view.findViewById<LinearLayout>(tempeValueContainer) val linearLayout = view.findViewById<LinearLayout>(tempeValueContainer)
linearLayout.addView(tempView) linearLayout.addView(tempView)
} }
} }
} }

View File

@@ -1,16 +1,23 @@
package com.lt2333.simplicitytools.hook.app.securitycenter package com.lt2333.simplicitytools.hook.app.securitycenter
import com.github.kyuubiran.ezxhelper.utils.findMethod import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.hookBefore import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.findClass
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object SkipWaitingTime : HookRegister() { object SkipWaitingTime : HookRegister() {
override fun init() { override fun init() {
findMethod("android.widget.TextView") { val textViewClass = "android.widget.TextView".findClass(getDefaultClassLoader())
name == "setText" && parameterCount == 4 textViewClass.hookBeforeMethod(
}.hookBefore { "setText",
hasEnable("skip_waiting_time") { CharSequence::class.java,
TextView.BufferType::class.java,
Boolean::class.java,
Int::class.java
) {
if (XSPUtils.getBoolean("skip_waiting_time", false)) {
if (it.args.isNotEmpty() && it.args[0]?.toString()?.startsWith("确定(") == true if (it.args.isNotEmpty() && it.args[0]?.toString()?.startsWith("确定(") == true
) { ) {
it.args[0] = "确定" it.args[0] = "确定"
@@ -18,12 +25,14 @@ object SkipWaitingTime : HookRegister() {
} }
} }
findMethod("android.widget.TextView") { textViewClass.hookBeforeMethod(
name == "setEnabled" && parameterTypes[0] == Boolean::class.java "setEnabled",
}.hookBefore { Boolean::class.java
hasEnable("skip_waiting_time") { ) {
if (XSPUtils.getBoolean("skip_waiting_time", false)) {
it.args[0] = true it.args[0] = true
} }
} }
} }
} }

View File

@@ -1,7 +1,6 @@
package com.lt2333.simplicitytools.hook.app.settings package com.lt2333.simplicitytools.hook.app.settings
import android.app.NotificationChannel import android.app.NotificationChannel
import com.github.kyuubiran.ezxhelper.utils.*
import com.lt2333.simplicitytools.util.* import com.lt2333.simplicitytools.util.*
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XposedHelpers import de.robv.android.xposed.XposedHelpers
@@ -9,29 +8,27 @@ import de.robv.android.xposed.XposedHelpers
object ShowNotificationImportance : HookRegister() { object ShowNotificationImportance : HookRegister() {
override fun init() { override fun init() {
findMethod("com.android.settings.notification.ChannelNotificationSettings"){ val channelNotificationSettingsClass = "com.android.settings.notification.ChannelNotificationSettings".findClass(getDefaultClassLoader())
name == "removeDefaultPrefs" channelNotificationSettingsClass.hookBeforeMethod("removeDefaultPrefs") {
}.hookBefore { if (!XSPUtils.getBoolean("show_notification_importance", false)) return@hookBeforeMethod
if (!XSPUtils.getBoolean("show_notification_importance", false)) return@hookBefore val importance = it.thisObject.callMethod("findPreference", "importance") ?: return@hookBeforeMethod
val importance = it.thisObject.invokeMethodAuto("findPreference", "importance") ?: return@hookBefore val mChannel = it.thisObject.getObjectField("mChannel") as NotificationChannel
val mChannel = it.thisObject.getObject("mChannel") as NotificationChannel val index = importance.callMethod("findSpinnerIndexOfValue", mChannel.importance.toString()) as Int
val index = importance.invokeMethodAuto("findSpinnerIndexOfValue", mChannel.importance.toString()) as Int if (index < 0) return@hookBeforeMethod
if (index < 0) return@hookBefore importance.callMethod("setValueIndex", index)
importance.invokeMethodAuto("setValueIndex", index)
XposedHelpers.setAdditionalInstanceField(importance, "channelNotificationSettings", it.thisObject) XposedHelpers.setAdditionalInstanceField(importance, "channelNotificationSettings", it.thisObject)
it.result = null it.result = null
} }
findMethod("androidx.preference.Preference"){ val dropDownPreferenceClass = XposedHelpers.findClass("androidx.preference.Preference", getDefaultClassLoader())
name == "callChangeListener" && parameterTypes[0]==Any::class.java dropDownPreferenceClass.hookAfterMethod("callChangeListener", Any::class.java) {
}.hookAfter { val channelNotificationSettings = XposedHelpers.getAdditionalInstanceField(it.thisObject, "channelNotificationSettings") ?: return@hookAfterMethod
val channelNotificationSettings = XposedHelpers.getAdditionalInstanceField(it.thisObject, "channelNotificationSettings") ?: return@hookAfter val mChannel = channelNotificationSettings.getObjectField("mChannel") as NotificationChannel
val mChannel = channelNotificationSettings.getObject("mChannel") as NotificationChannel mChannel.callMethod("setImportance", (it.args[0] as String).toInt())
mChannel.invokeMethodAuto("setImportance", (it.args[0] as String).toInt()) val mBackend = channelNotificationSettings.getObjectField("mBackend") ?: return@hookAfterMethod
val mBackend = channelNotificationSettings.getObjectOrNull("mBackend") ?: return@hookAfter val mPkg = channelNotificationSettings.getObjectField("mPkg") as String
val mPkg = channelNotificationSettings.getObject("mPkg") as String val mUid = channelNotificationSettings.getIntField("mUid")
val mUid = channelNotificationSettings.getObject("mUid") as Int mBackend.callMethod("updateChannel", mPkg, mUid, mChannel)
mBackend.invokeMethodAuto("updateChannel", mPkg, mUid, mChannel)
} }
} }

View File

@@ -2,22 +2,24 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.util.TypedValue import android.util.TypedValue
import android.widget.TextView import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.getObject
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.XSPUtils 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 com.lt2333.simplicitytools.util.xposed.base.HookRegister
object BatteryPercentage: HookRegister() { object BatteryPercentage: HookRegister() {
override fun init() { override fun init() {
val size = XSPUtils.getFloat("battery_percentage_font_size", 0f) val size = XSPUtils.getFloat("battery_percentage_font_size", 0f)
if (size == 0f) return if (size == 0f) return
findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") { "com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(
name == "updateResources" getDefaultClassLoader(),
}.hookAfter { "updateResources"
(it.thisObject.getObject("mBatteryPercentView") as TextView).setTextSize( ) {
(it.thisObject.getObjectField("mBatteryPercentView") as TextView).setTextSize(
TypedValue.COMPLEX_UNIT_DIP, size TypedValue.COMPLEX_UNIT_DIP, size
) )
} }
} }
} }

View File

@@ -1,22 +0,0 @@
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
object CanNotificationSlide: HookRegister() {
override fun init() {
findMethod("com.android.systemui.statusbar.notification.NotificationSettingsManager") {
name == "canSlide"
}.hookMethod {
after { param ->
hasEnable("can_notification_slide") {
param.result = true
}
}
}
}
}

View File

@@ -9,21 +9,22 @@ import android.widget.TextView
import android.widget.Toast import android.widget.Toast
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import cn.fkj233.ui.activity.dp2px import cn.fkj233.ui.activity.dp2px
import com.github.kyuubiran.ezxhelper.utils.* import com.github.kyuubiran.ezxhelper.utils.loadClass
import com.lt2333.simplicitytools.util.SystemProperties import com.lt2333.simplicitytools.util.*
import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import com.lt2333.simplicitytools.view.WeatherView import com.lt2333.simplicitytools.view.WeatherView
object ControlCenterWeather: HookRegister() { object ControlCenterWeather: HookRegister() {
override fun init() = hasEnable("control_center_weather") {
override fun init() {
hasEnable("control_center_weather") {
var mWeatherView: TextView? = null var mWeatherView: TextView? = null
var mConstraintLayout: ConstraintLayout? = null var mConstraintLayout: ConstraintLayout? = null
val isDisplayCity = XSPUtils.getBoolean("control_center_weather_city", false) val isDisplayCity = XSPUtils.getBoolean("control_center_weather_city", false)
findMethod("com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView") { "com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView".hookAfterMethod(
name == "onFinishInflate" getDefaultClassLoader(),
}.hookAfter { "onFinishInflate"
) {
val viewGroup = it.thisObject as ViewGroup val viewGroup = it.thisObject as ViewGroup
val context = viewGroup.context val context = viewGroup.context
@@ -138,11 +139,11 @@ object ControlCenterWeather : HookRegister() {
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT ViewGroup.LayoutParams.WRAP_CONTENT
) as ViewGroup.MarginLayoutParams ) as ViewGroup.MarginLayoutParams
layoutParam.putObject( layoutParam.setObjectField(
"bottomToTop", "bottomToTop",
context.resources.getIdentifier("date_time", "id", context.packageName) context.resources.getIdentifier("date_time", "id", context.packageName)
) )
layoutParam.putObject( layoutParam.setObjectField(
"startToEnd", "startToEnd",
context.resources.getIdentifier("big_time", "id", context.packageName) context.resources.getIdentifier("big_time", "id", context.packageName)
) )
@@ -180,15 +181,16 @@ object ControlCenterWeather : HookRegister() {
Toast.makeText(context, "启动失败", Toast.LENGTH_LONG).show() Toast.makeText(context, "启动失败", Toast.LENGTH_LONG).show()
} }
} }
}
}
//解决横屏重叠 //解决横屏重叠
findMethod("com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView") { "com.android.systemui.controlcenter.phone.widget.QSControlCenterHeaderView".hookAfterMethod(
name == "updateLayout" getDefaultClassLoader(),
}.hookAfter { "updateLayout"
) {
val viewGroup = it.thisObject as ViewGroup val viewGroup = it.thisObject as ViewGroup
val context = viewGroup.context val context = viewGroup.context
val mOrientation = viewGroup.getObject("mOrientation") as Int val mOrientation = viewGroup.getObjectField("mOrientation") as Int
// MIUI编译时间大于 2022-03-12 00:00:00 且为内测版 // MIUI编译时间大于 2022-03-12 00:00:00 且为内测版
if (SystemProperties.get(context, "ro.build.date.utc")!! if (SystemProperties.get(context, "ro.build.date.utc")!!
.toInt() >= 1647014400 && .toInt() >= 1647014400 &&
@@ -218,3 +220,5 @@ object ControlCenterWeather : HookRegister() {
} }
} }
} }
}

View File

@@ -1,17 +1,22 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.XSPUtils import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object CustomMobileTypeText : HookRegister() { object CustomMobileTypeText : HookRegister() {
override fun init() = hasEnable("custom_mobile_type_text_switch") {
findMethod("com.android.systemui.statusbar.policy.MobileSignalController") { override fun init() {
name == "getMobileTypeName" && parameterTypes[0] == Int::class.java hasEnable("custom_mobile_type_text_switch") {
}.hookAfter { "com.android.systemui.statusbar.policy.MobileSignalController".hookAfterMethod(
getDefaultClassLoader(),
"getMobileTypeName",
Int::class.java
) {
it.result = XSPUtils.getString("custom_mobile_type_text","5G") it.result = XSPUtils.getString("custom_mobile_type_text","5G")
} }
} }
} }
}

View File

@@ -2,17 +2,13 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.content.Context import android.content.Context
import android.net.TrafficStats import android.net.TrafficStats
import android.util.AttributeSet
import android.util.TypedValue import android.util.TypedValue
import android.view.Gravity import android.view.Gravity
import android.widget.TextView import android.widget.TextView
import com.github.kyuubiran.ezxhelper.init.InitFields import com.github.kyuubiran.ezxhelper.init.InitFields
import com.github.kyuubiran.ezxhelper.utils.findConstructor
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.R import com.lt2333.simplicitytools.R
import com.lt2333.simplicitytools.util.XSPUtils import com.lt2333.simplicitytools.util.*
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import java.text.DecimalFormat import java.text.DecimalFormat
@@ -30,7 +26,7 @@ object DoubleLineNetworkSpeed : HookRegister() {
private val getDualSize = XSPUtils.getInt("status_bar_network_speed_dual_row_size", 0) private val getDualSize = XSPUtils.getInt("status_bar_network_speed_dual_row_size", 0)
private val getDualAlign = XSPUtils.getInt("status_bar_network_speed_dual_row_gravity", 0) private val getDualAlign = XSPUtils.getInt("status_bar_network_speed_dual_row_gravity", 0)
override fun init() = hasEnable("status_bar_dual_row_network_speed") { override fun init() {
val none = InitFields.moduleRes.getString(R.string.none) val none = InitFields.moduleRes.getString(R.string.none)
@@ -41,9 +37,9 @@ object DoubleLineNetworkSpeed : HookRegister() {
?.lastOrNull().toString() ?.lastOrNull().toString()
} }
findConstructor("com.android.systemui.statusbar.views.NetworkSpeedView") { hasEnable("status_bar_dual_row_network_speed") {
parameterCount == 2 "com.android.systemui.statusbar.views.NetworkSpeedView".findClass(getDefaultClassLoader())
}.hookAfter { .hookAfterConstructor(Context::class.java, AttributeSet::class.java) {
val mView = it.thisObject as TextView val mView = it.thisObject as TextView
mView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 7f) mView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 7f)
if (getDualSize != 0) { if (getDualSize != 0) {
@@ -58,30 +54,26 @@ object DoubleLineNetworkSpeed : HookRegister() {
} }
} }
findMethod("com.android.systemui.statusbar.policy.NetworkSpeedController") { "com.android.systemui.statusbar.policy.NetworkSpeedController".hookBeforeMethod(
name == "formatSpeed" && parameterCount == 2 getDefaultClassLoader(),
}.hookBefore { "formatSpeed",
Context::class.java,
Long::class.java
) {
if (getDualAlign == 0) { if (getDualAlign == 0) {
it.result = it.result =
"$upIcon ${getTotalUpSpeed(it.args[0] as Context)}\n${downIcon} ${ "$upIcon ${getTotalUpSpeed(it.args[0]as Context)}\n${downIcon} ${getTotalDownloadSpeed(it.args[0]as Context)}"
getTotalDownloadSpeed(
it.args[0] as Context
)
}"
} else { } else {
it.result = it.result =
"${getTotalUpSpeed(it.args[0] as Context)} ${upIcon}\n${ "${getTotalUpSpeed(it.args[0]as Context)} ${upIcon}\n${getTotalDownloadSpeed(it.args[0]as Context)} $downIcon"
getTotalDownloadSpeed( }
it.args[0] as Context
)
} $downIcon"
} }
} }
} }
//获取总的上行速度 //获取总的上行速度
private fun getTotalUpSpeed(context: Context): String { private fun getTotalUpSpeed(context: Context): String {
var totalUpSpeed: Float var totalUpSpeed = 0F
val currentTotalTxBytes = TrafficStats.getTotalTxBytes() val currentTotalTxBytes = TrafficStats.getTotalTxBytes()
val nowTimeStampTotalUp = System.currentTimeMillis() val nowTimeStampTotalUp = System.currentTimeMillis()
@@ -89,28 +81,16 @@ object DoubleLineNetworkSpeed : HookRegister() {
//计算上传速度 //计算上传速度
val bytes = val bytes =
(currentTotalTxBytes - mLastTotalUp) * 1000 / (nowTimeStampTotalUp - lastTimeStampTotalUp).toFloat() (currentTotalTxBytes - mLastTotalUp) * 1000 / (nowTimeStampTotalUp - lastTimeStampTotalUp).toFloat()
var unit: String var unit = ""
if (bytes >= 1048576) { if (bytes >= 1048576) {
totalUpSpeed = totalUpSpeed =
DecimalFormat("0.0").format(bytes / 1048576).toFloat() DecimalFormat("0.0").format(bytes / 1048576).toFloat()
unit = context.resources.getString( unit = context.resources.getString(context.resources.getIdentifier("megabyte_per_second","string",context.packageName))
context.resources.getIdentifier(
"megabyte_per_second",
"string",
context.packageName
)
)
} else { } else {
totalUpSpeed = totalUpSpeed =
DecimalFormat("0.0").format(bytes / 1024).toFloat() DecimalFormat("0.0").format(bytes / 1024).toFloat()
unit = context.resources.getString( unit = context.resources.getString(context.resources.getIdentifier("kilobyte_per_second","string",context.packageName))
context.resources.getIdentifier(
"kilobyte_per_second",
"string",
context.packageName
)
)
} }
//保存当前的流量总和和上次的时间戳 //保存当前的流量总和和上次的时间戳
@@ -126,7 +106,7 @@ object DoubleLineNetworkSpeed : HookRegister() {
//获取总的下行速度 //获取总的下行速度
private fun getTotalDownloadSpeed(context: Context): String { private fun getTotalDownloadSpeed(context: Context): String {
var totalDownSpeed: Float var totalDownSpeed = 0F
val currentTotalRxBytes = TrafficStats.getTotalRxBytes() val currentTotalRxBytes = TrafficStats.getTotalRxBytes()
val nowTimeStampTotalDown = System.currentTimeMillis() val nowTimeStampTotalDown = System.currentTimeMillis()
@@ -134,28 +114,16 @@ object DoubleLineNetworkSpeed : HookRegister() {
val bytes = val bytes =
(currentTotalRxBytes - mLastTotalDown) * 1000 / (nowTimeStampTotalDown - lastTimeStampTotalDown).toFloat() (currentTotalRxBytes - mLastTotalDown) * 1000 / (nowTimeStampTotalDown - lastTimeStampTotalDown).toFloat()
var unit: String var unit = ""
if (bytes >= 1048576) { if (bytes >= 1048576) {
totalDownSpeed = totalDownSpeed =
DecimalFormat("0.0").format(bytes / 1048576).toFloat() DecimalFormat("0.0").format(bytes / 1048576).toFloat()
unit = context.resources.getString( unit = context.resources.getString(context.resources.getIdentifier("megabyte_per_second","string",context.packageName))
context.resources.getIdentifier(
"megabyte_per_second",
"string",
context.packageName
)
)
} else { } else {
totalDownSpeed = totalDownSpeed =
DecimalFormat("0.0").format(bytes / 1024).toFloat() DecimalFormat("0.0").format(bytes / 1024).toFloat()
unit = context.resources.getString( unit = context.resources.getString(context.resources.getIdentifier("kilobyte_per_second","string",context.packageName))
context.resources.getIdentifier(
"kilobyte_per_second",
"string",
context.packageName
)
)
} }
//保存当前的流量总和和上次的时间戳 //保存当前的流量总和和上次的时间戳
mLastTotalDown = currentTotalRxBytes mLastTotalDown = currentTotalRxBytes

View File

@@ -4,46 +4,42 @@ import android.view.View
import android.widget.FrameLayout import android.widget.FrameLayout
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.lt2333.simplicitytools.util.getObjectField
import com.github.kyuubiran.ezxhelper.utils.getObject
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object HideBatteryIcon : HookRegister() { object HideBatteryIcon : HookRegister() {
override fun init() { override fun init() {
findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") { "com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(getDefaultClassLoader(), "updateResources") {
name == "updateResources"
}.hookAfter {
//隐藏电池图标 //隐藏电池图标
hasEnable("hide_battery_icon") { hasEnable("hide_battery_icon") {
(it.thisObject.getObject("mBatteryIconView") as ImageView).visibility = View.GONE (it.thisObject.getObjectField("mBatteryIconView") as ImageView).visibility = View.GONE
if (it.thisObject.getObject("mBatteryStyle") == 1) { if (it.thisObject.getObjectField("mBatteryStyle") == 1) {
(it.thisObject.getObject("mBatteryDigitalView") as FrameLayout).visibility = (it.thisObject.getObjectField("mBatteryDigitalView") as FrameLayout).visibility = View.GONE
View.GONE
}
}
//隐藏电池内的百分比
hasEnable("hide_battery_percentage_icon") {
(it.thisObject.getObject("mBatteryPercentMarkView") as TextView).textSize = 0F
}
//隐藏电池百分号
hasEnable("hide_battery_percentage_icon") {
(it.thisObject.getObject("mBatteryPercentMarkView") as TextView).textSize = 0F
} }
} }
findMethod("com.android.systemui.statusbar.views.MiuiBatteryMeterView") { //隐藏电池内的百分比
name == "updateChargeAndText" hasEnable("hide_battery_percentage_icon") {
}.hookAfter { (it.thisObject.getObjectField("mBatteryPercentMarkView") as TextView).textSize = 0F
}
//隐藏电池百分号
hasEnable("hide_battery_percentage_icon") {
(it.thisObject.getObjectField("mBatteryPercentMarkView") as TextView).textSize = 0F
}
"com.android.systemui.statusbar.views.MiuiBatteryMeterView".hookAfterMethod(getDefaultClassLoader(), "updateChargeAndText") {
//隐藏电池充电图标 //隐藏电池充电图标
hasEnable("hide_battery_charging_icon") { hasEnable("hide_battery_charging_icon") {
(it.thisObject.getObject("mBatteryChargingInView") as ImageView).visibility = (it.thisObject.getObjectField("mBatteryChargingInView") as ImageView).visibility = View.GONE
View.GONE (it.thisObject.getObjectField("mBatteryChargingView") as ImageView).visibility = View.GONE
(it.thisObject.getObject("mBatteryChargingView") as ImageView).visibility =
View.GONE
} }
} }
} }
} }
}

View File

@@ -2,38 +2,38 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.lt2333.simplicitytools.util.getObjectField
import com.github.kyuubiran.ezxhelper.utils.getObject
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XC_MethodHook
object HideHDIcon: HookRegister() { object HideHDIcon: HookRegister() {
override fun init() { override fun init() {
findMethod("com.android.systemui.statusbar.StatusBarMobileView") { val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
name == "initViewState" && parameterCount == 1 "com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(getDefaultClassLoader(), "initViewState", iconState) {
}.hookAfter {
hide(it)
}
findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
name == "updateState" && parameterCount == 1
}.hookAfter {
hide(it)
}
}
private fun hide(it: XC_MethodHook.MethodHookParam) {
hasEnable("hide_big_hd_icon") { hasEnable("hide_big_hd_icon") {
(it.thisObject.getObject("mVolte") as ImageView).visibility = View.GONE (it.thisObject.getObjectField("mVolte") as ImageView).visibility = View.GONE
} }
hasEnable("hide_small_hd_icon") { hasEnable("hide_small_hd_icon") {
(it.thisObject.getObject("mSmallHd") as ImageView).visibility = View.GONE (it.thisObject.getObjectField("mSmallHd") as ImageView).visibility = View.GONE
} }
hasEnable("hide_hd_no_service_icon") { hasEnable("hide_hd_no_service_icon") {
(it.thisObject.getObject("mVolteNoService") as ImageView).visibility = (it.thisObject.getObjectField("mVolteNoService") as ImageView).visibility = View.GONE
View.GONE }
}
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(getDefaultClassLoader(), "updateState", iconState) {
hasEnable("hide_big_hd_icon") {
(it.thisObject.getObjectField("mVolte") as ImageView).visibility = View.GONE
}
hasEnable("hide_small_hd_icon") {
(it.thisObject.getObjectField("mSmallHd") as ImageView).visibility = View.GONE
}
hasEnable("hide_hd_no_service_icon") {
(it.thisObject.getObjectField("mVolteNoService") as ImageView).visibility = View.GONE
} }
} }
} }
}

View File

@@ -2,32 +2,28 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.lt2333.simplicitytools.util.getObjectField
import com.github.kyuubiran.ezxhelper.utils.getObject
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XC_MethodHook
object HideMobileActivityIcon: HookRegister() { object HideMobileActivityIcon: HookRegister() {
override fun init() { override fun init() {
findMethod("com.android.systemui.statusbar.StatusBarMobileView") { val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
name == "initViewState" && parameterCount == 1 "com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(getDefaultClassLoader(), "initViewState", iconState) {
}.hookAfter {
hide(it)
}
findMethod("com.android.systemui.statusbar.StatusBarMobileView") {
name == "updateState" && parameterCount == 1
}.hookAfter {
hide(it)
}
}
private fun hide(it: XC_MethodHook.MethodHookParam) {
hasEnable("hide_mobile_activity_icon") { hasEnable("hide_mobile_activity_icon") {
(it.thisObject.getObject("mLeftInOut") as ImageView).visibility = View.GONE (it.thisObject.getObjectField("mLeftInOut") as ImageView).visibility = View.GONE
(it.thisObject.getObject("mRightInOut") as ImageView).visibility = View.GONE (it.thisObject.getObjectField("mRightInOut") as ImageView).visibility = View.GONE
}
}
"com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(getDefaultClassLoader(), "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
} }
} }
} }
}

View File

@@ -3,11 +3,10 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.getObject
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.XSPUtils import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.getObjectField
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XC_MethodHook import de.robv.android.xposed.XC_MethodHook
@@ -16,15 +15,20 @@ object HideMobileTypeIcon : HookRegister() {
private val isBigType = XSPUtils.getBoolean("big_mobile_type_icon", false) private val isBigType = XSPUtils.getBoolean("big_mobile_type_icon", false)
override fun init() { override fun init() {
findMethod("com.android.systemui.statusbar.StatusBarMobileView") { val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$MobileIconState"
name == "initViewState" && parameterCount == 1 "com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
}.hookAfter { getDefaultClassLoader(),
"initViewState",
iconState
) {
hideMobileTypeIcon(it) hideMobileTypeIcon(it)
} }
findMethod("com.android.systemui.statusbar.StatusBarMobileView") { "com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
name == "updateState" && parameterCount == 1 getDefaultClassLoader(),
}.hookAfter { "updateState",
iconState
) {
hideMobileTypeIcon(it) hideMobileTypeIcon(it)
} }
} }
@@ -32,20 +36,21 @@ object HideMobileTypeIcon : HookRegister() {
private fun hideMobileTypeIcon(it: XC_MethodHook.MethodHookParam) { private fun hideMobileTypeIcon(it: XC_MethodHook.MethodHookParam) {
hasEnable("hide_mobile_type_icon") { hasEnable("hide_mobile_type_icon") {
if (isBigType) { if (isBigType) {
(it.thisObject.getObject("mMobileType") as TextView).visibility = (it.thisObject.getObjectField("mMobileType") as TextView).visibility =
View.GONE View.GONE
(it.thisObject.getObject("mMobileTypeImage") as ImageView).visibility = (it.thisObject.getObjectField("mMobileTypeImage") as ImageView).visibility =
View.GONE View.GONE
(it.thisObject.getObject("mMobileTypeSingle") as TextView).visibility = (it.thisObject.getObjectField("mMobileTypeSingle") as TextView).visibility =
View.GONE View.GONE
} else { } else {
(it.thisObject.getObject("mMobileType") as TextView).visibility = (it.thisObject.getObjectField("mMobileType") as TextView).visibility =
View.INVISIBLE View.INVISIBLE
(it.thisObject.getObject("mMobileTypeImage") as ImageView).visibility = (it.thisObject.getObjectField("mMobileTypeImage") as ImageView).visibility =
View.INVISIBLE View.INVISIBLE
(it.thisObject.getObject("mMobileTypeSingle") as TextView).visibility = (it.thisObject.getObjectField("mMobileTypeSingle") as TextView).visibility =
View.INVISIBLE View.INVISIBLE
} }
} }
} }
} }

View File

@@ -1,20 +1,21 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import android.widget.TextView import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.lt2333.simplicitytools.util.XSPUtils
import com.github.kyuubiran.ezxhelper.utils.hookAfter 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 com.lt2333.simplicitytools.util.xposed.base.HookRegister
object HideNetworkSpeedSplitter: HookRegister() { object HideNetworkSpeedSplitter: HookRegister() {
override fun init() { override fun init() {
findMethod("com.android.systemui.statusbar.views.NetworkSpeedSplitter") { val networkSpeedSplitterClass = "com.android.systemui.statusbar.views.NetworkSpeedSplitter".findClass(getDefaultClassLoader())
name == "init" networkSpeedSplitterClass.hookAfterMethod("init") {
}.hookAfter { if (XSPUtils.getBoolean("hide_network_speed_splitter", false)) {
hasEnable("hide_network_speed_splitter") {
val textView = it.thisObject as TextView val textView = it.thisObject as TextView
textView.text = " " textView.text = " "
} }
} }
} }
} }

View File

@@ -1,15 +1,13 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object HideSimIcon: HookRegister() { object HideSimIcon: HookRegister() {
override fun init() { override fun init() {
findMethod("com.android.systemui.statusbar.phone.StatusBarSignalPolicy") { "com.android.systemui.statusbar.phone.StatusBarSignalPolicy".hookBeforeMethod(getDefaultClassLoader(), "hasCorrectSubs", MutableList::class.java) {
name == "hasCorrectSubs" && parameterTypes[0] == MutableList::class.java
}.hookBefore {
val list = it.args[0] as MutableList<*> val list = it.args[0] as MutableList<*>
val size = list.size val size = list.size
hasEnable("hide_sim_two_icon", extraCondition = { size == 2 }) { hasEnable("hide_sim_two_icon", extraCondition = { size == 2 }) {
@@ -20,4 +18,5 @@ object HideSimIcon : HookRegister() {
} }
} }
} }
} }

View File

@@ -1,24 +1,26 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XC_MethodHook import de.robv.android.xposed.XC_MethodHook
object HideStatusBarIcon: HookRegister() { object HideStatusBarIcon: HookRegister() {
override fun init() {
findMethod("com.android.systemui.statusbar.phone.StatusBarIconControllerImpl") {
name == "setIconVisibility" && parameterCount == 2
}.hookBefore {
hideIcon(it)
}
findMethod("com.android.systemui.statusbar.phone.MiuiDripLeftStatusBarIconControllerImpl") { override fun init() {
name == "setIconVisibility" && parameterCount == 2 "com.android.systemui.statusbar.phone.StatusBarIconControllerImpl".hookBeforeMethod(
}.hookBefore { getDefaultClassLoader(),
hideIcon(it) "setIconVisibility",
} String::class.java,
Boolean::class.java
) { hideIcon(it) }
"com.android.systemui.statusbar.phone.MiuiDripLeftStatusBarIconControllerImpl".hookBeforeMethod(
getDefaultClassLoader(),
"setIconVisibility",
String::class.java,
Boolean::class.java
) { hideIcon(it) }
} }
private fun hideIcon(it: XC_MethodHook.MethodHookParam) { private fun hideIcon(it: XC_MethodHook.MethodHookParam) {

View File

@@ -1,18 +1,17 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable 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 com.lt2333.simplicitytools.util.xposed.base.HookRegister
object HideStatusBarNetworkSpeedSecond: HookRegister() { object HideStatusBarNetworkSpeedSecond: HookRegister() {
override fun init() { override fun init() {
findMethod("com.android.systemui.statusbar.views.NetworkSpeedView") { "com.android.systemui.statusbar.views.NetworkSpeedView".hookBeforeMethod(getDefaultClassLoader(), "setNetworkSpeed", String::class.java) {
name == "setNetworkSpeed" && parameterTypes[0] == String::class.java
}.hookBefore {
hasEnable("hide_status_bar_network_speed_second") { hasEnable("hide_status_bar_network_speed_second") {
if (it.args[0] != null) { it.args[0].isNonNull { s ->
(it.args[0] as String) it.args[0] = (s as String)
.replace("/", "") .replace("/", "")
.replace("s", "") .replace("s", "")
.replace("'", "") .replace("'", "")
@@ -21,4 +20,5 @@ object HideStatusBarNetworkSpeedSecond : HookRegister() {
} }
} }
} }
} }

View File

@@ -3,39 +3,35 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.lt2333.simplicitytools.util.getObjectField
import com.github.kyuubiran.ezxhelper.utils.getObject
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XC_MethodHook
object HideWifiActivityIcon: HookRegister() { object HideWifiActivityIcon: HookRegister() {
override fun init() { override fun init() {
findMethod("com.android.systemui.statusbar.StatusBarWifiView") { val iconState = "com.android.systemui.statusbar.phone.StatusBarSignalPolicy\$WifiIconState"
name == "initViewState" && parameterCount == 1 "com.android.systemui.statusbar.StatusBarWifiView".hookAfterMethod(getDefaultClassLoader(), "initViewState", iconState) {
}.hookAfter {
hide(it)
}
findMethod("com.android.systemui.statusbar.StatusBarWifiView") {
name == "updateState" && parameterCount == 1
}.hookAfter {
hide(it)
}
}
private fun hide(it: XC_MethodHook.MethodHookParam) {
//隐藏WIFI箭头 //隐藏WIFI箭头
hasEnable("hide_wifi_activity_icon") { hasEnable("hide_wifi_activity_icon") {
(it.thisObject.getObject("mWifiActivityView") as ImageView).visibility = (it.thisObject.getObjectField("mWifiActivityView") as ImageView).visibility = View.INVISIBLE
View.INVISIBLE
} }
//隐藏WIFI标准图标 //隐藏WIFI标准图标
hasEnable("hide_wifi_standard_icon") { hasEnable("hide_wifi_standard_icon") {
(it.thisObject.getObject("mWifiStandardView") as TextView).visibility = (it.thisObject.getObjectField("mWifiStandardView") as TextView).visibility = View.INVISIBLE
View.INVISIBLE }
}
"com.android.systemui.statusbar.StatusBarWifiView".hookAfterMethod(getDefaultClassLoader(), "updateState", iconState) {
//隐藏WIFI箭头
hasEnable("hide_wifi_activity_icon") {
(it.thisObject.getObjectField("mWifiActivityView") as ImageView).visibility = View.INVISIBLE
}
//隐藏WIFI标准图标
hasEnable("hide_wifi_standard_icon") {
(it.thisObject.getObjectField("mWifiStandardView") as TextView).visibility = View.INVISIBLE
}
} }
} }

View File

@@ -4,11 +4,11 @@ import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.os.Handler import android.os.Handler
import android.provider.Settings import android.provider.Settings
import android.util.AttributeSet
import android.util.Log import android.util.Log
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.* import com.lt2333.simplicitytools.util.*
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XC_MethodHook import de.robv.android.xposed.XC_MethodHook
import java.lang.reflect.Method import java.lang.reflect.Method
@@ -19,12 +19,16 @@ object LockScreenClockDisplaySeconds : HookRegister() {
private var nowTime: Date = Calendar.getInstance().time private var nowTime: Date = Calendar.getInstance().time
override fun init() = hasEnable("lock_screen_clock_display_seconds") { override fun init() {
findConstructor("com.miui.clock.MiuiBaseClock") { hasEnable("lock_screen_clock_display_seconds") {
paramCount == 2 "com.miui.clock.MiuiBaseClock".findClass(getDefaultClassLoader())
}.hookAfter { .hookAfterConstructor(
Context::class.java,
AttributeSet::class.java
) {
try { try {
val viewGroup = it.thisObject as LinearLayout val viewGroup = it.thisObject as LinearLayout
val d: Method = viewGroup.javaClass.getDeclaredMethod("updateTime") val d: Method = viewGroup.javaClass.getDeclaredMethod("updateTime")
val r = Runnable { val r = Runnable {
d.isAccessible = true d.isAccessible = true
@@ -36,31 +40,46 @@ object LockScreenClockDisplaySeconds : HookRegister() {
Handler(viewGroup.context.mainLooper).post(r) Handler(viewGroup.context.mainLooper).post(r)
} }
} }
Timer().scheduleAtFixedRate(T(), 1000 - System.currentTimeMillis() % 1000, 1000) Timer().scheduleAtFixedRate(
} catch (e: Exception) { T(),
1000 - System.currentTimeMillis() % 1000,
1000
)
} catch (e: java.lang.Exception) {
} }
} }
"com.miui.clock.MiuiLeftTopClock".hookAfterMethod(
getDefaultClassLoader(),
"updateTime"
) {
updateTime(it, false)
}
findMethod("com.miui.clock.MiuiLeftTopClock") { "com.miui.clock.MiuiLeftTopLargeClock".hookAfterMethod(
name == "updateTime" getDefaultClassLoader(),
}.hookAfter { updateTime(it, false) } "updateTime"
) {
updateTime(it, false)
}
findMethod("com.miui.clock.MiuiCenterHorizontalClock") { "com.miui.clock.MiuiCenterHorizontalClock".hookAfterMethod(
name == "updateTime" getDefaultClassLoader(),
}.hookAfter { updateTime(it, false) } "updateTime"
) {
updateTime(it, false)
}
findMethod("com.miui.clock.MiuiLeftTopLargeClock") { "com.miui.clock.MiuiVerticalClock".hookAfterMethod(
name == "updateTime" getDefaultClassLoader(),
}.hookAfter { updateTime(it, false) } "updateTime"
) {
findMethod("com.miui.clock.MiuiVerticalClock") { updateTime(it, true)
name == "updateTime" }
}.hookAfter { updateTime(it, true) } }
} }
private fun updateTime(it: XC_MethodHook.MethodHookParam, isVertical: Boolean) { private fun updateTime(it: XC_MethodHook.MethodHookParam, isVertical: Boolean) {
val textV = it.thisObject.getObject("mTimeText") as TextView val textV = it.thisObject.getObjectField("mTimeText") as TextView
val c: Context = textV.context val c: Context = textV.context
Log.d( Log.d(

View File

@@ -1,14 +1,15 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context
import android.widget.TextView import android.widget.TextView
import com.github.kyuubiran.ezxhelper.init.InitFields import com.github.kyuubiran.ezxhelper.init.InitFields
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.getObject
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.R import com.lt2333.simplicitytools.R
import com.lt2333.simplicitytools.util.findClass
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XposedHelpers
import java.io.BufferedReader import java.io.BufferedReader
import java.io.FileReader import java.io.FileReader
import java.lang.reflect.Method import java.lang.reflect.Method
@@ -16,21 +17,28 @@ import kotlin.math.roundToInt
object LockScreenCurrent : HookRegister() { object LockScreenCurrent : HookRegister() {
override fun init() = hasEnable("lock_screen_charging_current") { override fun init() {
findMethod("com.android.keyguard.charge.ChargeUtils") { hasEnable("lock_screen_charging_current") {
name == "getChargingHintText" && parameterCount == 3 "com.android.keyguard.charge.ChargeUtils".findClass(getDefaultClassLoader())
}.hookAfter { .hookAfterMethod(
"getChargingHintText",
Context::class.java,
Boolean::class.java,
Int::class.java
) {
it.result = getCurrent() + "\n" + it.result it.result = getCurrent() + "\n" + it.result
} }
"com.android.systemui.statusbar.phone.KeyguardBottomAreaView".findClass(getDefaultClassLoader())
findMethod("com.android.systemui.statusbar.phone.KeyguardBottomAreaView") { .hookAfterMethod(
name == "onFinishInflate" "onFinishInflate"
}.hookAfter { ) {
(it.thisObject.getObject( (XposedHelpers.getObjectField(
it.thisObject,
"mIndicationText" "mIndicationText"
) as TextView).isSingleLine = false ) as TextView).isSingleLine = false
} }
} }
}
/** /**
* 原始代码来自 CSDN * 原始代码来自 CSDN

View File

@@ -1,22 +1,26 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import android.annotation.SuppressLint
import android.app.KeyguardManager import android.app.KeyguardManager
import android.content.Context import android.content.Context
import android.os.SystemClock import android.os.SystemClock
import android.view.MotionEvent import android.view.MotionEvent
import android.view.View import android.view.View
import android.view.View.OnTouchListener import android.view.View.OnTouchListener
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.lt2333.simplicitytools.util.findClass
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XposedHelpers import de.robv.android.xposed.XposedHelpers
object LockScreenDoubleTapToSleep: HookRegister() { object LockScreenDoubleTapToSleep: HookRegister() {
override fun init() = hasEnable("lock_screen_double_tap_to_sleep") {
findMethod("com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer") { @SuppressLint("ClickableViewAccessibility")
name == "onFinishInflate" override fun init() {
}.hookBefore { hasEnable("lock_screen_double_tap_to_sleep") {
"com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer".findClass(
getDefaultClassLoader()
).hookBeforeMethod("onFinishInflate") {
val view = it.thisObject as View val view = it.thisObject as View
XposedHelpers.setAdditionalInstanceField(view, "currentTouchTime", 0L) XposedHelpers.setAdditionalInstanceField(view, "currentTouchTime", 0L)
XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", 0f) XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", 0f)
@@ -59,9 +63,10 @@ object LockScreenDoubleTapToSleep : HookRegister() {
) )
XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", currentTouchX) XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", currentTouchX)
XposedHelpers.setAdditionalInstanceField(view, "currentTouchY", currentTouchY) XposedHelpers.setAdditionalInstanceField(view, "currentTouchY", currentTouchY)
v.performClick()
false false
}) })
} }
} }
} }
}

View File

@@ -1,29 +1,25 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.lt2333.simplicitytools.util.*
import com.github.kyuubiran.ezxhelper.utils.hookReplace
import com.github.kyuubiran.ezxhelper.utils.invokeMethod
import com.github.kyuubiran.ezxhelper.utils.putObject
import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object MaximumNumberOfNotificationIcons: HookRegister() { object MaximumNumberOfNotificationIcons: HookRegister() {
override fun init() { override fun init() {
val icons = XSPUtils.getInt("maximum_number_of_notification_icons",3) val icons = XSPUtils.getInt("maximum_number_of_notification_icons",3)
val dots = XSPUtils.getInt("maximum_number_of_notification_dots",3) val dots = XSPUtils.getInt("maximum_number_of_notification_dots",3)
findMethod("com.android.systemui.statusbar.phone.NotificationIconContainer") { "com.android.systemui.statusbar.phone.NotificationIconContainer".replaceMethod(getDefaultClassLoader(), "miuiShowNotificationIcons", Boolean::class.java) {
name == "miuiShowNotificationIcons" && parameterCount == 1
}.hookReplace {
if (it.args[0] as Boolean) { if (it.args[0] as Boolean) {
it.thisObject.putObject("MAX_DOTS", dots) it.thisObject.setIntField("MAX_DOTS", dots)
it.thisObject.putObject("MAX_STATIC_ICONS", icons) it.thisObject.setIntField("MAX_STATIC_ICONS", icons)
it.thisObject.putObject("MAX_VISIBLE_ICONS_ON_LOCK", icons) it.thisObject.setIntField("MAX_VISIBLE_ICONS_ON_LOCK", icons)
} else { } else {
it.thisObject.putObject("MAX_DOTS", 0) it.thisObject.setIntField("MAX_DOTS", 0)
it.thisObject.putObject("MAX_STATIC_ICONS", 0) it.thisObject.setIntField("MAX_STATIC_ICONS", 0)
it.thisObject.putObject("MAX_VISIBLE_ICONS_ON_LOCK", 0) it.thisObject.setIntField("MAX_VISIBLE_ICONS_ON_LOCK", 0)
} }
it.thisObject.invokeMethod("updateState") it.thisObject.callMethod("updateState")
} }
} }
} }

View File

@@ -9,20 +9,22 @@ import android.widget.TextView
import android.widget.Toast import android.widget.Toast
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import cn.fkj233.ui.activity.dp2px import cn.fkj233.ui.activity.dp2px
import com.github.kyuubiran.ezxhelper.utils.* import com.github.kyuubiran.ezxhelper.utils.loadClass
import com.lt2333.simplicitytools.util.* import com.lt2333.simplicitytools.util.*
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import com.lt2333.simplicitytools.view.WeatherView import com.lt2333.simplicitytools.view.WeatherView
object NotificationWeather: HookRegister() { object NotificationWeather: HookRegister() {
override fun init() = hasEnable("notification_weather") { override fun init() {
hasEnable("notification_weather") {
var mWeatherView: TextView? = null var mWeatherView: TextView? = null
var mConstraintLayout: ConstraintLayout? = null var mConstraintLayout: ConstraintLayout? = null
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false) val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
findMethod("com.android.systemui.qs.MiuiNotificationHeaderView") { "com.android.systemui.qs.MiuiNotificationHeaderView".hookAfterMethod(
name == "onFinishInflate" getDefaultClassLoader(),
}.hookAfter { "onFinishInflate"
) {
val viewGroup = it.thisObject as ViewGroup val viewGroup = it.thisObject as ViewGroup
val context = viewGroup.context val context = viewGroup.context
@@ -137,11 +139,11 @@ object NotificationWeather : HookRegister() {
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT ViewGroup.LayoutParams.WRAP_CONTENT
) as ViewGroup.MarginLayoutParams ) as ViewGroup.MarginLayoutParams
layoutParam.putObject( layoutParam.setObjectField(
"bottomToTop", "bottomToTop",
context.resources.getIdentifier("date_time", "id", context.packageName) context.resources.getIdentifier("date_time", "id", context.packageName)
) )
layoutParam.putObject( layoutParam.setObjectField(
"startToEnd", "startToEnd",
context.resources.getIdentifier("big_time", "id", context.packageName) context.resources.getIdentifier("big_time", "id", context.packageName)
) )
@@ -179,14 +181,16 @@ object NotificationWeather : HookRegister() {
Toast.makeText(context, "启动失败", Toast.LENGTH_LONG).show() Toast.makeText(context, "启动失败", Toast.LENGTH_LONG).show()
} }
} }
}
findMethod("com.android.systemui.qs.MiuiNotificationHeaderView") { }
name == "updateLayout" //解决横屏重叠
}.hookAfter { "com.android.systemui.qs.MiuiNotificationHeaderView".hookAfterMethod(
getDefaultClassLoader(),
"updateLayout"
) {
val viewGroup = it.thisObject as ViewGroup val viewGroup = it.thisObject as ViewGroup
val context = viewGroup.context val context = viewGroup.context
val mOrientation = viewGroup.getObject("mOrientation") as Int val mOrientation = viewGroup.getObjectField("mOrientation") as Int
// MIUI编译时间大于 2022-03-12 00:00:00 且为内测版 // MIUI编译时间大于 2022-03-12 00:00:00 且为内测版
if (SystemProperties.get(context, "ro.build.date.utc")!! if (SystemProperties.get(context, "ro.build.date.utc")!!
.toInt() >= 1647014400 && .toInt() >= 1647014400 &&
@@ -216,3 +220,5 @@ object NotificationWeather : HookRegister() {
} }
} }
} }
}

View File

@@ -6,19 +6,21 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.TextView import android.widget.TextView
import android.widget.Toast import android.widget.Toast
import com.github.kyuubiran.ezxhelper.utils.* import com.github.kyuubiran.ezxhelper.utils.loadClass
import com.lt2333.simplicitytools.util.XSPUtils import com.lt2333.simplicitytools.util.*
import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import com.lt2333.simplicitytools.view.WeatherView import com.lt2333.simplicitytools.view.WeatherView
object OldNotificationWeather: HookRegister() { object OldNotificationWeather: HookRegister() {
override fun init() = hasEnable("notification_weather") {
override fun init() {
hasEnable("notification_weather") {
var mWeatherView: TextView? = null var mWeatherView: TextView? = null
val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false) val isDisplayCity = XSPUtils.getBoolean("notification_weather_city", false)
findMethod("com.android.systemui.qs.MiuiQSHeaderView") { "com.android.systemui.qs.MiuiQSHeaderView".hookAfterMethod(
name == "onFinishInflate" getDefaultClassLoader(),
}.hookAfter { "onFinishInflate"
) {
val viewGroup = it.thisObject as ViewGroup val viewGroup = it.thisObject as ViewGroup
val context = viewGroup.context val context = viewGroup.context
val layoutParam = val layoutParam =
@@ -29,7 +31,7 @@ object OldNotificationWeather : HookRegister() {
ViewGroup.LayoutParams.WRAP_CONTENT ViewGroup.LayoutParams.WRAP_CONTENT
) as ViewGroup.MarginLayoutParams ) as ViewGroup.MarginLayoutParams
layoutParam.putObject( layoutParam.setObjectField(
"endToStart", "endToStart",
context.resources.getIdentifier( context.resources.getIdentifier(
"notification_shade_shortcut", "notification_shade_shortcut",
@@ -37,7 +39,7 @@ object OldNotificationWeather : HookRegister() {
context.packageName context.packageName
) )
) )
layoutParam.putObject( layoutParam.setObjectField(
"topToTop", "topToTop",
context.resources.getIdentifier( context.resources.getIdentifier(
"notification_shade_shortcut", "notification_shade_shortcut",
@@ -45,7 +47,7 @@ object OldNotificationWeather : HookRegister() {
context.packageName context.packageName
) )
) )
layoutParam.putObject( layoutParam.setObjectField(
"bottomToBottom", "bottomToBottom",
context.resources.getIdentifier( context.resources.getIdentifier(
"notification_shade_shortcut", "notification_shade_shortcut",
@@ -80,12 +82,12 @@ object OldNotificationWeather : HookRegister() {
} }
} }
} }
//解决横屏重叠 //解决横屏重叠
findMethod("com.android.systemui.qs.MiuiQSHeaderView") { "com.android.systemui.qs.MiuiQSHeaderView".hookAfterMethod(
name == "updateLayout" getDefaultClassLoader(),
}.hookAfter { "updateLayout"
val mOritation = it.thisObject.getObject("mOrientation") as Int ) {
val mOritation = it.thisObject.getObjectField("mOrientation") as Int
if (mOritation == 1) { if (mOritation == 1) {
mWeatherView!!.visibility = View.VISIBLE mWeatherView!!.visibility = View.VISIBLE
} else { } else {
@@ -94,3 +96,6 @@ object OldNotificationWeather : HookRegister() {
} }
} }
} }
}

View File

@@ -2,39 +2,41 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.content.res.Configuration import android.content.res.Configuration
import android.view.ViewGroup import android.view.ViewGroup
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.github.kyuubiran.ezxhelper.utils.putObject
import com.lt2333.simplicitytools.util.XSPUtils import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XposedHelpers import de.robv.android.xposed.XposedHelpers
object OldQSCustom: HookRegister() { object OldQSCustom: HookRegister() {
override fun init() = hasEnable("old_qs_custom_switch") {
override fun init() {
hasEnable("old_qs_custom_switch") {
val mRows = XSPUtils.getInt("qs_custom_rows", 3) val mRows = XSPUtils.getInt("qs_custom_rows", 3)
val mRowsHorizontal = XSPUtils.getInt("qs_custom_rows_horizontal", 2) val mRowsHorizontal = XSPUtils.getInt("qs_custom_rows_horizontal", 2)
val mColumns = XSPUtils.getInt("qs_custom_columns", 4) val mColumns = XSPUtils.getInt("qs_custom_columns", 4)
val mColumnsUnexpanded = XSPUtils.getInt("qs_custom_columns_unexpanded", 5) val mColumnsUnexpanded = XSPUtils.getInt("qs_custom_columns_unexpanded", 5)
findMethod("com.android.systemui.qs.MiuiQuickQSPanel") { "com.android.systemui.qs.MiuiQuickQSPanel".hookBeforeMethod(
name == "setMaxTiles" && parameterCount == 1 getDefaultClassLoader(),
}.hookBefore { "setMaxTiles", Int::class.java
) {
//未展开时的列数 //未展开时的列数
it.args[0] = mColumnsUnexpanded it.args[0] = mColumnsUnexpanded
} }
findMethod("com.android.systemui.qs.MiuiTileLayout") { "com.android.systemui.qs.MiuiTileLayout".hookAfterMethod(
name == "updateColumns" getDefaultClassLoader(),
}.hookAfter { "updateColumns"
) {
//展开时的列数 //展开时的列数
it.thisObject.putObject("mColumns", mColumns) XposedHelpers.setObjectField(it.thisObject, "mColumns", mColumns)
} }
"com.android.systemui.qs.MiuiTileLayout".hookAfterMethod(
findMethod("com.android.systemui.qs.MiuiTileLayout") { getDefaultClassLoader(),
name == "updateResources" "updateResources"
}.hookAfter { ) {
//展开时的行数 //展开时的行数
val viewGroup = it.thisObject as ViewGroup val viewGroup = it.thisObject as ViewGroup
val mConfiguration: Configuration = viewGroup.context.resources.configuration val mConfiguration: Configuration = viewGroup.context.resources.configuration
@@ -47,3 +49,5 @@ object OldQSCustom : HookRegister() {
} }
} }
} }
}

View File

@@ -2,41 +2,34 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.view.View import android.view.View
import android.widget.LinearLayout import android.widget.LinearLayout
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.lt2333.simplicitytools.util.getObjectField
import com.github.kyuubiran.ezxhelper.utils.getObject
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable 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 com.lt2333.simplicitytools.util.xposed.base.HookRegister
object RemoveLockScreenCamera: HookRegister() { object RemoveLockScreenCamera: HookRegister() {
override fun init() { override fun init() {
//屏蔽右下角组件显示 //屏蔽右下角组件显示
findMethod("com.android.systemui.statusbar.phone.KeyguardBottomAreaView") { "com.android.systemui.statusbar.phone.KeyguardBottomAreaView".hookAfterMethod(getDefaultClassLoader(), "onFinishInflate") {
name == "onFinishInflate"
}.hookAfter {
hasEnable("remove_lock_screen_camera") { hasEnable("remove_lock_screen_camera") {
(it.thisObject.getObject("mRightAffordanceViewLayout") as LinearLayout).visibility = (it.thisObject.getObjectField("mRightAffordanceViewLayout") as LinearLayout).visibility = View.GONE
View.GONE
} }
} }
//屏蔽滑动撞墙动画 //屏蔽滑动撞墙动画
findMethod("com.android.keyguard.KeyguardMoveRightController") { "com.android.keyguard.KeyguardMoveRightController".hookBeforeMethod(getDefaultClassLoader(), "onTouchMove", Float::class.java, Float::class.java) {
name == "onTouchMove" && parameterCount == 2
}.hookBefore {
hasEnable("remove_lock_screen_camera") { hasEnable("remove_lock_screen_camera") {
it.result = false it.result = false
} }
} }
findMethod("com.android.keyguard.KeyguardMoveRightController") { "com.android.keyguard.KeyguardMoveRightController".hookBeforeMethod(getDefaultClassLoader(), "reset") {
name == "reset"
}.hookBefore {
hasEnable("remove_lock_screen_camera") { hasEnable("remove_lock_screen_camera") {
it.result = null it.result = null
} }
} }
} }
} }

View File

@@ -1,18 +1,17 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object RemoveTheLeftSideOfTheLockScreen: HookRegister() { object RemoveTheLeftSideOfTheLockScreen: HookRegister() {
override fun init() { override fun init() {
findMethod("com.android.keyguard.negative.MiuiKeyguardMoveLeftViewContainer") { "com.android.keyguard.negative.MiuiKeyguardMoveLeftViewContainer".hookBeforeMethod(getDefaultClassLoader(), "inflateLeftView") {
name == "inflateLeftView"
}.hookBefore {
hasEnable("remove_the_left_side_of_the_lock_screen") { hasEnable("remove_the_left_side_of_the_lock_screen") {
it.result = null it.result = null
} }
} }
} }
} }

View File

@@ -9,11 +9,10 @@ import android.view.ViewGroup
import android.widget.ImageView import android.widget.ImageView
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.github.kyuubiran.ezxhelper.utils.hookReturnConstant
import com.lt2333.simplicitytools.util.XSPUtils import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookAfterMethod
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XposedHelpers import de.robv.android.xposed.XposedHelpers
@@ -21,15 +20,16 @@ import de.robv.android.xposed.XposedHelpers
object StatusBarBigMobileTypeIcon: HookRegister() { object StatusBarBigMobileTypeIcon: HookRegister() {
private val upAndDownPosition = XSPUtils.getInt("big_mobile_type_icon_up_and_down_position", 0) private val upAndDownPosition = XSPUtils.getInt("big_mobile_type_icon_up_and_down_position", 0)
private val leftAndRightMargin = private val leftAndRightMargin = XSPUtils.getInt("big_mobile_type_icon_left_and_right_margins", 0)
XSPUtils.getInt("big_mobile_type_icon_left_and_right_margins", 0)
private val isBold = XSPUtils.getBoolean("big_mobile_type_icon_bold", true) private val isBold = XSPUtils.getBoolean("big_mobile_type_icon_bold", true)
private val size = XSPUtils.getFloat("big_mobile_type_icon_size", 12.5f) private val size = XSPUtils.getFloat("big_mobile_type_icon_size", 12.5f)
override fun init() = hasEnable("big_mobile_type_icon") { override fun init() {
findMethod("com.android.systemui.statusbar.StatusBarMobileView") { hasEnable("big_mobile_type_icon") {
name == "init" "com.android.systemui.statusbar.StatusBarMobileView".hookAfterMethod(
}.hookAfter { getDefaultClassLoader(),
"init"
) {
val statusBarMobileView = it.thisObject as ViewGroup val statusBarMobileView = it.thisObject as ViewGroup
val context: Context = statusBarMobileView.context val context: Context = statusBarMobileView.context
val res: Resources = context.resources val res: Resources = context.resources
@@ -116,9 +116,14 @@ object StatusBarBigMobileTypeIcon : HookRegister() {
} }
//屏蔽更新布局 //屏蔽更新布局
findMethod("com.android.systemui.statusbar.StatusBarMobileView") { "com.android.systemui.statusbar.StatusBarMobileView".hookBeforeMethod(
name == "updateMobileTypeLayout" && parameterTypes[0] == String::class.java getDefaultClassLoader(),
}.hookReturnConstant(null) "updateMobileTypeLayout", String::class.java
) {
it.result = null
} }
} }
} }
}
}

View File

@@ -1,21 +1,27 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.os.SystemClock import android.os.SystemClock
import android.view.MotionEvent import android.view.MotionEvent
import android.view.View.OnTouchListener import android.view.View.OnTouchListener
import android.view.ViewGroup import android.view.ViewGroup
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.lt2333.simplicitytools.util.findClass
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XposedHelpers import de.robv.android.xposed.XposedHelpers
object StatusBarDoubleTapToSleep: HookRegister() { object StatusBarDoubleTapToSleep: HookRegister() {
override fun init() = hasEnable("status_bar_double_tap_to_sleep") {
findMethod("com.android.systemui.statusbar.phone.MiuiPhoneStatusBarView") { @SuppressLint("ClickableViewAccessibility")
name == "onFinishInflate" override fun init() {
}.hookBefore { hasEnable("status_bar_double_tap_to_sleep") {
"com.android.systemui.statusbar.phone.MiuiPhoneStatusBarView".findClass(
getDefaultClassLoader()
).hookBeforeMethod(
"onFinishInflate"
) {
val view = it.thisObject as ViewGroup val view = it.thisObject as ViewGroup
XposedHelpers.setAdditionalInstanceField(view, "currentTouchTime", 0L) XposedHelpers.setAdditionalInstanceField(view, "currentTouchTime", 0L)
XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", 0f) XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", 0f)
@@ -54,9 +60,10 @@ object StatusBarDoubleTapToSleep : HookRegister() {
) )
XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", currentTouchX) XposedHelpers.setAdditionalInstanceField(view, "currentTouchX", currentTouchX)
XposedHelpers.setAdditionalInstanceField(view, "currentTouchY", currentTouchY) XposedHelpers.setAdditionalInstanceField(view, "currentTouchY", currentTouchY)
v.performClick()
false false
}) })
} }
} }
} }
}

View File

@@ -1,9 +1,11 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import android.annotation.SuppressLint
import android.app.KeyguardManager import android.app.KeyguardManager
import android.content.Context import android.content.Context
import android.content.res.Configuration import android.content.res.Configuration
import android.content.res.Resources import android.content.res.Resources
import android.os.Bundle
import android.view.Gravity import android.view.Gravity
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
@@ -11,53 +13,45 @@ import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import cn.fkj233.ui.activity.dp2px import cn.fkj233.ui.activity.dp2px
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.getObject
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import com.lt2333.simplicitytools.util.XSPUtils import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.hasEnable 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 com.lt2333.simplicitytools.util.xposed.base.HookRegister
import de.robv.android.xposed.XposedHelpers import de.robv.android.xposed.XposedHelpers
@SuppressLint("StaticFieldLeak")
object StatusBarLayout : HookRegister() { object StatusBarLayout : HookRegister() {
private var mLeftLayout: LinearLayout? = null
private var mRightLayout: LinearLayout? = null
private var mCenterLayout: LinearLayout? = null
private var statusBar: ViewGroup? = null
private var statusBarLeft = 0 private var statusBarLeft = 0
private var statusBarTop = 0 private var statusBarTop = 0
private var statusBarRight = 0 private var statusBarRight = 0
private var statusBarBottom = 0 private var statusBarBottom = 0
override fun init() { override fun init() {
var mLeftLayout: LinearLayout? = null
var mRightLayout: LinearLayout? = null
var mCenterLayout: LinearLayout? = null
var statusBar: ViewGroup? = null
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)
} else {
//横屏状态
mLeftLayout!!.setPadding(175, 0, 0, 0)
mRightLayout!!.setPadding(0, 0, 175, 0)
statusBar!!.setPadding(0, statusBarTop, 0, statusBarBottom)
}
}
when (XSPUtils.getInt("status_bar_layout_mode", 0)) { when (XSPUtils.getInt("status_bar_layout_mode", 0)) {
//默认 //默认
0 -> return 0 -> return
//时钟居中 //时钟居中
1 -> { 1 -> {
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") { val collapsedStatusBarFragmentClass =
name == "onViewCreated" && parameterCount == 2 "com.android.systemui.statusbar.phone.CollapsedStatusBarFragment".findClass(
}.hookAfter { getDefaultClassLoader()
)
collapsedStatusBarFragmentClass.hookAfterMethod(
"onViewCreated",
View::class.java,
Bundle::class.java
) { param ->
val MiuiPhoneStatusBarView: ViewGroup = val MiuiPhoneStatusBarView: ViewGroup =
it.thisObject.getObject("mStatusBar") as ViewGroup param.thisObject.getObjectField("mStatusBar") as ViewGroup
val context: Context = MiuiPhoneStatusBarView.context val context: Context = MiuiPhoneStatusBarView.context
val res: Resources = MiuiPhoneStatusBarView.resources val res: Resources = MiuiPhoneStatusBarView.resources
val statusBarId: Int = val statusBarId: Int =
@@ -82,7 +76,7 @@ object StatusBarLayout : HookRegister() {
statusBar = MiuiPhoneStatusBarView.findViewById(statusBarId) statusBar = MiuiPhoneStatusBarView.findViewById(statusBarId)
val statusBarContents: ViewGroup = val statusBarContents: ViewGroup =
MiuiPhoneStatusBarView.findViewById(statusBarContentsId) MiuiPhoneStatusBarView.findViewById(statusBarContentsId)
if (statusBar == null) return@hookAfter if (statusBar == null) return@hookAfterMethod
val clock: TextView = MiuiPhoneStatusBarView.findViewById(clockId) val clock: TextView = MiuiPhoneStatusBarView.findViewById(clockId)
val phoneStatusBarLeftContainer: ViewGroup = val phoneStatusBarLeftContainer: ViewGroup =
MiuiPhoneStatusBarView.findViewById(phoneStatusBarLeftContainerId) MiuiPhoneStatusBarView.findViewById(phoneStatusBarLeftContainerId)
@@ -165,11 +159,13 @@ object StatusBarLayout : HookRegister() {
updateLayout(context) updateLayout(context)
} }
} }
val phoneStatusBarViewClass =
"com.android.systemui.statusbar.phone.PhoneStatusBarView".findClass(
getDefaultClassLoader()
)
findMethod("com.android.systemui.statusbar.phone.PhoneStatusBarView") { phoneStatusBarViewClass.hookAfterMethod("updateLayoutForCutout") {
name == "updateLayoutForCutout" if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
}.hookAfter {
hasEnable("layout_compatibility_mode") {
val context = (it.thisObject as ViewGroup).context val context = (it.thisObject as ViewGroup).context
updateLayout(context) updateLayout(context)
} }
@@ -177,11 +173,18 @@ object StatusBarLayout : HookRegister() {
} }
//时钟居右 //时钟居右
2 -> { 2 -> {
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") { val collapsedStatusBarFragmentClass =
name == "onViewCreated" && parameterCount == 2 "com.android.systemui.statusbar.phone.CollapsedStatusBarFragment".findClass(
}.hookAfter { getDefaultClassLoader()
val MiuiPhoneStatusBarView = )
it.thisObject.getObject("mStatusBar") as ViewGroup
collapsedStatusBarFragmentClass.hookAfterMethod(
"onViewCreated",
View::class.java,
Bundle::class.java
) { param ->
val MiuiPhoneStatusBarView: ViewGroup =
param.thisObject.getObjectField("mStatusBar") as ViewGroup
val context: Context = MiuiPhoneStatusBarView.context val context: Context = MiuiPhoneStatusBarView.context
val res: Resources = MiuiPhoneStatusBarView.resources val res: Resources = MiuiPhoneStatusBarView.resources
@@ -193,7 +196,7 @@ object StatusBarLayout : HookRegister() {
//查找组件 //查找组件
statusBar = MiuiPhoneStatusBarView.findViewById(statusBarId) statusBar = MiuiPhoneStatusBarView.findViewById(statusBarId)
if (statusBar == null) return@hookAfter if (statusBar == null) return@hookAfterMethod
val clock: TextView = MiuiPhoneStatusBarView.findViewById(clockId) val clock: TextView = MiuiPhoneStatusBarView.findViewById(clockId)
val battery: ViewGroup = MiuiPhoneStatusBarView.findViewById(batteryId) val battery: ViewGroup = MiuiPhoneStatusBarView.findViewById(batteryId)
@@ -216,11 +219,18 @@ object StatusBarLayout : HookRegister() {
} }
//时钟居中+图标居左 //时钟居中+图标居左
3 -> { 3 -> {
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") { val collapsedStatusBarFragmentClass =
name == "onViewCreated" && parameterCount == 2 "com.android.systemui.statusbar.phone.CollapsedStatusBarFragment".findClass(
}.hookAfter { getDefaultClassLoader()
val MiuiPhoneStatusBarView = )
it.thisObject.getObject("mStatusBar") as ViewGroup
collapsedStatusBarFragmentClass.hookAfterMethod(
"onViewCreated",
View::class.java,
Bundle::class.java
) { param ->
val MiuiPhoneStatusBarView: ViewGroup =
param.thisObject.getObjectField("mStatusBar") as ViewGroup
val context: Context = MiuiPhoneStatusBarView.context val context: Context = MiuiPhoneStatusBarView.context
val res: Resources = MiuiPhoneStatusBarView.resources val res: Resources = MiuiPhoneStatusBarView.resources
val statusBarId: Int = val statusBarId: Int =
@@ -270,7 +280,7 @@ object StatusBarLayout : HookRegister() {
statusBar = MiuiPhoneStatusBarView.findViewById(statusBarId) statusBar = MiuiPhoneStatusBarView.findViewById(statusBarId)
val statusBarContents: ViewGroup = val statusBarContents: ViewGroup =
MiuiPhoneStatusBarView.findViewById(statusBarContentsId) MiuiPhoneStatusBarView.findViewById(statusBarContentsId)
if (statusBar == null) return@hookAfter if (statusBar == null) return@hookAfterMethod
val clock: TextView = MiuiPhoneStatusBarView.findViewById(clockId) val clock: TextView = MiuiPhoneStatusBarView.findViewById(clockId)
val phoneStatusBarLeftContainer: ViewGroup = val phoneStatusBarLeftContainer: ViewGroup =
MiuiPhoneStatusBarView.findViewById(phoneStatusBarLeftContainerId) MiuiPhoneStatusBarView.findViewById(phoneStatusBarLeftContainerId)
@@ -389,19 +399,26 @@ object StatusBarLayout : HookRegister() {
} }
} }
//兼容模式 //兼容模式
findMethod("com.android.systemui.statusbar.phone.PhoneStatusBarView") { val phoneStatusBarViewClass =
name == "updateLayoutForCutout" "com.android.systemui.statusbar.phone.PhoneStatusBarView".findClass(
}.hookAfter { getDefaultClassLoader()
)
phoneStatusBarViewClass.hookAfterMethod("updateLayoutForCutout") {
if (XSPUtils.getBoolean("layout_compatibility_mode", false)) { if (XSPUtils.getBoolean("layout_compatibility_mode", false)) {
val context = (it.thisObject as ViewGroup).context val context = (it.thisObject as ViewGroup).context
updateLayout(context) updateLayout(context)
} }
} }
//解决重叠 //解决重叠
findMethod("com.android.systemui.statusbar.phone.MiuiCollapsedStatusBarFragment") { val miuiCollapsedStatusBarFragmentClass =
name == "showClock" && parameterTypes[0] == Boolean::class.java "com.android.systemui.statusbar.phone.MiuiCollapsedStatusBarFragment".findClass(
}.hookAfter { getDefaultClassLoader()
)
miuiCollapsedStatusBarFragmentClass.hookAfterMethod(
"showClock",
Boolean::class.java
) {
val MiuiPhoneStatusBarView = val MiuiPhoneStatusBarView =
XposedHelpers.getObjectField(it.thisObject, "mStatusBar") as ViewGroup XposedHelpers.getObjectField(it.thisObject, "mStatusBar") as ViewGroup
val res = MiuiPhoneStatusBarView.resources val res = MiuiPhoneStatusBarView.resources
@@ -419,8 +436,21 @@ object StatusBarLayout : HookRegister() {
} }
} }
} }
}
private 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)
} else {
//横屏状态
mLeftLayout!!.setPadding(175, 0, 0, 0)
mRightLayout!!.setPadding(0, 0, 175, 0)
statusBar!!.setPadding(0, statusBarTop, 0, statusBarBottom)
}
} }
} }

View File

@@ -1,18 +1,17 @@
package com.lt2333.simplicitytools.hook.app.systemui package com.lt2333.simplicitytools.hook.app.systemui
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object StatusBarNetworkSpeedRefreshSpeed: HookRegister() { object StatusBarNetworkSpeedRefreshSpeed: HookRegister() {
override fun init() { override fun init() {
findMethod("com.android.systemui.statusbar.policy.NetworkSpeedController") { "com.android.systemui.statusbar.policy.NetworkSpeedController".hookBeforeMethod(getDefaultClassLoader(), "postUpdateNetworkSpeedDelay", Long::class.java) {
name == "postUpdateNetworkSpeedDelay" && parameterTypes[0] == Long::class.java
}.hookBefore {
hasEnable("status_bar_network_speed_refresh_speed") { hasEnable("status_bar_network_speed_refresh_speed") {
it.args[0] = 1000L it.args[0] = 1000L
} }
} }
} }
} }

View File

@@ -3,14 +3,16 @@ package com.lt2333.simplicitytools.hook.app.systemui
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.content.res.Resources import android.content.res.Resources
import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.provider.Settings import android.provider.Settings
import android.util.AttributeSet
import android.util.TypedValue import android.util.TypedValue
import android.view.Gravity import android.view.Gravity
import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.TextView import android.widget.TextView
import com.github.kyuubiran.ezxhelper.utils.* import com.lt2333.simplicitytools.util.*
import com.lt2333.simplicitytools.util.XSPUtils
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
import java.lang.reflect.Method import java.lang.reflect.Method
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
@@ -39,14 +41,17 @@ object StatusBarTimeCustomization : HookRegister() {
override fun init() { override fun init() {
if (isOpen) { if (isOpen) {
var c: Context? = null var c: Context? = null
val miuiClockClass =
findConstructor("com.android.systemui.statusbar.views.MiuiClock") { "com.android.systemui.statusbar.views.MiuiClock".findClass(getDefaultClassLoader())
paramCount == 3 miuiClockClass.hookAfterConstructor(
}.hookAfter { Context::class.java,
AttributeSet::class.java,
Integer.TYPE
) {
try { try {
c = it.args[0] as Context c = it.args[0] as Context
val textV = it.thisObject as TextView val textV = it.thisObject as TextView
if (textV.resources.getResourceEntryName(textV.id) != "clock") return@hookAfter if (textV.resources.getResourceEntryName(textV.id) != "clock") return@hookAfterConstructor
textV.isSingleLine = false textV.isSingleLine = false
if (isDoubleLine) { if (isDoubleLine) {
str = "\n" str = "\n"
@@ -74,13 +79,10 @@ object StatusBarTimeCustomization : HookRegister() {
} }
} }
Timer().scheduleAtFixedRate(T(), 1000 - System.currentTimeMillis() % 1000, 1000) Timer().scheduleAtFixedRate(T(), 1000 - System.currentTimeMillis() % 1000, 1000)
} catch (e: Exception) { } catch (e: java.lang.Exception) {
} }
} }
miuiClockClass.hookAfterMethod("updateTime") {
findMethod("com.android.systemui.statusbar.views.MiuiClock") {
name == "updateTime"
}.hookAfter {
try { try {
val textV = it.thisObject as TextView val textV = it.thisObject as TextView
if (textV.resources.getResourceEntryName(textV.id) == "clock") { if (textV.resources.getResourceEntryName(textV.id) == "clock") {
@@ -95,13 +97,18 @@ object StatusBarTimeCustomization : HookRegister() {
} catch (e: Exception) { } catch (e: Exception) {
} }
} }
if (isCenterAlign) { if (isCenterAlign) {
findMethod("com.android.systemui.statusbar.phone.CollapsedStatusBarFragment") { val collapsedStatusBarFragmentClass =
name == "onViewCreated" && parameterCount == 2 "com.android.systemui.statusbar.phone.CollapsedStatusBarFragment".findClass(
}.hookAfter { getDefaultClassLoader()
val MiuiPhoneStatusBarView = )
it.thisObject.getObject("mStatusBar") as ViewGroup collapsedStatusBarFragmentClass.hookAfterMethod(
"onViewCreated",
View::class.java,
Bundle::class.java
) {
val MiuiPhoneStatusBarView: ViewGroup =
it.thisObject.getObjectField("mStatusBar") as ViewGroup
val res: Resources = MiuiPhoneStatusBarView.resources val res: Resources = MiuiPhoneStatusBarView.resources
val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui") val clockId: Int = res.getIdentifier("clock", "id", "com.android.systemui")
val clock: TextView = MiuiPhoneStatusBarView.findViewById(clockId) val clock: TextView = MiuiPhoneStatusBarView.findViewById(clockId)

View File

@@ -1,18 +1,18 @@
package com.lt2333.simplicitytools.hook.app.thememanager package com.lt2333.simplicitytools.hook.app.thememanager
import com.github.kyuubiran.ezxhelper.utils.findMethod import com.lt2333.simplicitytools.util.findClass
import com.github.kyuubiran.ezxhelper.utils.hookBefore
import com.lt2333.simplicitytools.util.hasEnable import com.lt2333.simplicitytools.util.hasEnable
import com.lt2333.simplicitytools.util.hookBeforeMethod
import com.lt2333.simplicitytools.util.xposed.base.HookRegister import com.lt2333.simplicitytools.util.xposed.base.HookRegister
object RemoveAds : HookRegister() { object RemoveAds : HookRegister() {
override fun init() { override fun init() {
findMethod("com.android.thememanager.basemodule.ad.model.AdInfoResponse") { "com.android.thememanager.basemodule.ad.model.AdInfoResponse".hookBeforeMethod(getDefaultClassLoader(), "isAdValid", "com.android.thememanager.basemodule.ad.model.AdInfo".findClass(getDefaultClassLoader())) {
name == "isAdValid" && parameterCount == 1
}.hookBefore {
hasEnable("remove_thememanager_ads") { hasEnable("remove_thememanager_ads") {
it.result = false it.result = false
} }
} }
} }
} }

View File

@@ -0,0 +1,502 @@
package com.lt2333.simplicitytools.util
import android.content.res.XResources
import android.util.Log
import dalvik.system.BaseDexClassLoader
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.XC_MethodReplacement
import de.robv.android.xposed.XposedBridge
import de.robv.android.xposed.XposedHelpers
import de.robv.android.xposed.callbacks.XC_LayoutInflated
import java.lang.reflect.Field
import java.lang.reflect.Member
import java.util.*
const val TAG = "SimplicityTools"
fun log(any: Any?, online: Boolean = false) {
val msg: String = if (any is Throwable) Log.getStackTraceString(any) else any.toString()
// Log.d(TAG, msg)
XposedBridge.log("$TAG: $msg")
}
typealias MethodHookParam = XC_MethodHook.MethodHookParam
typealias Replacer = (XC_MethodHook.MethodHookParam) -> Any?
typealias Hooker = (XC_MethodHook.MethodHookParam) -> Unit
fun Class<*>.hookMethod(method: String?, vararg args: Any?) = try {
XposedHelpers.findAndHookMethod(this, method, *args)
} catch (e: NoSuchMethodError) {
log(e)
null
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
null
} catch (e: ClassNotFoundException) {
log(e)
null
}
fun Member.hookMethod(callback: XC_MethodHook) = try {
XposedBridge.hookMethod(this, callback)
} catch (e: Throwable) {
log(e)
null
}
inline fun XC_MethodHook.MethodHookParam.callHooker(crossinline hooker: Hooker) = try {
hooker(this)
} catch (e: Throwable) {
log("Error occurred calling hooker on ${this.method}")
log(e)
}
inline fun XC_MethodHook.MethodHookParam.callReplacer(crossinline replacer: Replacer) = try {
replacer(this)
} catch (e: Throwable) {
log("Error occurred calling replacer on ${this.method}")
log(e)
null
}
inline fun Member.replaceMethod(crossinline replacer: Replacer) =
hookMethod(object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam) = param.callReplacer(replacer)
})
inline fun Member.hookAfterMethod(crossinline hooker: Hooker) =
hookMethod(object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Member.hookBeforeMethod(crossinline hooker: (XC_MethodHook.MethodHookParam) -> Unit) =
hookMethod(object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.hookBeforeMethod(
method: String?,
vararg args: Any?,
crossinline hooker: Hooker
) = hookMethod(method, *args, object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.hookAfterMethod(
method: String?,
vararg args: Any?,
crossinline hooker: Hooker
) = hookMethod(method, *args, object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.replaceMethod(
method: String?,
vararg args: Any?,
crossinline replacer: Replacer
) = hookMethod(method, *args, object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam) = param.callReplacer(replacer)
})
fun Class<*>.hookAllMethods(methodName: String?, hooker: XC_MethodHook): Set<XC_MethodHook.Unhook> =
try {
XposedBridge.hookAllMethods(this, methodName, hooker)
} catch (e: NoSuchMethodError) {
log(e)
emptySet()
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
emptySet()
} catch (e: ClassNotFoundException) {
log(e)
emptySet()
}
inline fun Class<*>.hookBeforeAllMethods(methodName: String?, crossinline hooker: Hooker) =
hookAllMethods(methodName, object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.hookAfterAllMethods(methodName: String?, crossinline hooker: Hooker) =
hookAllMethods(methodName, object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.replaceAfterAllMethods(methodName: String?, crossinline replacer: Replacer) =
hookAllMethods(methodName, object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam) = param.callReplacer(replacer)
})
fun Class<*>.hookConstructor(vararg args: Any?) = try {
XposedHelpers.findAndHookConstructor(this, *args)
} catch (e: NoSuchMethodError) {
log(e)
null
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
null
} catch (e: ClassNotFoundException) {
log(e)
null
}
inline fun Class<*>.hookBeforeConstructor(vararg args: Any?, crossinline hooker: Hooker) =
hookConstructor(*args, object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.hookAfterConstructor(vararg args: Any?, crossinline hooker: Hooker) =
hookConstructor(*args, object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.replaceConstructor(vararg args: Any?, crossinline hooker: Hooker) =
hookConstructor(*args, object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
fun Class<*>.hookAllConstructors(hooker: XC_MethodHook): Set<XC_MethodHook.Unhook> = try {
XposedBridge.hookAllConstructors(this, hooker)
} catch (e: NoSuchMethodError) {
log(e)
emptySet()
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
emptySet()
} catch (e: ClassNotFoundException) {
log(e)
emptySet()
}
inline fun Class<*>.hookAfterAllConstructors(crossinline hooker: Hooker) =
hookAllConstructors(object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.hookBeforeAllConstructors(crossinline hooker: Hooker) =
hookAllConstructors(object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
inline fun Class<*>.replaceAfterAllConstructors(crossinline hooker: Hooker) =
hookAllConstructors(object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam) = param.callHooker(hooker)
})
fun String.hookMethod(classLoader: ClassLoader, method: String?, vararg args: Any?) = try {
findClass(classLoader).hookMethod(method, *args)
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
null
} catch (e: ClassNotFoundException) {
log(e)
null
}
inline fun String.hookBeforeMethod(
classLoader: ClassLoader,
method: String?,
vararg args: Any?,
crossinline hooker: Hooker
) = try {
findClass(classLoader).hookBeforeMethod(method, *args, hooker = hooker)
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
null
} catch (e: ClassNotFoundException) {
log(e)
null
}
inline fun String.hookAfterMethod(
classLoader: ClassLoader,
method: String?,
vararg args: Any?,
crossinline hooker: Hooker
) = try {
findClass(classLoader).hookAfterMethod(method, *args, hooker = hooker)
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
null
} catch (e: ClassNotFoundException) {
log(e)
null
}
inline fun String.replaceMethod(
classLoader: ClassLoader,
method: String?,
vararg args: Any?,
crossinline replacer: Replacer
) = try {
findClass(classLoader).replaceMethod(method, *args, replacer = replacer)
} catch (e: XposedHelpers.ClassNotFoundError) {
log(e)
null
} catch (e: ClassNotFoundException) {
log(e)
null
}
fun XC_MethodHook.MethodHookParam.invokeOriginalMethod(): Any? =
XposedBridge.invokeOriginalMethod(method, thisObject, args)
inline fun <T, R> T.runCatchingOrNull(func: T.() -> R?) = try {
func()
} catch (e: Throwable) {
null
}
fun Any.getObjectField(field: String?): Any? = XposedHelpers.getObjectField(this, field)
fun Any.getObjectFieldOrNull(field: String?): Any? = runCatchingOrNull {
XposedHelpers.getObjectField(this, field)
}
@Suppress("UNCHECKED_CAST")
fun <T> Any.getObjectFieldAs(field: String?) = XposedHelpers.getObjectField(this, field) as T
@Suppress("UNCHECKED_CAST")
fun <T> Any.getObjectFieldOrNullAs(field: String?) = runCatchingOrNull {
XposedHelpers.getObjectField(this, field) as T
}
fun Any.getIntField(field: String?) = XposedHelpers.getIntField(this, field)
fun Any.getIntFieldOrNull(field: String?) = runCatchingOrNull {
XposedHelpers.getIntField(this, field)
}
fun Any.getLongField(field: String?) = XposedHelpers.getLongField(this, field)
fun Any.getLongFieldOrNull(field: String?) = runCatchingOrNull {
XposedHelpers.getLongField(this, field)
}
fun Any.getBooleanFieldOrNull(field: String?) = runCatchingOrNull {
XposedHelpers.getBooleanField(this, field)
}
fun Any.callMethod(methodName: String?, vararg args: Any?): Any? =
XposedHelpers.callMethod(this, methodName, *args)
fun Any.callMethodOrNull(methodName: String?, vararg args: Any?): Any? = runCatchingOrNull {
XposedHelpers.callMethod(this, methodName, *args)
}
fun Class<*>.callStaticMethod(methodName: String?, vararg args: Any?): Any? =
XposedHelpers.callStaticMethod(this, methodName, *args)
fun Class<*>.callStaticMethodOrNull(methodName: String?, vararg args: Any?): Any? =
runCatchingOrNull {
XposedHelpers.callStaticMethod(this, methodName, *args)
}
@Suppress("UNCHECKED_CAST")
fun <T> Class<*>.callStaticMethodAs(methodName: String?, vararg args: Any?) =
XposedHelpers.callStaticMethod(this, methodName, *args) as T
@Suppress("UNCHECKED_CAST")
fun <T> Class<*>.callStaticMethodOrNullAs(methodName: String?, vararg args: Any?) =
runCatchingOrNull {
XposedHelpers.callStaticMethod(this, methodName, *args) as T
}
@Suppress("UNCHECKED_CAST")
fun <T> Class<*>.getStaticObjectFieldAs(field: String?) = XposedHelpers.getStaticObjectField(
this,
field
) as T
@Suppress("UNCHECKED_CAST")
fun <T> Class<*>.getStaticObjectFieldOrNullAs(field: String?) = runCatchingOrNull {
XposedHelpers.getStaticObjectField(this, field) as T
}
fun Class<*>.getStaticObjectField(field: String?): Any? =
XposedHelpers.getStaticObjectField(this, field)
fun Class<*>.getStaticObjectFieldOrNull(field: String?): Any? = runCatchingOrNull {
XposedHelpers.getStaticObjectField(this, field)
}
fun Class<*>.setStaticObjectField(field: String?, obj: Any?) = apply {
XposedHelpers.setStaticObjectField(this, field, obj)
}
fun Class<*>.setStaticObjectFieldIfExist(field: String?, obj: Any?) = apply {
try {
XposedHelpers.setStaticObjectField(this, field, obj)
} catch (ignored: Throwable) {
}
}
inline fun <reified T> Class<*>.findFieldByExactType(): Field? =
XposedHelpers.findFirstFieldByExactType(this, T::class.java)
fun Class<*>.findFieldByExactType(type: Class<*>): Field? =
XposedHelpers.findFirstFieldByExactType(this, type)
@Suppress("UNCHECKED_CAST")
fun <T> Any.callMethodAs(methodName: String?, vararg args: Any?) =
XposedHelpers.callMethod(this, methodName, *args) as T
@Suppress("UNCHECKED_CAST")
fun <T> Any.callMethodOrNullAs(methodName: String?, vararg args: Any?) = runCatchingOrNull {
XposedHelpers.callMethod(this, methodName, *args) as T
}
fun Any.callMethod(methodName: String?, parameterTypes: Array<Class<*>>, vararg args: Any?): Any? =
XposedHelpers.callMethod(this, methodName, parameterTypes, *args)
fun Any.callMethodOrNull(
methodName: String?,
parameterTypes: Array<Class<*>>,
vararg args: Any?
): Any? = runCatchingOrNull {
XposedHelpers.callMethod(this, methodName, parameterTypes, *args)
}
fun Class<*>.callStaticMethod(
methodName: String?,
parameterTypes: Array<Class<*>>,
vararg args: Any?
): Any? = XposedHelpers.callStaticMethod(this, methodName, parameterTypes, *args)
fun Class<*>.callStaticMethodOrNull(
methodName: String?,
parameterTypes: Array<Class<*>>,
vararg args: Any?
): Any? = runCatchingOrNull {
XposedHelpers.callStaticMethod(this, methodName, parameterTypes, *args)
}
fun String.findClass(classLoader: ClassLoader?): Class<*> =
XposedHelpers.findClass(this, classLoader)
fun String.findClassOrNull(classLoader: ClassLoader?): Class<*>? =
XposedHelpers.findClassIfExists(this, classLoader)
fun Class<*>.new(vararg args: Any?): Any = XposedHelpers.newInstance(this, *args)
fun Class<*>.new(parameterTypes: Array<Class<*>>, vararg args: Any?): Any =
XposedHelpers.newInstance(this, parameterTypes, *args)
fun Class<*>.findField(field: String?): Field = XposedHelpers.findField(this, field)
fun Class<*>.findFieldOrNull(field: String?): Field? = XposedHelpers.findFieldIfExists(this, field)
fun <T> T.setIntField(field: String?, value: Int) = apply {
XposedHelpers.setIntField(this, field, value)
}
fun <T> T.setLongField(field: String?, value: Long) = apply {
XposedHelpers.setLongField(this, field, value)
}
fun <T> T.setFloatField(field: String?, value: Float) = apply {
XposedHelpers.setFloatField(this, field, value)
}
fun <T> T.setObjectField(field: String?, value: Any?) = apply {
XposedHelpers.setObjectField(this, field, value)
}
fun <T> T.setBooleanField(field: String?, value: Boolean) = apply {
XposedHelpers.setBooleanField(this, field, value)
}
inline fun XResources.hookLayout(
id: Int,
crossinline hooker: (XC_LayoutInflated.LayoutInflatedParam) -> Unit
) {
try {
hookLayout(id, object : XC_LayoutInflated() {
override fun handleLayoutInflated(liparam: LayoutInflatedParam) {
try {
hooker(liparam)
} catch (e: Throwable) {
log(e)
}
}
})
} catch (e: Throwable) {
log(e)
}
}
inline fun XResources.hookLayout(
pkg: String,
type: String,
name: String,
crossinline hooker: (XC_LayoutInflated.LayoutInflatedParam) -> Unit
) {
try {
val id = getIdentifier(name, type, pkg)
hookLayout(id, hooker)
} catch (e: Throwable) {
log(e)
}
}
fun Class<*>.findFirstFieldByExactType(type: Class<*>): Field =
XposedHelpers.findFirstFieldByExactType(this, type)
fun Class<*>.findFirstFieldByExactTypeOrNull(type: Class<*>?): Field? = runCatchingOrNull {
XposedHelpers.findFirstFieldByExactType(this, type)
}
fun Any.getFirstFieldByExactType(type: Class<*>): Any? =
javaClass.findFirstFieldByExactType(type).get(this)
@Suppress("UNCHECKED_CAST")
fun <T> Any.getFirstFieldByExactTypeAs(type: Class<*>) =
javaClass.findFirstFieldByExactType(type).get(this) as? T
inline fun <reified T : Any> Any.getFirstFieldByExactType() =
javaClass.findFirstFieldByExactType(T::class.java).get(this) as? T
fun Any.getFirstFieldByExactTypeOrNull(type: Class<*>?): Any? = runCatchingOrNull {
javaClass.findFirstFieldByExactTypeOrNull(type)?.get(this)
}
@Suppress("UNCHECKED_CAST")
fun <T> Any.getFirstFieldByExactTypeOrNullAs(type: Class<*>?) =
getFirstFieldByExactTypeOrNull(type) as? T
inline fun <reified T> Any.getFirstFieldByExactTypeOrNull() =
getFirstFieldByExactTypeOrNull(T::class.java) as? T
fun ClassLoader.allClassesList(): List<String> {
var classLoader = this
while (classLoader !is BaseDexClassLoader) {
if (classLoader.parent != null) classLoader = classLoader.parent
else return emptyList()
}
return classLoader.getObjectField("pathList")
?.getObjectFieldAs<Array<Any>>("dexElements")
?.flatMap {
it.getObjectField("dexFile")?.callMethodAs<Enumeration<String>>("entries")?.toList()
.orEmpty()
}.orEmpty()
}
inline fun ClassLoader.findDexClassLoader(): BaseDexClassLoader? {
var classLoader = this
while (classLoader !is BaseDexClassLoader) {
if (classLoader.parent != null) classLoader = classLoader.parent
else return null
}
return classLoader
}
inline fun <T> T?.isNull(crossinline isNull: () -> Unit):T? {
if (this == null) isNull()
return this
}
inline fun <T> T?.isNonNull(crossinline nonNull: (T) -> Unit): T? {
if (this != null) nonNull(this)
return this
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -1,24 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="0.5625"
android:scaleY="0.5625">
<path
android:pathData="M0,0h192v192h-192z">
<aapt:attr name="android:fillColor">
<gradient
android:startY="192"
android:startX="0"
android:endY="0"
android:endX="192"
android:type="linear">
<item android:offset="0" android:color="#FFF76B1C"/>
<item android:offset="1" android:color="#FFFAD961"/>
</gradient>
</aapt:attr>
</path>
</group>
</vector>

View File

@@ -1,23 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="0.37125"
android:scaleY="0.37125"
android:translateX="18.36"
android:translateY="18.36">
<path
android:pathData="M57.71,64.27 L51.6,40.71A3.48,3.48 0,0 1,55 36.35H55A3.49,3.49 0,0 1,58.41 39l4.12,17.58h0.22l4.81,-17.7a3.48,3.48 0,0 1,3.35 -2.57h2.26a3.5,3.5 0,0 1,3.35 2.51l5.15,17.76h0.22L86,39a3.49,3.49 0,0 1,3.39 -2.69h0a3.47,3.47 0,0 1,3.35 4.39L86.36,64.3A3.49,3.49 0,0 1,83 66.87h-2a3.48,3.48 0,0 1,-3.32 -2.42l-5.6,-17.62h-0.22l-5.6,17.62A3.48,3.48 0,0 1,63 66.87H61.07A3.47,3.47 0,0 1,57.71 64.27Z"
android:fillColor="#fff"/>
<path
android:pathData="M99,66a9.67,9.67 0,0 1,-3.85 -4.15,14.11 14.11,0 0,1 -1.33,-6.34 14,14 0,0 1,1.33 -6.31A9.67,9.67 0,0 1,99 45a12.71,12.71 0,0 1,11.79 0,9.59 9.59,0 0,1 3.84,4.15A14,14 0,0 1,116 55.46a14.11,14.11 0,0 1,-1.34 6.34A9.59,9.59 0,0 1,110.77 66,12.71 12.71,0 0,1 99,66ZM107.93,59.56a6.66,6.66 0,0 0,1.11 -4,6.52 6.52,0 0,0 -1.11,-4 3.85,3.85 0,0 0,-6.07 0,6.52 6.52,0 0,0 -1.11,4 6.66,6.66 0,0 0,1.11 4,3.85 3.85,0 0,0 6.07,0Z"
android:fillColor="#fff"/>
<path
android:pathData="M123.54,66a9.59,9.59 0,0 1,-3.84 -4.15,14.11 14.11,0 0,1 -1.34,-6.34 14,14 0,0 1,1.34 -6.31A9.59,9.59 0,0 1,123.54 45a12.73,12.73 0,0 1,11.8 0,9.59 9.59,0 0,1 3.84,4.15 14,14 0,0 1,1.34 6.31,14.11 14.11,0 0,1 -1.34,6.34A9.59,9.59 0,0 1,135.34 66a12.73,12.73 0,0 1,-11.8 0ZM132.47,59.56a6.66,6.66 0,0 0,1.11 -4,6.52 6.52,0 0,0 -1.11,-4 3.84,3.84 0,0 0,-6.06 0,6.46 6.46,0 0,0 -1.12,4 6.6,6.6 0,0 0,1.12 4,3.84 3.84,0 0,0 6.06,0Z"
android:fillColor="#fff"/>
<path
android:pathData="M129.08,95.23 L97.56,77a3.23,3.23 0,0 0,-3.12 0L62.92,95.23a3.21,3.21 0,0 0,-1.57 2.71v36.4a3.2,3.2 0,0 0,1.57 2.7l31.52,18.2a3.18,3.18 0,0 0,3.12 0L129.08,137a3.22,3.22 0,0 0,1.14 -1.15,3.25 3.25,0 0,0 0.43,-1.55L130.65,97.94A3.22,3.22 0,0 0,129.08 95.23ZM96,83.35l9.51,5.49L80.24,103.43l-9.51,-5.49ZM92.88,147.12L67.6,132.53L67.6,103.35l9.51,5.49L77.11,125a3.13,3.13 0,1 0,6.25 0L83.36,112.45l9.52,5.49ZM96,112.53 L86.49,107l25.27,-14.59 9.51,5.49ZM124.4,132.53L99.13,147.12L99.13,117.94l25.27,-14.59Z"
android:fillColor="#fff"/>
</group>
</vector>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/> <background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/> <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon> </adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/> <background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/> <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon> </adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -82,12 +82,12 @@
<string name="battery_optimization_summary">MIUI で非表示になったバッテリー最適化メニューをすばやく開く</string> <string name="battery_optimization_summary">MIUI で非表示になったバッテリー最適化メニューをすばやく開く</string>
<string name="remove_small_window_restrictions">小さなウィンドウを強制的に表示</string> <string name="remove_small_window_restrictions">小さなウィンドウを強制的に表示</string>
<string name="app_coolapk_url">5つ星のレビューをお願いします。</string> <string name="app_coolapk_url">5つ星のレビューをお願いします。</string>
<string name="app_coolapk_url_summary">多くの人に見つけてもらいやすくなります</string> <string name="app_coolapk_url_summary">これにより、より多くの発見が可能になります</string>
<string name="qq_channel">公式QQチャンネルに参加する</string> <string name="qq_channel">公式QQチャンネルに参加する</string>
<string name="tg_channel">公式telegramチャンネルに参加する</string> <string name="tg_channel">公式telegramチャンネルに参加する</string>
<string name="tg_channel_summary">チャンネルページにチャットグループを入力することができます</string> <string name="tg_channel_summary">チャンネルページにチャットグループを入力することができます</string>
<string name="discussions">討論</string> <string name="discussions">討論</string>
<string name="remove_small_window_restrictions_summary">小さなウィンドウへのシステムのブラックリストとソフトウェア制限を無視します</string> <string name="remove_small_window_restrictions_summary">システムのブラックリストと小さなウィンドウのソフトウェアの禁止を無視</string>
<string name="remove_the_left_side_of_the_lock_screen">ロック画面のサイドパネルを削除</string> <string name="remove_the_left_side_of_the_lock_screen">ロック画面のサイドパネルを削除</string>
<string name="remove_lock_screen_camera">ロック画面のカメラ機能を削除</string> <string name="remove_lock_screen_camera">ロック画面のカメラ機能を削除</string>
<string name="only_official_default_themes_are_supported">公式のデフォルトテーマのみサポートされています</string> <string name="only_official_default_themes_are_supported">公式のデフォルトテーマのみサポートされています</string>
@@ -100,17 +100,17 @@
<string name="status_bar_network_speed_refresh_speed_summary">ステータスバーのネットワーク速度コンポーネントの更新頻度を1秒に変更します</string> <string name="status_bar_network_speed_refresh_speed_summary">ステータスバーのネットワーク速度コンポーネントの更新頻度を1秒に変更します</string>
<string name="hide_battery_percentage_icon_summary">バッテリー残量表示機能は自分でオンにする必要があります</string> <string name="hide_battery_percentage_icon_summary">バッテリー残量表示機能は自分でオンにする必要があります</string>
<string name="hide_status_bar_network_speed_second_summary">ステータスバーのネットワーク速度表示の (/s) 単位を隠す</string> <string name="hide_status_bar_network_speed_second_summary">ステータスバーのネットワーク速度表示の (/s) 単位を隠す</string>
<string name="remove_the_maximum_number_of_notification_icons_summary">ステータスバーの通知数の3つまでの上限を削除しま</string> <string name="remove_the_maximum_number_of_notification_icons_summary">ステータスバーの通知数の3つまでの上限を削除す</string>
<string name="scope_systemui_summary">システムインターフェース、ステータスバー、ロック画面などをカスタマイズしま</string> <string name="scope_systemui_summary">システムインターフェース、ステータスバー、ロック画面などをカスタマイズす</string>
<string name="scope_android_summary">初めてモジュールを有効にした後、またはモジュールが更新された後、システムを再起動した後にここの機能が有効になります</string> <string name="scope_android_summary">初めてモジュールを有効にした後、またはモジュールが更新された後、システムを再起動した後にここの機能が有効になります</string>
<string name="scope_other_summary">セキュリティアプリ、ギャラリーエディタ、バッテリー、パフォーマンスなど。</string> <string name="scope_other_summary">セキュリティアプリ、ギャラリーエディタ、バッテリー、パフォーマンスなど。</string>
<string name="scope_powerkeeper">バッテリーとパフォーマンス</string> <string name="scope_powerkeeper">バッテリーとパフォーマンス</string>
<string name="scope_securitycenter">セキュリティアプリ</string> <string name="scope_securitycenter">セキュリティアプリ</string>
<string name="scope_mediaeditor">ギャラリーエディター</string> <string name="scope_mediaeditor">ギャラリーエディター</string>
<string name="home_time_summary">オンにすると、時計ウィジェットがある場合でも、ステータスバーに時計が表示されます</string> <string name="home_time_summary">オンにすると、時計ウィジェットがある場合でも、ステータスバーに時計が表示されます</string>
<string name="skip_waiting_time_summary">USBデバッグ、不明なソース、ユーザー補助を利用する際のMIUIによる待機時間を無視しま</string> <string name="skip_waiting_time_summary">USBデバッグ、不明なソース、アクセシビリティを利用する際のMIUIによる待機時間を無視す</string>
<string name="lock_one_hundred_summary">セキュリティアプリのスコアを100ポイントに設定し、最適化ボタンをブロックします</string> <string name="lock_one_hundred_summary">セキュリティアプリのスコアを100ポイントに設定し、最適化ボタンをブロックします</string>
<string name="unlock_unlimited_cropping_summary">MIUI による画像トリミングの最小制限を無視しま</string> <string name="unlock_unlimited_cropping_summary">MIUI による画像トリミングの最小制限を無視す</string>
<string name="hide_wifi_activity_icon">Wi-Fiアクティビティアイコンを隠す</string> <string name="hide_wifi_activity_icon">Wi-Fiアクティビティアイコンを隠す</string>
<string name="hide_mobile_activity_icon">モバイルアクティビティのアイコンを隠す</string> <string name="hide_mobile_activity_icon">モバイルアクティビティのアイコンを隠す</string>
<string name="hide_mobile_type_icon">モバイルタイプのアイコンを隠す</string> <string name="hide_mobile_type_icon">モバイルタイプのアイコンを隠す</string>
@@ -138,8 +138,8 @@
<string name="remove_macro_blacklist">ゲームのマクロブラックリストを削除</string> <string name="remove_macro_blacklist">ゲームのマクロブラックリストを削除</string>
<string name="hide_network_speed_splitter">ネットワーク速度分割器を非表示</string> <string name="hide_network_speed_splitter">ネットワーク速度分割器を非表示</string>
<string name="updater">更新</string> <string name="updater">更新</string>
<string name="remove_ota_validate">*OTA 検証を無効化 [実験的]</string> <string name="remove_ota_validate">*Remove OTA validate [LAB]</string>
<string name="remove_ota_validate_summary">- 仮想AB対応端末のみ対応しています。\ n -内部テストの資格を必要とせず、内部テストパッケージをインストールできるようにします。\ n -内部テスト許可を持っている方は、内部のテストの更新を受け取れなくなるため、システムアップデートをブロックするために使用できます。\ n -OSバージョンが変わる場合は工場出荷状態に戻すことをお勧めします。\ n -非公式のROMの使用には非対応です</string> <string name="remove_ota_validate_summary">- VABシリーズのサポートのみをサポートしてください。\ n -内部テストの資格を必要としません。内部の内部テストパッケージにフラッシュします。\ n -内部テスト許可を持っている方は、内部のテストの更新を受け取ることができず、システムアップデートをブロックするために使用できます。\ n -クロスバージョン型のアップグレード後、データをクリアすることをお勧めします。\ n -非公式のROMの使用はサポートされていません</string>
<string name="settings">設定</string> <string name="settings">設定</string>
<string name="show_notification_importance">通知の重要性を表示</string> <string name="show_notification_importance">通知の重要性を表示</string>
<string name="show_notification_importance_summary">MIUI 12 以降のバージョンで非表示になっている通知の重要性設定を表示します</string> <string name="show_notification_importance_summary">MIUI 12 以降のバージョンで非表示になっている通知の重要性設定を表示します</string>
@@ -152,8 +152,8 @@
<string name="current">現在:</string> <string name="current">現在:</string>
<string name="participate_in_translation">翻訳に参加する</string> <string name="participate_in_translation">翻訳に参加する</string>
<string name="participate_in_translation_summary">翻訳を手伝ってください!</string> <string name="participate_in_translation_summary">翻訳を手伝ってください!</string>
<string name="lock_screen_charging_current">充電中に電流の情報を表示</string> <string name="lock_screen_charging_current">充電中に現在の情報を表示</string>
<string name="current_current">電流</string> <string name="current_current">現在</string>
<string name="remove_open_app_confirmation_popup">外部アプリを開くときのポップアップを削除</string> <string name="remove_open_app_confirmation_popup">外部アプリを開くときのポップアップを削除</string>
<string name="remove_open_app_confirmation_popup_summary">「アプリAがアプリBを開くことを許可」のチェーンのポップアップを削除します</string> <string name="remove_open_app_confirmation_popup_summary">「アプリAがアプリBを開くことを許可」のチェーンのポップアップを削除します</string>
<string name="hide_volume_icon">音量アイコンを非表示</string> <string name="hide_volume_icon">音量アイコンを非表示</string>
@@ -205,7 +205,7 @@
<string name="digestCreak">比較署名を無効にする</string> <string name="digestCreak">比較署名を無効にする</string>
<string name="digestCreak_summary">異なる署名を持つアプリの再インストールを許可します。</string> <string name="digestCreak_summary">異なる署名を持つアプリの再インストールを許可します。</string>
<string name="UsePreSig">インストール済みの署名を使用</string> <string name="UsePreSig">インストール済みの署名を使用</string>
<string name="UsePreSig_summary">アプリのインストール時に、常に既存アプリの署名を使用します。\nこのオプションは<b>大変危険</b>です。\n本当に必要なときだけ有効にしてください</string> <string name="UsePreSig_summary">アプリのインストール時に、常に既存アプリの署名を使用します。\nこのオプションは<b>めちゃくちゃ危険</b>です。\n本当に必要なときだけ有効にしてください</string>
<string name="enhancedMode">強化モード</string> <string name="enhancedMode">強化モード</string>
<string name="enhancedMode_summary">アプリケーションでいくつかの検証に合格する</string> <string name="enhancedMode_summary">アプリケーションでいくつかの検証に合格する</string>
<string name="rear_display">背面ディスプレイ (11 Ultra)</string> <string name="rear_display">背面ディスプレイ (11 Ultra)</string>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name" translatable="false">WooBox For MIUI</string> <string name="app_name" translatable="false">Simplicity Tools</string>
<string name="performance">Performance</string> <string name="performance">Performance</string>
<string name="lock_max_fps">Lock the current refresh rate upper limit</string> <string name="lock_max_fps">Lock the current refresh rate upper limit</string>
<string name="ui">Interface</string> <string name="ui">Interface</string>
@@ -181,7 +181,7 @@
<string name="left">Left</string> <string name="left">Left</string>
<string name="right">Right</string> <string name="right">Right</string>
<string name="big_mobile_type_icon">Big Mobile Type Icon</string> <string name="big_mobile_type_icon">Big Mobile Type Icon</string>
<string name="can_notification_slide">Make most notifications can be slide to small window</string> <string name="can_notification_slide">Make all notification can be slide to small window</string>
<string name="battery_percentage_font_size">Battery percentage font size</string> <string name="battery_percentage_font_size">Battery percentage font size</string>
<string name="zero_do_no_change">0: do not change</string> <string name="zero_do_no_change">0: do not change</string>
<string name="big_mobile_type_icon_size">Big mobile type icon size</string> <string name="big_mobile_type_icon_size">Big mobile type icon size</string>
@@ -219,5 +219,4 @@
<string name="allow_untrusted_touches">Allow untrusted touches</string> <string name="allow_untrusted_touches">Allow untrusted touches</string>
<string name="take_effect_after_reboot">Take effect after reboot</string> <string name="take_effect_after_reboot">Take effect after reboot</string>
<string name="media_volume_steps_summary">Turning on may cause the scrolling of the volume bar to freeze or the Bluetooth volume to be abnormal</string> <string name="media_volume_steps_summary">Turning on may cause the scrolling of the volume bar to freeze or the Bluetooth volume to be abnormal</string>
<string name="can_notification_slide_summary">Some notifications through Mi Push may not be supported.</string>
</resources> </resources>

View File

@@ -5,7 +5,7 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath("com.android.tools.build:gradle:7.1.3") classpath("com.android.tools.build:gradle:7.1.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong

View File

@@ -1,11 +1,11 @@
### WooBox 隐私政策 ### Simplicity Tools隐私政策
版本1.3 修订与生效日期2022年4月16 版本1.2 修订与生效日期2022年1月25
#### 前言 #### 前言
为帮助您使用 WooBox 产品或服务,我们可能收集与提供服务相关的设备信息或申请设备权限,您有权拒绝或撤回授权; 为帮助您使用 Simplicity Tools 产品或服务,我们可能收集与提供服务相关的设备信息或申请设备权限,您有权拒绝或撤回授权;
我们采取了互联网业内标准的技术措施和数据安全措施来保护您的设备信息安全; 我们采取了互联网业内标准的技术措施和数据安全措施来保护您的设备信息安全;
@@ -16,14 +16,14 @@
目录 目录
``` ```
WooBox 隐私政策 Simplicity Tools 隐私政策
目录 目录
1. 引言 1. 引言
2. WooBox 处理设备信息的法律依据 2. Simplicity Tools 处理设备信息的法律依据
3. 我们如何收集和使用您的设备信息 3. 我们如何收集和使用您的设备信息
3.1 向您提供产品和/或服务 3.1 向您提供产品和/或服务
A. 向您提供 WooBox 产品和/或服务的核心业务功能 A. 向您提供 Simplicity Tools 产品和/或服务的核心业务功能
B向您提供 WooBox 产品和/或服务的附加业务功能 B向您提供 Simplicity Tools 产品和/或服务的附加业务功能
3.2 征得授权同意的例外 3.2 征得授权同意的例外
4. 我们如何转让、公开披露您的设备信息 4. 我们如何转让、公开披露您的设备信息
4.1 转让您的设备信息 4.1 转让您的设备信息
@@ -38,31 +38,31 @@ B向您提供 WooBox 产品和/或服务的附加业务功能
1. 引言 1. 引言
【特别提示】请您在使用我们的各项产品和/或服务前,仔细阅读并充分理解本政策。重点内容我们已采用粗体表示,希望您特别关注。一旦您使用或继续使用 WooBox 产品/服务,即表示您同意我们按照本政策处理您的相关信息。 【特别提示】请您在使用我们的各项产品和/或服务前,仔细阅读并充分理解本政策。重点内容我们已采用粗体表示,希望您特别关注。一旦您使用或继续使用 Simplicity Tools 产品/服务,即表示您同意我们按照本政策处理您的相关信息。
2. WooBox 处理设备信息的法律依据 2. Simplicity Tools 处理设备信息的法律依据
如果您是中华人民共和国大陆地区的用户,我们将依据《中华人民共和国网络安全法》、《信息安全技术 个人信息安全规范》GB/T 35273-2017以及其他相关法律法规收集和使用您的设备信息或申请设备权限为您提供 WooBox 产品或服务。 我们通常只会在征得您同意的情况下收集您的设备信息。 如果您是中华人民共和国大陆地区的用户,我们将依据《中华人民共和国网络安全法》、《信息安全技术 个人信息安全规范》GB/T 35273-2017以及其他相关法律法规收集和使用您的设备信息或申请设备权限为您提供 Simplicity Tools 产品或服务。 我们通常只会在征得您同意的情况下收集您的设备信息。
3. 我们如何收集和使用您的设备信息 3. 我们如何收集和使用您的设备信息
我们会遵循正当、合法、必要的原则,出于本政策所述的以下目的,收集和使用您在使用服务过程中主动提供或因使用 WooBox 产品和/或服务而产生的设备信息。如果我们要将您的设备信息用于本政策未载明的其它用途,或基于特定目的将收集而来的信息用于其他目的,我们将以合理的方式向您告知,并在使用前再次征得您的同意。 我们会遵循正当、合法、必要的原则,出于本政策所述的以下目的,收集和使用您在使用服务过程中主动提供或因使用 Simplicity Tools 产品和/或服务而产生的设备信息。如果我们要将您的设备信息用于本政策未载明的其它用途,或基于特定目的将收集而来的信息用于其他目的,我们将以合理的方式向您告知,并在使用前再次征得您的同意。
3.1 向您提供产品和/或服务 3.1 向您提供产品和/或服务
A. 向您提供 WooBox 产品和/或服务的核心业务功能 A. 向您提供 Simplicity Tools 产品和/或服务的核心业务功能
为实现 WooBox 的核心业务功能,我们可能需要向您收集设备信息。以下将详细列出 WooBox 的核心业务功能及为实现该功能所需收集的设备信息,若您拒绝收集,则无法使用该服务。 为实现 Simplicity Tools 的核心业务功能,我们可能需要向您收集设备信息。以下将详细列出 Simplicity Tools 的核心业务功能及为实现该功能所需收集的设备信息,若您拒绝收集,则无法使用该服务。
查看设备中的所有应用信息。 WooBox 会读取您的设备应用列表; 查看设备中的所有应用信息。 Simplicity Tools 会读取您的设备应用列表;
搜索功能。 当您使用 WooBox 提供的搜索功能时,我们可能会使用应用数据缓存,收集您设备上的信息并进行本地存储。 该信息通常无法单独识别您的个人身份。 搜索功能。 当您使用 Simplicity Tools 提供的搜索功能时,我们可能会使用应用数据缓存,收集您设备上的信息并进行本地存储。 该信息通常无法单独识别您的个人身份。
B向您提供 WooBox 产品和/或服务的附加业务功能 B向您提供 Simplicity Tools 产品和/或服务的附加业务功能
为了向您提供更优质的产品和服务,我们可能需要收集下述信息。 如果您拒绝提供下述信息,不影响您正常使用 3.1 A 项所描述的 WooBox 核心业务功能,但我们无法向您提供某些特定功能和服务。 为了向您提供更优质的产品和服务,我们可能需要收集下述信息。 如果您拒绝提供下述信息,不影响您正常使用 3.1 A 项所描述的 Simplicity Tools 核心业务功能,但我们无法向您提供某些特定功能和服务。
Bug 分析。 WooBox 使用微软公司出品的第三方 Bug 分析平台 Microsoft AppCenter 进行设备数据的收集和分析,以发现软件运行中可能出现的问题和故障,并予以改进。 Bug 分析。 Simplicity Tools 使用微软公司出品的第三方 Bug 分析平台 Microsoft AppCenter 进行设备数据的收集和分析,以发现软件运行中可能出现的问题和故障,并予以改进。
3.2 征得授权同意的例外 3.2 征得授权同意的例外
@@ -76,7 +76,7 @@ d. 出于维护您或其他个人的生命、财产等重大合法权益但又
e. 所收集的设备信息是您自行向社会公众公开的; e. 所收集的设备信息是您自行向社会公众公开的;
f. 从合法公开披露的信息中收集到您的设备信息,如从合法的新闻报道、政府信息公开等渠道; f. 从合法公开披露的信息中收集到您的设备信息,如从合法的新闻报道、政府信息公开等渠道;
g. 根据您的要求签订和履行合同所必需的; g. 根据您的要求签订和履行合同所必需的;
h. 用于维护 WooBox 的产品和/或服务的安全稳定运行所必需的,例如发现、处置产品或服务的故障; h. 用于维护 Simplicity Tools 的产品和/或服务的安全稳定运行所必需的,例如发现、处置产品或服务的故障;
i. 法律法规规定的其他情形。 i. 法律法规规定的其他情形。
``` ```
@@ -114,7 +114,7 @@ G. 法律法规规定的其他情形。
6. 如何更新与修改本政策 6. 如何更新与修改本政策
6.1 本政策为《 WooBox 用户协议》的重要组成部分。 WooBox 保留不时更新或修改本政策的权利。 6.1 本政策为《 Simplicity Tools 用户协议》的重要组成部分。 Simplicity Tools 保留不时更新或修改本政策的权利。
6.2 未经您明确同意,我们不会削减您按照本政策所应享有的权利。我们会通过 App 客户端推送通知、弹窗形式等合理方式通知您,以便您能及时了解本政策所做的任何变更。 6.2 未经您明确同意,我们不会削减您按照本政策所应享有的权利。我们会通过 App 客户端推送通知、弹窗形式等合理方式通知您,以便您能及时了解本政策所做的任何变更。
@@ -129,7 +129,7 @@ E. 我们负责处理设备信息安全的责任部门、联络方式及投诉
F. 设备信息安全影响评估报告表明存在高风险时。 F. 设备信息安全影响评估报告表明存在高风险时。
``` ```
6.4 若您不同意修改后的隐私政策,您有权并应立即停止使用 WooBox 的服务。如果您继续使用 WooBox 的服务,则视为您接受 WooBox 对本政策相关条款所做的修改。 6.4 若您不同意修改后的隐私政策,您有权并应立即停止使用 Simplicity Tools 的服务。如果您继续使用 Simplicity Tools 的服务,则视为您接受 Simplicity Tools 对本政策相关条款所做的修改。
7. 争议解决 7. 争议解决
@@ -141,12 +141,12 @@ F. 设备信息安全影响评估报告表明存在高风险时。
设备信息: 设备信息是指以电子或者其他方式记录的能够单独或者与其他信息结合识别设备身份的各种信息,包括但不限于设备的品牌、型号、系统版本、 唯一设备标识符、 网络 IP 地址、Cookie等 设备信息: 设备信息是指以电子或者其他方式记录的能够单独或者与其他信息结合识别设备身份的各种信息,包括但不限于设备的品牌、型号、系统版本、 唯一设备标识符、 网络 IP 地址、Cookie等
设备: 设备是指可用于访问 WooBox 产品和/或服务的装置,例如台式计算机、笔记本电脑、平板电脑或智能手机。 设备: 设备是指可用于访问 Simplicity Tools 产品和/或服务的装置,例如台式计算机、笔记本电脑、平板电脑或智能手机。
唯一设备标识符: 唯一设备标识符(专属 ID 或 UUID是指由设备制造商编入到设备中的一串字符可用于以独有方式标识相应设备例如手机的 IMEI 号)。唯一设备标识符有多种用途,其中可在不能使用 Cookie例如在移动应用程序中时用以提供广告。 唯一设备标识符: 唯一设备标识符(专属 ID 或 UUID是指由设备制造商编入到设备中的一串字符可用于以独有方式标识相应设备例如手机的 IMEI 号)。唯一设备标识符有多种用途,其中可在不能使用 Cookie例如在移动应用程序中时用以提供广告。
IP 地址: 每台上网的设备都会指定一个编号,称为互联网协议 ( IP ) 地址。这些编号通常都是根据地理区域指定的。IP 地址通常可用于识别设备连接至互联网时所在的位置。 IP 地址: 每台上网的设备都会指定一个编号,称为互联网协议 ( IP ) 地址。这些编号通常都是根据地理区域指定的。IP 地址通常可用于识别设备连接至互联网时所在的位置。
信息收集技术: 我们在《 WooBox 隐私政策》中所述的“自动收集”包括以下方式: A. Cookie曲奇档案 Cookie 是您浏览网页时,网站服务器放在客户端(您的计算机、移动电话或其他智能终端内)里面的一个小小的文本文件,当您再次访问相应网站时,网站就可通过 Cookie 识别您的浏览器。Cookie 可能会存储用户偏好及其他信息。您可以将浏览器配置为拒绝所有 Cookie 或在网站发送 Cookie 时显示提示。不过,如果没有 Cookie某些网站功能或服务可能无法正常工作。具体可参见《 WooBox Cookie 指引》。 B. Web beacon网络信标 Web beacon 是装嵌在网站或电邮内的电子图像文件案或其他技术,可用于计算访客数目、记录您是否及何时阅览电邮或网站,或用以使用某些 Cookie。 C. Log files日志文件 Log files 储存自动收集的若干数据。该等数据包括互联网协议( IP )地址、浏览器类型、互联网服务提供商( ISP )、引用/退出页面、操作系统、日期/时间戳和点击流数据等。 D. ET Tag实体标签 ET Tag 是在互联网浏览器与互联网服务器之间背后传送的 HTTP 协议标头,可代替 Cookie用以追踪个别使用者使我们可更深入地了解和改善我们的服务。 E. JavaScript JavaScript 是一种编程语言用于制作更具互动性和动态的网页。JavaScript 可以设定 Cookie、阅读 Cookie 及删除 Cookie。 信息收集技术: 我们在《 Simplicity Tools 隐私政策》中所述的“自动收集”包括以下方式: A. Cookie曲奇档案 Cookie 是您浏览网页时,网站服务器放在客户端(您的计算机、移动电话或其他智能终端内)里面的一个小小的文本文件,当您再次访问相应网站时,网站就可通过 Cookie 识别您的浏览器。Cookie 可能会存储用户偏好及其他信息。您可以将浏览器配置为拒绝所有 Cookie 或在网站发送 Cookie 时显示提示。不过,如果没有 Cookie某些网站功能或服务可能无法正常工作。具体可参见《 Simplicity Tools Cookie 指引》。 B. Web beacon网络信标 Web beacon 是装嵌在网站或电邮内的电子图像文件案或其他技术,可用于计算访客数目、记录您是否及何时阅览电邮或网站,或用以使用某些 Cookie。 C. Log files日志文件 Log files 储存自动收集的若干数据。该等数据包括互联网协议( IP )地址、浏览器类型、互联网服务提供商( ISP )、引用/退出页面、操作系统、日期/时间戳和点击流数据等。 D. ET Tag实体标签 ET Tag 是在互联网浏览器与互联网服务器之间背后传送的 HTTP 协议标头,可代替 Cookie用以追踪个别使用者使我们可更深入地了解和改善我们的服务。 E. JavaScript JavaScript 是一种编程语言用于制作更具互动性和动态的网页。JavaScript 可以设定 Cookie、阅读 Cookie 及删除 Cookie。
算法: 计算机在执行解题运算时遵循的流程或一系列规则。 算法: 计算机在执行解题运算时遵循的流程或一系列规则。

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View File

@@ -1,6 +1,6 @@
#Sat Apr 23 16:13:18 CST 2022 #Sun Feb 13 16:53:34 CST 2022
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View File

@@ -6,6 +6,6 @@ dependencyResolutionManagement {
maven("https://api.xposed.info") maven("https://api.xposed.info")
} }
} }
rootProject.name = "WooBoxForMIUI" rootProject.name = "Simplicity Tools"
include(":app") include(":app")
include(":blockmiui") include(":blockmiui")