feat(Letterboxd): Add Hide ads patch (#6309)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
Swakshan
2025-11-24 17:26:55 +05:30
committed by GitHub
parent fff29544b9
commit 0af0ee92c4
3 changed files with 53 additions and 0 deletions

View File

@@ -328,6 +328,10 @@ public final class app/revanced/patches/irplus/ad/RemoveAdsPatchKt {
public static final fun getRemoveAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/letterboxd/ads/HideAdsPatchKt {
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/lightroom/misc/login/DisableMandatoryLoginPatchKt {
public static final fun getDisableMandatoryLoginPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}

View File

@@ -0,0 +1,29 @@
package app.revanced.patches.letterboxd.ads
import app.revanced.patcher.fingerprint
internal const val admobHelperClassName = "Lcom/letterboxd/letterboxd/helpers/AdmobHelper;"
internal val admobHelperSetShowAdsFingerprint = fingerprint {
custom { method, classDef ->
method.name == "setShowAds" && classDef.type == admobHelperClassName
}
}
internal val admobHelperShouldShowAdsFingerprint = fingerprint {
custom { method, classDef ->
method.name == "shouldShowAds" && classDef.type == admobHelperClassName
}
}
internal val filmFragmentShowAdsFingerprint = fingerprint {
custom { method, classDef ->
method.name == "showAds" && classDef.type.endsWith("/FilmFragment;")
}
}
internal val memberExtensionShowAdsFingerprint = fingerprint {
custom { method, classDef ->
method.name == "showAds" && classDef.type.endsWith("/AMemberExtensionKt;")
}
}

View File

@@ -0,0 +1,20 @@
package app.revanced.patches.letterboxd.ads
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.util.returnEarly
@Suppress("unused")
val hideAdsPatch = bytecodePatch(
name = "Hide ads",
) {
compatibleWith("com.letterboxd.letterboxd")
execute {
admobHelperSetShowAdsFingerprint.method.addInstruction(0, "const p1, 0x0")
listOf(admobHelperShouldShowAdsFingerprint, filmFragmentShowAdsFingerprint, memberExtensionShowAdsFingerprint).forEach {
it.method.returnEarly(false)
}
}
}