mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-23 18:51:03 +00:00
Compare commits
22 Commits
v2.176.0-d
...
v2.177.1-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22a18467de | ||
|
|
ccc369a2a8 | ||
|
|
c3d898ae0d | ||
|
|
96add7b8fa | ||
|
|
2ee28e0081 | ||
|
|
fa49810907 | ||
|
|
2814328bfd | ||
|
|
055bc2e072 | ||
|
|
7b01617cd4 | ||
|
|
3cec0b59c1 | ||
|
|
228e8b7d48 | ||
|
|
70e893a5d3 | ||
|
|
28abefeab0 | ||
|
|
b2c7a6a54f | ||
|
|
4570b273a7 | ||
|
|
45d5f708af | ||
|
|
3cd52cbffa | ||
|
|
35803524f4 | ||
|
|
b4312c0945 | ||
|
|
6bbe1a1433 | ||
|
|
c508efd0b0 | ||
|
|
d3d89c9d27 |
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
@@ -23,6 +23,16 @@ jobs:
|
|||||||
# https://github.com/cycjimmy/semantic-release-action#private-packages
|
# https://github.com/cycjimmy/semantic-release-action#private-packages
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
- name: Cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
${{ runner.home }}/.gradle/caches
|
||||||
|
${{ runner.home }}/.gradle/wrapper
|
||||||
|
.gradle
|
||||||
|
build
|
||||||
|
node_modules
|
||||||
|
key: ${{ runner.os }}-gradle-npm-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'package-lock.json') }}
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
94
CHANGELOG.md
94
CHANGELOG.md
@@ -1,3 +1,97 @@
|
|||||||
|
## [2.177.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.177.0...v2.177.1-dev.1) (2023-06-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* don't include all Litho patches, when not included ([fc69491](https://github.com/revanced/revanced-patches/commit/fc69491dfe4b119d46dd3da27b556e55fe0cecfb))
|
||||||
|
|
||||||
|
# [2.177.0](https://github.com/revanced/revanced-patches/compare/v2.176.1...v2.177.0) (2023-06-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **reddit/hide-ads:** search for correct reference class descriptor ([ad2a858](https://github.com/revanced/revanced-patches/commit/ad2a8585b2a5ecbc5eb92dd23b0ab124aa8a2541))
|
||||||
|
* **syncforreddit/change-oauth-client-id:** trim whitespace from OAuth string ([#2402](https://github.com/revanced/revanced-patches/issues/2402)) ([2afea71](https://github.com/revanced/revanced-patches/commit/2afea71557cfe4eb64d7c7ebf5a07dfd24a11824))
|
||||||
|
* **syncforreddit/change-oauth-client-id:** use downloads directory ([9b5af77](https://github.com/revanced/revanced-patches/commit/9b5af77a229a22466cfe8ed41a21d081beeae960))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **syncforreddit/change-oauth-client-id:** support pro version ([d34288b](https://github.com/revanced/revanced-patches/commit/d34288b6e8c7f5bb944622a3c741fcc693868033))
|
||||||
|
|
||||||
|
# [2.177.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.177.0-dev.1...v2.177.0-dev.2) (2023-06-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **reddit/hide-ads:** search for correct reference class descriptor ([ad2a858](https://github.com/revanced/revanced-patches/commit/ad2a8585b2a5ecbc5eb92dd23b0ab124aa8a2541))
|
||||||
|
|
||||||
|
# [2.177.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.176.2-dev.2...v2.177.0-dev.1) (2023-06-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **syncforreddit/change-oauth-client-id:** support pro version ([d34288b](https://github.com/revanced/revanced-patches/commit/d34288b6e8c7f5bb944622a3c741fcc693868033))
|
||||||
|
|
||||||
|
## [2.176.2-dev.2](https://github.com/revanced/revanced-patches/compare/v2.176.2-dev.1...v2.176.2-dev.2) (2023-06-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **syncforreddit/change-oauth-client-id:** trim whitespace from OAuth string ([#2402](https://github.com/revanced/revanced-patches/issues/2402)) ([2afea71](https://github.com/revanced/revanced-patches/commit/2afea71557cfe4eb64d7c7ebf5a07dfd24a11824))
|
||||||
|
|
||||||
|
## [2.176.2-dev.1](https://github.com/revanced/revanced-patches/compare/v2.176.1...v2.176.2-dev.1) (2023-06-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **syncforreddit/change-oauth-client-id:** use downloads directory ([9b5af77](https://github.com/revanced/revanced-patches/commit/9b5af77a229a22466cfe8ed41a21d081beeae960))
|
||||||
|
|
||||||
|
## [2.176.1](https://github.com/revanced/revanced-patches/compare/v2.176.0...v2.176.1) (2023-06-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **syncforreddit/change-oauth-client-id:** use correct signature for Android API ([4db2eba](https://github.com/revanced/revanced-patches/commit/4db2eba6d66f094f1d2400bfa8b9c15a175f796e))
|
||||||
|
|
||||||
|
## [2.176.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.176.0...v2.176.1-dev.1) (2023-06-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **syncforreddit/change-oauth-client-id:** use correct signature for Android API ([4db2eba](https://github.com/revanced/revanced-patches/commit/4db2eba6d66f094f1d2400bfa8b9c15a175f796e))
|
||||||
|
|
||||||
|
# [2.176.0](https://github.com/revanced/revanced-patches/compare/v2.175.0...v2.176.0) (2023-06-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **instagram/hide-timeline-ads:** constrain to version `275.0.0.27.98` ([#2377](https://github.com/revanced/revanced-patches/issues/2377)) ([6ee836c](https://github.com/revanced/revanced-patches/commit/6ee836c587676ba53c2e4748ec1828e193f1c071))
|
||||||
|
* **songpal:** make patches more resilient ([#2386](https://github.com/revanced/revanced-patches/issues/2386)) ([947bf42](https://github.com/revanced/revanced-patches/commit/947bf42b7c8d029b8a26a5c306869e02a69b62fd))
|
||||||
|
* use correct import ([9b6e730](https://github.com/revanced/revanced-patches/commit/9b6e730395e56e60cf08372dbbc3a10e92ba8e95))
|
||||||
|
* **youtube/hide-get-premium:** shorten descriptions ([f5224c4](https://github.com/revanced/revanced-patches/commit/f5224c4980285ef1e29d17887f02b5b397785245))
|
||||||
|
* **youtube/theme:** use custom light/dark colors for launch splash screen ([#2337](https://github.com/revanced/revanced-patches/issues/2337)) ([8adc05a](https://github.com/revanced/revanced-patches/commit/8adc05a17445dede5f35ee27426d20b750a2a1d3))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **citra:** remove patches ([#2384](https://github.com/revanced/revanced-patches/issues/2384)) ([d182329](https://github.com/revanced/revanced-patches/commit/d1823297ce27fc6f3246123c91d9463080afb7ee))
|
||||||
|
* **finanzonline:** support any version ([#2347](https://github.com/revanced/revanced-patches/issues/2347)) ([cc66b1f](https://github.com/revanced/revanced-patches/commit/cc66b1fc6200bbdcc2697ddd7085d46447775be2))
|
||||||
|
* **reddit:** add `hide-promoted` patch ([#2350](https://github.com/revanced/revanced-patches/issues/2350)) ([c3fd36c](https://github.com/revanced/revanced-patches/commit/c3fd36cfba7fb8246f8b3a29d9310bd88f01c3e7))
|
||||||
|
* **songpal:** add `remove-badge-tab` patch ([bde9053](https://github.com/revanced/revanced-patches/commit/bde9053f04e202a7b394a1dad335470d5495e5fc))
|
||||||
|
* **songpal:** add `remove-notification-badge` patch ([1b77f96](https://github.com/revanced/revanced-patches/commit/1b77f9633cf7e72d653f1d37483b7399e1ad797d))
|
||||||
|
* **syncforreddit/change-oauth-client-id:** improve error message ([a39b2fd](https://github.com/revanced/revanced-patches/commit/a39b2fd9828b514670135918e69ee736cb4615e5))
|
||||||
|
* **syncforreddit:** add `change-oauth-client-id` patch ([#2393](https://github.com/revanced/revanced-patches/issues/2393)) ([c93f0c6](https://github.com/revanced/revanced-patches/commit/c93f0c6a99fb2365747371f0f38eff8e0b77aee1))
|
||||||
|
* **youtube/hide-ads:** hide mix playlists ([dbb38ed](https://github.com/revanced/revanced-patches/commit/dbb38eddfd33db685b8e8be2f2a641a1199e7361))
|
||||||
|
* **youtube/swipe-controls:** add option to save and restore brightness ([3d03471](https://github.com/revanced/revanced-patches/commit/3d03471b1c2f18d22f17167db78764520064353a))
|
||||||
|
|
||||||
|
# [2.176.0-dev.7](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.6...v2.176.0-dev.7) (2023-06-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **syncforreddit/change-oauth-client-id:** improve error message ([a39b2fd](https://github.com/revanced/revanced-patches/commit/a39b2fd9828b514670135918e69ee736cb4615e5))
|
||||||
|
|
||||||
# [2.176.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.5...v2.176.0-dev.6) (2023-06-12)
|
# [2.176.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.5...v2.176.0-dev.6) (2023-06-12)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ The official ReVanced Patches.
|
|||||||
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 18.19.35 |
|
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 18.19.35 |
|
||||||
| `hide-ads` | Removes general ads. | 18.19.35 |
|
| `hide-ads` | Removes general ads. | 18.19.35 |
|
||||||
| `hide-album-cards` | Hides the album cards below the artist description. | 18.19.35 |
|
| `hide-album-cards` | Hides the album cards below the artist description. | 18.19.35 |
|
||||||
| `hide-artist-card` | Hides the artist card below the searchbar. | 18.19.35 |
|
|
||||||
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 18.19.35 |
|
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 18.19.35 |
|
||||||
| `hide-breaking-news-shelf` | Hides the breaking news shelf on the homepage tab. | 18.19.35 |
|
| `hide-breaking-news-shelf` | Hides the breaking news shelf on the homepage tab. | 18.19.35 |
|
||||||
| `hide-captions-button` | Hides the captions button on video player. | 18.19.35 |
|
| `hide-captions-button` | Hides the captions button on video player. | 18.19.35 |
|
||||||
@@ -205,6 +204,14 @@ The official ReVanced Patches.
|
|||||||
| `spoof-signature` | Spoofs the signature of the app. | all |
|
| `spoof-signature` | Spoofs the signature of the app. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### [📦 `com.laurencedawson.reddit_sync.pro`](https://play.google.com/store/apps/details?id=com.laurencedawson.reddit_sync.pro)
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `change-oauth-client-id` | Changes the OAuth client ID. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
### [📦 `com.myprog.hexedit`](https://play.google.com/store/apps/details?id=com.myprog.hexedit)
|
### [📦 `com.myprog.hexedit`](https://play.google.com/store/apps/details?id=com.myprog.hexedit)
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package android.os;
|
package android.os;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public final class Environment {
|
public final class Environment {
|
||||||
public static String getExternalStorageDirectory() {
|
public static File getExternalStorageDirectory() {
|
||||||
throw new UnsupportedOperationException("Stub");
|
throw new UnsupportedOperationException("Stub");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.176.0-dev.6
|
version = 2.177.1-dev.1
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -73,7 +73,7 @@ class HideAdsPatch : BytecodePatch(
|
|||||||
|
|
||||||
val reference = (it as ReferenceInstruction).reference as MethodReference
|
val reference = (it as ReferenceInstruction).reference as MethodReference
|
||||||
|
|
||||||
reference.name == "add" && reference.definingClass == "Lava/util/ArrayList;"
|
reference.name == "add" && reference.definingClass == "Ljava/util/ArrayList;"
|
||||||
}
|
}
|
||||||
|
|
||||||
result.mutableMethod.removeInstruction(index)
|
result.mutableMethod.removeInstruction(index)
|
||||||
|
|||||||
@@ -20,7 +20,12 @@ import java.util.*
|
|||||||
@Patch
|
@Patch
|
||||||
@Name("change-oauth-client-id")
|
@Name("change-oauth-client-id")
|
||||||
@Description("Changes the OAuth client ID.")
|
@Description("Changes the OAuth client ID.")
|
||||||
@Compatibility([Package("com.laurencedawson.reddit_sync")])
|
@Compatibility(
|
||||||
|
[
|
||||||
|
Package("com.laurencedawson.reddit_sync"),
|
||||||
|
Package("com.laurencedawson.reddit_sync.pro")
|
||||||
|
]
|
||||||
|
)
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class ChangeOAuthClientIdPatch : BytecodePatch(
|
class ChangeOAuthClientIdPatch : BytecodePatch(
|
||||||
listOf(GetAuthorizationStringFingerprint)
|
listOf(GetAuthorizationStringFingerprint)
|
||||||
@@ -43,11 +48,11 @@ class ChangeOAuthClientIdPatch : BytecodePatch(
|
|||||||
Alternatively, you can provide the client ID using patch options.
|
Alternatively, you can provide the client ID using patch options.
|
||||||
|
|
||||||
You can get your client ID from https://www.reddit.com/prefs/apps.
|
You can get your client ID from https://www.reddit.com/prefs/apps.
|
||||||
The redirect URI has to be set to "http://redditsync/auth".
|
The application type has to be "installed app" and the redirect URI has to be set to "http://redditsync/auth"
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
return PatchResultError(error)
|
return PatchResultError(error)
|
||||||
}.let { clientId = it.readText() }
|
}.let { clientId = it.readText().trim() }
|
||||||
}
|
}
|
||||||
|
|
||||||
GetAuthorizationStringFingerprint.result?.also { result ->
|
GetAuthorizationStringFingerprint.result?.also { result ->
|
||||||
@@ -93,4 +98,4 @@ class ChangeOAuthClientIdPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch.P
|
|||||||
@HideAdsCompatibility
|
@HideAdsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class HideAdsResourcePatch : ResourcePatch {
|
class HideAdsResourcePatch : ResourcePatch {
|
||||||
|
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
PreferenceScreen.LAYOUT.addPreferences(
|
PreferenceScreen.LAYOUT.addPreferences(
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
@@ -200,6 +199,12 @@ class HideAdsResourcePatch : ResourcePatch {
|
|||||||
StringResource("revanced_hide_mix_playlists_summary_on", "Mix playlists are hidden"),
|
StringResource("revanced_hide_mix_playlists_summary_on", "Mix playlists are hidden"),
|
||||||
StringResource("revanced_hide_mix_playlists_summary_off", "Mix playlists are shown")
|
StringResource("revanced_hide_mix_playlists_summary_off", "Mix playlists are shown")
|
||||||
),
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"revanced_hide_artist_cards",
|
||||||
|
StringResource("revanced_hide_artist_cards_title", "Hide artist cards"),
|
||||||
|
StringResource("revanced_hide_artist_cards_on", "Artist cards is hidden"),
|
||||||
|
StringResource("revanced_hide_artist_cards_off", "Artist cards is shown")
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
PreferenceScreen.ADS.addPreferences(
|
PreferenceScreen.ADS.addPreferences(
|
||||||
@@ -259,6 +264,8 @@ class HideAdsResourcePatch : ResourcePatch {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||||
|
|
||||||
adAttributionId = ResourceMappingPatch.resourceMappings.single { it.name == "ad_attribution" }.id
|
adAttributionId = ResourceMappingPatch.resourceMappings.single { it.name == "ad_attribution" }.id
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
@@ -266,5 +273,8 @@ class HideAdsResourcePatch : ResourcePatch {
|
|||||||
|
|
||||||
internal companion object {
|
internal companion object {
|
||||||
var adAttributionId: Long = -1
|
var adAttributionId: Long = -1
|
||||||
|
|
||||||
|
private const val FILTER_CLASS_DESCRIPTOR =
|
||||||
|
"Lapp/revanced/integrations/patches/components/AdsFilter;"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,14 @@ class HideButtonsPatch : ResourcePatch {
|
|||||||
StringResource("revanced_hide_buttons_preference_screen_summary", "Hide or show buttons under videos")
|
StringResource("revanced_hide_buttons_preference_screen_summary", "Hide or show buttons under videos")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
private const val FILTER_CLASS_DESCRIPTOR =
|
||||||
|
"Lapp/revanced/integrations/patches/components/ButtonsFilter;"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.layout.hide.artistcards.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility([Package("com.google.android.youtube", arrayOf("18.16.37", "18.19.35"))])
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
internal annotation class HideArtistCardCompatibility
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.layout.hide.artistcards.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.ResourceContext
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.ResourcePatch
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
|
||||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
|
||||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
|
||||||
import app.revanced.patches.youtube.layout.hide.artistcards.annotations.HideArtistCardCompatibility
|
|
||||||
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
|
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@DependsOn([ResourceMappingPatch::class, LithoFilterPatch::class])
|
|
||||||
@Name("hide-artist-card")
|
|
||||||
@Description("Hides the artist card below the searchbar.")
|
|
||||||
@HideArtistCardCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class HideArtistCardsPatch : ResourcePatch {
|
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
|
||||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
|
||||||
SwitchPreference(
|
|
||||||
"revanced_hide_artist_cards",
|
|
||||||
StringResource("revanced_hide_artist_cards_title", "Hide artist cards"),
|
|
||||||
StringResource("revanced_hide_artist_cards_on", "Artist cards is hidden"),
|
|
||||||
StringResource("revanced_hide_artist_cards_off", "Artist cards is shown")
|
|
||||||
),
|
|
||||||
)
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -49,6 +49,8 @@ class HideShortsComponentsPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||||
|
|
||||||
// region Hide the Shorts shelf.
|
// region Hide the Shorts shelf.
|
||||||
|
|
||||||
ReelConstructorFingerprint.result?.let {
|
ReelConstructorFingerprint.result?.let {
|
||||||
@@ -59,7 +61,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
|||||||
injectHideViewCall(
|
injectHideViewCall(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
viewRegister,
|
viewRegister,
|
||||||
CLASS_DESCRIPTOR,
|
FILTER_CLASS_DESCRIPTOR,
|
||||||
"hideShortsShelf"
|
"hideShortsShelf"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -89,7 +91,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
|||||||
val viewRegister = getInstruction<OneRegisterInstruction>(checkCastIndex).registerA
|
val viewRegister = getInstruction<OneRegisterInstruction>(checkCastIndex).registerA
|
||||||
addInstruction(
|
addInstruction(
|
||||||
checkCastIndex + 1,
|
checkCastIndex + 1,
|
||||||
"sput-object v$viewRegister, $CLASS_DESCRIPTOR->pivotBar:" +
|
"sput-object v$viewRegister, $FILTER_CLASS_DESCRIPTOR->pivotBar:" +
|
||||||
"Lcom/google/android/libraries/youtube/rendering/ui/pivotbar/PivotBar;"
|
"Lcom/google/android/libraries/youtube/rendering/ui/pivotbar/PivotBar;"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -102,7 +104,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
|||||||
throw RenderBottomNavigationBarFingerprint.toErrorResult()
|
throw RenderBottomNavigationBarFingerprint.toErrorResult()
|
||||||
|
|
||||||
RenderBottomNavigationBarFingerprint.result!!.mutableMethod.apply {
|
RenderBottomNavigationBarFingerprint.result!!.mutableMethod.apply {
|
||||||
addInstruction(0, "invoke-static { }, $CLASS_DESCRIPTOR->hideNavigationBar()V")
|
addInstruction(0, "invoke-static { }, $FILTER_CLASS_DESCRIPTOR->hideNavigationBar()V")
|
||||||
}
|
}
|
||||||
} ?: return RenderBottomNavigationBarParentFingerprint.toErrorResult()
|
} ?: return RenderBottomNavigationBarParentFingerprint.toErrorResult()
|
||||||
|
|
||||||
@@ -115,7 +117,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
|||||||
|
|
||||||
addInstruction(
|
addInstruction(
|
||||||
insertIndex,
|
insertIndex,
|
||||||
"invoke-static { v$viewRegister }, $CLASS_DESCRIPTOR->" +
|
"invoke-static { v$viewRegister }, $FILTER_CLASS_DESCRIPTOR->" +
|
||||||
"hideNavigationBar(Landroid/view/View;)Landroid/view/View;"
|
"hideNavigationBar(Landroid/view/View;)Landroid/view/View;"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -127,7 +129,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
private const val CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/components/ShortsFilter;"
|
private const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/components/ShortsFilter;"
|
||||||
|
|
||||||
private enum class ShortsButtons(private val resourceName: String, private val methodName: String) {
|
private enum class ShortsButtons(private val resourceName: String, private val methodName: String) {
|
||||||
COMMENTS("reel_dyn_comment", "hideShortsCommentsButton"),
|
COMMENTS("reel_dyn_comment", "hideShortsCommentsButton"),
|
||||||
@@ -139,7 +141,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
|||||||
|
|
||||||
val setIdIndex = referencedIndex + 1
|
val setIdIndex = referencedIndex + 1
|
||||||
val viewRegister = method.getInstruction<FiveRegisterInstruction>(setIdIndex).registerC
|
val viewRegister = method.getInstruction<FiveRegisterInstruction>(setIdIndex).registerC
|
||||||
method.injectHideViewCall(setIdIndex, viewRegister, CLASS_DESCRIPTOR, methodName)
|
method.injectHideViewCall(setIdIndex, viewRegister, FILTER_CLASS_DESCRIPTOR, methodName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.litho.filter.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object LithoFilterFingerprint : MethodFingerprint(
|
||||||
|
customFingerprint = custom@{ method, classDef ->
|
||||||
|
if (method.name != "<clinit>") return@custom false
|
||||||
|
|
||||||
|
classDef.type.endsWith("LithoFilterPatch;")
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -4,8 +4,11 @@ import app.revanced.extensions.toErrorResult
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
|
||||||
|
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
@@ -15,29 +18,29 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
|||||||
import app.revanced.patcher.util.smali.ExternalLabel
|
import app.revanced.patcher.util.smali.ExternalLabel
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.litho.filter.annotation.LithoFilterCompatibility
|
import app.revanced.patches.youtube.misc.litho.filter.annotation.LithoFilterCompatibility
|
||||||
import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ComponentContextParserFingerprint
|
import app.revanced.patches.youtube.misc.litho.filter.fingerprints.*
|
||||||
import app.revanced.patches.youtube.misc.litho.filter.fingerprints.EmptyComponentBuilderFingerprint
|
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||||
import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ProtobufBufferFingerprint
|
|
||||||
import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ReadComponentIdentifierFingerprint
|
|
||||||
import org.jf.dexlib2.iface.instruction.Instruction
|
import org.jf.dexlib2.iface.instruction.Instruction
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||||
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
import java.io.Closeable
|
||||||
|
|
||||||
@DependsOn([IntegrationsPatch::class])
|
@DependsOn([IntegrationsPatch::class])
|
||||||
@Description("Hooks the method which parses the bytes into a ComponentContext to filter components.")
|
@Description("Hooks the method which parses the bytes into a ComponentContext to filter components.")
|
||||||
@LithoFilterCompatibility
|
@LithoFilterCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class LithoFilterPatch : BytecodePatch(
|
class LithoFilterPatch : BytecodePatch(
|
||||||
listOf(ComponentContextParserFingerprint)
|
listOf(ComponentContextParserFingerprint, LithoFilterFingerprint)
|
||||||
) {
|
), Closeable {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
ComponentContextParserFingerprint.result?.also {
|
ComponentContextParserFingerprint.result?.also {
|
||||||
arrayOf(
|
arrayOf(
|
||||||
EmptyComponentBuilderFingerprint, ReadComponentIdentifierFingerprint, ProtobufBufferFingerprint
|
EmptyComponentBuilderFingerprint,
|
||||||
|
ReadComponentIdentifierFingerprint,
|
||||||
|
ProtobufBufferFingerprint
|
||||||
).forEach { fingerprint ->
|
).forEach { fingerprint ->
|
||||||
if (!fingerprint.resolve(context, it.mutableMethod, it.mutableClass))
|
if (fingerprint.resolve(context, it.mutableMethod, it.mutableClass)) return@forEach
|
||||||
return fingerprint.toErrorResult()
|
return fingerprint.toErrorResult()
|
||||||
}
|
}
|
||||||
}?.let { result ->
|
}?.let { result ->
|
||||||
val builderMethodIndex = EmptyComponentBuilderFingerprint.patternScanEndIndex
|
val builderMethodIndex = EmptyComponentBuilderFingerprint.patternScanEndIndex
|
||||||
@@ -45,16 +48,28 @@ class LithoFilterPatch : BytecodePatch(
|
|||||||
|
|
||||||
result.mutableMethod.apply {
|
result.mutableMethod.apply {
|
||||||
val insertHookIndex = result.scanResult.patternScanResult!!.endIndex
|
val insertHookIndex = result.scanResult.patternScanResult!!.endIndex
|
||||||
val builderMethodDescriptor = getInstruction(builderMethodIndex).descriptor
|
|
||||||
val emptyComponentFieldDescriptor = getInstruction(emptyComponentFieldIndex).descriptor
|
// region Get free registers that this patch uses
|
||||||
// Register is overwritten right after it is used in this patch, therefore free to clobber.
|
// Registers are overwritten right after they are used in this patch, therefore free to clobber.
|
||||||
val free = getInstruction<TwoRegisterInstruction>(insertHookIndex - 1).registerA
|
|
||||||
val free2 = getInstruction<OneRegisterInstruction>(insertHookIndex).registerA
|
val freeRegistersInstruction = getInstruction<FiveRegisterInstruction>(insertHookIndex - 2)
|
||||||
|
|
||||||
|
// Later used to store the protobuf buffer object.
|
||||||
|
val free1 = getInstruction<OneRegisterInstruction>(insertHookIndex).registerA
|
||||||
|
// Later used to store the identifier of the component.
|
||||||
|
// This register currently holds a reference to the StringBuilder object
|
||||||
|
// that is required before clobbering.
|
||||||
|
val free2 = freeRegistersInstruction.registerC
|
||||||
|
|
||||||
@Suppress("UnnecessaryVariable")
|
@Suppress("UnnecessaryVariable")
|
||||||
// The register, this patch clobbers, is previously used for the StringBuilder,
|
val stringBuilderRegister = free2
|
||||||
// later on a new StringBuilder is instantiated on it.
|
|
||||||
val stringBuilderRegister = free
|
// endregion
|
||||||
|
|
||||||
|
// region Get references that this patch needs
|
||||||
|
|
||||||
|
val builderMethodDescriptor = getInstruction(builderMethodIndex).descriptor
|
||||||
|
val emptyComponentFieldDescriptor = getInstruction(emptyComponentFieldIndex).descriptor
|
||||||
|
|
||||||
val identifierRegister =
|
val identifierRegister =
|
||||||
getInstruction<OneRegisterInstruction>(ReadComponentIdentifierFingerprint.patternScanEndIndex).registerA
|
getInstruction<OneRegisterInstruction>(ReadComponentIdentifierFingerprint.patternScanEndIndex).registerA
|
||||||
@@ -69,57 +84,87 @@ class LithoFilterPatch : BytecodePatch(
|
|||||||
getInstruction(ProtobufBufferFingerprint.patternScanEndIndex - 1).descriptor
|
getInstruction(ProtobufBufferFingerprint.patternScanEndIndex - 1).descriptor
|
||||||
val protobufBufferFieldDescriptor = "$protobufBufferRefTypeDescriptor->b:Ljava/nio/ByteBuffer;"
|
val protobufBufferFieldDescriptor = "$protobufBufferRefTypeDescriptor->b:Ljava/nio/ByteBuffer;"
|
||||||
|
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region Patch the method
|
||||||
|
|
||||||
|
// Insert the instructions that are responsible
|
||||||
|
// to return an EmptyComponent instead of the original component if the filter method returns false.
|
||||||
addInstructionsWithLabels(
|
addInstructionsWithLabels(
|
||||||
insertHookIndex, // right after setting the component.pathBuilder field.
|
insertHookIndex,
|
||||||
"""
|
"""
|
||||||
# Get the protobuf buffer object.
|
# Get the protobuf buffer object.
|
||||||
|
|
||||||
move-object/from16 v$free2, p$protobufParameterNumber
|
move-object/from16 v$free1, p$protobufParameterNumber
|
||||||
iget-object v$free2, v$free2, $protobufBufferRefTypeRefFieldDescriptor
|
iget-object v$free1, v$free1, $protobufBufferRefTypeRefFieldDescriptor
|
||||||
check-cast v$free2, $protobufBufferRefTypeDescriptor
|
check-cast v$free1, $protobufBufferRefTypeDescriptor
|
||||||
|
|
||||||
# Register "free" now holds the protobuf buffer object
|
# Register "free" now holds the protobuf buffer object
|
||||||
|
|
||||||
iget-object v$free2, v$free2, $protobufBufferFieldDescriptor
|
iget-object v$free1, v$free1, $protobufBufferFieldDescriptor
|
||||||
|
|
||||||
# Invoke the filter method.
|
# Invoke the filter method.
|
||||||
|
|
||||||
invoke-static { v$stringBuilderRegister, v$identifierRegister, v$free2 }, $FILTER_METHOD_DESCRIPTOR
|
invoke-static { v$stringBuilderRegister, v$identifierRegister, v$free1 }, $FILTER_METHOD_DESCRIPTOR
|
||||||
move-result v$free
|
move-result v$free1
|
||||||
|
|
||||||
if-eqz v$free, :not_an_ad
|
if-eqz v$free1, :unfiltered
|
||||||
|
|
||||||
# If the filter method returned true, then return a replacement empty component.
|
move-object/from16 v$free2, p1
|
||||||
|
invoke-static {v$free2}, $builderMethodDescriptor
|
||||||
move-object/from16 v$free, p1
|
move-result-object v$free2
|
||||||
invoke-static {v$free}, $builderMethodDescriptor
|
iget-object v$free2, v$free2, $emptyComponentFieldDescriptor
|
||||||
move-result-object v$free
|
return-object v$free2
|
||||||
iget-object v$free, v$free, $emptyComponentFieldDescriptor
|
|
||||||
return-object v$free
|
|
||||||
""",
|
""",
|
||||||
ExternalLabel("not_an_ad", getInstruction(insertHookIndex))
|
// Used to jump over the instruction which block the component from being created.
|
||||||
|
ExternalLabel("unfiltered", getInstruction(insertHookIndex))
|
||||||
)
|
)
|
||||||
|
// endregion
|
||||||
}
|
}
|
||||||
} ?: return ComponentContextParserFingerprint.toErrorResult()
|
} ?: return ComponentContextParserFingerprint.toErrorResult()
|
||||||
|
|
||||||
|
LithoFilterFingerprint.result?.mutableMethod?.apply {
|
||||||
|
removeInstructions(2, 4) // Remove dummy filter.
|
||||||
|
|
||||||
|
addFilter = { classDescriptor ->
|
||||||
|
addInstructions(
|
||||||
|
2,
|
||||||
|
"""
|
||||||
|
new-instance v1, $classDescriptor
|
||||||
|
invoke-direct {v1}, $classDescriptor-><init>()V
|
||||||
|
const/4 v2, ${filterCount++}
|
||||||
|
aput-object v1, v0, v2
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} ?: return LithoFilterFingerprint.toErrorResult()
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
private companion object {
|
override fun close() = LithoFilterFingerprint.result!!
|
||||||
|
.mutableMethod.replaceInstruction(0, "const/4 v0, $filterCount")
|
||||||
|
|
||||||
|
companion object {
|
||||||
private val MethodFingerprint.patternScanResult
|
private val MethodFingerprint.patternScanResult
|
||||||
get() = result!!.scanResult.patternScanResult!!
|
get() = result!!.scanResult.patternScanResult!!
|
||||||
|
|
||||||
val MethodFingerprint.patternScanEndIndex
|
private val MethodFingerprint.patternScanEndIndex
|
||||||
get() = patternScanResult.endIndex
|
get() = patternScanResult.endIndex
|
||||||
|
|
||||||
val MethodFingerprint.patternScanStartIndex
|
private val MethodFingerprint.patternScanStartIndex
|
||||||
get() = patternScanResult.startIndex
|
get() = patternScanResult.startIndex
|
||||||
|
|
||||||
val Instruction.descriptor
|
private val Instruction.descriptor
|
||||||
get() = (this as ReferenceInstruction).reference.toString()
|
get() = (this as ReferenceInstruction).reference.toString()
|
||||||
|
|
||||||
const val FILTER_METHOD_DESCRIPTOR =
|
private const val FILTER_METHOD_DESCRIPTOR =
|
||||||
"Lapp/revanced/integrations/patches/components/LithoFilterPatch;" +
|
"Lapp/revanced/integrations/patches/components/LithoFilterPatch;" +
|
||||||
"->filter(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/nio/ByteBuffer;)Z"
|
"->filter(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/nio/ByteBuffer;)Z"
|
||||||
|
|
||||||
|
internal lateinit var addFilter: (String) -> Unit
|
||||||
|
private set
|
||||||
|
|
||||||
|
private var filterCount = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user