From 4fb3456e93ff7ec19030de8870e1cb9c1319faef Mon Sep 17 00:00:00 2001 From: Ashley <73482956+ascopes@users.noreply.github.com> Date: Fri, 31 May 2024 00:47:02 +0100 Subject: [PATCH] fix(Reddit - Hide ads): Constrain to last working version 2024.17.0 (#3192) Co-authored-by: oSumAtrIX --- .../revanced/patches/reddit/ad/banner/HideBannerPatch.kt | 3 +++ .../app/revanced/patches/reddit/ad/general/HideAdsPatch.kt | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patches/reddit/ad/banner/HideBannerPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/ad/banner/HideBannerPatch.kt index c5121696..31180319 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/ad/banner/HideBannerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/ad/banner/HideBannerPatch.kt @@ -4,6 +4,9 @@ import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.Patch +// Note that for now, this patch and anything using it will only work on +// Reddit 2024.17.0 or older. Newer versions will crash during patching. +// See https://github.com/ReVanced/revanced-patches/issues/3099 @Patch(description = "Hides banner ads from comments on subreddits.") object HideBannerPatch : ResourcePatch() { private const val RESOURCE_FILE_PATH = "res/layout/merge_listheader_link_detail.xml" diff --git a/src/main/kotlin/app/revanced/patches/reddit/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/ad/general/HideAdsPatch.kt index 02465c90..8aa188e9 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/ad/general/HideAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/ad/general/HideAdsPatch.kt @@ -20,7 +20,12 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference @Patch( name = "Hide ads", dependencies = [HideBannerPatch::class, HideCommentAdsPatch::class], - compatiblePackages = [CompatiblePackage("com.reddit.frontpage")], + // Note that for now, this patch and anything using it will only work on + // Reddit 2024.17.0 or older. Newer versions will crash during patching. + // See https://github.com/ReVanced/revanced-patches/issues/3099 + // and https://github.com/iBotPeaches/Apktool/issues/3534. + // This constraint is necessary due to dependency on HideBannerPatch. + compatiblePackages = [CompatiblePackage("com.reddit.frontpage", ["2024.17.0"])], requiresIntegrations = true, ) @Suppress("unused")