mirror of
https://github.com/fankes/MIUINativeNotifyIcon.git
synced 2025-09-04 01:35:26 +08:00
Modify merge to YukiHookAPI new usage
This commit is contained in:
@@ -36,7 +36,7 @@ import com.highcapable.yukihookapi.hook.log.loggerW
|
||||
import com.highcapable.yukihookapi.hook.xposed.proxy.IYukiHookXposedInit
|
||||
|
||||
@InjectYukiHookWithXposed(isUsingResourcesHook = false)
|
||||
class HookEntry : IYukiHookXposedInit {
|
||||
object HookEntry : IYukiHookXposedInit {
|
||||
|
||||
override fun onInit() = configs {
|
||||
debugLog { tag = "MIUINativeNotifyIcon" }
|
||||
|
@@ -641,7 +641,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
||||
/** 必要的延迟防止 Sp 存储不刷新 */
|
||||
SystemClock.sleep(100)
|
||||
/** 获取可读写状态 */
|
||||
return prefs.isXSharePrefsReadable.also {
|
||||
return prefs.isPreferencesAvailable.also {
|
||||
isUsingCachingMethod = true
|
||||
prefs.clearCache()
|
||||
cachingIconDatas()
|
||||
@@ -907,7 +907,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
||||
/** 自动检查通知图标优化更新的注入监听 */
|
||||
MiuiClockClass.hook {
|
||||
injectMember {
|
||||
method { name = "updateTime" }.remedys { method { name = "updateClock" } }
|
||||
method { name { it == "updateTime" || it == "updateClock" } }
|
||||
afterHook {
|
||||
instance<View>().context.also {
|
||||
/** 注册定时监听 */
|
||||
|
@@ -336,7 +336,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
else -> "模块未激活"
|
||||
}
|
||||
binding.mainTextApiWay.isVisible = YukiHookAPI.Status.isXposedModuleActive
|
||||
binding.mainTextApiWay.text = "Activated by ${YukiHookAPI.Status.executorName} API ${YukiHookAPI.Status.executorVersion}"
|
||||
binding.mainTextApiWay.text = "Activated by ${YukiHookAPI.Status.Executor.name} API ${YukiHookAPI.Status.Executor.apiLevel}"
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
@@ -55,7 +55,7 @@ import com.google.android.material.snackbar.Snackbar
|
||||
import com.highcapable.yukihookapi.hook.factory.hasClass
|
||||
import com.highcapable.yukihookapi.hook.factory.method
|
||||
import com.highcapable.yukihookapi.hook.factory.toClassOrNull
|
||||
import com.highcapable.yukihookapi.hook.type.java.StringType
|
||||
import com.highcapable.yukihookapi.hook.type.java.StringClass
|
||||
import com.highcapable.yukihookapi.hook.xposed.application.ModuleApplication.Companion.appContext
|
||||
import com.topjohnwu.superuser.Shell
|
||||
import java.io.ByteArrayOutputStream
|
||||
@@ -447,7 +447,7 @@ fun Bitmap.round(radius: Float): Bitmap = safeOf(default = this) {
|
||||
fun findPropString(key: String, default: String = "") = safeOf(default) {
|
||||
"android.os.SystemProperties".toClassOrNull()?.method {
|
||||
name = "get"
|
||||
param(StringType, StringType)
|
||||
param(StringClass, StringClass)
|
||||
}?.get()?.invoke(key, default) ?: default
|
||||
}
|
||||
|
||||
|
@@ -59,7 +59,8 @@ object SystemUITool {
|
||||
* @param context 实例
|
||||
* @param result 成功后回调
|
||||
*/
|
||||
fun checkingActivated(context: Context, result: (Boolean) -> Unit) = context.dataChannel(SYSTEMUI_PACKAGE_NAME).checkingVersionEquals(result)
|
||||
fun checkingActivated(context: Context, result: (Boolean) -> Unit) =
|
||||
context.dataChannel(SYSTEMUI_PACKAGE_NAME).checkingVersionEquals(result = result)
|
||||
|
||||
/**
|
||||
* 重启系统界面
|
||||
|
Reference in New Issue
Block a user