@@ -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 /* * 注册定时监听 */
0 commit comments