mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-05-31 05:50:25 +02:00
feat(Threads): Hide Ads (#5064)
This commit is contained in:
parent
0b9001613d
commit
3c4cecb966
@ -296,6 +296,10 @@ public final class app/revanced/patches/messenger/navbar/RemoveMetaAITabPatchKt
|
||||
public static final fun getRemoveMetaAITabPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/meta/ads/HideAdsPatchKt {
|
||||
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/mifitness/misc/locale/ForceEnglishLocalePatchKt {
|
||||
public static final fun getForceEnglishLocalePatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
@ -1,23 +1,9 @@
|
||||
package app.revanced.patches.instagram.ads
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
|
||||
@Deprecated("Patch was moved to different package: app.revanced.patches.meta.ads.hideAdsPatch")
|
||||
@Suppress("unused")
|
||||
val hideAdsPatch = bytecodePatch(
|
||||
name = "Hide ads",
|
||||
description = "Hides ads in stories, discover, profile, etc. " +
|
||||
"An ad can still appear once when refreshing the home feed.",
|
||||
) {
|
||||
compatibleWith("com.instagram.android")
|
||||
|
||||
execute {
|
||||
adInjectorFingerprint.method.addInstructions(
|
||||
0,
|
||||
"""
|
||||
const/4 v0, 0x0
|
||||
return v0
|
||||
""",
|
||||
)
|
||||
}
|
||||
val hideAdsPatch = bytecodePatch {
|
||||
dependsOn(app.revanced.patches.meta.ads.hideAdsPatch)
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
package app.revanced.patches.instagram.ads
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
internal val adInjectorFingerprint = fingerprint {
|
||||
accessFlags(AccessFlags.PRIVATE)
|
||||
returns("Z")
|
||||
parameters("L", "L")
|
||||
strings(
|
||||
"SponsoredContentController.insertItem",
|
||||
)
|
||||
}
|
||||
package app.revanced.patches.meta.ads
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
internal val adInjectorFingerprint = fingerprint {
|
||||
accessFlags(AccessFlags.PRIVATE)
|
||||
returns("Z")
|
||||
parameters("L", "L")
|
||||
strings(
|
||||
"SponsoredContentController.insertItem",
|
||||
)
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package app.revanced.patches.meta.ads
|
||||
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
@Suppress("unused")
|
||||
val hideAdsPatch = bytecodePatch(
|
||||
name = "Hide ads",
|
||||
) {
|
||||
/**
|
||||
* Patch is identical for both Instagram and Threads app.
|
||||
*/
|
||||
compatibleWith(
|
||||
"com.instagram.android",
|
||||
"com.instagram.barcelona",
|
||||
)
|
||||
|
||||
execute {
|
||||
adInjectorFingerprint.method.returnEarly(false)
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user