refactor: update KavaRef usage to 1.0.1

This commit is contained in:
2025-07-06 21:37:37 +08:00
parent 29b14a811e
commit a7582de004
2 changed files with 5 additions and 4 deletions

View File

@@ -68,6 +68,7 @@ import com.fankes.coloros.notify.utils.tool.ActivationPromptTool
import com.fankes.coloros.notify.utils.tool.BitmapCompatTool import com.fankes.coloros.notify.utils.tool.BitmapCompatTool
import com.fankes.coloros.notify.utils.tool.IconAdaptationTool import com.fankes.coloros.notify.utils.tool.IconAdaptationTool
import com.fankes.coloros.notify.utils.tool.SystemUITool import com.fankes.coloros.notify.utils.tool.SystemUITool
import com.highcapable.kavaref.KavaRef.Companion.asResolver
import com.highcapable.kavaref.KavaRef.Companion.resolve import com.highcapable.kavaref.KavaRef.Companion.resolve
import com.highcapable.kavaref.condition.type.VagueType import com.highcapable.kavaref.condition.type.VagueType
import com.highcapable.kavaref.extension.VariousClass import com.highcapable.kavaref.extension.VariousClass
@@ -363,7 +364,7 @@ object SystemUIHooker : YukiBaseHooker() {
/** 刷新通知小图标 */ /** 刷新通知小图标 */
private fun refreshNotificationIcons() = runInSafe { private fun refreshNotificationIcons() = runInSafe {
notificationPresenter?.resolve()?.optional()?.firstMethodOrNull { notificationPresenter?.asResolver()?.optional()?.firstMethodOrNull {
name = "updateNotificationsOnDensityOrFontScaleChanged" name = "updateNotificationsOnDensityOrFontScaleChanged"
emptyParameters() emptyParameters()
}?.invoke() }?.invoke()
@@ -886,7 +887,7 @@ object SystemUIHooker : YukiBaseHooker() {
?.of(NotificationViewWrapperClass.resolve().optional().firstFieldOrNull { ?.of(NotificationViewWrapperClass.resolve().optional().firstFieldOrNull {
name = "mRow" name = "mRow"
}?.of(instance)?.get())?.invokeQuietly()?.let { }?.of(instance)?.get())?.invokeQuietly()?.let {
it.resolve().optional().firstMethodOrNull { it.asResolver().optional().firstMethodOrNull {
name = "getSbn" name = "getSbn"
}?.invoke<StatusBarNotification>() }?.invoke<StatusBarNotification>()
}.also { nf -> }.also { nf ->

View File

@@ -48,9 +48,9 @@ libraries:
version-ref: <this>::api version-ref: <this>::api
com.highcapable.kavaref: com.highcapable.kavaref:
kavaref-core: kavaref-core:
version: 1.0.0 version: 1.0.1
kavaref-extension: kavaref-extension:
version: 1.0.0 version: 1.0.1
com.github.topjohnwu.libsu: com.github.topjohnwu.libsu:
core: core:
version: 5.2.2 version: 5.2.2