mirror of
https://github.com/fankes/ColorOSNotifyIcon.git
synced 2025-09-04 09:45:34 +08:00
Modify merge to YukiHookAPI new usage
This commit is contained in:
@@ -33,7 +33,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 = "ColorOSNotifyIcon" }
|
||||
|
@@ -560,7 +560,7 @@ object SystemUIHooker : YukiBaseHooker() {
|
||||
/** 必要的延迟防止 Sp 存储不刷新 */
|
||||
SystemClock.sleep(100)
|
||||
/** 获取可读写状态 */
|
||||
return prefs.isXSharePrefsReadable.also {
|
||||
return prefs.isPreferencesAvailable.also {
|
||||
isUsingCachingMethod = true
|
||||
prefs.clearCache()
|
||||
cachingIconDatas()
|
||||
|
@@ -325,7 +325,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() {
|
||||
|
@@ -58,7 +58,7 @@ import com.highcapable.yukihookapi.hook.factory.field
|
||||
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
|
||||
@@ -380,7 +380,7 @@ val String.bitmap: Bitmap get() = unbase64.bitmap
|
||||
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