File tree Expand file tree Collapse file tree 7 files changed +63
-9
lines changed
src/main/kotlin/app/revanced/patches/photomath/misc Expand file tree Collapse file tree 7 files changed +63
-9
lines changed Original file line number Diff line number Diff line change @@ -418,8 +418,14 @@ public final class app/revanced/patches/photomath/detection/signature/SignatureD
418418 public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
419419}
420420
421- public final class app/revanced/patches/photomath/misc/unlockplus/UnlockPlusPatch : app/revanced/patcher/patch/BytecodePatch {
422- public static final field INSTANCE Lapp/revanced/patches/photomath/misc/unlockplus/UnlockPlusPatch;
421+ public final class app/revanced/patches/photomath/misc/annoyances/HideUpdatePopupPatch : app/revanced/patcher/patch/BytecodePatch {
422+ public static final field INSTANCE Lapp/revanced/patches/photomath/misc/annoyances/HideUpdatePopupPatch;
423+ public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
424+ public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
425+ }
426+
427+ public final class app/revanced/patches/photomath/misc/unlock/plus/UnlockPlusPatch : app/revanced/patcher/patch/BytecodePatch {
428+ public static final field INSTANCE Lapp/revanced/patches/photomath/misc/unlock/plus/UnlockPlusPatch;
423429 public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
424430 public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
425431}
Original file line number Diff line number Diff line change 1+ package app.revanced.patches.photomath.misc.annoyances
2+
3+ import app.revanced.patcher.data.BytecodeContext
4+ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
5+ import app.revanced.patcher.patch.BytecodePatch
6+ import app.revanced.patcher.patch.annotation.CompatiblePackage
7+ import app.revanced.patcher.patch.annotation.Patch
8+ import app.revanced.patches.photomath.detection.signature.SignatureDetectionPatch
9+ import app.revanced.patches.photomath.misc.annoyances.fingerprints.HideUpdatePopupFingerprint
10+ import app.revanced.util.exception
11+
12+ @Patch(
13+ name = " Hide update popup" ,
14+ description = " Prevents the update popup from showing up." ,
15+ dependencies = [SignatureDetectionPatch ::class ],
16+ compatiblePackages = [CompatiblePackage (" com.microblink.photomath" , [" 8.32.0" ])]
17+ )
18+ @Suppress(" unused" )
19+ object HideUpdatePopupPatch : BytecodePatch(
20+ setOf(HideUpdatePopupFingerprint )
21+ ) {
22+ override fun execute (context : BytecodeContext ) = HideUpdatePopupFingerprint .result?.mutableMethod?.addInstructions(
23+ 2 , // Insert after the null check.
24+ " return-void"
25+ ) ? : throw HideUpdatePopupFingerprint .exception
26+ }
Original file line number Diff line number Diff line change 1+ package app.revanced.patches.photomath.misc.annoyances.fingerprints
2+
3+ import app.revanced.patcher.extensions.or
4+ import app.revanced.patcher.fingerprint.MethodFingerprint
5+ import com.android.tools.smali.dexlib2.AccessFlags
6+ import com.android.tools.smali.dexlib2.Opcode
7+
8+ internal object HideUpdatePopupFingerprint : MethodFingerprint(
9+ customFingerprint = { _, classDef ->
10+ // The popup is shown only in the main activity
11+ classDef.type == " Lcom/microblink/photomath/main/activity/MainActivity;"
12+ },
13+ opcodes = listOf(
14+ Opcode .CONST_HIGH16 ,
15+ Opcode .INVOKE_VIRTUAL , // ViewPropertyAnimator .alpha(1.0f)
16+ Opcode .MOVE_RESULT_OBJECT ,
17+ Opcode .CONST_WIDE_16 ,
18+ Opcode .INVOKE_VIRTUAL , // ViewPropertyAnimator .setDuration(1000L)
19+ ),
20+ accessFlags = AccessFlags .FINAL or AccessFlags .PUBLIC ,
21+ returnType = " V" ,
22+ )
Original file line number Diff line number Diff line change 1- package app.revanced.patches.photomath.misc.bookpoint
1+ package app.revanced.patches.photomath.misc.unlock. bookpoint
22
33import app.revanced.util.exception
44import app.revanced.patcher.data.BytecodeContext
55import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
66import app.revanced.patcher.patch.BytecodePatch
77import app.revanced.patcher.patch.annotation.Patch
8- import app.revanced.patches.photomath.misc.bookpoint.fingerprints.IsBookpointEnabledFingerprint
8+ import app.revanced.patches.photomath.misc.unlock. bookpoint.fingerprints.IsBookpointEnabledFingerprint
99
1010@Patch(description = " Enables textbook access" )
1111internal object EnableBookpointPatch : BytecodePatch(
Original file line number Diff line number Diff line change 1- package app.revanced.patches.photomath.misc.bookpoint.fingerprints
1+ package app.revanced.patches.photomath.misc.unlock. bookpoint.fingerprints
22
33import app.revanced.patcher.extensions.or
44import app.revanced.patcher.fingerprint.MethodFingerprint
Original file line number Diff line number Diff line change 1- package app.revanced.patches.photomath.misc.unlockplus
1+ package app.revanced.patches.photomath.misc.unlock.plus
22
33import app.revanced.util.exception
44import app.revanced.patcher.data.BytecodeContext
@@ -7,8 +7,8 @@ import app.revanced.patcher.patch.BytecodePatch
77import app.revanced.patcher.patch.annotation.CompatiblePackage
88import app.revanced.patcher.patch.annotation.Patch
99import app.revanced.patches.photomath.detection.signature.SignatureDetectionPatch
10- import app.revanced.patches.photomath.misc.bookpoint.EnableBookpointPatch
11- import app.revanced.patches.photomath.misc.unlockplus .fingerprints.IsPlusUnlockedFingerprint
10+ import app.revanced.patches.photomath.misc.unlock. bookpoint.EnableBookpointPatch
11+ import app.revanced.patches.photomath.misc.unlock.plus .fingerprints.IsPlusUnlockedFingerprint
1212
1313@Patch(
1414 name = " Unlock plus" ,
Original file line number Diff line number Diff line change 1- package app.revanced.patches.photomath.misc.unlockplus .fingerprints
1+ package app.revanced.patches.photomath.misc.unlock.plus .fingerprints
22
33import app.revanced.patcher.extensions.or
44import app.revanced.patcher.fingerprint.MethodFingerprint
You can’t perform that action at this time.
0 commit comments