Skip to content

Commit ffb7068

Browse files
committed
Update YukiHookAPI
1 parent 70eadb8 commit ffb7068

3 files changed

Lines changed: 14 additions & 13 deletions

File tree

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ android {
3838

3939
buildTypes {
4040
release {
41-
minifyEnabled true
41+
minifyEnabled rootProject.ext.enableR8
4242
signingConfig signingConfigs.debug
4343
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
4444
}
@@ -72,8 +72,8 @@ tasks.whenTaskAdded {
7272

7373
dependencies {
7474
compileOnly 'de.robv.android.xposed:api:82'
75-
implementation 'com.highcapable.yukihookapi:api:1.0.73'
76-
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.73'
75+
implementation 'com.highcapable.yukihookapi:api:1.0.75'
76+
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.75'
7777
implementation 'com.github.tiann:FreeReflection:3.1.0'
7878
implementation "com.github.topjohnwu.libsu:core:3.1.2"
7979
implementation 'androidx.annotation:annotation:1.3.0'

app/src/main/java/com/fankes/coloros/notify/hook/entity/SystemUIHooker.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ class SystemUIHooker : YukiBaseHooker() {
549549
}
550550
beforeHook {
551551
/** 是否移除 */
552-
if (args().int() == 7 && prefs.get(DataConst.REMOVE_CHANGECP_NOTIFY)) resultNull()
552+
if (args().first().int() == 7 && prefs.get(DataConst.REMOVE_CHANGECP_NOTIFY)) resultNull()
553553
}
554554
}
555555
}
@@ -573,7 +573,7 @@ class SystemUIHooker : YukiBaseHooker() {
573573
name = "isGrayscaleOplus"
574574
param(ImageViewClass, OplusContrastColorUtilClass)
575575
}
576-
replaceAny { firstArgs<ImageView>()?.let { isGrayscaleIcon(it.context, it.drawable) } }
576+
replaceAny { args().first().cast<ImageView>()?.let { isGrayscaleIcon(it.context, it.drawable) } }
577577
}.ignoredHookingFailure()
578578
}
579579
/** 替换状态栏图标 */
@@ -588,7 +588,7 @@ class SystemUIHooker : YukiBaseHooker() {
588588
.get(field { name = "iconBuilder" }.get(instance).cast()).cast<Context>()?.also { context ->
589589
NotificationEntryClass.clazz.method {
590590
name = "getSbn"
591-
}.get(firstArgs).invoke<StatusBarNotification>()?.also { nf ->
591+
}.get(args[0]).invoke<StatusBarNotification>()?.also { nf ->
592592
nf.notification.smallIcon.loadDrawable(context).also { iconDrawable ->
593593
compatStatusIcon(
594594
context = context,
@@ -620,7 +620,7 @@ class SystemUIHooker : YukiBaseHooker() {
620620
param(StatusBarNotificationClass)
621621
}
622622
afterHook {
623-
if (firstArgs != null) instance<ImageView>().also {
623+
if (args[0] != null) instance<ImageView>().also {
624624
/** 注册壁纸颜色监听 */
625625
registerWallpaperColorChanged(it)
626626
/** 注册广播 */
@@ -698,7 +698,7 @@ class SystemUIHooker : YukiBaseHooker() {
698698
param(ContextClass, IntentClass)
699699
}
700700
afterHook {
701-
if (isEnableHookColorNotifyIcon()) (lastArgs as? Intent)?.also {
701+
if (isEnableHookColorNotifyIcon()) args().last().cast<Intent>()?.also {
702702
if (it.action.equals(Intent.ACTION_PACKAGE_REPLACED).not() &&
703703
it.getBooleanExtra(Intent.EXTRA_REPLACING, false)
704704
) return@also
@@ -708,11 +708,11 @@ class SystemUIHooker : YukiBaseHooker() {
708708
if (iconDatas.takeIf { e -> e.isNotEmpty() }
709709
?.filter { e -> e.packageName == newPkgName }
710710
.isNullOrEmpty()
711-
) IconAdaptationTool.pushNewAppSupportNotify(firstArgs()!!, newPkgName)
711+
) IconAdaptationTool.pushNewAppSupportNotify(args().first().cast()!!, newPkgName)
712712
}
713713
Intent.ACTION_PACKAGE_REMOVED ->
714714
IconAdaptationTool.removeNewAppSupportNotify(
715-
context = firstArgs()!!,
715+
context = args().first().cast()!!,
716716
packageName = it.data?.schemeSpecificPart ?: ""
717717
)
718718
}
@@ -728,7 +728,7 @@ class SystemUIHooker : YukiBaseHooker() {
728728
param(ContextClass, IntentClass)
729729
}
730730
afterHook {
731-
firstArgs<Context>()?.also {
731+
args().first().cast<Context>()?.also {
732732
/** 注册广播 */
733733
registerReceiver(it)
734734
/** 注册定时监听 */

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
plugins {
2-
id 'com.android.application' version '7.1.2' apply false
3-
id 'com.android.library' version '7.1.2' apply false
2+
id 'com.android.application' version '7.1.3' apply false
3+
id 'com.android.library' version '7.1.3' apply false
44
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
55
}
66

77
ext {
88
appVersionName = "1.53"
99
appVersionCode = 10
10+
enableR8 = true
1011
}
1112

1213
task clean(type: Delete) {

0 commit comments

Comments
 (0)