mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-28 18:05:49 +01:00
feat(Willhaben): Add Hide ads
patch (#3740)
This commit is contained in:
parent
8f3acbe8c2
commit
1fe3a523e9
@ -1520,6 +1520,12 @@ public final class app/revanced/patches/warnwetter/misc/promocode/PromoCodeUnloc
|
||||
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/willhaben/ads/HideAdsPatch : app/revanced/patcher/patch/BytecodePatch {
|
||||
public static final field INSTANCE Lapp/revanced/patches/willhaben/ads/HideAdsPatch;
|
||||
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/windyapp/misc/unlockpro/UnlockProPatch : app/revanced/patcher/patch/BytecodePatch {
|
||||
public static final field INSTANCE Lapp/revanced/patches/windyapp/misc/unlockpro/UnlockProPatch;
|
||||
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||
|
@ -0,0 +1,28 @@
|
||||
package app.revanced.patches.willhaben.ads
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.willhaben.ads.fingerprints.AdResolverFingerprint
|
||||
import app.revanced.patches.willhaben.ads.fingerprints.WHAdViewInjectorFingerprint
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
@Patch(
|
||||
name = "Hide ads",
|
||||
description = "Hides all in-app ads.",
|
||||
compatiblePackages = [CompatiblePackage("at.willhaben")]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object HideAdsPatch : BytecodePatch(
|
||||
fingerprints = setOf(
|
||||
AdResolverFingerprint,
|
||||
WHAdViewInjectorFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
arrayOf(AdResolverFingerprint, WHAdViewInjectorFingerprint).forEach {
|
||||
it.returnEarly()
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package app.revanced.patches.willhaben.ads.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
internal object AdResolverFingerprint : MethodFingerprint(
|
||||
"L",
|
||||
parameters = listOf("L", "L"),
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
strings = listOf(
|
||||
"Google Ad is invalid ",
|
||||
"Google Native Ad is invalid ",
|
||||
"Criteo Ad is invalid ",
|
||||
"Amazon Ad is invalid "
|
||||
)
|
||||
)
|
@ -0,0 +1,15 @@
|
||||
package app.revanced.patches.willhaben.ads.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
internal object WHAdViewInjectorFingerprint : MethodFingerprint(
|
||||
"V",
|
||||
parameters = listOf("L", "L", "L", "Z"),
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
strings = listOf("successfulAdView"),
|
||||
customFingerprint = { _, classDef ->
|
||||
classDef.type == "Lat/willhaben/advertising/WHAdView;"
|
||||
}
|
||||
)
|
Loading…
Reference in New Issue
Block a user