mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-04 18:52:52 +01:00
fix(Sync for Reddit - Disable ads): fix compatibility with latest version
This commit is contained in:
parent
6c013143a5
commit
1456577f11
@ -1,11 +1,10 @@
|
|||||||
package app.revanced.patches.syncforreddit.detection.piracy.fingerprints
|
package app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||||
import org.jf.dexlib2.iface.reference.TypeReference
|
|
||||||
|
|
||||||
object PiracyDetectionFingerprint : MethodFingerprint(
|
object PiracyDetectionFingerprint : MethodFingerprint(
|
||||||
returnType = "V",
|
returnType = "V",
|
||||||
|
@ -1,19 +1,18 @@
|
|||||||
package app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.patch
|
package app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.patch
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patches.syncforreddit.detection.piracy.fingerprints.PiracyDetectionFingerprint
|
import app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.fingerprints.PiracyDetectionFingerprint
|
||||||
|
|
||||||
@Description("Disables detection of modified versions.")
|
@Description("Disables detection of modified versions.")
|
||||||
@Version("0.0.1")
|
|
||||||
class DisablePiracyDetectionPatch : BytecodePatch(listOf(PiracyDetectionFingerprint)) {
|
class DisablePiracyDetectionPatch : BytecodePatch(listOf(PiracyDetectionFingerprint)) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
// Do not return an error if the fingerprint is not resolved.
|
||||||
|
// This is fine because new versions of the target app do not need this patch.
|
||||||
PiracyDetectionFingerprint.result?.mutableMethod?.apply {
|
PiracyDetectionFingerprint.result?.mutableMethod?.apply {
|
||||||
addInstruction(
|
addInstruction(
|
||||||
0,
|
0,
|
||||||
@ -21,7 +20,7 @@ class DisablePiracyDetectionPatch : BytecodePatch(listOf(PiracyDetectionFingerpr
|
|||||||
return-void
|
return-void
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
} ?: return PiracyDetectionFingerprint.toErrorResult()
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user