mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-22 10:23:55 +00:00
feat(Viber): Add Hide ads patch (#5826)
This commit is contained in:
@@ -1242,6 +1242,10 @@ public final class app/revanced/patches/twitter/misc/links/SanitizeSharingLinksP
|
|||||||
public static final fun getSanitizeSharingLinksPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getSanitizeSharingLinksPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class app/revanced/patches/viber/ads/HideAdsPatchKt {
|
||||||
|
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
|
}
|
||||||
|
|
||||||
public final class app/revanced/patches/vsco/misc/pro/UnlockProPatchKt {
|
public final class app/revanced/patches/vsco/misc/pro/UnlockProPatchKt {
|
||||||
public static final fun getUnlockProPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
public static final fun getUnlockProPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.viber.ads
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint
|
||||||
|
|
||||||
|
internal val adsFreeFingerprint = fingerprint {
|
||||||
|
returns("I")
|
||||||
|
parameters()
|
||||||
|
custom { method, classDef ->
|
||||||
|
classDef.type.contains("com/viber/voip/feature/viberplus") &&
|
||||||
|
classDef.superclass?.contains("com/viber/voip/core/feature") == true && // Must extend com.viber.voip.core.feature.?
|
||||||
|
classDef.methods.count() == 1
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package app.revanced.patches.viber.ads
|
||||||
|
|
||||||
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
|
import app.revanced.util.returnEarly
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
val hideAdsPatch = bytecodePatch(
|
||||||
|
name = "Hide Ads",
|
||||||
|
description = "Hides ad banners between chats.",
|
||||||
|
) {
|
||||||
|
compatibleWith("com.viber.voip")
|
||||||
|
|
||||||
|
execute {
|
||||||
|
// Return 1 (true) indicating ads should be disabled.
|
||||||
|
adsFreeFingerprint.method.returnEarly(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user