mirror of
https://github.com/fankes/MIUINativeNotifyIcon.git
synced 2025-09-07 03:05:51 +08:00
修复一个问题
This commit is contained in:
@@ -459,8 +459,7 @@ class HookMain : IXposedHookLoadPackage {
|
|||||||
"getSmallIcon",
|
"getSmallIcon",
|
||||||
lpparam.findClass(ExpandedNotificationClass),
|
lpparam.findClass(ExpandedNotificationClass),
|
||||||
Int::class.java
|
Int::class.java
|
||||||
)
|
).apply { isAccessible = true }
|
||||||
.apply { isAccessible = true }
|
|
||||||
} catch (_: Throwable) {
|
} catch (_: Throwable) {
|
||||||
/** 旧版方法 */
|
/** 旧版方法 */
|
||||||
lpparam.findClass(NotificationUtilClass)
|
lpparam.findClass(NotificationUtilClass)
|
||||||
@@ -477,6 +476,7 @@ class HookMain : IXposedHookLoadPackage {
|
|||||||
}
|
}
|
||||||
/** 修复下拉通知图标自动设置回 APP 图标的方法 */
|
/** 修复下拉通知图标自动设置回 APP 图标的方法 */
|
||||||
runWithoutError(error = "AutoSetAppIcon") {
|
runWithoutError(error = "AutoSetAppIcon") {
|
||||||
|
var isNewWay = true
|
||||||
try {
|
try {
|
||||||
/** 新版方法 */
|
/** 新版方法 */
|
||||||
lpparam.findClass(NotificationHeaderViewWrapperInjectorClass)
|
lpparam.findClass(NotificationHeaderViewWrapperInjectorClass)
|
||||||
@@ -487,6 +487,7 @@ class HookMain : IXposedHookLoadPackage {
|
|||||||
lpparam.findClass(ExpandedNotificationClass)
|
lpparam.findClass(ExpandedNotificationClass)
|
||||||
).apply { isAccessible = true }
|
).apply { isAccessible = true }
|
||||||
} catch (_: Throwable) {
|
} catch (_: Throwable) {
|
||||||
|
isNewWay = false
|
||||||
/** 旧版方法 */
|
/** 旧版方法 */
|
||||||
lpparam.findClass(NotificationHeaderViewWrapperInjectorClass)
|
lpparam.findClass(NotificationHeaderViewWrapperInjectorClass)
|
||||||
.getDeclaredMethod(
|
.getDeclaredMethod(
|
||||||
@@ -497,7 +498,7 @@ class HookMain : IXposedHookLoadPackage {
|
|||||||
}.also {
|
}.also {
|
||||||
XposedBridge.hookMethod(it, object : XC_MethodReplacement() {
|
XposedBridge.hookMethod(it, object : XC_MethodReplacement() {
|
||||||
override fun replaceHookedMethod(param: MethodHookParam): Any? {
|
override fun replaceHookedMethod(param: MethodHookParam): Any? {
|
||||||
lpparam.hookNotifyIconOnSet(param, isNew = true)
|
lpparam.hookNotifyIconOnSet(param, isNew = isNewWay)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user