Merge code

This commit is contained in:
2022-03-25 01:57:43 +08:00
parent fad7a6f4cd
commit 836b4abaf1

View File

@@ -484,7 +484,7 @@ class HookEntry : YukiHookXposedInitProxy {
} }
beforeHook { beforeHook {
/** 是否移除 */ /** 是否移除 */
if (firstArgs as Int == 7 && prefs.getBoolean(REMOVE_CHANGECP_NOTIFY)) resultNull() if (firstArgs<Int>() == 7 && prefs.getBoolean(REMOVE_CHANGECP_NOTIFY)) resultNull()
} }
} }
} }
@@ -508,7 +508,7 @@ class HookEntry : YukiHookXposedInitProxy {
name = "isGrayscaleOplus" name = "isGrayscaleOplus"
param(ImageViewClass, OplusContrastColorUtilClass.clazz) param(ImageViewClass, OplusContrastColorUtilClass.clazz)
} }
replaceAny { (firstArgs as? ImageView?)?.let { isGrayscaleIcon(it.context, it.drawable) } } replaceAny { firstArgs<ImageView>()?.let { isGrayscaleIcon(it.context, it.drawable) } }
}.ignoredHookingFailure() }.ignoredHookingFailure()
} }
/** 替换状态栏图标 */ /** 替换状态栏图标 */
@@ -615,11 +615,11 @@ class HookEntry : YukiHookXposedInitProxy {
if (iconDatas.takeIf { e -> e.isNotEmpty() } if (iconDatas.takeIf { e -> e.isNotEmpty() }
?.filter { e -> e.packageName == newPkgName } ?.filter { e -> e.packageName == newPkgName }
.isNullOrEmpty() .isNullOrEmpty()
) IconAdaptationTool.pushNewAppSupportNotify(firstArgs as Context, newPkgName) ) IconAdaptationTool.pushNewAppSupportNotify(firstArgs()!!, newPkgName)
} }
Intent.ACTION_PACKAGE_REMOVED -> Intent.ACTION_PACKAGE_REMOVED ->
IconAdaptationTool.removeNewAppSupportNotify( IconAdaptationTool.removeNewAppSupportNotify(
firstArgs as Context, context = firstArgs()!!,
packageName = it.data?.schemeSpecificPart ?: "" packageName = it.data?.schemeSpecificPart ?: ""
) )
} }