mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-20 01:23:57 +00:00
refactor(photomath): EnableBookpointPatch
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
package app.revanced.patches.photomath.misc.unlock.bookpoint
|
||||
|
||||
import app.revanced.patcher.extensions.replaceInstructions
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patcher.patch.creatingBytecodePatch
|
||||
|
||||
val enableBookpointPatch = bytecodePatch(
|
||||
@Suppress("unused")
|
||||
val `Enable bookpoint` by creatingBytecodePatch(
|
||||
description = "Enables textbook access",
|
||||
) {
|
||||
|
||||
apply {
|
||||
isBookpointEnabledFingerprint.method.replaceInstructions(
|
||||
isBookpointEnabledMethod.replaceInstructions(
|
||||
0,
|
||||
"""
|
||||
const/4 v0, 0x1
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
package app.revanced.patches.photomath.misc.unlock.bookpoint
|
||||
|
||||
import app.revanced.patcher.BytecodePatchContextMethodMatching.gettingFirstMutableMethodDeclaratively
|
||||
import app.revanced.patcher.accessFlags
|
||||
import app.revanced.patcher.instructions
|
||||
import app.revanced.patcher.invoke
|
||||
import app.revanced.patcher.parameterTypes
|
||||
import app.revanced.patcher.patch.BytecodePatchContext
|
||||
import app.revanced.patcher.returnType
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import app.revanced.patcher.fingerprint
|
||||
|
||||
internal val isBookpointEnabledFingerprint = fingerprint {
|
||||
internal val BytecodePatchContext.isBookpointEnabledMethod by gettingFirstMutableMethodDeclaratively {
|
||||
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
|
||||
returns("Z")
|
||||
parameters()
|
||||
strings(
|
||||
"NoGeoData",
|
||||
"NoCountryInGeo",
|
||||
"RemoteConfig",
|
||||
"GeoRCMismatch"
|
||||
returnType("Z")
|
||||
parameterTypes()
|
||||
instructions(
|
||||
"NoGeoData"(),
|
||||
"NoCountryInGeo"(),
|
||||
"RemoteConfig"(),
|
||||
"GeoRCMismatch"()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user