Skip to content

Commit bf62c42

Browse files
committed
fix: UnlockAiWallpaper hook failed on new version
1 parent 2a48dab commit bf62c42

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

library/hook/src/main/java/com/sevtinge/hyperceiler/hook/module/rules/aod/UnlockAiWallpaper.kt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,18 @@ import io.github.kyuubiran.ezxhelper.xposed.dsl.HookFactory.`-Static`.createHook
2626
object UnlockAiWallpaper : BaseHook() {
2727

2828
override fun init() {
29-
loadClass("com.miui.keyguard.editor.edit.aiwapper.AIWallPaperManager").methodFinder()
30-
.filterByName("isSupportType")
31-
.first().createHook {
32-
returnConstant(true)
33-
}
29+
loadClass("com.miui.keyguard.editor.edit.aiwapper.AIWallPaperManager").methodFinder().apply {
30+
runCatching {
31+
filterByName("isSupportedDevice")
32+
.first().createHook {
33+
returnConstant(true)
34+
}
35+
}.onFailure {
36+
filterByName("isSupportType")
37+
.first().createHook {
38+
returnConstant(true)
39+
}
40+
}
41+
}
3442
}
3543
}

0 commit comments

Comments
 (0)