mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-07 18:03:55 +01:00
Compare commits
36 Commits
v2.176.0-d
...
v2.178.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f1b70e625 | ||
|
|
d30797f9b8 | ||
|
|
d5609f65ca | ||
|
|
88e6ab2d07 | ||
|
|
7d85d2ad91 | ||
|
|
21adab5ef3 | ||
|
|
2e7e231e7d | ||
|
|
ae67a762ff | ||
|
|
66118829b3 | ||
|
|
22a18467de | ||
|
|
ccc369a2a8 | ||
|
|
c3d898ae0d | ||
|
|
96add7b8fa | ||
|
|
2ee28e0081 | ||
|
|
fa49810907 | ||
|
|
2814328bfd | ||
|
|
055bc2e072 | ||
|
|
7b01617cd4 | ||
|
|
3cec0b59c1 | ||
|
|
228e8b7d48 | ||
|
|
70e893a5d3 | ||
|
|
28abefeab0 | ||
|
|
b2c7a6a54f | ||
|
|
4570b273a7 | ||
|
|
45d5f708af | ||
|
|
3cd52cbffa | ||
|
|
35803524f4 | ||
|
|
b4312c0945 | ||
|
|
6bbe1a1433 | ||
|
|
c508efd0b0 | ||
|
|
d3d89c9d27 | ||
|
|
9192987b55 | ||
|
|
5e3865cb36 | ||
|
|
7138447a1f | ||
|
|
f96ce4063b | ||
|
|
c282abf677 |
25
.github/workflows/release.yml
vendored
25
.github/workflows/release.yml
vendored
@@ -23,23 +23,16 @@ jobs:
|
||||
# https://github.com/cycjimmy/semantic-release-action#private-packages
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
- name: Setup JDK
|
||||
uses: actions/setup-java@v3
|
||||
- name: Cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'zulu'
|
||||
cache: gradle
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'npm'
|
||||
- name: Setup Android SDK
|
||||
uses: amyu/setup-android@v2
|
||||
with:
|
||||
cache-disabled: false
|
||||
sdk-version: '33'
|
||||
build-tools-version: '33.0.1'
|
||||
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
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
136
CHANGELOG.md
136
CHANGELOG.md
@@ -1,3 +1,139 @@
|
||||
# [2.178.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.2...v2.178.0-dev.3) (2023-06-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/comments:** add missing filter ([#2423](https://github.com/revanced/revanced-patches/issues/2423)) ([cab04b3](https://github.com/revanced/revanced-patches/commit/cab04b3a56cfc5bf00b7c6fcf6f86ab75aa5d4fd))
|
||||
|
||||
# [2.178.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.1...v2.178.0-dev.2) (2023-06-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **googlerecorder/remove-device-restrictions:** add missing app constraint ([#2438](https://github.com/revanced/revanced-patches/issues/2438)) ([d5efe26](https://github.com/revanced/revanced-patches/commit/d5efe26f8959cde75dd3865ec3c2df4b05210e4a))
|
||||
|
||||
# [2.178.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.177.1-dev.2...v2.178.0-dev.1) (2023-06-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **google-recorder:** add `remove-device-restrictions` patch ([ef96ed1](https://github.com/revanced/revanced-patches/commit/ef96ed124e12091dde34124eabd8be9f2bb9280c))
|
||||
|
||||
## [2.177.1-dev.2](https://github.com/revanced/revanced-patches/compare/v2.177.1-dev.1...v2.177.1-dev.2) (2023-06-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube:** separate `hide-ads` to `hide-layout-components` patch ([7e0417f](https://github.com/revanced/revanced-patches/commit/7e0417f6728fa7b79a9d8cbcfd3ccba484a5567d))
|
||||
|
||||
## [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)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **reddit:** add `hide-promoted` patch ([#2350](https://github.com/revanced/revanced-patches/issues/2350)) ([c3fd36c](https://github.com/revanced/revanced-patches/commit/c3fd36cfba7fb8246f8b3a29d9310bd88f01c3e7))
|
||||
|
||||
# [2.176.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.4...v2.176.0-dev.5) (2023-06-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **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))
|
||||
|
||||
# [2.176.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.3...v2.176.0-dev.4) (2023-06-11)
|
||||
|
||||
|
||||
|
||||
136
README.md
136
README.md
@@ -25,7 +25,6 @@ The official ReVanced Patches.
|
||||
| `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-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-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 |
|
||||
@@ -36,6 +35,7 @@ The official ReVanced Patches.
|
||||
| `hide-filter-bar` | Hides the filter bar in video feeds. | 18.19.35 |
|
||||
| `hide-floating-microphone-button` | Hides the floating microphone button which appears in search. | 18.19.35 |
|
||||
| `hide-info-cards` | Hides info cards in videos. | 18.19.35 |
|
||||
| `hide-layout-components` | Hides general layout components. | 18.19.35 |
|
||||
| `hide-load-more-button` | Hides the button under videos that loads similar videos. | 18.19.35 |
|
||||
| `hide-player-buttons` | Adds the option to hide video player previous and next buttons. | 18.19.35 |
|
||||
| `hide-player-overlay` | Hides the dark background overlay from the player when player controls are visible. | all |
|
||||
@@ -140,17 +140,6 @@ The official ReVanced Patches.
|
||||
| `hide-views-stats` | Hides the view stats under tweets. | 9.71.0-release.0 |
|
||||
</details>
|
||||
|
||||
### [📦 `com.reddit.frontpage`](https://play.google.com/store/apps/details?id=com.reddit.frontpage)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `hide-ads` | Removes general ads from the Reddit frontpage and subreddits. | all |
|
||||
| `hide-subreddit-banner` | Hides banner ads from comments on subreddits. | all |
|
||||
| `premium-icon-reddit` | Unlocks premium Reddit app icons. | all |
|
||||
| `sanitize-sharing-links` | Removes (tracking) query parameters from the URLs when sharing links. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.facebook.orca`](https://play.google.com/store/apps/details?id=com.facebook.orca)
|
||||
<details>
|
||||
|
||||
@@ -161,6 +150,25 @@ The official ReVanced Patches.
|
||||
| `hide-inbox-ads` | Hides ads in inbox. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.reddit.frontpage`](https://play.google.com/store/apps/details?id=com.reddit.frontpage)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `hide-ads` | Removes ads from the Reddit. | all |
|
||||
| `premium-icon-reddit` | Unlocks premium Reddit app icons. | all |
|
||||
| `sanitize-sharing-links` | Removes (tracking) query parameters from the URLs when sharing links. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.laurencedawson.reddit_sync`](https://play.google.com/store/apps/details?id=com.laurencedawson.reddit_sync)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `change-oauth-client-id` | Changes the OAuth client ID. | all |
|
||||
| `disable-ads` | Disables ads. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.spotify.music`](https://play.google.com/store/apps/details?id=com.spotify.music)
|
||||
<details>
|
||||
|
||||
@@ -197,6 +205,14 @@ The official ReVanced Patches.
|
||||
| `spoof-signature` | Spoofs the signature of the app. | all |
|
||||
</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)
|
||||
<details>
|
||||
|
||||
@@ -205,14 +221,6 @@ The official ReVanced Patches.
|
||||
| `disable-ads` | Disables ads in HexEditor. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.laurencedawson.reddit_sync`](https://play.google.com/store/apps/details?id=com.laurencedawson.reddit_sync)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `disable-ads` | Disables ads. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.spotify.lite`](https://play.google.com/store/apps/details?id=com.spotify.lite)
|
||||
<details>
|
||||
|
||||
@@ -285,6 +293,14 @@ The official ReVanced Patches.
|
||||
| `remove-debugging-detection` | Removes the USB and wireless debugging checks. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.google.android.apps.recorder`](https://play.google.com/store/apps/details?id=com.google.android.apps.recorder)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `remove-device-restrictions` | Removes restrictions from using the app on any device. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.dci.dev.androidtwelvewidgets`](https://play.google.com/store/apps/details?id=com.dci.dev.androidtwelvewidgets)
|
||||
<details>
|
||||
|
||||
@@ -317,6 +333,30 @@ The official ReVanced Patches.
|
||||
| `unlock-prime` | Unlocks Nova Prime and all functions of the app. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `tv.trakt.trakt`](https://play.google.com/store/apps/details?id=tv.trakt.trakt)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.zombodroid.MemeGenerator`](https://play.google.com/store/apps/details?id=com.zombodroid.MemeGenerator)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks pro features. | 4.6377 |
|
||||
</details>
|
||||
|
||||
### [📦 `com.ithebk.expensemanager`](https://play.google.com/store/apps/details?id=com.ithebk.expensemanager)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.vsco.cam`](https://play.google.com/store/apps/details?id=com.vsco.cam)
|
||||
<details>
|
||||
|
||||
@@ -333,22 +373,6 @@ The official ReVanced Patches.
|
||||
| `unlock-pro` | Unlocks all pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.candylink.openvpn`](https://play.google.com/store/apps/details?id=com.candylink.openvpn)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks premium features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.ithebk.expensemanager`](https://play.google.com/store/apps/details?id=com.ithebk.expensemanager)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `ginlemon.iconpackstudio`](https://play.google.com/store/apps/details?id=ginlemon.iconpackstudio)
|
||||
<details>
|
||||
|
||||
@@ -357,22 +381,6 @@ The official ReVanced Patches.
|
||||
| `unlock-pro` | Unlocks all pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.zombodroid.MemeGenerator`](https://play.google.com/store/apps/details?id=com.zombodroid.MemeGenerator)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks pro features. | 4.6377 |
|
||||
</details>
|
||||
|
||||
### [📦 `co.windyapp.android`](https://play.google.com/store/apps/details?id=co.windyapp.android)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks all pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `org.totschnig.myexpenses`](https://play.google.com/store/apps/details?id=org.totschnig.myexpenses)
|
||||
<details>
|
||||
|
||||
@@ -381,14 +389,6 @@ The official ReVanced Patches.
|
||||
| `unlock-pro` | Unlocks all professional features. | 3.4.9 |
|
||||
</details>
|
||||
|
||||
### [📦 `tv.trakt.trakt`](https://play.google.com/store/apps/details?id=tv.trakt.trakt)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.wakdev.apps.nfctools.se`](https://play.google.com/store/apps/details?id=com.wakdev.apps.nfctools.se)
|
||||
<details>
|
||||
|
||||
@@ -397,6 +397,22 @@ The official ReVanced Patches.
|
||||
| `unlock-pro` | Unlocks all pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `co.windyapp.android`](https://play.google.com/store/apps/details?id=co.windyapp.android)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks all pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.candylink.openvpn`](https://play.google.com/store/apps/details?id=com.candylink.openvpn)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-pro` | Unlocks premium features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.ticktick.task`](https://play.google.com/store/apps/details?id=com.ticktick.task)
|
||||
<details>
|
||||
|
||||
|
||||
@@ -33,6 +33,10 @@ dependencies {
|
||||
implementation("com.google.code.gson:gson:2.10.1")
|
||||
// Required for FlexVer-Java
|
||||
implementation("com.unascribed:flexver-java:1.0.2")
|
||||
|
||||
// A dependency to the Android library unfortunately fails the build,
|
||||
// which is why this is required for the patch change-oauth-client-id
|
||||
compileOnly(project("dummy"))
|
||||
}
|
||||
|
||||
kotlin {
|
||||
|
||||
9
dummy/build.gradle.kts
Normal file
9
dummy/build.gradle.kts
Normal file
@@ -0,0 +1,9 @@
|
||||
plugins {
|
||||
id("java")
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(11))
|
||||
}
|
||||
}
|
||||
9
dummy/src/main/java/android/os/Environment.java
Normal file
9
dummy/src/main/java/android/os/Environment.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package android.os;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public final class Environment {
|
||||
public static File getExternalStorageDirectory() {
|
||||
throw new UnsupportedOperationException("Stub");
|
||||
}
|
||||
}
|
||||
@@ -1,2 +1,2 @@
|
||||
kotlin.code.style = official
|
||||
version = 2.176.0-dev.4
|
||||
version = 2.178.0-dev.3
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1,3 @@
|
||||
include("dummy")
|
||||
|
||||
rootProject.name = "revanced-patches"
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.revanced.patches.googlerecorder.restrictions.fingereprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object OnApplicationCreateFingerprint : MethodFingerprint(
|
||||
strings = listOf("com.google.android.feature.PIXEL_2017_EXPERIENCE"),
|
||||
customFingerprint = custom@{ methodDef, classDef ->
|
||||
if (methodDef.name != "onCreate") return@custom false
|
||||
|
||||
classDef.type.endsWith("RecorderApplication;")
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,45 @@
|
||||
package app.revanced.patches.googlerecorder.restrictions.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Package
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.googlerecorder.restrictions.fingereprints.OnApplicationCreateFingerprint
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch
|
||||
@Name("remove-device-restrictions")
|
||||
@Description("Removes restrictions from using the app on any device.")
|
||||
@Compatibility([Package("com.google.android.apps.recorder")])
|
||||
@Version("0.0.1")
|
||||
class RemoveDeviceRestrictions : BytecodePatch(
|
||||
listOf(OnApplicationCreateFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
OnApplicationCreateFingerprint.result?.let {
|
||||
val featureStringIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
||||
|
||||
it.mutableMethod.apply {
|
||||
// Remove check for device restrictions.
|
||||
removeInstructions(featureStringIndex - 2, 5)
|
||||
|
||||
val featureAvailableRegister = getInstruction<OneRegisterInstruction>(featureStringIndex).registerA
|
||||
|
||||
// Override "isPixelDevice()" to return true.
|
||||
addInstruction(featureStringIndex, "const/4 v$featureAvailableRegister, 0x1")
|
||||
}
|
||||
} ?: return OnApplicationCreateFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package app.revanced.patches.reddit.ad.banner.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.reddit.frontpage"
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class HideBannerCompatibility
|
||||
@@ -7,17 +7,12 @@ 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.Patch
|
||||
import app.revanced.patches.reddit.ad.banner.annotations.HideBannerCompatibility
|
||||
|
||||
@Patch
|
||||
@Name("hide-subreddit-banner")
|
||||
@Description("Hides banner ads from comments on subreddits.")
|
||||
@HideBannerCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideBannerPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
|
||||
context.xmlEditor[RESOURCE_FILE_PATH].use {
|
||||
it.file.getElementsByTagName("merge").item(0).childNodes.apply {
|
||||
val attributes = arrayOf("height", "width")
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.revanced.patches.reddit.ad.comments.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object HideCommentAdsFingerprint : MethodFingerprint(
|
||||
strings = listOf(
|
||||
"link",
|
||||
// CommentPageRepository is not returning a link object
|
||||
"is not returning a link object"
|
||||
),
|
||||
customFingerprint = { _, classDef ->
|
||||
classDef.sourceFile == "PostDetailPresenter.kt"
|
||||
},
|
||||
)
|
||||
@@ -0,0 +1,34 @@
|
||||
package app.revanced.patches.reddit.ad.comments.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.RequiresIntegrations
|
||||
import app.revanced.patches.reddit.ad.comments.fingerprints.HideCommentAdsFingerprint
|
||||
|
||||
@Name("hide-comment-ads")
|
||||
@Description("Removes all comment ads.")
|
||||
@RequiresIntegrations
|
||||
@Version("0.0.1")
|
||||
class HideCommentAdsPatch : BytecodePatch(
|
||||
listOf(HideCommentAdsFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
val method = HideCommentAdsFingerprint.result!!.mutableMethod
|
||||
// Returns a blank object instead of the comment ad.
|
||||
method.addInstructions(
|
||||
0,
|
||||
"""
|
||||
new-instance v0, Ljava/lang/Object;
|
||||
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
|
||||
return-object v0
|
||||
"""
|
||||
)
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,6 @@ package app.revanced.patches.reddit.ad.general.annotations
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.reddit.frontpage"
|
||||
)]
|
||||
)
|
||||
@Compatibility([Package("com.reddit.frontpage")])
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class HideAdsCompatibility
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package app.revanced.patches.reddit.ad.general.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object AdPostFingerprint : MethodFingerprint(
|
||||
"V",
|
||||
// "children" are present throughout multiple versions
|
||||
strings = listOf("children"),
|
||||
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("Listing;") },
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
package app.revanced.patches.reddit.ad.general.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object NewAdPostFingerprint : MethodFingerprint(
|
||||
opcodes = listOf(Opcode.INVOKE_VIRTUAL),
|
||||
strings = listOf("chain", "feedElement"),
|
||||
customFingerprint = { _, classDef -> classDef.sourceFile == "AdElementConverter.kt" },
|
||||
)
|
||||
@@ -4,51 +4,89 @@ import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.patch.annotations.RequiresIntegrations
|
||||
import app.revanced.patches.reddit.ad.banner.patch.HideBannerPatch
|
||||
import app.revanced.patches.reddit.ad.comments.patch.HideCommentAdsPatch
|
||||
import app.revanced.patches.reddit.ad.general.annotations.HideAdsCompatibility
|
||||
import app.revanced.patches.reddit.ad.general.fingerprints.AdPostFingerprint
|
||||
import app.revanced.patches.reddit.ad.general.fingerprints.NewAdPostFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21c
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.reference.StringReference
|
||||
import org.jf.dexlib2.immutable.reference.ImmutableStringReference
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
||||
import org.jf.dexlib2.iface.reference.FieldReference
|
||||
import org.jf.dexlib2.iface.reference.MethodReference
|
||||
|
||||
@Patch
|
||||
@Name("hide-ads")
|
||||
@Description("Removes general ads from the Reddit frontpage and subreddits.")
|
||||
@Description("Removes ads from the Reddit.")
|
||||
@DependsOn([HideBannerPatch::class, HideCommentAdsPatch::class])
|
||||
@HideAdsCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideAdsPatch : BytecodePatch() {
|
||||
@RequiresIntegrations
|
||||
@Version("0.0.2")
|
||||
class HideAdsPatch : BytecodePatch(
|
||||
listOf(AdPostFingerprint, NewAdPostFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
context.classes.forEach { classDef ->
|
||||
classDef.methods.forEach methodLoop@{ method ->
|
||||
val implementation = method.implementation ?: return@methodLoop
|
||||
// region Filter promoted ads (does not work in popular or latest feed)
|
||||
|
||||
implementation.instructions.forEachIndexed { i, instruction ->
|
||||
if (instruction.opcode != Opcode.CONST_STRING) return@forEachIndexed
|
||||
if (((instruction as ReferenceInstruction).reference as StringReference).string != "AdPost") return@forEachIndexed
|
||||
AdPostFingerprint.result?.mutableMethod?.apply {
|
||||
val setPostsListChildren = implementation!!.instructions.first { instruction ->
|
||||
if (instruction.opcode != Opcode.IPUT_OBJECT) return@first false
|
||||
|
||||
val proxiedClass = context.proxy(classDef).mutableClass
|
||||
|
||||
val proxiedImplementation = proxiedClass.methods.first {
|
||||
it.name == method.name && it.parameterTypes.containsAll(method.parameterTypes)
|
||||
}.implementation!!
|
||||
|
||||
var newString = "AdPost1"
|
||||
if (proxiedImplementation.instructions[i - 1].opcode == Opcode.CONST_STRING) {
|
||||
newString = "SubredditPost"
|
||||
}
|
||||
proxiedImplementation.replaceInstruction(
|
||||
i, BuilderInstruction21c(
|
||||
Opcode.CONST_STRING, (proxiedImplementation.instructions[i] as BuilderInstruction21c).registerA, ImmutableStringReference(newString)
|
||||
)
|
||||
)
|
||||
}
|
||||
val reference = (instruction as ReferenceInstruction).reference as FieldReference
|
||||
reference.name == "children"
|
||||
}
|
||||
|
||||
val castedInstruction = setPostsListChildren as Instruction22c
|
||||
val itemsRegister = castedInstruction.registerA
|
||||
val listInstanceRegister = castedInstruction.registerB
|
||||
|
||||
// postsList.children = filterChildren(postListItems)
|
||||
removeInstruction(setPostsListChildren.location.index)
|
||||
addInstructions(
|
||||
setPostsListChildren.location.index,
|
||||
"""
|
||||
invoke-static {v$itemsRegister}, $FILTER_METHOD_DESCRIPTOR
|
||||
move-result-object v0
|
||||
iput-object v0, v$listInstanceRegister, ${castedInstruction.reference}
|
||||
"""
|
||||
)
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
// region Remove ads from popular and latest feed
|
||||
|
||||
NewAdPostFingerprint.result?.let { result ->
|
||||
// The new feeds work by inserting posts into lists.
|
||||
// AdElementConverter is conveniently responsible for inserting all feed ads.
|
||||
// By removing the appending instruction no ad posts gets appended to the feed.
|
||||
val index = result.method.implementation!!.instructions.indexOfFirst {
|
||||
if (it.opcode != Opcode.INVOKE_VIRTUAL) return@indexOfFirst false
|
||||
|
||||
val reference = (it as ReferenceInstruction).reference as MethodReference
|
||||
|
||||
reference.name == "add" && reference.definingClass == "Ljava/util/ArrayList;"
|
||||
}
|
||||
|
||||
result.mutableMethod.removeInstruction(index)
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private companion object {
|
||||
private const val FILTER_METHOD_DESCRIPTOR =
|
||||
"Lapp/revanced/reddit/patches/FilterPromotedLinksPatch;" +
|
||||
"->filterChildren(Ljava/lang/Iterable;)Ljava/util/List;"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package app.revanced.patches.syncforreddit.ads.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility([Package("com.laurencedawson.reddit_sync")])
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
internal annotation class DisableAdsCompatibility
|
||||
@@ -1,9 +1,7 @@
|
||||
package app.revanced.patches.syncforreddit.ads.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.annotation.*
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
@@ -11,7 +9,6 @@ import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.syncforreddit.ads.annotations.DisableAdsCompatibility
|
||||
import app.revanced.patches.syncforreddit.ads.fingerprints.IsAdsEnabledFingerprint
|
||||
import app.revanced.patches.syncforreddit.detection.piracy.patch.DisablePiracyDetectionPatch
|
||||
|
||||
@@ -19,8 +16,8 @@ import app.revanced.patches.syncforreddit.detection.piracy.patch.DisablePiracyDe
|
||||
@Name("disable-ads")
|
||||
@DependsOn([DisablePiracyDetectionPatch::class])
|
||||
@Description("Disables ads.")
|
||||
@Compatibility([Package("com.laurencedawson.reddit_sync")])
|
||||
@Version("0.0.1")
|
||||
@DisableAdsCompatibility
|
||||
class DisableAdsPatch : BytecodePatch(listOf(IsAdsEnabledFingerprint)) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
IsAdsEnabledFingerprint.result?.mutableMethod?.apply {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.revanced.patches.syncforreddit.api.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object GetAuthorizationStringFingerprint : MethodFingerprint(
|
||||
strings = listOf("authorize.compact?client_id")
|
||||
)
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.revanced.patches.syncforreddit.api.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object GetBearerTokenFingerprint : MethodFingerprint(
|
||||
strings = listOf("Basic")
|
||||
)
|
||||
@@ -0,0 +1,101 @@
|
||||
package app.revanced.patches.syncforreddit.api.patch
|
||||
|
||||
import android.os.Environment
|
||||
import app.revanced.patcher.annotation.*
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||
import app.revanced.patcher.patch.*
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.syncforreddit.api.fingerprints.GetAuthorizationStringFingerprint
|
||||
import app.revanced.patches.syncforreddit.api.fingerprints.GetBearerTokenFingerprint
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.reference.StringReference
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
@Patch
|
||||
@Name("change-oauth-client-id")
|
||||
@Description("Changes the OAuth client ID.")
|
||||
@Compatibility(
|
||||
[
|
||||
Package("com.laurencedawson.reddit_sync"),
|
||||
Package("com.laurencedawson.reddit_sync.pro")
|
||||
]
|
||||
)
|
||||
@Version("0.0.1")
|
||||
class ChangeOAuthClientIdPatch : BytecodePatch(
|
||||
listOf(GetAuthorizationStringFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
if (clientId == null) {
|
||||
// Test if on Android
|
||||
try {
|
||||
Class.forName("android.os.Environment")
|
||||
} catch (e: ClassNotFoundException) {
|
||||
return PatchResultError("No client ID provided")
|
||||
}
|
||||
|
||||
File(Environment.getExternalStorageDirectory(), "reddit_client_id_revanced.txt").also {
|
||||
if (it.exists()) return@also
|
||||
|
||||
val error = """
|
||||
In order to use this patch, you need to provide a client ID.
|
||||
You can do this by creating a file at ${it.absolutePath} with the client ID as its content.
|
||||
Alternatively, you can provide the client ID using patch options.
|
||||
|
||||
You can get your client ID from https://www.reddit.com/prefs/apps.
|
||||
The application type has to be "installed app" and the redirect URI has to be set to "http://redditsync/auth"
|
||||
""".trimIndent()
|
||||
|
||||
return PatchResultError(error)
|
||||
}.let { clientId = it.readText().trim() }
|
||||
}
|
||||
|
||||
GetAuthorizationStringFingerprint.result?.also { result ->
|
||||
GetBearerTokenFingerprint.also { it.resolve(context, result.classDef) }.result?.mutableMethod?.apply {
|
||||
val auth = Base64.getEncoder().encodeToString("$clientId:".toByteArray(Charsets.UTF_8))
|
||||
addInstructions(
|
||||
0,
|
||||
"""
|
||||
const-string v0, "Basic $auth"
|
||||
return-object v0
|
||||
"""
|
||||
)
|
||||
} ?: return PatchResultError("Could not find required method to patch.")
|
||||
}?.let {
|
||||
val occurrenceIndex = it.scanResult.stringsScanResult!!.matches.first().index
|
||||
|
||||
it.mutableMethod.apply {
|
||||
val authorizationStringInstruction = getInstruction<ReferenceInstruction>(occurrenceIndex)
|
||||
val targetRegister = (authorizationStringInstruction as OneRegisterInstruction).registerA
|
||||
val reference = authorizationStringInstruction.reference as StringReference
|
||||
|
||||
val newAuthorizationUrl = reference.string.replace(
|
||||
"client_id=.*?&".toRegex(),
|
||||
"client_id=${clientId!!}&"
|
||||
)
|
||||
|
||||
replaceInstruction(
|
||||
occurrenceIndex,
|
||||
"const-string v$targetRegister, \"$newAuthorizationUrl\""
|
||||
)
|
||||
}
|
||||
} ?: return PatchResultError("Could not find required method to patch.")
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
companion object : OptionsContainer() {
|
||||
var clientId by option(
|
||||
PatchOption.StringOption(
|
||||
"client-id",
|
||||
null,
|
||||
"OAuth client ID",
|
||||
"The client ID to use for OAuth."
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -7,14 +7,15 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.*
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.ad.general.annotation.HideAdsCompatibility
|
||||
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch.PreferenceScreen
|
||||
|
||||
@DependsOn(
|
||||
dependencies = [
|
||||
[
|
||||
LithoFilterPatch::class,
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class
|
||||
@@ -23,185 +24,7 @@ import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch.P
|
||||
@HideAdsCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideAdsResourcePatch : ResourcePatch {
|
||||
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_gray_separator",
|
||||
StringResource("revanced_hide_gray_separator_title", "Hide gray separator"),
|
||||
StringResource("revanced_hide_gray_separator_summary_on", "Gray separators are hidden"),
|
||||
StringResource("revanced_hide_gray_separator_summary_off", "Gray separators are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_channel_guidelines",
|
||||
StringResource("revanced_hide_channel_guidelines_title", "Hide channel guidelines"),
|
||||
StringResource(
|
||||
"revanced_hide_channel_guidelines_summary_on",
|
||||
"Channel guidelines are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_channel_guidelines_summary_off",
|
||||
"Channel guidelines are shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_chapter_teaser",
|
||||
StringResource(
|
||||
"revanced_hide_chapter_teaser_title",
|
||||
"Hide chapter teaser under videos"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_chapter_teaser_summary_on",
|
||||
"Chapter teasers are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_chapter_teaser_summary_off",
|
||||
"Chapter teasers are shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_merchandise_banners",
|
||||
StringResource("revanced_hide_merchandise_banners_title", "Hide merchandise banners"),
|
||||
StringResource("revanced_hide_merchandise_banners_summary_on", "Merchandise banners are hidden"),
|
||||
StringResource("revanced_hide_merchandise_banners_summary_off", "Merchandise banners are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_community_posts",
|
||||
StringResource("revanced_hide_community_posts_title", "Hide community posts"),
|
||||
StringResource("revanced_hide_community_posts_summary_on", "Community posts are hidden"),
|
||||
StringResource("revanced_hide_community_posts_summary_off", "Community posts are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_compact_banner",
|
||||
StringResource("revanced_hide_compact_banner_title", "Hide compact banners"),
|
||||
StringResource("revanced_hide_compact_banner_summary_on", "Compact banners are hidden"),
|
||||
StringResource("revanced_hide_compact_banner_summary_off", "Compact banners are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_products_banner",
|
||||
StringResource("revanced_hide_products_banner_title", "Hide banner to view products"),
|
||||
StringResource("revanced_hide_products_banner_summary_on", "Banner is hidden"),
|
||||
StringResource("revanced_hide_products_banner_summary_off", "Banner is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_web_search_results",
|
||||
StringResource("revanced_hide_web_search_results_title", "Hide web search results"),
|
||||
StringResource("revanced_hide_web_search_results_summary_on", "Web search results are hidden"),
|
||||
StringResource("revanced_hide_web_search_results_summary_off", "Web search results are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_movies_section",
|
||||
StringResource("revanced_hide_movies_section_title", "Hide movies section"),
|
||||
StringResource("revanced_hide_movies_section_summary_on", "Movies section is hidden"),
|
||||
StringResource("revanced_hide_movies_section_summary_off", "Movies section is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_feed_survey",
|
||||
StringResource("revanced_hide_feed_survey_title", "Hide feed surveys"),
|
||||
StringResource("revanced_hide_feed_survey_summary_on", "Feed surveys are hidden"),
|
||||
StringResource("revanced_hide_feed_survey_summary_off", "Feed surveys are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_community_guidelines",
|
||||
StringResource("revanced_hide_community_guidelines_title", "Hide community guidelines"),
|
||||
StringResource(
|
||||
"revanced_hide_community_guidelines_summary_on",
|
||||
"Community guidelines are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_community_guidelines_summary_off",
|
||||
"Community guidelines are shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_subscribers_community_guidelines",
|
||||
StringResource(
|
||||
"revanced_hide_subscribers_community_guidelines_title",
|
||||
"Hide subscribers community guidelines"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_subscribers_community_guidelines_summary_on",
|
||||
"Subscribers community guidelines are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_subscribers_community_guidelines_summary_off",
|
||||
"Subscribers community guidelines are shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_channel_member_shelf",
|
||||
StringResource("revanced_hide_channel_member_shelf_title", "Hide channel member shelf"),
|
||||
StringResource(
|
||||
"revanced_hide_channel_member_shelf_summary_on",
|
||||
"Channel member shelf is hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_channel_member_shelf_summary_off",
|
||||
"Channel member shelf is shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_emergency_box",
|
||||
StringResource("revanced_hide_emergency_box_title", "Hide emergency boxes"),
|
||||
StringResource("revanced_hide_emergency_box_summary_on", "Emergency boxes are hidden"),
|
||||
StringResource("revanced_hide_emergency_box_summary_off", "Emergency boxes are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_info_panels",
|
||||
StringResource("revanced_hide_info_panels_title", "Hide info panels"),
|
||||
StringResource("revanced_hide_info_panels_summary_on", "Info panels are hidden"),
|
||||
StringResource("revanced_hide_info_panels_summary_off", "Info panels are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_medical_panels",
|
||||
StringResource("revanced_hide_medical_panels_title", "Hide medical panels"),
|
||||
StringResource("revanced_hide_medical_panels_summary_on", "Medical panels are hidden"),
|
||||
StringResource("revanced_hide_medical_panels_summary_off", "Medical panels are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_channel_bar",
|
||||
StringResource("revanced_hide_channel_bar_title", "Hide channel bar"),
|
||||
StringResource("revanced_hide_channel_bar_summary_on", "Channel bar is hidden"),
|
||||
StringResource("revanced_hide_channel_bar_summary_off", "Channel bar is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_quick_actions",
|
||||
StringResource("revanced_hide_quick_actions_title", "Hide quick actions in fullscreen"),
|
||||
StringResource("revanced_hide_quick_actions_summary_on", "Quick actions are hidden"),
|
||||
StringResource("revanced_hide_quick_actions_summary_off", "Quick actions are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_related_videos",
|
||||
StringResource("revanced_hide_related_videos_title", "Hide related videos in quick actions"),
|
||||
StringResource("revanced_hide_related_videos_summary_on", "Related videos are hidden"),
|
||||
StringResource("revanced_hide_related_videos_summary_off", "Related videos are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_image_shelf",
|
||||
StringResource("revanced_hide_image_shelf", "Hide image shelf in search results"),
|
||||
StringResource("revanced_hide_image_shelf_summary_on", "Image shelf is hidden"),
|
||||
StringResource("revanced_hide_image_shelf_summary_off", "Image shelf is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_audio_track_button",
|
||||
StringResource("revanced_hide_audio_track_button_title", "Hide audio track button"),
|
||||
StringResource("revanced_hide_audio_track_button_on", "Audio track button is hidden"),
|
||||
StringResource("revanced_hide_audio_track_button_off", "Audio track button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_latest_posts_ads",
|
||||
StringResource("revanced_hide_latest_posts_ads_title", "Hide latest posts"),
|
||||
StringResource("revanced_hide_latest_posts_ads_summary_on", "Latest posts are hidden"),
|
||||
StringResource("revanced_hide_latest_posts_ads_summary_off", "Latest posts are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_mix_playlists",
|
||||
StringResource("revanced_hide_mix_playlists_title", "Hide mix playlists"),
|
||||
StringResource("revanced_hide_mix_playlists_summary_on", "Mix playlists are hidden"),
|
||||
StringResource("revanced_hide_mix_playlists_summary_off", "Mix playlists are shown")
|
||||
),
|
||||
)
|
||||
|
||||
PreferenceScreen.ADS.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_general_ads",
|
||||
@@ -227,38 +50,28 @@ class HideAdsResourcePatch : ResourcePatch {
|
||||
StringResource("revanced_hide_self_sponsor_ads_summary_on", "Self sponsored cards are hidden"),
|
||||
StringResource("revanced_hide_self_sponsor_ads_summary_off", "Self sponsored cards are shown")
|
||||
),
|
||||
PreferenceScreen(
|
||||
"revanced_custom_filter_preference_screen",
|
||||
StringResource("revanced_custom_filter_preference_screen_title", "Custom filter"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_custom_filter",
|
||||
StringResource(
|
||||
"revanced_custom_filter_title",
|
||||
"Enable custom filter"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_custom_filter_summary_on",
|
||||
"Custom filter is enabled"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_custom_filter_summary_off",
|
||||
"Custom filter is disabled"
|
||||
)
|
||||
),
|
||||
// TODO: This should be a dynamic ListPreference, which does not exist yet
|
||||
TextPreference(
|
||||
"revanced_custom_filter_strings",
|
||||
StringResource("revanced_custom_filter_strings_title", "Custom filter"),
|
||||
StringResource(
|
||||
"revanced_custom_filter_strings_summary",
|
||||
"Filter components by their name separated by a comma"
|
||||
)
|
||||
)
|
||||
)
|
||||
SwitchPreference(
|
||||
"revanced_hide_products_banner",
|
||||
StringResource("revanced_hide_products_banner_title", "Hide banner to view products"),
|
||||
StringResource("revanced_hide_products_banner_summary_on", "Banner is hidden"),
|
||||
StringResource("revanced_hide_products_banner_summary_off", "Banner is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_web_search_results",
|
||||
StringResource("revanced_hide_web_search_results_title", "Hide web search results"),
|
||||
StringResource("revanced_hide_web_search_results_summary_on", "Web search results are hidden"),
|
||||
StringResource("revanced_hide_web_search_results_summary_off", "Web search results are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_merchandise_banners",
|
||||
StringResource("revanced_hide_merchandise_banners_title", "Hide merchandise banners"),
|
||||
StringResource("revanced_hide_merchandise_banners_summary_on", "Merchandise banners are hidden"),
|
||||
StringResource("revanced_hide_merchandise_banners_summary_off", "Merchandise banners are shown")
|
||||
)
|
||||
)
|
||||
|
||||
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||
|
||||
adAttributionId = ResourceMappingPatch.resourceMappings.single { it.name == "ad_attribution" }.id
|
||||
|
||||
return PatchResultSuccess()
|
||||
@@ -266,5 +79,8 @@ class HideAdsResourcePatch : ResourcePatch {
|
||||
|
||||
internal companion object {
|
||||
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")
|
||||
)
|
||||
)
|
||||
|
||||
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
@@ -9,21 +9,23 @@ 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.PreferenceScreen
|
||||
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.comments.annotations.HideCommentsCompatibility
|
||||
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
|
||||
@Patch
|
||||
@Name("comments")
|
||||
@Description("Hides components related to comments.")
|
||||
@HideCommentsCompatibility
|
||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@DependsOn([SettingsPatch::class, LithoFilterPatch::class])
|
||||
@Version("0.0.1")
|
||||
class CommentsPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
PreferenceScreen(
|
||||
"revanced_comments_preference_screen",
|
||||
@@ -48,4 +50,8 @@ class CommentsPatch : ResourcePatch {
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/components/CommentsFilter;"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package app.revanced.patches.youtube.misc.litho.filter.annotation
|
||||
package app.revanced.patches.youtube.layout.hide.general.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 LithoFilterCompatibility
|
||||
internal annotation class HideLayoutComponentsCompatibility
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
package app.revanced.patches.youtube.layout.hide.general.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.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.shared.settings.preference.impl.TextPreference
|
||||
import app.revanced.patches.youtube.layout.hide.general.annotations.HideLayoutComponentsCompatibility
|
||||
import app.revanced.patches.youtube.misc.litho.filter.patch.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch.PreferenceScreen
|
||||
|
||||
@Patch
|
||||
@Name("hide-layout-components")
|
||||
@Description("Hides general layout components.")
|
||||
@DependsOn([LithoFilterPatch::class, SettingsPatch::class])
|
||||
@HideLayoutComponentsCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideLayoutComponentsPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_gray_separator",
|
||||
StringResource("revanced_hide_gray_separator_title", "Hide gray separator"),
|
||||
StringResource("revanced_hide_gray_separator_summary_on", "Gray separators are hidden"),
|
||||
StringResource("revanced_hide_gray_separator_summary_off", "Gray separators are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_channel_guidelines",
|
||||
StringResource("revanced_hide_channel_guidelines_title", "Hide channel guidelines"),
|
||||
StringResource(
|
||||
"revanced_hide_channel_guidelines_summary_on",
|
||||
"Channel guidelines are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_channel_guidelines_summary_off",
|
||||
"Channel guidelines are shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_chapter_teaser",
|
||||
StringResource(
|
||||
"revanced_hide_chapter_teaser_title",
|
||||
"Hide chapter teaser under videos"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_chapter_teaser_summary_on",
|
||||
"Chapter teasers are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_chapter_teaser_summary_off",
|
||||
"Chapter teasers are shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_community_posts",
|
||||
StringResource("revanced_hide_community_posts_title", "Hide community posts"),
|
||||
StringResource("revanced_hide_community_posts_summary_on", "Community posts are hidden"),
|
||||
StringResource("revanced_hide_community_posts_summary_off", "Community posts are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_compact_banner",
|
||||
StringResource("revanced_hide_compact_banner_title", "Hide compact banners"),
|
||||
StringResource("revanced_hide_compact_banner_summary_on", "Compact banners are hidden"),
|
||||
StringResource("revanced_hide_compact_banner_summary_off", "Compact banners are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_movies_section",
|
||||
StringResource("revanced_hide_movies_section_title", "Hide movies section"),
|
||||
StringResource("revanced_hide_movies_section_summary_on", "Movies section is hidden"),
|
||||
StringResource("revanced_hide_movies_section_summary_off", "Movies section is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_feed_survey",
|
||||
StringResource("revanced_hide_feed_survey_title", "Hide feed surveys"),
|
||||
StringResource("revanced_hide_feed_survey_summary_on", "Feed surveys are hidden"),
|
||||
StringResource("revanced_hide_feed_survey_summary_off", "Feed surveys are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_community_guidelines",
|
||||
StringResource("revanced_hide_community_guidelines_title", "Hide community guidelines"),
|
||||
StringResource(
|
||||
"revanced_hide_community_guidelines_summary_on",
|
||||
"Community guidelines are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_community_guidelines_summary_off",
|
||||
"Community guidelines are shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_subscribers_community_guidelines",
|
||||
StringResource(
|
||||
"revanced_hide_subscribers_community_guidelines_title",
|
||||
"Hide subscribers community guidelines"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_subscribers_community_guidelines_summary_on",
|
||||
"Subscribers community guidelines are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_subscribers_community_guidelines_summary_off",
|
||||
"Subscribers community guidelines are shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_channel_member_shelf",
|
||||
StringResource("revanced_hide_channel_member_shelf_title", "Hide channel member shelf"),
|
||||
StringResource(
|
||||
"revanced_hide_channel_member_shelf_summary_on",
|
||||
"Channel member shelf is hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_channel_member_shelf_summary_off",
|
||||
"Channel member shelf is shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_emergency_box",
|
||||
StringResource("revanced_hide_emergency_box_title", "Hide emergency boxes"),
|
||||
StringResource("revanced_hide_emergency_box_summary_on", "Emergency boxes are hidden"),
|
||||
StringResource("revanced_hide_emergency_box_summary_off", "Emergency boxes are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_info_panels",
|
||||
StringResource("revanced_hide_info_panels_title", "Hide info panels"),
|
||||
StringResource("revanced_hide_info_panels_summary_on", "Info panels are hidden"),
|
||||
StringResource("revanced_hide_info_panels_summary_off", "Info panels are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_medical_panels",
|
||||
StringResource("revanced_hide_medical_panels_title", "Hide medical panels"),
|
||||
StringResource("revanced_hide_medical_panels_summary_on", "Medical panels are hidden"),
|
||||
StringResource("revanced_hide_medical_panels_summary_off", "Medical panels are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_channel_bar",
|
||||
StringResource("revanced_hide_channel_bar_title", "Hide channel bar"),
|
||||
StringResource("revanced_hide_channel_bar_summary_on", "Channel bar is hidden"),
|
||||
StringResource("revanced_hide_channel_bar_summary_off", "Channel bar is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_quick_actions",
|
||||
StringResource("revanced_hide_quick_actions_title", "Hide quick actions in fullscreen"),
|
||||
StringResource("revanced_hide_quick_actions_summary_on", "Quick actions are hidden"),
|
||||
StringResource("revanced_hide_quick_actions_summary_off", "Quick actions are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_related_videos",
|
||||
StringResource("revanced_hide_related_videos_title", "Hide related videos in quick actions"),
|
||||
StringResource("revanced_hide_related_videos_summary_on", "Related videos are hidden"),
|
||||
StringResource("revanced_hide_related_videos_summary_off", "Related videos are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_image_shelf",
|
||||
StringResource("revanced_hide_image_shelf", "Hide image shelf in search results"),
|
||||
StringResource("revanced_hide_image_shelf_summary_on", "Image shelf is hidden"),
|
||||
StringResource("revanced_hide_image_shelf_summary_off", "Image shelf is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_audio_track_button",
|
||||
StringResource("revanced_hide_audio_track_button_title", "Hide audio track button"),
|
||||
StringResource("revanced_hide_audio_track_button_on", "Audio track button is hidden"),
|
||||
StringResource("revanced_hide_audio_track_button_off", "Audio track button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_latest_posts_ads",
|
||||
StringResource("revanced_hide_latest_posts_ads_title", "Hide latest posts"),
|
||||
StringResource("revanced_hide_latest_posts_ads_summary_on", "Latest posts are hidden"),
|
||||
StringResource("revanced_hide_latest_posts_ads_summary_off", "Latest posts are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_mix_playlists",
|
||||
StringResource("revanced_hide_mix_playlists_title", "Hide mix playlists"),
|
||||
StringResource("revanced_hide_mix_playlists_summary_on", "Mix playlists are hidden"),
|
||||
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")
|
||||
),
|
||||
app.revanced.patches.shared.settings.preference.impl.PreferenceScreen(
|
||||
"revanced_custom_filter_preference_screen",
|
||||
StringResource("revanced_custom_filter_preference_screen_title", "Custom filter"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_custom_filter",
|
||||
StringResource(
|
||||
"revanced_custom_filter_title",
|
||||
"Enable custom filter"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_custom_filter_summary_on",
|
||||
"Custom filter is enabled"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_custom_filter_summary_off",
|
||||
"Custom filter is disabled"
|
||||
)
|
||||
),
|
||||
// TODO: This should be a dynamic ListPreference, which does not exist yet
|
||||
TextPreference(
|
||||
"revanced_custom_filter_strings",
|
||||
StringResource("revanced_custom_filter_strings_title", "Custom filter"),
|
||||
StringResource(
|
||||
"revanced_custom_filter_strings_summary",
|
||||
"Filter components by their name separated by a comma"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
internal companion object {
|
||||
private const val FILTER_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/components/LayoutComponentsFilter;"
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,8 @@ class HideShortsComponentsPatch : BytecodePatch(
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||
|
||||
// region Hide the Shorts shelf.
|
||||
|
||||
ReelConstructorFingerprint.result?.let {
|
||||
@@ -59,7 +61,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
||||
injectHideViewCall(
|
||||
insertIndex,
|
||||
viewRegister,
|
||||
CLASS_DESCRIPTOR,
|
||||
FILTER_CLASS_DESCRIPTOR,
|
||||
"hideShortsShelf"
|
||||
)
|
||||
}
|
||||
@@ -89,7 +91,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
||||
val viewRegister = getInstruction<OneRegisterInstruction>(checkCastIndex).registerA
|
||||
addInstruction(
|
||||
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;"
|
||||
)
|
||||
}
|
||||
@@ -102,7 +104,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
||||
throw RenderBottomNavigationBarFingerprint.toErrorResult()
|
||||
|
||||
RenderBottomNavigationBarFingerprint.result!!.mutableMethod.apply {
|
||||
addInstruction(0, "invoke-static { }, $CLASS_DESCRIPTOR->hideNavigationBar()V")
|
||||
addInstruction(0, "invoke-static { }, $FILTER_CLASS_DESCRIPTOR->hideNavigationBar()V")
|
||||
}
|
||||
} ?: return RenderBottomNavigationBarParentFingerprint.toErrorResult()
|
||||
|
||||
@@ -115,7 +117,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
||||
|
||||
addInstruction(
|
||||
insertIndex,
|
||||
"invoke-static { v$viewRegister }, $CLASS_DESCRIPTOR->" +
|
||||
"invoke-static { v$viewRegister }, $FILTER_CLASS_DESCRIPTOR->" +
|
||||
"hideNavigationBar(Landroid/view/View;)Landroid/view/View;"
|
||||
)
|
||||
}
|
||||
@@ -127,7 +129,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
||||
}
|
||||
|
||||
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) {
|
||||
COMMENTS("reel_dyn_comment", "hideShortsCommentsButton"),
|
||||
@@ -139,7 +141,7 @@ class HideShortsComponentsPatch : BytecodePatch(
|
||||
|
||||
val setIdIndex = referencedIndex + 1
|
||||
val viewRegister = method.getInstruction<FiveRegisterInstruction>(setIdIndex).registerC
|
||||
method.injectHideViewCall(setIdIndex, viewRegister, CLASS_DESCRIPTOR, methodName)
|
||||
method.injectHideViewCall(setIdIndex, viewRegister, FILTER_CLASS_DESCRIPTOR, methodName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.jf.dexlib2.iface.reference.StringReference
|
||||
|
||||
@Patch
|
||||
@DependsOn(
|
||||
dependencies = [
|
||||
[
|
||||
IntegrationsPatch::class,
|
||||
VideoIdPatch::class,
|
||||
// Required to skip segments on time.
|
||||
|
||||
@@ -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.Version
|
||||
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.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.Companion.resolve
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
@@ -14,30 +17,28 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
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.fingerprints.ComponentContextParserFingerprint
|
||||
import app.revanced.patches.youtube.misc.litho.filter.fingerprints.EmptyComponentBuilderFingerprint
|
||||
import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ProtobufBufferFingerprint
|
||||
import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ReadComponentIdentifierFingerprint
|
||||
import app.revanced.patches.youtube.misc.litho.filter.fingerprints.*
|
||||
import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
import org.jf.dexlib2.iface.instruction.Instruction
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
import java.io.Closeable
|
||||
|
||||
@DependsOn([IntegrationsPatch::class])
|
||||
@Description("Hooks the method which parses the bytes into a ComponentContext to filter components.")
|
||||
@LithoFilterCompatibility
|
||||
@Version("0.0.1")
|
||||
class LithoFilterPatch : BytecodePatch(
|
||||
listOf(ComponentContextParserFingerprint)
|
||||
) {
|
||||
listOf(ComponentContextParserFingerprint, LithoFilterFingerprint)
|
||||
), Closeable {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
ComponentContextParserFingerprint.result?.also {
|
||||
arrayOf(
|
||||
EmptyComponentBuilderFingerprint, ReadComponentIdentifierFingerprint, ProtobufBufferFingerprint
|
||||
EmptyComponentBuilderFingerprint,
|
||||
ReadComponentIdentifierFingerprint,
|
||||
ProtobufBufferFingerprint
|
||||
).forEach { fingerprint ->
|
||||
if (!fingerprint.resolve(context, it.mutableMethod, it.mutableClass))
|
||||
return fingerprint.toErrorResult()
|
||||
if (fingerprint.resolve(context, it.mutableMethod, it.mutableClass)) return@forEach
|
||||
return fingerprint.toErrorResult()
|
||||
}
|
||||
}?.let { result ->
|
||||
val builderMethodIndex = EmptyComponentBuilderFingerprint.patternScanEndIndex
|
||||
@@ -45,16 +46,28 @@ class LithoFilterPatch : BytecodePatch(
|
||||
|
||||
result.mutableMethod.apply {
|
||||
val insertHookIndex = result.scanResult.patternScanResult!!.endIndex
|
||||
val builderMethodDescriptor = getInstruction(builderMethodIndex).descriptor
|
||||
val emptyComponentFieldDescriptor = getInstruction(emptyComponentFieldIndex).descriptor
|
||||
// Register is overwritten right after it is used in this patch, therefore free to clobber.
|
||||
val free = getInstruction<TwoRegisterInstruction>(insertHookIndex - 1).registerA
|
||||
val free2 = getInstruction<OneRegisterInstruction>(insertHookIndex).registerA
|
||||
|
||||
// region Get free registers that this patch uses
|
||||
// Registers are overwritten right after they are used in this patch, therefore free to clobber.
|
||||
|
||||
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")
|
||||
// The register, this patch clobbers, is previously used for the StringBuilder,
|
||||
// later on a new StringBuilder is instantiated on it.
|
||||
val stringBuilderRegister = free
|
||||
val stringBuilderRegister = free2
|
||||
|
||||
// endregion
|
||||
|
||||
// region Get references that this patch needs
|
||||
|
||||
val builderMethodDescriptor = getInstruction(builderMethodIndex).descriptor
|
||||
val emptyComponentFieldDescriptor = getInstruction(emptyComponentFieldIndex).descriptor
|
||||
|
||||
val identifierRegister =
|
||||
getInstruction<OneRegisterInstruction>(ReadComponentIdentifierFingerprint.patternScanEndIndex).registerA
|
||||
@@ -69,57 +82,87 @@ class LithoFilterPatch : BytecodePatch(
|
||||
getInstruction(ProtobufBufferFingerprint.patternScanEndIndex - 1).descriptor
|
||||
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(
|
||||
insertHookIndex, // right after setting the component.pathBuilder field.
|
||||
insertHookIndex,
|
||||
"""
|
||||
# Get the protobuf buffer object.
|
||||
|
||||
move-object/from16 v$free2, p$protobufParameterNumber
|
||||
iget-object v$free2, v$free2, $protobufBufferRefTypeRefFieldDescriptor
|
||||
check-cast v$free2, $protobufBufferRefTypeDescriptor
|
||||
move-object/from16 v$free1, p$protobufParameterNumber
|
||||
iget-object v$free1, v$free1, $protobufBufferRefTypeRefFieldDescriptor
|
||||
check-cast v$free1, $protobufBufferRefTypeDescriptor
|
||||
|
||||
# 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-static { v$stringBuilderRegister, v$identifierRegister, v$free2 }, $FILTER_METHOD_DESCRIPTOR
|
||||
move-result v$free
|
||||
invoke-static { v$stringBuilderRegister, v$identifierRegister, v$free1 }, $FILTER_METHOD_DESCRIPTOR
|
||||
move-result v$free1
|
||||
|
||||
if-eqz v$free, :not_an_ad
|
||||
|
||||
# If the filter method returned true, then return a replacement empty component.
|
||||
|
||||
move-object/from16 v$free, p1
|
||||
invoke-static {v$free}, $builderMethodDescriptor
|
||||
move-result-object v$free
|
||||
iget-object v$free, v$free, $emptyComponentFieldDescriptor
|
||||
return-object v$free
|
||||
if-eqz v$free1, :unfiltered
|
||||
|
||||
move-object/from16 v$free2, p1
|
||||
invoke-static {v$free2}, $builderMethodDescriptor
|
||||
move-result-object v$free2
|
||||
iget-object v$free2, v$free2, $emptyComponentFieldDescriptor
|
||||
return-object v$free2
|
||||
""",
|
||||
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()
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
private companion object {
|
||||
override fun close() = LithoFilterFingerprint.result!!
|
||||
.mutableMethod.replaceInstruction(0, "const/4 v0, $filterCount")
|
||||
|
||||
companion object {
|
||||
private val MethodFingerprint.patternScanResult
|
||||
get() = result!!.scanResult.patternScanResult!!
|
||||
|
||||
val MethodFingerprint.patternScanEndIndex
|
||||
private val MethodFingerprint.patternScanEndIndex
|
||||
get() = patternScanResult.endIndex
|
||||
|
||||
val MethodFingerprint.patternScanStartIndex
|
||||
private val MethodFingerprint.patternScanStartIndex
|
||||
get() = patternScanResult.startIndex
|
||||
|
||||
val Instruction.descriptor
|
||||
private val Instruction.descriptor
|
||||
get() = (this as ReferenceInstruction).reference.toString()
|
||||
|
||||
const val FILTER_METHOD_DESCRIPTOR =
|
||||
private const val FILTER_METHOD_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/patches/components/LithoFilterPatch;" +
|
||||
"->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