diff --git a/patches/src/main/kotlin/app/revanced/patches/photomath/misc/unlock/plus/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/photomath/misc/unlock/plus/Fingerprints.kt index a9e9e8044..9ffd32b90 100644 --- a/patches/src/main/kotlin/app/revanced/patches/photomath/misc/unlock/plus/Fingerprints.kt +++ b/patches/src/main/kotlin/app/revanced/patches/photomath/misc/unlock/plus/Fingerprints.kt @@ -1,13 +1,16 @@ package app.revanced.patches.photomath.misc.unlock.plus +import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively +import app.revanced.patcher.accessFlags +import app.revanced.patcher.definingClass +import app.revanced.patcher.patch.BytecodePatchContext +import app.revanced.patcher.returnType +import app.revanced.patcher.string import com.android.tools.smali.dexlib2.AccessFlags -import app.revanced.patcher.fingerprint -internal val isPlusUnlockedFingerprint = fingerprint { +internal val BytecodePatchContext.isPlusUnlockedMethod by gettingFirstMutableMethodDeclaratively { accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL) - returns("Z") - strings("genius") - custom { _, classDef -> - classDef.endsWith("/User;") - } -} \ No newline at end of file + returnType("Z") + string("genius") + definingClass("/User;"::endsWith) +} diff --git a/patches/src/main/kotlin/app/revanced/patches/photomath/misc/unlock/plus/UnlockPlusPatch.kt b/patches/src/main/kotlin/app/revanced/patches/photomath/misc/unlock/plus/UnlockPlusPatch.kt index 132a1eacb..3f0f8b159 100644 --- a/patches/src/main/kotlin/app/revanced/patches/photomath/misc/unlock/plus/UnlockPlusPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/photomath/misc/unlock/plus/UnlockPlusPatch.kt @@ -1,20 +1,18 @@ package app.revanced.patches.photomath.misc.unlock.plus import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patches.photomath.detection.signature.signatureDetectionPatch -import app.revanced.patches.photomath.misc.unlock.bookpoint.enableBookpointPatch +import app.revanced.patcher.patch.creatingBytecodePatch +import app.revanced.patches.photomath.detection.signature.`Signature detection` +import app.revanced.patches.photomath.misc.unlock.bookpoint.`Enable bookpoint` @Suppress("unused") -val unlockPlusPatch = bytecodePatch( - name = "Unlock plus", -) { - dependsOn(signatureDetectionPatch, enableBookpointPatch) +val `Unlock plus` by creatingBytecodePatch { + dependsOn(`Signature detection`, `Enable bookpoint`) compatibleWith("com.microblink.photomath") apply { - isPlusUnlockedFingerprint.method.addInstructions( + isPlusUnlockedMethod.addInstructions( 0, """ const/4 v0, 0x1