Skip to content

Commit 6cbcc90

Browse files
committed
fix: support camera version to 6.3 (The only new feature is the 6.3 camera)
1 parent 9e6275a commit 6cbcc90

2 files changed

Lines changed: 37 additions & 10 deletions

File tree

library/libhook/src/main/java/com/sevtinge/hyperceiler/libhook/rules/camera/CloudWatermark.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package com.sevtinge.hyperceiler.libhook.rules.camera
2020

2121
import com.sevtinge.hyperceiler.common.log.XposedLog
2222
import com.sevtinge.hyperceiler.libhook.base.BaseHook
23+
import com.sevtinge.hyperceiler.libhook.utils.hookapi.tool.AppsTool.getPackageVersionCode
2324
import io.github.kyuubiran.ezxhelper.core.finder.MethodFinder.`-Static`.methodFinder
2425
import io.github.kyuubiran.ezxhelper.xposed.dsl.HookFactory.`-Static`.createHook
2526
import org.json.JSONObject
@@ -29,11 +30,19 @@ import java.lang.reflect.Modifier
2930

3031
// thank HolyBear
3132
object CloudWatermark : BaseHook() {
33+
34+
val is63Camera by lazy {
35+
getPackageVersionCode(lpparam) >= 630000000
36+
}
37+
3238
override fun useDexKit() = true
3339

3440
override fun initDexKit(): Boolean {
35-
cloudOld
36-
cloudMethod
41+
if (is63Camera) {
42+
cloudMethod
43+
} else {
44+
cloudOld
45+
}
3746
cloudDelete
3847
return true
3948
}

library/libhook/src/main/java/com/sevtinge/hyperceiler/libhook/rules/camera/UnlockLeica.kt

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,32 @@ object UnlockLeica : BaseHook() {
3131
override fun useDexKit() = true
3232

3333
override fun initDexKit(): Boolean {
34-
unlockMethod1
35-
unlockMethod2
34+
if (is60Camera) {
35+
unlockMethod1
36+
} else {
37+
unlockMethod2
38+
}
3639
unlockMethod3
40+
unlockMethod4
3741
return true
3842
}
43+
3944
// 这破玩意写了十几个小时,得出的结论是,跨一个大版本就需要改一下特征点
4045
// 手上只有 5.3 和 6.1 两个版本,其他版本我不保证能解锁
41-
// 目前兼容到 6.2 版本
46+
// 目前兼容到 6.4 版本
4247
// 累了,先这样吧
4348
// 后面如果能优化的话再说
44-
// 2025.5.1 ~ 2025.9.17
45-
val isNewCamera by lazy {
49+
// 2025.5.1 ~ 2026.3.30
50+
val is60Camera by lazy {
4651
getPackageVersionCode(lpparam) >= 600000000
4752
}
53+
val is63Camera by lazy {
54+
getPackageVersionCode(lpparam) >= 630000000
55+
}
56+
val is64Camera by lazy {
57+
// 主包表示无法理解米米的行为,6.4 相机的内容和 6.2 一致,除了 CloudWatermark 这个云控内容
58+
getPackageVersionCode(lpparam) >= 640000000
59+
}
4860

4961
private val unlockMethod1 by lazy<Method> {
5062
requiredMember("uM1") {
@@ -55,7 +67,13 @@ object UnlockLeica : BaseHook() {
5567
declaredClass {
5668
usingEqStrings("pref_qc_camera_sharpness_key", "pref_tint_color")
5769
}
58-
addInvoke("Landroid/app/Application;->getColor(I)I")
70+
71+
if (is63Camera && !is64Camera) {
72+
// 相机 6.3.005670.0
73+
addInvoke("Landroid/content/Context;->getColor(I)I")
74+
} else {
75+
addInvoke("Landroid/app/Application;->getColor(I)I")
76+
}
5977

6078
modifiers = Modifier.STATIC or Modifier.PUBLIC
6179
returnType = "int"
@@ -92,7 +110,7 @@ object UnlockLeica : BaseHook() {
92110

93111
private val unlockMethod3 by lazy<Method> {
94112
requiredMember("uM3") {
95-
if (isNewCamera) {
113+
if (is60Camera) {
96114
// 6.x
97115
it.findMethod {
98116
matcher {
@@ -149,7 +167,7 @@ object UnlockLeica : BaseHook() {
149167
}
150168

151169
override fun init() {
152-
if (isNewCamera) {
170+
if (is60Camera) {
153171
unlockMethod1.createHook {
154172
returnConstant(true)
155173
}

0 commit comments

Comments
 (0)