3 Commits
1.52 ... 1.53

Author SHA1 Message Date
1f2b1d5046 Update version to 1.53 2022-04-04 23:22:10 +08:00
7896e4836c Update YukiHookAPI 2022-04-04 23:13:24 +08:00
d2ff1fe3ec 修复 ColorOS 11 Android 11 上的问题 2022-04-04 23:12:58 +08:00
5 changed files with 26 additions and 10 deletions

View File

@@ -2,7 +2,7 @@
[![Blank](https://img.shields.io/badge/build-passing-brightgreen)](https://github.com/fankes/ColorOSNotifyIcon)
[![Blank](https://img.shields.io/badge/license-AGPL3.0-blue)](https://github.com/fankes/ColorOSNotifyIcon/blob/master/LICENSE)
[![Blank](https://img.shields.io/badge/version-v1.52-green)](https://github.com/fankes/ColorOSNotifyIcon/releases)
[![Blank](https://img.shields.io/badge/version-v1.53-green)](https://github.com/fankes/ColorOSNotifyIcon/releases)
[![Blank](https://img.shields.io/github/downloads/fankes/ColorOSNotifyIcon/total?label=Release)](https://github.com/fankes/ColorOSNotifyIcon/releases)
[![Blank](https://img.shields.io/github/downloads/Xposed-Modules-Repo/com.fankes.coloros.notify/total?label=LSPosed%20Repo&logo=Android&style=flat&labelColor=F48FB1&logoColor=ffffff)](https://github.com/Xposed-Modules-Repo/com.fankes.coloros.notify/releases)
[![Telegram](https://img.shields.io/static/v1?label=Telegram&message=交流讨论&color=0088cc)](https://t.me/XiaofangInternet)

View File

@@ -72,8 +72,8 @@ tasks.whenTaskAdded {
dependencies {
compileOnly 'de.robv.android.xposed:api:82'
implementation 'com.highcapable.yukihookapi:api:1.0.70'
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.70'
implementation 'com.highcapable.yukihookapi:api:1.0.71'
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.71'
implementation 'com.github.tiann:FreeReflection:3.1.0'
implementation "com.github.topjohnwu.libsu:core:3.1.2"
implementation 'androidx.annotation:annotation:1.3.0'

View File

@@ -41,7 +41,7 @@ object Const {
const val MODULE_VERSION_CODE = BuildConfig.VERSION_CODE
/** 当前模块的版本校验 */
const val MODULE_VERSION_VERIFY = "${MODULE_VERSION_NAME}_${MODULE_VERSION_CODE}_202204041448"
const val MODULE_VERSION_VERIFY = "${MODULE_VERSION_NAME}_${MODULE_VERSION_CODE}_202204042319"
/** 当前模块的版本校验标签 */
const val MODULE_VERSION_VERIFY_TAG = "module_version_verify"

View File

@@ -104,13 +104,14 @@ class SystemUIHooker : YukiBaseHooker() {
/** 根据多个版本存在不同的包名相同的类 */
private val OplusNotificationIconAreaControllerClass = VariousClass(
"com.oplusos.systemui.statusbar.phone.OplusNotificationIconAreaController",
"com.coloros.systemui.statusbar.phone.ColorosNotificationIconAreaController"
"com.oplusos.systemui.statusbar.policy.OplusNotificationIconAreaController",
"com.coloros.systemui.statusbar.policy.ColorNotificationIconAreaController"
)
/** 根据多个版本存在不同的包名相同的类 */
private val SystemPromptControllerClass = VariousClass(
"com.oplusos.systemui.statusbar.policy.SystemPromptController",
"com.coloros.systemui.statusbar.policy.SystemPromptController"
"com.coloros.systemui.statusbar.policy.ColorSystemPromptController"
)
/** 根据多个版本存在不同的包名相同的类 */
@@ -171,6 +172,9 @@ class SystemUIHooker : YukiBaseHooker() {
/** 状态栏通知图标容器 */
private var notificationIconContainer: ViewGroup? = null
/** 状态栏通知图标数组 */
private var notificationIconInstances = ArrayList<View>()
/** 缓存的通知小图标包装纸实例 */
private var notificationViewWrappers = ArraySet<Any>()
@@ -300,7 +304,7 @@ class SystemUIHooker : YukiBaseHooker() {
.get(RoundRectDrawableUtilClass.clazz.field { name = "Companion" }.get().self)
/** 启动一个线程防止卡顿 */
Thread {
notificationIconContainer?.children?.forEach {
(notificationIconContainer?.children?.toList() ?: notificationIconInstances.takeIf { it.isNotEmpty() })?.forEach {
runInSafe {
/** 得到通知实例 */
val nf = nfField.get(it).cast<StatusBarNotification>() ?: return@Thread
@@ -628,11 +632,23 @@ class SystemUIHooker : YukiBaseHooker() {
/** 注入状态栏通知图标容器实例 */
OplusNotificationIconAreaControllerClass.hook {
injectMember {
var isOldWay = false
method {
name = "updateIconsForLayout"
paramCount = 10
}.remedys {
method {
name = "updateIconsForLayout"
paramCount = 1
}.onFind { isOldWay = true }
}
afterHook {
if (isOldWay) {
notificationIconInstances.clear()
field { name = "mLastToShow" }.get(instance).list<View>()
.takeIf { it.isNotEmpty() }?.forEach { notificationIconInstances.add(it) }
} else notificationIconContainer = args(index = 1).cast()
}
afterHook { notificationIconContainer = args(index = 1).cast() }
}
}
/** 替换通知图标和样式 */

View File

@@ -5,8 +5,8 @@ plugins {
}
ext {
appVersionName = "1.52"
appVersionCode = 9
appVersionName = "1.53"
appVersionCode = 10
}
task clean(type: Delete) {