2023-09-20 05:33:02 +02:00
|
|
|
package app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy
|
2023-05-07 18:15:30 +02:00
|
|
|
|
|
|
|
import app.revanced.patcher.data.BytecodeContext
|
2023-06-07 03:46:13 +02:00
|
|
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
2023-05-07 18:15:30 +02:00
|
|
|
import app.revanced.patcher.patch.BytecodePatch
|
2023-09-20 05:33:02 +02:00
|
|
|
import app.revanced.patcher.patch.annotation.Patch
|
2023-07-18 00:36:37 +02:00
|
|
|
import app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.fingerprints.PiracyDetectionFingerprint
|
2023-05-07 18:15:30 +02:00
|
|
|
|
2024-03-02 08:27:05 +01:00
|
|
|
@Patch(description = "Disables detection of modified versions.")
|
2023-09-20 05:33:02 +02:00
|
|
|
object DisablePiracyDetectionPatch : BytecodePatch(setOf(PiracyDetectionFingerprint)) {
|
2023-08-27 21:40:49 +02:00
|
|
|
override fun execute(context: BytecodeContext) {
|
2023-10-03 01:52:53 +02:00
|
|
|
// Do not throw an error if the fingerprint is not resolved.
|
2023-07-18 00:36:37 +02:00
|
|
|
// This is fine because new versions of the target app do not need this patch.
|
2023-05-07 18:15:30 +02:00
|
|
|
PiracyDetectionFingerprint.result?.mutableMethod?.apply {
|
2024-03-02 08:27:05 +01:00
|
|
|
addInstruction(0, "return-void")
|
2023-10-03 01:52:53 +02:00
|
|
|
}
|
2023-05-07 18:15:30 +02:00
|
|
|
}
|
2024-03-02 08:27:05 +01:00
|
|
|
}
|