mirror of
https://github.com/fankes/ColorOSNotifyIcon.git
synced 2025-09-06 02:35:41 +08:00
Make SystemUIHooker singleton
This commit is contained in:
@@ -47,7 +47,7 @@ class HookEntry : IYukiHookXposedInit {
|
||||
/** Hook 被手动关闭停止 Hook */
|
||||
prefs.get(DataConst.ENABLE_MODULE).not() -> loggerW(msg = "Aborted Hook -> Hook Closed")
|
||||
/** 开始 Hook */
|
||||
else -> loadApp(SYSTEMUI_PACKAGE_NAME, SystemUIHooker())
|
||||
else -> loadApp(SYSTEMUI_PACKAGE_NAME, SystemUIHooker)
|
||||
}
|
||||
}
|
||||
}
|
@@ -20,6 +20,8 @@
|
||||
*
|
||||
* This file is Created by fankes on 2022/3/25.
|
||||
*/
|
||||
@file:Suppress("StaticFieldLeak")
|
||||
|
||||
package com.fankes.coloros.notify.hook.entity
|
||||
|
||||
import android.app.WallpaperManager
|
||||
@@ -71,9 +73,7 @@ import com.highcapable.yukihookapi.hook.type.java.LongType
|
||||
/**
|
||||
* 系统界面核心 Hook 类
|
||||
*/
|
||||
class SystemUIHooker : YukiBaseHooker() {
|
||||
|
||||
companion object {
|
||||
object SystemUIHooker : YukiBaseHooker() {
|
||||
|
||||
/** 原生存在的类 */
|
||||
private const val ContrastColorUtilClass = "com.android.internal.util.ContrastColorUtil"
|
||||
@@ -175,7 +175,6 @@ class SystemUIHooker : YukiBaseHooker() {
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.row.wrapper.NotificationHeaderViewWrapper",
|
||||
"$SYSTEMUI_PACKAGE_NAME.statusbar.notification.NotificationHeaderViewWrapper"
|
||||
)
|
||||
}
|
||||
|
||||
/** 缓存的彩色 APP 图标 */
|
||||
private var appIcons = ArrayMap<String, Drawable>()
|
||||
|
Reference in New Issue
Block a user