mirror of
https://github.com/fankes/ColorOSNotifyIcon.git
synced 2025-09-06 10:45:49 +08:00
Update YukiHookAPI
This commit is contained in:
@@ -61,8 +61,8 @@ tasks.whenTaskAdded {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly 'de.robv.android.xposed:api:82'
|
compileOnly 'de.robv.android.xposed:api:82'
|
||||||
implementation 'com.highcapable.yukihookapi:api:1.0.4'
|
implementation 'com.highcapable.yukihookapi:api:1.0.5-fix'
|
||||||
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.4'
|
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.5-fix'
|
||||||
implementation 'com.github.tiann:FreeReflection:3.1.0'
|
implementation 'com.github.tiann:FreeReflection:3.1.0'
|
||||||
implementation "com.github.topjohnwu.libsu:core:3.1.2"
|
implementation "com.github.topjohnwu.libsu:core:3.1.2"
|
||||||
implementation 'androidx.annotation:annotation:1.3.0'
|
implementation 'androidx.annotation:annotation:1.3.0'
|
||||||
|
@@ -278,19 +278,12 @@ class HookEntry : YukiHookXposedInitProxy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onHook() {
|
override fun onInit() = configs {
|
||||||
runConfig()
|
|
||||||
runHook()
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 配置 Hook */
|
|
||||||
private fun runConfig() = configs {
|
|
||||||
debugTag = "ColorOSNotify"
|
debugTag = "ColorOSNotify"
|
||||||
isDebug = false
|
isDebug = false
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 开始 Hook */
|
override fun onHook() = encase {
|
||||||
private fun runHook() = encase {
|
|
||||||
loadApp(SYSTEMUI_PACKAGE_NAME) {
|
loadApp(SYSTEMUI_PACKAGE_NAME) {
|
||||||
when {
|
when {
|
||||||
/** 不是 ColorOS 系统停止 Hook */
|
/** 不是 ColorOS 系统停止 Hook */
|
||||||
@@ -345,7 +338,7 @@ class HookEntry : YukiHookXposedInitProxy {
|
|||||||
param(ImageViewClass, OplusContrastColorUtilClass.clazz)
|
param(ImageViewClass, OplusContrastColorUtilClass.clazz)
|
||||||
}
|
}
|
||||||
replaceAny { (firstArgs as? ImageView?)?.let { isGrayscaleIcon(it.context, it.drawable) } }
|
replaceAny { (firstArgs as? ImageView?)?.let { isGrayscaleIcon(it.context, it.drawable) } }
|
||||||
}.ignoredHookingFailure()
|
}.ignoredNoSuchMemberFailure()
|
||||||
}
|
}
|
||||||
/** 替换状态栏图标 */
|
/** 替换状态栏图标 */
|
||||||
IconManagerClass.hook {
|
IconManagerClass.hook {
|
||||||
|
Reference in New Issue
Block a user