mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-04-30 14:44:33 +02:00
fix(Sync): Fix patches by not throwing unnecessarily
This commit is contained in:
parent
0c75929a83
commit
2ee13160d5
@ -10,6 +10,6 @@ val disablePiracyDetectionPatch = bytecodePatch(
|
|||||||
execute {
|
execute {
|
||||||
// Do not throw an error if the fingerprint is not resolved.
|
// Do not throw an error if the fingerprint is not resolved.
|
||||||
// This is fine because new versions of the target app do not need this patch.
|
// This is fine because new versions of the target app do not need this patch.
|
||||||
piracyDetectionFingerprint.method.addInstruction(0, "return-void")
|
piracyDetectionFingerprint.methodOrNull?.addInstruction(0, "return-void")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package app.revanced.patches.reddit.customclients.sync.detection.piracy
|
package app.revanced.patches.reddit.customclients.sync.detection.piracy
|
||||||
|
|
||||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.instructions
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
|
||||||
import com.android.tools.smali.dexlib2.AccessFlags
|
|
||||||
import app.revanced.patcher.fingerprint
|
import app.revanced.patcher.fingerprint
|
||||||
|
import app.revanced.util.getReference
|
||||||
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
|
import com.android.tools.smali.dexlib2.iface.reference.Reference
|
||||||
|
|
||||||
internal val piracyDetectionFingerprint = fingerprint {
|
internal val piracyDetectionFingerprint = fingerprint {
|
||||||
accessFlags(AccessFlags.PRIVATE, AccessFlags.FINAL)
|
accessFlags(AccessFlags.PRIVATE, AccessFlags.FINAL)
|
||||||
@ -16,12 +18,9 @@ internal val piracyDetectionFingerprint = fingerprint {
|
|||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
)
|
)
|
||||||
custom { method, _ ->
|
custom { method, _ ->
|
||||||
method.implementation?.instructions?.any {
|
method.implementation ?: return@custom false
|
||||||
if (it.opcode != Opcode.NEW_INSTANCE) return@any false
|
method.instructions.any {
|
||||||
|
it.getReference<Reference>()?.toString() == "Lcom/github/javiersantos/piracychecker/PiracyChecker;"
|
||||||
val reference = (it as ReferenceInstruction).reference
|
}
|
||||||
|
|
||||||
reference.toString() == "Lcom/github/javiersantos/piracychecker/PiracyChecker;"
|
|
||||||
} == true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user