From 8ec405a35903c38da74953d10c975a15ca6e7d60 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sat, 13 Sep 2025 15:31:54 +0000 Subject: [PATCH 1/5] chore: Release v5.36.0-dev.1 [skip ci] # [5.36.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.35.0...v5.36.0-dev.1) (2025-09-13) ### Bug Fixes * **Duolingo - Disable ads:** Support latest app target ([#5782](https://github.com/ReVanced/revanced-patches/issues/5782)) ([88b47ef](https://github.com/ReVanced/revanced-patches/commit/88b47ef414cd073ec3800258b32aceb6f383a411)) * **YouTube - Hide layout components:** Hide new type of Playable shelf ([8cd8e59](https://github.com/ReVanced/revanced-patches/commit/8cd8e59bbc3a878269276b8ae5f627b044d157f0)) * **YouTube Music:** Resolve playback issues, change recommended app target to `7.29.52` ([#5813](https://github.com/ReVanced/revanced-patches/issues/5813)) ([a53b00d](https://github.com/ReVanced/revanced-patches/commit/a53b00dd514dbe2b3406f3c1013a4f58a7f481c5)) ### Features * **YouTube - SponsorBlock:** Add 'Hook' segment category ([#5783](https://github.com/ReVanced/revanced-patches/issues/5783)) ([9d4aa5c](https://github.com/ReVanced/revanced-patches/commit/9d4aa5cd16a6f9e95cf7c626351b46b86ca80efe)) --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ba994fda..b7d8c8466 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,20 @@ # [5.36.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.35.0...v5.36.0-dev.1) (2025-09-13) +### Bug Fixes + +* **Duolingo - Disable ads:** Support latest app target ([#5782](https://github.com/ReVanced/revanced-patches/issues/5782)) ([88b47ef](https://github.com/ReVanced/revanced-patches/commit/88b47ef414cd073ec3800258b32aceb6f383a411)) +* **YouTube - Hide layout components:** Hide new type of Playable shelf ([8cd8e59](https://github.com/ReVanced/revanced-patches/commit/8cd8e59bbc3a878269276b8ae5f627b044d157f0)) +* **YouTube Music:** Resolve playback issues, change recommended app target to `7.29.52` ([#5813](https://github.com/ReVanced/revanced-patches/issues/5813)) ([a53b00d](https://github.com/ReVanced/revanced-patches/commit/a53b00dd514dbe2b3406f3c1013a4f58a7f481c5)) + + +### Features + +* **YouTube - SponsorBlock:** Add 'Hook' segment category ([#5783](https://github.com/ReVanced/revanced-patches/issues/5783)) ([9d4aa5c](https://github.com/ReVanced/revanced-patches/commit/9d4aa5cd16a6f9e95cf7c626351b46b86ca80efe)) + +# [5.36.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.35.0...v5.36.0-dev.1) (2025-09-13) + + ### Bug Fixes * **Duolingo - Disable ads:** Support latest app target ([#5782](https://github.com/ReVanced/revanced-patches/issues/5782)) ([88b47ef](https://github.com/ReVanced/revanced-patches/commit/88b47ef414cd073ec3800258b32aceb6f383a411)) From c001daba4a861dc500b34e3c9e718cd61dfd2b0f Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 14 Sep 2025 06:56:22 +0000 Subject: [PATCH 2/5] chore: Release v5.36.0 [skip ci] # [5.36.0](https://github.com/ReVanced/revanced-patches/compare/v5.35.0...v5.36.0) (2025-09-14) ### Bug Fixes * **Duolingo - Disable ads:** Support latest app target ([#5782](https://github.com/ReVanced/revanced-patches/issues/5782)) ([88b47ef](https://github.com/ReVanced/revanced-patches/commit/88b47ef414cd073ec3800258b32aceb6f383a411)) * **YouTube - Hide layout components:** Hide new type of Playable shelf ([8cd8e59](https://github.com/ReVanced/revanced-patches/commit/8cd8e59bbc3a878269276b8ae5f627b044d157f0)) * **YouTube Music:** Resolve playback issues, change recommended app target to `7.29.52` ([#5813](https://github.com/ReVanced/revanced-patches/issues/5813)) ([a53b00d](https://github.com/ReVanced/revanced-patches/commit/a53b00dd514dbe2b3406f3c1013a4f58a7f481c5)) ### Features * **YouTube - SponsorBlock:** Add 'Hook' segment category ([#5783](https://github.com/ReVanced/revanced-patches/issues/5783)) ([9d4aa5c](https://github.com/ReVanced/revanced-patches/commit/9d4aa5cd16a6f9e95cf7c626351b46b86ca80efe)) --- CHANGELOG.md | 14 ++++++++++++++ gradle.properties | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7d8c8466..1e7724480 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# [5.36.0](https://github.com/ReVanced/revanced-patches/compare/v5.35.0...v5.36.0) (2025-09-14) + + +### Bug Fixes + +* **Duolingo - Disable ads:** Support latest app target ([#5782](https://github.com/ReVanced/revanced-patches/issues/5782)) ([88b47ef](https://github.com/ReVanced/revanced-patches/commit/88b47ef414cd073ec3800258b32aceb6f383a411)) +* **YouTube - Hide layout components:** Hide new type of Playable shelf ([8cd8e59](https://github.com/ReVanced/revanced-patches/commit/8cd8e59bbc3a878269276b8ae5f627b044d157f0)) +* **YouTube Music:** Resolve playback issues, change recommended app target to `7.29.52` ([#5813](https://github.com/ReVanced/revanced-patches/issues/5813)) ([a53b00d](https://github.com/ReVanced/revanced-patches/commit/a53b00dd514dbe2b3406f3c1013a4f58a7f481c5)) + + +### Features + +* **YouTube - SponsorBlock:** Add 'Hook' segment category ([#5783](https://github.com/ReVanced/revanced-patches/issues/5783)) ([9d4aa5c](https://github.com/ReVanced/revanced-patches/commit/9d4aa5cd16a6f9e95cf7c626351b46b86ca80efe)) + # [5.36.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.35.0...v5.36.0-dev.1) (2025-09-13) diff --git a/gradle.properties b/gradle.properties index 6806f82b4..39ea23752 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M org.gradle.parallel = true android.useAndroidX = true kotlin.code.style = official -version = 5.36.0-dev.1 +version = 5.36.0 From e12359b94f19d5c7ffd7de577970dd488a2a7152 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 14 Sep 2025 15:46:32 +0400 Subject: [PATCH 3/5] chore: Sync translations (#5829) --- .../addresources/values-az-rAZ/strings.xml | 15 ++++++++++----- .../addresources/values-tr-rTR/strings.xml | 4 ++-- .../addresources/values-zh-rTW/strings.xml | 14 +++++++++----- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/patches/src/main/resources/addresources/values-az-rAZ/strings.xml b/patches/src/main/resources/addresources/values-az-rAZ/strings.xml index 180779e53..5a651318d 100644 --- a/patches/src/main/resources/addresources/values-az-rAZ/strings.xml +++ b/patches/src/main/resources/addresources/values-az-rAZ/strings.xml @@ -1074,9 +1074,12 @@ Sizin istifadəçi Id-niz parol kimidir və heç vaxt paylaşmaq olmaz. Həqiqi məzmunu olmayan aralıq. Fasilə, statik kadr və ya təkrarlanan animasiya ola bilər. Məlumat ehtiva edən keçidlər daxil deyil Son kartlar / Zaminlər Zaminlər və ya YouTube bitiş kartları görünəndə. Məlumat daxil olan nəticələr üçün deyil - Önizləmə/Anons/Qısa - Videoda və ya seriyanın digər videolarında nə gözlənildiyini və ya baş verdiyini göstərən, bütün məlumatların başqa yerdə təkrarlandığı bölüm toplusuƏlaqəsiz/Zarafatlar - Videonun əsas məzmununu başa düşmək tələb olunmayan yalnız əlaqəsiz və ya yumor üçün əlavə edilmiş təsiredici səhnələr. Məzmun və ya arxa plan detallarını təqdim edən bölümlər daxil deyil + Giriş / Salamlar + Yaxınlaşan video üçün danışılan kadrlar, salamlama və sağollaşma. Əlavə məzmun əlavə edən bölmələr daxil deyil + Önizləmə / Anons + Videoda və ya seriyanın digər videolarında nə gözlənildiyini və ya baş verdiyini göstərən, bütün məlumatların başqa yerdə təkrarlandığı bölüm toplusu + Əlaqəsiz / Zarafatlar + Videonun əsas məzmunun başa düşmək tələb olunmayan əlaqəsiz səhnələr və ya zarafatlar. Məzmun və ya arxa plan təfərrüatlarını təmin edən bölmələr daxil deyil Musiqi: Musiqi olmayan bölmə Yalnız musiqi videolarında istifadə üçün. Artıq başqa kateqoriyaya aid edilməyən musiqisiz musiqi videoları bölmələri Ötür @@ -1089,10 +1092,11 @@ Sizin istifadəçi Id-niz parol kimidir və heç vaxt paylaşmaq olmaz. Fasiləni ötür Fasiləni ötür Bitişi ötür + Girişi ötür Önizləməni ötür Önizləməni ötür Anonsu ötür - Əlaqəsiz hissəni ötür + Əlaqəsiz olanı ötür Musiqisiz hissəni ötür Bölümü ötür Sponsorlu hissə ötürüldü @@ -1103,10 +1107,11 @@ Sizin istifadəçi Id-niz parol kimidir və heç vaxt paylaşmaq olmaz. Fasilə ötürüldü Fasilə ötürüldü Bitiş ötürüldü + Giriş ötürüldü Önbaxış ötürüldü Önbaxış ötürüldü Anons ötürüldü - Əlaqəsiz hissə ötürüldü + Əlaqəsiz ötürüldü Musiqi olmayan bölmə ötürüldü Göndərilməmiş bölüm ötürüldü Çoxlu bölümlər ötürüldü diff --git a/patches/src/main/resources/addresources/values-tr-rTR/strings.xml b/patches/src/main/resources/addresources/values-tr-rTR/strings.xml index 79c5c8d26..4d116be1a 100644 --- a/patches/src/main/resources/addresources/values-tr-rTR/strings.xml +++ b/patches/src/main/resources/addresources/values-tr-rTR/strings.xml @@ -1078,11 +1078,11 @@ Kullanıcı kimliğiniz bir parola gibidir ve asla paylaşılmamalıdır. Bitiş Ekranı / Jenerik Jenerik veya YouTube bitiş kartlarının göründüğü zaman. Bilgi içeren çıkarımlar için değil Giriş / Selamlama - Gelecek video için anlatımlı fragmanlar, selamlamalar ve vedalar. Ek içerik ekleyen bölümler dahil değildir + Gelecek video için anlatımlı fragmanlar, selamlamalar ve vedalar. Ek içerik ekleyen kısımları içermez Ön İzleme / Özet Videoda veya bir dizinin diğer videolarında neler olduğunu ve nelerin geleceğini gösteren, tüm bilgilerin başka bir yerde tekrarlandığı klip koleksiyonu Konuyla Alakasız / Şakalar - Videonun ana içeriğini anlamak için gerekli olmayan alakasız sahneler veya şakalar. Bağlam veya arka plan detayları sağlayan bölümleri içermez + Videonun ana içeriğini anlamak için gerekli olmayan alakasız sahneler veya şakalar. Bağlam veya arka plan detayları sağlayan kısımları içermez Müzik: Müzik Olmayan Kısım Yalnızca müzik videolarında kullanım içindir. Müzik videolarının başka bir kategorinin kapsamadığı müziksiz bölümleri Atla diff --git a/patches/src/main/resources/addresources/values-zh-rTW/strings.xml b/patches/src/main/resources/addresources/values-zh-rTW/strings.xml index 8affb50f3..960a437de 100644 --- a/patches/src/main/resources/addresources/values-zh-rTW/strings.xml +++ b/patches/src/main/resources/addresources/values-zh-rTW/strings.xml @@ -1075,10 +1075,12 @@ Second \"item\" text" 指影片中沒有實際內容的片段。可能為暫停、靜態畫面或重複動畫。不包含含有資訊的轉場。 片尾資訊卡/鳴謝 鳴謝或 YouTube 片尾資訊卡出現時。不適用於含有資訊的結論。 - 預告/回顧/前情提要 + 開場白 / 問候 + 即將推出的影片的旁白預告片、問候語和告別語。不包含增加額外內容的部分 + 預覽 / 回顧 展示影片或系列影片中即將到來或已發生的內容片段合輯,且所有資訊在其他地方重複出現。 - 填充閒聊/笑話 - 指為了填充時間或增添幽默感而加入的旁支情節,並非理解影片主要內容所必需。不包含提供背景資訊或脈絡的片段。 + 離題 / 笑話 + 離題的場景或笑話,這些內容並非理解影片主要內容所必需的。不包括提供背景或詳細資訊的部分 音樂:非音樂片段 僅適用於音樂影片。音樂影片中沒有音樂,且不屬於其他類別的段落。 跳過 @@ -1091,10 +1093,11 @@ Second \"item\" text" 跳過中場休息 跳過中場休息 跳過片尾 + 跳過掛鉤 跳過預覽 跳過預覽 跳過回顧 - 跳過閒聊 + 跳過離題 跳過非音樂 跳過片段 已跳過贊助商廣告 @@ -1105,10 +1108,11 @@ Second \"item\" text" 已跳過中場休息 已跳過中場休息 已跳過結尾 + 已跳過掛鉤 已跳過預覽 已跳過預覽 已跳過回顧 - 已跳過閒聊 + 已跳過不相關內容 已跳過非音樂部分 跳過了未提交的片段 已跳過多個片段 From 61cadf72cda08c62919d6cebd633f82a95a82ab9 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 14 Sep 2025 15:49:35 +0400 Subject: [PATCH 4/5] refactor(Spoof video streams): Back port code from v22 branch to support patching the latest YT Music. Using any target above 7.49.52 is untested and only recommended for experimental or development purposes. --- patches/api/patches.api | 1 + .../music/misc/spoof/SpoofVideoStreams.kt | 3 +- .../music/playservice/VersionCheckPatch.kt | 3 ++ .../patches/shared/misc/spoof/Fingerprints.kt | 29 ++++++++++++++++--- .../misc/spoof/SpoofVideoStreamsPatch.kt | 3 +- 5 files changed, 33 insertions(+), 6 deletions(-) diff --git a/patches/api/patches.api b/patches/api/patches.api index b222e63bd..7c09b37e4 100644 --- a/patches/api/patches.api +++ b/patches/api/patches.api @@ -404,6 +404,7 @@ public final class app/revanced/patches/music/playservice/VersionCheckPatchKt { public static final fun getVersionCheckPatch ()Lapp/revanced/patcher/patch/ResourcePatch; public static final fun is_7_33_or_greater ()Z public static final fun is_8_11_or_greater ()Z + public static final fun is_8_15_or_greater ()Z } public final class app/revanced/patches/myexpenses/misc/pro/UnlockProPatchKt { diff --git a/patches/src/main/kotlin/app/revanced/patches/music/misc/spoof/SpoofVideoStreams.kt b/patches/src/main/kotlin/app/revanced/patches/music/misc/spoof/SpoofVideoStreams.kt index 10c65dae1..0dd9a4424 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/misc/spoof/SpoofVideoStreams.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/misc/spoof/SpoofVideoStreams.kt @@ -2,6 +2,7 @@ package app.revanced.patches.music.misc.spoof import app.revanced.patches.music.playservice.is_7_33_or_greater import app.revanced.patches.music.playservice.is_8_11_or_greater +import app.revanced.patches.music.playservice.is_8_15_or_greater import app.revanced.patches.music.playservice.versionCheckPatch import app.revanced.patches.shared.misc.spoof.spoofVideoStreamsPatch @@ -16,6 +17,6 @@ val spoofVideoStreamsPatch = spoofVideoStreamsPatch( dependsOn(versionCheckPatch, userAgentClientSpoofPatch) }, fixMediaFetchHotConfigChanges = { true }, - fixMediaFetchHotConfigAlternativeChanges = { is_8_11_or_greater }, + fixMediaFetchHotConfigAlternativeChanges = { is_8_11_or_greater && !is_8_15_or_greater }, fixParsePlaybackResponseFeatureFlag = { is_7_33_or_greater } ) \ No newline at end of file diff --git a/patches/src/main/kotlin/app/revanced/patches/music/playservice/VersionCheckPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/playservice/VersionCheckPatch.kt index 86fbdc132..467498bf2 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/playservice/VersionCheckPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/playservice/VersionCheckPatch.kt @@ -9,6 +9,8 @@ var is_7_33_or_greater = false private set var is_8_11_or_greater = false private set +var is_8_15_or_greater = false + private set val versionCheckPatch = resourcePatch( description = "Uses the Play Store service version to find the major/minor version of the YouTube Music target app.", @@ -21,5 +23,6 @@ val versionCheckPatch = resourcePatch( // All bug fix releases always seem to use the same play store version as the minor version. is_7_33_or_greater = 245199000 <= playStoreServicesVersion is_8_11_or_greater = 251199000 <= playStoreServicesVersion + is_8_15_or_greater = 251530000 <= playStoreServicesVersion } } diff --git a/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/Fingerprints.kt index cbeea3f78..67ba7c80c 100644 --- a/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/Fingerprints.kt +++ b/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/Fingerprints.kt @@ -1,9 +1,12 @@ package app.revanced.patches.shared.misc.spoof import app.revanced.patcher.fingerprint +import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstruction import app.revanced.util.literal import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.iface.reference.MethodReference internal val buildInitPlaybackRequestFingerprint = fingerprint { returns("Lorg/chromium/net/UrlRequest\$Builder;") @@ -35,8 +38,15 @@ internal val buildPlayerRequestURIFingerprint = fingerprint { internal val buildRequestFingerprint = fingerprint { accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC) - returns("Lorg/chromium/net/UrlRequest;") + returns("Lorg/chromium/net/UrlRequest") // UrlRequest; or UrlRequest$Builder; custom { methodDef, _ -> + if (methodDef.indexOfFirstInstruction { + val reference = getReference() + reference?.name == "newUrlRequestBuilder" + } < 0) { + return@custom false + } + // Different targets have slightly different parameters // Earlier targets have parameters: @@ -58,12 +68,22 @@ internal val buildRequestFingerprint = fingerprint { // Lorg/chromium/net/UrlRequest\$Callback; // L + // 20.16+ uses a refactored and extracted method: + // L + // Ljava/util/Map; + // [B + // L + // Lorg/chromium/net/UrlRequest$Callback; + // L + val parameterTypes = methodDef.parameterTypes - (parameterTypes.size == 7 || parameterTypes.size == 8) && - parameterTypes[1] == "Ljava/util/Map;" // URL headers. + val parameterTypesSize = parameterTypes.size + (parameterTypesSize == 6 || parameterTypesSize == 7 || parameterTypesSize == 8) && + parameterTypes[1] == "Ljava/util/Map;" // URL headers. } } + internal val protobufClassParseByteBufferFingerprint = fingerprint { accessFlags(AccessFlags.PROTECTED, AccessFlags.STATIC) returns("L") @@ -148,7 +168,8 @@ internal val mediaFetchHotConfigFingerprint = fingerprint { literal { MEDIA_FETCH_HOT_CONFIG_FEATURE_FLAG } } -// YT 20.10+, YT Music 8.11+ +// YT 20.10+, YT Music 8.11 - 8.14. +// Flag is missing in YT Music 8.15+, and it is not known if a replacement flag/feature exists. internal const val MEDIA_FETCH_HOT_CONFIG_ALTERNATIVE_FEATURE_FLAG = 45683169L internal val mediaFetchHotConfigAlternativeFingerprint = fingerprint { diff --git a/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/SpoofVideoStreamsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/SpoofVideoStreamsPatch.kt index 4cb3ffac3..e30651041 100644 --- a/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/SpoofVideoStreamsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/shared/misc/spoof/SpoofVideoStreamsPatch.kt @@ -10,6 +10,7 @@ import app.revanced.patcher.patch.BytecodePatchContext import app.revanced.patcher.patch.bytecodePatch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable import app.revanced.patches.all.misc.resources.addResourcesPatch +import app.revanced.patches.music.misc.extension.sharedExtensionPatch import app.revanced.util.findFreeRegister import app.revanced.util.findInstructionIndicesReversedOrThrow import app.revanced.util.getReference @@ -42,7 +43,7 @@ fun spoofVideoStreamsPatch( ) { block() - dependsOn(addResourcesPatch) + dependsOn(sharedExtensionPatch, addResourcesPatch) execute { // region Enable extension helper method used by other patches From 0abfab79d7cda15bf17c53679fbfffb021662649 Mon Sep 17 00:00:00 2001 From: Samo Hribar <34912839+samolego@users.noreply.github.com> Date: Sun, 14 Sep 2025 13:49:52 +0200 Subject: [PATCH 5/5] feat(Viber): Add `Hide ads` patch (#5826) --- patches/api/patches.api | 4 ++++ .../revanced/patches/viber/ads/Fingerprints.kt | 13 +++++++++++++ .../revanced/patches/viber/ads/HideAdsPatch.kt | 17 +++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 patches/src/main/kotlin/app/revanced/patches/viber/ads/Fingerprints.kt create mode 100644 patches/src/main/kotlin/app/revanced/patches/viber/ads/HideAdsPatch.kt diff --git a/patches/api/patches.api b/patches/api/patches.api index 7c09b37e4..6d4c6e065 100644 --- a/patches/api/patches.api +++ b/patches/api/patches.api @@ -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 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 static final fun getUnlockProPatch ()Lapp/revanced/patcher/patch/BytecodePatch; } diff --git a/patches/src/main/kotlin/app/revanced/patches/viber/ads/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/viber/ads/Fingerprints.kt new file mode 100644 index 000000000..11ebe0d11 --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/viber/ads/Fingerprints.kt @@ -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 + } +} diff --git a/patches/src/main/kotlin/app/revanced/patches/viber/ads/HideAdsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/viber/ads/HideAdsPatch.kt new file mode 100644 index 000000000..683e750e1 --- /dev/null +++ b/patches/src/main/kotlin/app/revanced/patches/viber/ads/HideAdsPatch.kt @@ -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) + } +}