mirror of
https://github.com/fankes/MIUINativeNotifyIcon.git
synced 2025-09-07 03:05:51 +08:00
Update YukiHookAPI
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# MIUI 原生通知图标
|
# MIUI 原生通知图标
|
||||||
|
|
||||||
[](https://github.com/fankes/MIUINativeNotifyIcon)
|
[](https://github.com/fankes/MIUINativeNotifyIcon)
|
||||||
[](https://github.com/fankes/MIUINativeNotifyIcon/blob/master/LICENSE)
|
[](https://github.com/fankes/MIUINativeNotifyIcon/blob/master/LICENSE)
|
||||||
[](https://github.com/fankes/MIUINativeNotifyIcon/releases)
|
[](https://github.com/fankes/MIUINativeNotifyIcon/releases)
|
||||||
[](https://github.com/fankes/MIUINativeNotifyIcon/releases)
|
[](https://github.com/fankes/MIUINativeNotifyIcon/releases)
|
||||||
|
@@ -38,7 +38,7 @@ android {
|
|||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled true
|
minifyEnabled false
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.debug
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
@@ -72,8 +72,8 @@ tasks.whenTaskAdded {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly 'de.robv.android.xposed:api:82'
|
compileOnly 'de.robv.android.xposed:api:82'
|
||||||
implementation 'com.highcapable.yukihookapi:api:1.0.69'
|
implementation 'com.highcapable.yukihookapi:api:1.0.70'
|
||||||
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.69'
|
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.70'
|
||||||
implementation "com.github.topjohnwu.libsu:core:3.1.2"
|
implementation "com.github.topjohnwu.libsu:core:3.1.2"
|
||||||
implementation 'androidx.annotation:annotation:1.3.0'
|
implementation 'androidx.annotation:annotation:1.3.0'
|
||||||
implementation 'com.geyifeng.immersionbar:immersionbar:3.2.0'
|
implementation 'com.geyifeng.immersionbar:immersionbar:3.2.0'
|
||||||
|
@@ -268,7 +268,7 @@ class SystemUIHooker : YukiBaseHooker() {
|
|||||||
get() = safeOfFalse {
|
get() = safeOfFalse {
|
||||||
NotificationUtilClass.clazz.hasMethod {
|
NotificationUtilClass.clazz.hasMethod {
|
||||||
name = "ignoreStatusBarIconColor"
|
name = "ignoreStatusBarIconColor"
|
||||||
param(ExpandedNotificationClass.clazz)
|
param(ExpandedNotificationClass)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -685,7 +685,7 @@ class SystemUIHooker : YukiBaseHooker() {
|
|||||||
injectMember {
|
injectMember {
|
||||||
method {
|
method {
|
||||||
name = "shouldSubstituteSmallIcon"
|
name = "shouldSubstituteSmallIcon"
|
||||||
param(ExpandedNotificationClass.clazz)
|
param(ExpandedNotificationClass)
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* MIUI 12 在非原生样式下 MIPUSH 的图标着色异常
|
* MIUI 12 在非原生样式下 MIPUSH 的图标着色异常
|
||||||
@@ -698,15 +698,15 @@ class SystemUIHooker : YukiBaseHooker() {
|
|||||||
var isUseLegacy = false
|
var isUseLegacy = false
|
||||||
method {
|
method {
|
||||||
name = "getSmallIcon"
|
name = "getSmallIcon"
|
||||||
param(ExpandedNotificationClass.clazz, IntType)
|
param(ExpandedNotificationClass, IntType)
|
||||||
}.remedys {
|
}.remedys {
|
||||||
method {
|
method {
|
||||||
name = "getSmallIcon"
|
name = "getSmallIcon"
|
||||||
param(ExpandedNotificationClass.clazz)
|
param(ExpandedNotificationClass)
|
||||||
}
|
}
|
||||||
method {
|
method {
|
||||||
name = "getSmallIcon"
|
name = "getSmallIcon"
|
||||||
param(ContextClass, ExpandedNotificationClass.clazz)
|
param(ContextClass, ExpandedNotificationClass)
|
||||||
}.onFind { isUseLegacy = true }
|
}.onFind { isUseLegacy = true }
|
||||||
}
|
}
|
||||||
afterHook {
|
afterHook {
|
||||||
@@ -757,7 +757,7 @@ class SystemUIHooker : YukiBaseHooker() {
|
|||||||
}.remedys {
|
}.remedys {
|
||||||
method {
|
method {
|
||||||
name = "setNotification"
|
name = "setNotification"
|
||||||
param(ExpandedNotificationClass.clazz)
|
param(ExpandedNotificationClass)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
afterHook {
|
afterHook {
|
||||||
@@ -845,7 +845,7 @@ class SystemUIHooker : YukiBaseHooker() {
|
|||||||
}
|
}
|
||||||
/** 记录实例 */
|
/** 记录实例 */
|
||||||
injectMember {
|
injectMember {
|
||||||
constructor { param(ContextClass, ViewClass, ExpandableNotificationRowClass.clazz) }
|
constructor { param(ContextClass, ViewClass, ExpandableNotificationRowClass) }
|
||||||
afterHook { notificationViewWrappers.add(instance) }
|
afterHook { notificationViewWrappers.add(instance) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -867,7 +867,7 @@ class SystemUIHooker : YukiBaseHooker() {
|
|||||||
}
|
}
|
||||||
/** 记录实例 */
|
/** 记录实例 */
|
||||||
injectMember {
|
injectMember {
|
||||||
constructor { param(ContextClass, ViewClass, ExpandableNotificationRowClass.clazz) }
|
constructor { param(ContextClass, ViewClass, ExpandableNotificationRowClass) }
|
||||||
afterHook { miuiNotificationViewWrappers.add(instance) }
|
afterHook { miuiNotificationViewWrappers.add(instance) }
|
||||||
}
|
}
|
||||||
}.ignoredHookClassNotFoundFailure()
|
}.ignoredHookClassNotFoundFailure()
|
||||||
@@ -899,11 +899,11 @@ class SystemUIHooker : YukiBaseHooker() {
|
|||||||
injectMember {
|
injectMember {
|
||||||
method {
|
method {
|
||||||
name = "setAppIcon"
|
name = "setAppIcon"
|
||||||
param(ContextClass, ImageViewClass, ExpandedNotificationClass.clazz)
|
param(ContextClass, ImageViewClass, ExpandedNotificationClass)
|
||||||
}.remedys {
|
}.remedys {
|
||||||
method {
|
method {
|
||||||
name = "setAppIcon"
|
name = "setAppIcon"
|
||||||
param(ImageViewClass, ExpandedNotificationClass.clazz)
|
param(ImageViewClass, ExpandedNotificationClass)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
intercept()
|
intercept()
|
||||||
@@ -911,7 +911,7 @@ class SystemUIHooker : YukiBaseHooker() {
|
|||||||
injectMember {
|
injectMember {
|
||||||
method {
|
method {
|
||||||
name = "resetIconBgAndPaddings"
|
name = "resetIconBgAndPaddings"
|
||||||
param(ImageViewClass, ExpandedNotificationClass.clazz)
|
param(ImageViewClass, ExpandedNotificationClass)
|
||||||
}
|
}
|
||||||
intercept()
|
intercept()
|
||||||
}.ignoredNoSuchMemberFailure()
|
}.ignoredNoSuchMemberFailure()
|
||||||
|
@@ -39,7 +39,7 @@ import android.widget.TextView
|
|||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.viewbinding.ViewBinding
|
import androidx.viewbinding.ViewBinding
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||||
import com.highcapable.yukihookapi.annotation.DoNotUseField
|
import com.highcapable.yukihookapi.annotation.CauseProblemsApi
|
||||||
import com.highcapable.yukihookapi.hook.factory.method
|
import com.highcapable.yukihookapi.hook.factory.method
|
||||||
import com.highcapable.yukihookapi.hook.type.android.LayoutInflaterClass
|
import com.highcapable.yukihookapi.hook.type.android.LayoutInflaterClass
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ class DialogBuilder(val context: Context, private val isUseBlackTheme: Boolean)
|
|||||||
|
|
||||||
private var dialogInstance: Dialog? = null // 对话框实例
|
private var dialogInstance: Dialog? = null // 对话框实例
|
||||||
|
|
||||||
@DoNotUseField
|
@CauseProblemsApi
|
||||||
var customLayoutView: View? = null // 自定义布局
|
var customLayoutView: View? = null // 自定义布局
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user