mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-21 18:03:56 +00:00
refactor(photomath): UnlockPlusPatch
This commit is contained in:
@@ -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;")
|
||||
}
|
||||
}
|
||||
returnType("Z")
|
||||
string("genius")
|
||||
definingClass("/User;"::endsWith)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user