From fb02b481e2be8c2bc4441dc5b3dc6a9df3a2a379 Mon Sep 17 00:00:00 2001 From: FullerBread2032 <56510855+FullerBread2032@users.noreply.github.com> Date: Mon, 13 May 2024 01:45:13 +0200 Subject: [PATCH] feat(Photomath): Support version `8.37.0` (#3109) --- .../detection/deviceid/SpoofDeviceIdPatch.kt | 2 +- .../fingerprints/GetDeviceIdFingerprint.kt | 14 +++++++++++++- .../fingerprints/CheckSignatureFingerprint.kt | 4 +--- .../misc/annoyances/HideUpdatePopupPatch.kt | 2 +- .../photomath/misc/unlock/plus/UnlockPlusPatch.kt | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/photomath/detection/deviceid/SpoofDeviceIdPatch.kt b/src/main/kotlin/app/revanced/patches/photomath/detection/deviceid/SpoofDeviceIdPatch.kt index d1c97cdec..0ea645e52 100644 --- a/src/main/kotlin/app/revanced/patches/photomath/detection/deviceid/SpoofDeviceIdPatch.kt +++ b/src/main/kotlin/app/revanced/patches/photomath/detection/deviceid/SpoofDeviceIdPatch.kt @@ -14,7 +14,7 @@ import kotlin.random.Random name = "Spoof device ID", description = "Spoofs device ID to mitigate manual bans by developers.", dependencies = [SignatureDetectionPatch::class], - compatiblePackages = [CompatiblePackage("com.microblink.photomath", ["8.32.0"])] + compatiblePackages = [CompatiblePackage("com.microblink.photomath", ["8.37.0"])] ) @Suppress("unused") object SpoofDeviceIdPatch : BytecodePatch( diff --git a/src/main/kotlin/app/revanced/patches/photomath/detection/deviceid/fingerprints/GetDeviceIdFingerprint.kt b/src/main/kotlin/app/revanced/patches/photomath/detection/deviceid/fingerprints/GetDeviceIdFingerprint.kt index ef3e29f68..fe01d7b59 100644 --- a/src/main/kotlin/app/revanced/patches/photomath/detection/deviceid/fingerprints/GetDeviceIdFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/photomath/detection/deviceid/fingerprints/GetDeviceIdFingerprint.kt @@ -1,9 +1,21 @@ package app.revanced.patches.photomath.detection.deviceid.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint +import com.android.tools.smali.dexlib2.Opcode internal object GetDeviceIdFingerprint : MethodFingerprint( returnType = "Ljava/lang/String;", - strings = listOf("androidId", "android_id"), + opcodes = listOf( + Opcode.SGET_OBJECT, + Opcode.IGET_OBJECT, + Opcode.INVOKE_STATIC, + Opcode.MOVE_RESULT_OBJECT, + Opcode.IF_NEZ, + Opcode.INVOKE_STATIC, + Opcode.MOVE_RESULT_OBJECT, + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT_OBJECT, + Opcode.INVOKE_VIRTUAL, + ), parameters = listOf() ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/photomath/detection/signature/fingerprints/CheckSignatureFingerprint.kt b/src/main/kotlin/app/revanced/patches/photomath/detection/signature/fingerprints/CheckSignatureFingerprint.kt index 97c42de2b..cd784ab20 100644 --- a/src/main/kotlin/app/revanced/patches/photomath/detection/signature/fingerprints/CheckSignatureFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/photomath/detection/signature/fingerprints/CheckSignatureFingerprint.kt @@ -5,11 +5,9 @@ import com.android.tools.smali.dexlib2.Opcode internal object CheckSignatureFingerprint : MethodFingerprint( strings = listOf( - "packageInfo.signatures", - "currentSignature" + "signatures", ), opcodes = listOf( - Opcode.CONST_STRING, Opcode.CONST_STRING, Opcode.INVOKE_STATIC, Opcode.INVOKE_STATIC, diff --git a/src/main/kotlin/app/revanced/patches/photomath/misc/annoyances/HideUpdatePopupPatch.kt b/src/main/kotlin/app/revanced/patches/photomath/misc/annoyances/HideUpdatePopupPatch.kt index 147555907..0c6fb6689 100644 --- a/src/main/kotlin/app/revanced/patches/photomath/misc/annoyances/HideUpdatePopupPatch.kt +++ b/src/main/kotlin/app/revanced/patches/photomath/misc/annoyances/HideUpdatePopupPatch.kt @@ -13,7 +13,7 @@ import app.revanced.util.exception name = "Hide update popup", description = "Prevents the update popup from showing up.", dependencies = [SignatureDetectionPatch::class], - compatiblePackages = [CompatiblePackage("com.microblink.photomath", ["8.32.0"])] + compatiblePackages = [CompatiblePackage("com.microblink.photomath", ["8.37.0"])] ) @Suppress("unused") object HideUpdatePopupPatch : BytecodePatch( diff --git a/src/main/kotlin/app/revanced/patches/photomath/misc/unlock/plus/UnlockPlusPatch.kt b/src/main/kotlin/app/revanced/patches/photomath/misc/unlock/plus/UnlockPlusPatch.kt index 8895696cd..3885c5c23 100644 --- a/src/main/kotlin/app/revanced/patches/photomath/misc/unlock/plus/UnlockPlusPatch.kt +++ b/src/main/kotlin/app/revanced/patches/photomath/misc/unlock/plus/UnlockPlusPatch.kt @@ -13,7 +13,7 @@ import app.revanced.patches.photomath.misc.unlock.plus.fingerprints.IsPlusUnlock @Patch( name = "Unlock plus", dependencies = [SignatureDetectionPatch::class, EnableBookpointPatch::class], - compatiblePackages = [CompatiblePackage("com.microblink.photomath", ["8.32.0"])] + compatiblePackages = [CompatiblePackage("com.microblink.photomath", ["8.37.0"])] ) @Suppress("unused") object UnlockPlusPatch : BytecodePatch(