From ef644e48018a90429108779b7419299c4f43e4ff Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Tue, 3 Oct 2023 01:52:53 +0200 Subject: [PATCH] fix(Sync for Reddit): Do not throw an error when not necessary --- .../detection/piracy/DisablePiracyDetectionPatch.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/reddit/customclients/syncforreddit/detection/piracy/DisablePiracyDetectionPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/customclients/syncforreddit/detection/piracy/DisablePiracyDetectionPatch.kt index 8ebf643937..e075ee69c6 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/customclients/syncforreddit/detection/piracy/DisablePiracyDetectionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/customclients/syncforreddit/detection/piracy/DisablePiracyDetectionPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy -import app.revanced.extensions.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.patch.BytecodePatch @@ -10,7 +9,7 @@ import app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy. @Patch(description = "Disables detection of modified versions.",) object DisablePiracyDetectionPatch : BytecodePatch(setOf(PiracyDetectionFingerprint)) { override fun execute(context: BytecodeContext) { - // Do not return 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. PiracyDetectionFingerprint.result?.mutableMethod?.apply { addInstruction( @@ -19,6 +18,6 @@ object DisablePiracyDetectionPatch : BytecodePatch(setOf(PiracyDetectionFingerpr return-void """ ) - } ?: throw PiracyDetectionFingerprint.exception + } } } \ No newline at end of file