mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-22 18:23:59 +00:00
Compare commits
103 Commits
v5.46.0-de
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e675e6f62 | ||
|
|
421cb2899e | ||
|
|
97e74157fa | ||
|
|
5edd9dccae | ||
|
|
9c18e1e649 | ||
|
|
71ce8230a9 | ||
|
|
156441d3cf | ||
|
|
634f47ef84 | ||
|
|
eeb133325e | ||
|
|
e8d58ca9af | ||
|
|
5b5c50254d | ||
|
|
ef052c0d8f | ||
|
|
d9fa580222 | ||
|
|
182224c79d | ||
|
|
83c0127ebb | ||
|
|
3762f1de08 | ||
|
|
18c0b04f0c | ||
|
|
4c4ba1c78c | ||
|
|
7cef24a5e9 | ||
|
|
8725a49ba3 | ||
|
|
8b6360e34f | ||
|
|
a10c51f160 | ||
|
|
eecc44b956 | ||
|
|
3401467a6d | ||
|
|
87247590de | ||
|
|
41e2590584 | ||
|
|
778d13ce8b | ||
|
|
19f146c01d | ||
|
|
12b819d20e | ||
|
|
004b5908db | ||
|
|
f4af27dfec | ||
|
|
4cc315952d | ||
|
|
6312fe8d60 | ||
|
|
3d754575a4 | ||
|
|
a3f7609fe3 | ||
|
|
d25dcfe49a | ||
|
|
1cc2cb9cb2 | ||
|
|
f5cbb31724 | ||
|
|
b42ae27ce6 | ||
|
|
43ab29d03d | ||
|
|
789f0a5628 | ||
|
|
da836b667c | ||
|
|
44e7dbcf4d | ||
|
|
195c239000 | ||
|
|
c47beae213 | ||
|
|
cebcfab86a | ||
|
|
71c6cb569e | ||
|
|
6bb6281149 | ||
|
|
16bd96e2bb | ||
|
|
8f3f4c95bb | ||
|
|
da02d68587 | ||
|
|
a429824bb7 | ||
|
|
e0f33468e6 | ||
|
|
315931cbf8 | ||
|
|
dc69f2433e | ||
|
|
73e43b2a49 | ||
|
|
918f04793f | ||
|
|
f1a9537f01 | ||
|
|
1f4f252c81 | ||
|
|
2b560f5fe9 | ||
|
|
f8bd1239cc | ||
|
|
c825ebda37 | ||
|
|
255c00b183 | ||
|
|
0ea3491227 | ||
|
|
5d437b08dd | ||
|
|
018d176914 | ||
|
|
9a77beea8a | ||
|
|
ded8370207 | ||
|
|
4d1104fc32 | ||
|
|
34830ba63b | ||
|
|
7a6894d809 | ||
|
|
144e6e2694 | ||
|
|
847ee189a9 | ||
|
|
dc813fe617 | ||
|
|
02831a6069 | ||
|
|
5228fd4b58 | ||
|
|
6bd7dca75b | ||
|
|
22ed7bfbb3 | ||
|
|
a7c220a4ae | ||
|
|
d8ca4ee931 | ||
|
|
a5d197b977 | ||
|
|
a0ec4c07f7 | ||
|
|
0928dcd00d | ||
|
|
bbd8932b2e | ||
|
|
300b12f948 | ||
|
|
ac583d40d0 | ||
|
|
c400188c38 | ||
|
|
0af0ee92c4 | ||
|
|
fff29544b9 | ||
|
|
9495cf49ef | ||
|
|
15675b5164 | ||
|
|
654d091e65 | ||
|
|
98371be33c | ||
|
|
2f0de15e67 | ||
|
|
df160370e2 | ||
|
|
bb745b555b | ||
|
|
8df9a46721 | ||
|
|
94ae84ad0f | ||
|
|
4febb2e2e9 | ||
|
|
b9bc7e3e58 | ||
|
|
9f3bb26cb9 | ||
|
|
d64dfc2884 | ||
|
|
a39ef1e0a4 |
3
.github/workflows/build_pull_request.yml
vendored
3
.github/workflows/build_pull_request.yml
vendored
@@ -25,7 +25,8 @@ jobs:
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ORG_GRADLE_PROJECT_githubPackagesUsername: ${{ env.GITHUB_ACTOR }}
|
||||
ORG_GRADLE_PROJECT_githubPackagesPassword: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./gradlew :patches:buildAndroid --no-daemon
|
||||
|
||||
- name: Upload artifacts
|
||||
|
||||
2
.github/workflows/pull_strings.yml
vendored
2
.github/workflows/pull_strings.yml
vendored
@@ -2,7 +2,7 @@ name: Pull strings
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 */12 * * *"
|
||||
- cron: "0 0 * * 0"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
7
.github/workflows/push_strings.yml
vendored
7
.github/workflows/push_strings.yml
vendored
@@ -16,10 +16,11 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Preprocess strings
|
||||
- name: Process strings
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./gradlew clean preprocessCrowdinStrings
|
||||
ORG_GRADLE_PROJECT_githubPackagesUsername: ${{ github.actor }}
|
||||
ORG_GRADLE_PROJECT_githubPackagesPassword: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./gradlew processStringsForCrowdin
|
||||
|
||||
- name: Push strings
|
||||
uses: crowdin/github-action@v2
|
||||
|
||||
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@@ -31,7 +31,8 @@ jobs:
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ORG_GRADLE_PROJECT_githubPackagesUsername: ${{ github.actor }}
|
||||
ORG_GRADLE_PROJECT_githubPackagesPassword: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./gradlew :patches:buildAndroid clean
|
||||
|
||||
- name: Setup Node.js
|
||||
@@ -55,6 +56,8 @@ jobs:
|
||||
id: release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ORG_GRADLE_PROJECT_githubPackagesUsername: ${{ github.actor }}
|
||||
ORG_GRADLE_PROJECT_githubPackagesPassword: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Attest
|
||||
if: steps.release.outputs.new_release_published == 'true'
|
||||
|
||||
362
CHANGELOG.md
362
CHANGELOG.md
@@ -1,3 +1,365 @@
|
||||
# [5.50.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.49.0-dev.1...v5.50.0-dev.1) (2026-01-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Nothing X:** Add `Show K1 token(s)` patch ([#6490](https://github.com/ReVanced/revanced-patches/issues/6490)) ([421cb28](https://github.com/ReVanced/revanced-patches/commit/421cb2899ef5c0f100fb8007bae8b89137d0e41c))
|
||||
* **YouTube Music:** Add `Unlock Android Auto Media Browser` patch ([#6477](https://github.com/ReVanced/revanced-patches/issues/6477)) ([5edd9dc](https://github.com/ReVanced/revanced-patches/commit/5edd9dccae3b1ab4edf19771a771812e3c9ccf80))
|
||||
|
||||
# [5.50.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.48.0...v5.50.0-dev.1) (2026-01-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **YouTube Music:** Add `Unlock Android Auto Media Browser` patch ([#6477](https://github.com/ReVanced/revanced-patches/issues/6477)) ([89645dc](https://github.com/ReVanced/revanced-patches/commit/89645dcc2e13603b8f2fedb5e16231cb396e5965))
|
||||
|
||||
# [5.49.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.48.1-dev.1...v5.49.0-dev.1) (2026-01-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **YouTube Music:** Add `Hide layout components` patch ([#6365](https://github.com/ReVanced/revanced-patches/issues/6365)) ([71ce823](https://github.com/ReVanced/revanced-patches/commit/71ce8230a959dcaf2d8cd5dad1a4f21b88819aa0))
|
||||
|
||||
## [5.48.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.48.0...v5.48.1-dev.1) (2026-01-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Disable `Prevent screenshot detection` by default ([#6511](https://github.com/ReVanced/revanced-patches/issues/6511)) ([5b5c502](https://github.com/ReVanced/revanced-patches/commit/5b5c50254d533faa0e04d542f4859cbef610713e))
|
||||
|
||||
# [5.48.0](https://github.com/ReVanced/revanced-patches/compare/v5.47.0...v5.48.0) (2026-01-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Boost for Reddit - Fix missing audio in video downloads:** Make it work again by reflecting Reddits latest changes ([#6500](https://github.com/ReVanced/revanced-patches/issues/6500)) ([eecc44b](https://github.com/ReVanced/revanced-patches/commit/eecc44b9567bf2ca72ac99e0dafa483a6803c0f9))
|
||||
* **Disney+ - Skip ads:** Remove unsupported package names ([#6422](https://github.com/ReVanced/revanced-patches/issues/6422)) ([44e7dbc](https://github.com/ReVanced/revanced-patches/commit/44e7dbcf4d7eaf94dd0164baba847d3e19250154))
|
||||
* Fix build error introduced in `4046bee` ([#6417](https://github.com/ReVanced/revanced-patches/issues/6417)) ([789f0a5](https://github.com/ReVanced/revanced-patches/commit/789f0a562861825065633d172445ebf35a1ba8d8))
|
||||
* Fix compilation error introduced in `6bb6281` ([#6409](https://github.com/ReVanced/revanced-patches/issues/6409)) ([71c6cb5](https://github.com/ReVanced/revanced-patches/commit/71c6cb569ebf7b93cf73ee391839e5220557ce7c))
|
||||
* Fix compilation error introduced in dc69f243 ([#6392](https://github.com/ReVanced/revanced-patches/issues/6392)) ([a429824](https://github.com/ReVanced/revanced-patches/commit/a429824bb77b49aea14b0b54f2204ae24d5209a1))
|
||||
* **Instagram:** `Sanitize sharing links` ([#6483](https://github.com/ReVanced/revanced-patches/issues/6483)) ([8724759](https://github.com/ReVanced/revanced-patches/commit/87247590de3db74680cb02ba1d87bf683b2269e2))
|
||||
* **YouTube - Hide layout components:** Hide new type of crowdfunding box ([#6380](https://github.com/ReVanced/revanced-patches/issues/6380)) ([dc69f24](https://github.com/ReVanced/revanced-patches/commit/dc69f2433e2650654e2dffdd76b0b0c8a52bf515))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Add `Disable Sentry telemetry` patch ([#6416](https://github.com/ReVanced/revanced-patches/issues/6416)) ([4cc3159](https://github.com/ReVanced/revanced-patches/commit/4cc315952db557c565872de9e8484805f2e42305))
|
||||
* Add `Prevent screenshot detection` patch ([#6482](https://github.com/ReVanced/revanced-patches/issues/6482)) ([83c0127](https://github.com/ReVanced/revanced-patches/commit/83c0127ebb8f53ab8a067758619faaac5596c145))
|
||||
* Disable Play Integrity patch ([#6412](https://github.com/ReVanced/revanced-patches/issues/6412)) ([6312fe8](https://github.com/ReVanced/revanced-patches/commit/6312fe8d60da24465c0c1b0fa4e94ceb79873d9c))
|
||||
* **Instagram - Hides navigation buttons:** Add more buttons to hide ([#6390](https://github.com/ReVanced/revanced-patches/issues/6390)) ([6bb6281](https://github.com/ReVanced/revanced-patches/commit/6bb62811493da04812cc3e392e68d874f95cbef9))
|
||||
* **Instagram:** Add `Hide highlights tray` patch ([#6489](https://github.com/ReVanced/revanced-patches/issues/6489)) ([8725a49](https://github.com/ReVanced/revanced-patches/commit/8725a49ba3a06fee0280ffcf4be62cd960cd301e))
|
||||
* **Instagram:** Add `Remove build expired popup` patch ([#6488](https://github.com/ReVanced/revanced-patches/issues/6488)) ([18c0b04](https://github.com/ReVanced/revanced-patches/commit/18c0b04f0cd1bf8cd78b05af3b8ebe3a6a5f9e48))
|
||||
* **Instagram:** Disable `Disable Reels scrolling` by default ([3401467](https://github.com/ReVanced/revanced-patches/commit/3401467a6d49fc75b6757a15e5c848330c1b7307))
|
||||
* **Letterboxd:** Add `Unlock app icons` patch ([#6415](https://github.com/ReVanced/revanced-patches/issues/6415)) ([d25dcfe](https://github.com/ReVanced/revanced-patches/commit/d25dcfe49ac331c9b3dca739ba0be95dbab669cc))
|
||||
* **ProtonVPN:** Add `Unlock split tunneling` patch ([#6353](https://github.com/ReVanced/revanced-patches/issues/6353)) ([e0f3346](https://github.com/ReVanced/revanced-patches/commit/e0f33468e6e96b9f10cf35ec67622d6488528c90))
|
||||
* **SBS On Demand:** Add `Remove ads` patch ([#6378](https://github.com/ReVanced/revanced-patches/issues/6378)) ([315931c](https://github.com/ReVanced/revanced-patches/commit/315931cbf8f61cd4b3a54ace1ff03685d748614c))
|
||||
* **Strava:** Add `Add 'Give Kudos' button to 'Group Activity'` patch ([#6475](https://github.com/ReVanced/revanced-patches/issues/6475)) ([4c4ba1c](https://github.com/ReVanced/revanced-patches/commit/4c4ba1c78c9f4568a2b572f5c69e9c6c734e1a7f))
|
||||
* **Strava:** Add `Add media download` patch ([#6449](https://github.com/ReVanced/revanced-patches/issues/6449)) ([778d13c](https://github.com/ReVanced/revanced-patches/commit/778d13ce8b28ca6df3a665530320e4a21a27ae44))
|
||||
* **Strava:** Add `Block Snowplow tracking` patch ([#6413](https://github.com/ReVanced/revanced-patches/issues/6413)) ([c47beae](https://github.com/ReVanced/revanced-patches/commit/c47beae21376dd17ab8bc09afe73e9094481bde9))
|
||||
* **Strava:** Add `Disable Quick Edit` patch ([#6452](https://github.com/ReVanced/revanced-patches/issues/6452)) ([f5cbb31](https://github.com/ReVanced/revanced-patches/commit/f5cbb31724d15f7e939b96ee0186fd0a108f9fdc))
|
||||
* **Strava:** Add `Enable password login` patch ([#6396](https://github.com/ReVanced/revanced-patches/issues/6396)) ([8f3f4c9](https://github.com/ReVanced/revanced-patches/commit/8f3f4c95bb8f151fc9a2c272bf7d0e905c2f01fc))
|
||||
* **Strava:** Add `Overwrite media upload parameters` patch ([#6410](https://github.com/ReVanced/revanced-patches/issues/6410)) ([b42ae27](https://github.com/ReVanced/revanced-patches/commit/b42ae27ce66ebad9e9cfc5b70fc121df5bad7567))
|
||||
* **YouTube:** Add `Pause on audio interrupt` patch ([#6464](https://github.com/ReVanced/revanced-patches/issues/6464)) ([19f146c](https://github.com/ReVanced/revanced-patches/commit/19f146c01dc381b3cccd61e61ba4901872ff12d8))
|
||||
|
||||
# [5.48.0-dev.13](https://github.com/ReVanced/revanced-patches/compare/v5.48.0-dev.12...v5.48.0-dev.13) (2026-01-19)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Add `Prevent screenshot detection` patch ([#6482](https://github.com/ReVanced/revanced-patches/issues/6482)) ([83c0127](https://github.com/ReVanced/revanced-patches/commit/83c0127ebb8f53ab8a067758619faaac5596c145))
|
||||
|
||||
# [5.48.0-dev.12](https://github.com/ReVanced/revanced-patches/compare/v5.48.0-dev.11...v5.48.0-dev.12) (2026-01-19)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Instagram:** Add `Remove build expired popup` patch ([#6488](https://github.com/ReVanced/revanced-patches/issues/6488)) ([18c0b04](https://github.com/ReVanced/revanced-patches/commit/18c0b04f0cd1bf8cd78b05af3b8ebe3a6a5f9e48))
|
||||
* **Strava:** Add `Add 'Give Kudos' button to 'Group Activity'` patch ([#6475](https://github.com/ReVanced/revanced-patches/issues/6475)) ([4c4ba1c](https://github.com/ReVanced/revanced-patches/commit/4c4ba1c78c9f4568a2b572f5c69e9c6c734e1a7f))
|
||||
|
||||
# [5.48.0-dev.11](https://github.com/ReVanced/revanced-patches/compare/v5.48.0-dev.10...v5.48.0-dev.11) (2026-01-19)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Instagram:** Add `Hide highlights tray` patch ([#6489](https://github.com/ReVanced/revanced-patches/issues/6489)) ([8725a49](https://github.com/ReVanced/revanced-patches/commit/8725a49ba3a06fee0280ffcf4be62cd960cd301e))
|
||||
|
||||
# [5.48.0-dev.10](https://github.com/ReVanced/revanced-patches/compare/v5.48.0-dev.9...v5.48.0-dev.10) (2026-01-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Boost for Reddit - Fix missing audio in video downloads:** Make it work again by reflecting Reddits latest changes ([#6500](https://github.com/ReVanced/revanced-patches/issues/6500)) ([eecc44b](https://github.com/ReVanced/revanced-patches/commit/eecc44b9567bf2ca72ac99e0dafa483a6803c0f9))
|
||||
* **Instagram:** `Sanitize sharing links` ([#6483](https://github.com/ReVanced/revanced-patches/issues/6483)) ([8724759](https://github.com/ReVanced/revanced-patches/commit/87247590de3db74680cb02ba1d87bf683b2269e2))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Instagram:** Disable `Disable Reels scrolling` by default ([3401467](https://github.com/ReVanced/revanced-patches/commit/3401467a6d49fc75b6757a15e5c848330c1b7307))
|
||||
* **Strava:** Add `Add media download` patch ([#6449](https://github.com/ReVanced/revanced-patches/issues/6449)) ([778d13c](https://github.com/ReVanced/revanced-patches/commit/778d13ce8b28ca6df3a665530320e4a21a27ae44))
|
||||
* **YouTube:** Add `Pause on audio interrupt` patch ([#6464](https://github.com/ReVanced/revanced-patches/issues/6464)) ([19f146c](https://github.com/ReVanced/revanced-patches/commit/19f146c01dc381b3cccd61e61ba4901872ff12d8))
|
||||
|
||||
# [5.48.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v5.48.0-dev.8...v5.48.0-dev.9) (2026-01-08)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Add `Disable Sentry telemetry` patch ([#6416](https://github.com/ReVanced/revanced-patches/issues/6416)) ([4cc3159](https://github.com/ReVanced/revanced-patches/commit/4cc315952db557c565872de9e8484805f2e42305))
|
||||
* Disable Play Integrity patch ([#6412](https://github.com/ReVanced/revanced-patches/issues/6412)) ([6312fe8](https://github.com/ReVanced/revanced-patches/commit/6312fe8d60da24465c0c1b0fa4e94ceb79873d9c))
|
||||
|
||||
# [5.48.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v5.48.0-dev.7...v5.48.0-dev.8) (2026-01-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Letterboxd:** Add `Unlock app icons` patch ([#6415](https://github.com/ReVanced/revanced-patches/issues/6415)) ([d25dcfe](https://github.com/ReVanced/revanced-patches/commit/d25dcfe49ac331c9b3dca739ba0be95dbab669cc))
|
||||
|
||||
# [5.48.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v5.48.0-dev.6...v5.48.0-dev.7) (2026-01-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Strava:** Add `Disable Quick Edit` patch ([#6452](https://github.com/ReVanced/revanced-patches/issues/6452)) ([f5cbb31](https://github.com/ReVanced/revanced-patches/commit/f5cbb31724d15f7e939b96ee0186fd0a108f9fdc))
|
||||
* **Strava:** Add `Overwrite media upload parameters` patch ([#6410](https://github.com/ReVanced/revanced-patches/issues/6410)) ([b42ae27](https://github.com/ReVanced/revanced-patches/commit/b42ae27ce66ebad9e9cfc5b70fc121df5bad7567))
|
||||
|
||||
# [5.48.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v5.48.0-dev.5...v5.48.0-dev.6) (2026-01-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix build error introduced in `4046bee` ([#6417](https://github.com/ReVanced/revanced-patches/issues/6417)) ([789f0a5](https://github.com/ReVanced/revanced-patches/commit/789f0a562861825065633d172445ebf35a1ba8d8))
|
||||
|
||||
# [5.48.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v5.48.0-dev.4...v5.48.0-dev.5) (2025-12-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Disney+ - Skip ads:** Remove unsupported package names ([#6422](https://github.com/ReVanced/revanced-patches/issues/6422)) ([44e7dbc](https://github.com/ReVanced/revanced-patches/commit/44e7dbcf4d7eaf94dd0164baba847d3e19250154))
|
||||
|
||||
# [5.48.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.48.0-dev.3...v5.48.0-dev.4) (2025-12-29)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Strava:** Add `Block Snowplow tracking` patch ([#6413](https://github.com/ReVanced/revanced-patches/issues/6413)) ([c47beae](https://github.com/ReVanced/revanced-patches/commit/c47beae21376dd17ab8bc09afe73e9094481bde9))
|
||||
|
||||
# [5.48.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.48.0-dev.2...v5.48.0-dev.3) (2025-12-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix compilation error introduced in `6bb6281` ([#6409](https://github.com/ReVanced/revanced-patches/issues/6409)) ([71c6cb5](https://github.com/ReVanced/revanced-patches/commit/71c6cb569ebf7b93cf73ee391839e5220557ce7c))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Instagram - Hides navigation buttons:** Add more buttons to hide ([#6390](https://github.com/ReVanced/revanced-patches/issues/6390)) ([6bb6281](https://github.com/ReVanced/revanced-patches/commit/6bb62811493da04812cc3e392e68d874f95cbef9))
|
||||
|
||||
# [5.48.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.48.0-dev.1...v5.48.0-dev.2) (2025-12-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Strava:** Add `Enable password login` patch ([#6396](https://github.com/ReVanced/revanced-patches/issues/6396)) ([8f3f4c9](https://github.com/ReVanced/revanced-patches/commit/8f3f4c95bb8f151fc9a2c272bf7d0e905c2f01fc))
|
||||
|
||||
# [5.48.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.47.0...v5.48.0-dev.1) (2025-12-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix compilation error introduced in dc69f243 ([#6392](https://github.com/ReVanced/revanced-patches/issues/6392)) ([a429824](https://github.com/ReVanced/revanced-patches/commit/a429824bb77b49aea14b0b54f2204ae24d5209a1))
|
||||
* **YouTube - Hide layout components:** Hide new type of crowdfunding box ([#6380](https://github.com/ReVanced/revanced-patches/issues/6380)) ([dc69f24](https://github.com/ReVanced/revanced-patches/commit/dc69f2433e2650654e2dffdd76b0b0c8a52bf515))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ProtonVPN:** Add `Unlock split tunneling` patch ([#6353](https://github.com/ReVanced/revanced-patches/issues/6353)) ([e0f3346](https://github.com/ReVanced/revanced-patches/commit/e0f33468e6e96b9f10cf35ec67622d6488528c90))
|
||||
* **SBS On Demand:** Add `Remove ads` patch ([#6378](https://github.com/ReVanced/revanced-patches/issues/6378)) ([315931c](https://github.com/ReVanced/revanced-patches/commit/315931cbf8f61cd4b3a54ace1ff03685d748614c))
|
||||
|
||||
# [5.47.0](https://github.com/ReVanced/revanced-patches/compare/v5.46.0...v5.47.0) (2025-12-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Instagram - Disable signature check:** Change patch to default excluded ([#6283](https://github.com/ReVanced/revanced-patches/issues/6283)) ([bb745b5](https://github.com/ReVanced/revanced-patches/commit/bb745b555b3808b7679c5995319aa365630fbd76))
|
||||
* **Lightroom:** Add `Disable version check` patch to fix opening the app ([#6315](https://github.com/ReVanced/revanced-patches/issues/6315)) ([018d176](https://github.com/ReVanced/revanced-patches/commit/018d176914a06a30e9007a3eb2e6b0f459078413))
|
||||
* **Reddit - Hide ads:** Update patch for new versions of Reddit ([#6342](https://github.com/ReVanced/revanced-patches/issues/6342)) ([f8bd123](https://github.com/ReVanced/revanced-patches/commit/f8bd1239cc0f0bd1c2dca39f846951bf512891e3))
|
||||
* **Spotify:** Make patches work with latest versions again ([#6359](https://github.com/ReVanced/revanced-patches/issues/6359)) ([34830ba](https://github.com/ReVanced/revanced-patches/commit/34830ba63b436146064f0f89f948d51cd0cb9146))
|
||||
* **YouTube - Hide layout components:** Fix "Hide Subscribe button" in channel page not working ([#6363](https://github.com/ReVanced/revanced-patches/issues/6363)) ([ded8370](https://github.com/ReVanced/revanced-patches/commit/ded83702077701aac8a8749d71bf7376427f37d6))
|
||||
* **YouTube - Hide player flyout menu items:** Allow hiding audio menu with 'Android No SDK' client type ([9495cf4](https://github.com/ReVanced/revanced-patches/commit/9495cf49ef8a872be64de6c971c1919b4b9a8720))
|
||||
* **YouTube - Sanitize sharing links:** Handle non hierarchical urls ([654d091](https://github.com/ReVanced/revanced-patches/commit/654d091e650cda37650b57cbf3ba6f1cdd6d47d3))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Disney+ - SkipAds:** Add other package names the patch is compatible with ([#6372](https://github.com/ReVanced/revanced-patches/issues/6372)) ([1f4f252](https://github.com/ReVanced/revanced-patches/commit/1f4f252c81e9a89267f6e37548e66027b1bc1a1a))
|
||||
* **Disney+:** Add `Skip ads` patch ([#6343](https://github.com/ReVanced/revanced-patches/issues/6343)) ([6bd7dca](https://github.com/ReVanced/revanced-patches/commit/6bd7dca75bd2ea335a596aa93a8b767d39be5f83))
|
||||
* **IdAustria - Remove device integrity check:** Update patch to work with latest version ([#6360](https://github.com/ReVanced/revanced-patches/issues/6360)) ([0ea3491](https://github.com/ReVanced/revanced-patches/commit/0ea3491227fc50c03555d43d3fec78eb82906b26))
|
||||
* **Instagram:** Add `Anonymous story viewing` patch ([#6263](https://github.com/ReVanced/revanced-patches/issues/6263)) ([94ae84a](https://github.com/ReVanced/revanced-patches/commit/94ae84ad0fc3a9197c82d5356301d464730c3b17))
|
||||
* **Instagram:** Add `Disable auto story flipping` patch ([#6262](https://github.com/ReVanced/revanced-patches/issues/6262)) ([2f0de15](https://github.com/ReVanced/revanced-patches/commit/2f0de15e67e4f99ed6ecdc136d04cceb23b0d069))
|
||||
* **Instagram:** Add `Disable Reels scrolling` patch ([#6317](https://github.com/ReVanced/revanced-patches/issues/6317)) ([0928dcd](https://github.com/ReVanced/revanced-patches/commit/0928dcd00dc2a9c1eef9a23c1e26ff5dc9ee670a))
|
||||
* **Letterboxd:** Add `Hide ads` patch ([#6309](https://github.com/ReVanced/revanced-patches/issues/6309)) ([0af0ee9](https://github.com/ReVanced/revanced-patches/commit/0af0ee92c48bb2ffc332197e05439e20c5c05d83))
|
||||
* **Peacock TV:** Add `Hide ads` patch ([#6348](https://github.com/ReVanced/revanced-patches/issues/6348)) ([847ee18](https://github.com/ReVanced/revanced-patches/commit/847ee189a971e6d4a99823998569f8e561b8319c))
|
||||
* **ProtonVPN:** Add `Remove delay` patch ([#6326](https://github.com/ReVanced/revanced-patches/issues/6326)) ([bbd8932](https://github.com/ReVanced/revanced-patches/commit/bbd8932b2e740aff96ba047332e541bff3e09436))
|
||||
* **Spoof SIM provider:** Spoof additional TelephonyManager methods ([#6293](https://github.com/ReVanced/revanced-patches/issues/6293)) ([ac583d4](https://github.com/ReVanced/revanced-patches/commit/ac583d40d0f4c0e6544e3661ff3e82a25912f2b0))
|
||||
* **YouTube - Hide layout components:** Add "Hide cell divider", "Hide featured links", and "Hide featured videos" options ([#6335](https://github.com/ReVanced/revanced-patches/issues/6335)) ([a5d197b](https://github.com/ReVanced/revanced-patches/commit/a5d197b9775b98d7a37bfdee9e5f726d5e04d8cf))
|
||||
* **YouTube - Hide layout components:** Add "Hide Join button" and "Hide Subscribe button" options for channel page ([#6345](https://github.com/ReVanced/revanced-patches/issues/6345)) ([02831a6](https://github.com/ReVanced/revanced-patches/commit/02831a6069fc30ffa3a87f8e4de653d003a2187e))
|
||||
* **YouTube - Hide Shorts components:** Add "Hide auto-dubbed label" and "Hide live preview" options ([#6334](https://github.com/ReVanced/revanced-patches/issues/6334)) ([a7c220a](https://github.com/ReVanced/revanced-patches/commit/a7c220a4aea93ea7ae7005b5760443d7571c4228))
|
||||
|
||||
# [5.47.0-dev.18](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.17...v5.47.0-dev.18) (2025-12-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Disney+ - SkipAds:** Add other package names the patch is compatible with ([#6372](https://github.com/ReVanced/revanced-patches/issues/6372)) ([1f4f252](https://github.com/ReVanced/revanced-patches/commit/1f4f252c81e9a89267f6e37548e66027b1bc1a1a))
|
||||
|
||||
# [5.47.0-dev.17](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.16...v5.47.0-dev.17) (2025-12-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Reddit - Hide ads:** Update patch for new versions of Reddit ([#6342](https://github.com/ReVanced/revanced-patches/issues/6342)) ([f8bd123](https://github.com/ReVanced/revanced-patches/commit/f8bd1239cc0f0bd1c2dca39f846951bf512891e3))
|
||||
|
||||
# [5.47.0-dev.16](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.15...v5.47.0-dev.16) (2025-12-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Lightroom:** Add `Disable version check` patch to fix opening the app ([#6315](https://github.com/ReVanced/revanced-patches/issues/6315)) ([018d176](https://github.com/ReVanced/revanced-patches/commit/018d176914a06a30e9007a3eb2e6b0f459078413))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **IdAustria - Remove device integrity check:** Update patch to work with latest version ([#6360](https://github.com/ReVanced/revanced-patches/issues/6360)) ([0ea3491](https://github.com/ReVanced/revanced-patches/commit/0ea3491227fc50c03555d43d3fec78eb82906b26))
|
||||
|
||||
# [5.47.0-dev.15](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.14...v5.47.0-dev.15) (2025-12-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Hide layout components:** Fix "Hide Subscribe button" in channel page not working ([#6363](https://github.com/ReVanced/revanced-patches/issues/6363)) ([ded8370](https://github.com/ReVanced/revanced-patches/commit/ded83702077701aac8a8749d71bf7376427f37d6))
|
||||
|
||||
# [5.47.0-dev.14](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.13...v5.47.0-dev.14) (2025-12-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Spotify:** Make patches work with latest versions again ([#6359](https://github.com/ReVanced/revanced-patches/issues/6359)) ([34830ba](https://github.com/ReVanced/revanced-patches/commit/34830ba63b436146064f0f89f948d51cd0cb9146))
|
||||
|
||||
# [5.47.0-dev.13](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.12...v5.47.0-dev.13) (2025-12-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Peacock TV:** Add `Hide ads` patch ([#6348](https://github.com/ReVanced/revanced-patches/issues/6348)) ([847ee18](https://github.com/ReVanced/revanced-patches/commit/847ee189a971e6d4a99823998569f8e561b8319c))
|
||||
|
||||
# [5.47.0-dev.12](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.11...v5.47.0-dev.12) (2025-12-08)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **YouTube - Hide layout components:** Add "Hide Join button" and "Hide Subscribe button" options for channel page ([#6345](https://github.com/ReVanced/revanced-patches/issues/6345)) ([02831a6](https://github.com/ReVanced/revanced-patches/commit/02831a6069fc30ffa3a87f8e4de653d003a2187e))
|
||||
|
||||
# [5.47.0-dev.11](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.10...v5.47.0-dev.11) (2025-12-08)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Disney+:** Add `Skip ads` patch ([#6343](https://github.com/ReVanced/revanced-patches/issues/6343)) ([6bd7dca](https://github.com/ReVanced/revanced-patches/commit/6bd7dca75bd2ea335a596aa93a8b767d39be5f83))
|
||||
|
||||
# [5.47.0-dev.10](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.9...v5.47.0-dev.10) (2025-12-08)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **YouTube - Hide Shorts components:** Add "Hide auto-dubbed label" and "Hide live preview" options ([#6334](https://github.com/ReVanced/revanced-patches/issues/6334)) ([a7c220a](https://github.com/ReVanced/revanced-patches/commit/a7c220a4aea93ea7ae7005b5760443d7571c4228))
|
||||
|
||||
# [5.47.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.8...v5.47.0-dev.9) (2025-12-08)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **YouTube - Hide layout components:** Add "Hide cell divider", "Hide featured links", and "Hide featured videos" options ([#6335](https://github.com/ReVanced/revanced-patches/issues/6335)) ([a5d197b](https://github.com/ReVanced/revanced-patches/commit/a5d197b9775b98d7a37bfdee9e5f726d5e04d8cf))
|
||||
|
||||
# [5.47.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.7...v5.47.0-dev.8) (2025-12-08)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Instagram:** Add `Disable Reels scrolling` patch ([#6317](https://github.com/ReVanced/revanced-patches/issues/6317)) ([0928dcd](https://github.com/ReVanced/revanced-patches/commit/0928dcd00dc2a9c1eef9a23c1e26ff5dc9ee670a))
|
||||
* **ProtonVPN:** Add `Remove delay` patch ([#6326](https://github.com/ReVanced/revanced-patches/issues/6326)) ([bbd8932](https://github.com/ReVanced/revanced-patches/commit/bbd8932b2e740aff96ba047332e541bff3e09436))
|
||||
|
||||
# [5.47.0-dev.7](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.6...v5.47.0-dev.7) (2025-12-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Spoof SIM provider:** Spoof additional TelephonyManager methods ([#6293](https://github.com/ReVanced/revanced-patches/issues/6293)) ([ac583d4](https://github.com/ReVanced/revanced-patches/commit/ac583d40d0f4c0e6544e3661ff3e82a25912f2b0))
|
||||
|
||||
# [5.47.0-dev.6](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.5...v5.47.0-dev.6) (2025-11-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Letterboxd:** Add `Hide ads` patch ([#6309](https://github.com/ReVanced/revanced-patches/issues/6309)) ([0af0ee9](https://github.com/ReVanced/revanced-patches/commit/0af0ee92c48bb2ffc332197e05439e20c5c05d83))
|
||||
|
||||
# [5.47.0-dev.5](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.4...v5.47.0-dev.5) (2025-11-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Hide player flyout menu items:** Allow hiding audio menu with 'Android No SDK' client type ([9495cf4](https://github.com/ReVanced/revanced-patches/commit/9495cf49ef8a872be64de6c971c1919b4b9a8720))
|
||||
|
||||
# [5.47.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.3...v5.47.0-dev.4) (2025-11-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Sanitize sharing links:** Handle non hierarchical urls ([654d091](https://github.com/ReVanced/revanced-patches/commit/654d091e650cda37650b57cbf3ba6f1cdd6d47d3))
|
||||
|
||||
# [5.47.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.2...v5.47.0-dev.3) (2025-11-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Instagram:** Add `Disable auto story flipping` patch ([#6262](https://github.com/ReVanced/revanced-patches/issues/6262)) ([2f0de15](https://github.com/ReVanced/revanced-patches/commit/2f0de15e67e4f99ed6ecdc136d04cceb23b0d069))
|
||||
|
||||
# [5.47.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.47.0-dev.1...v5.47.0-dev.2) (2025-11-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Instagram - Disable signature check:** Change patch to default excluded ([#6283](https://github.com/ReVanced/revanced-patches/issues/6283)) ([bb745b5](https://github.com/ReVanced/revanced-patches/commit/bb745b555b3808b7679c5995319aa365630fbd76))
|
||||
|
||||
# [5.47.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.46.0...v5.47.0-dev.1) (2025-11-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Instagram:** Add `Anonymous story viewing` patch ([#6263](https://github.com/ReVanced/revanced-patches/issues/6263)) ([94ae84a](https://github.com/ReVanced/revanced-patches/commit/94ae84ad0fc3a9197c82d5356301d464730c3b17))
|
||||
|
||||
# [5.46.0](https://github.com/ReVanced/revanced-patches/compare/v5.45.0...v5.46.0) (2025-11-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Duolingo - Disable ads:** Constrain patch to last working app target ([f238ae9](https://github.com/ReVanced/revanced-patches/commit/f238ae9895000f01d1dccb800cc8efde0d5362bd))
|
||||
* **Instagram - Hide navigation buttons:** Constrain patch to last working app target ([e030e9c](https://github.com/ReVanced/revanced-patches/commit/e030e9c07a7748e117ac44f6776a9f6317b20623))
|
||||
* **Spotify - Hide Create button:** Remove obsolete patch that is no longer needed ([#6252](https://github.com/ReVanced/revanced-patches/issues/6252)) ([59d85b2](https://github.com/ReVanced/revanced-patches/commit/59d85b28a7fcb285ff5f2bb6ae654020d76b2019))
|
||||
* **YouTube - Check watch history domain name resolution:** Fix false positive warning message if the internet connection fails halfway into the DNS check ([5726353](https://github.com/ReVanced/revanced-patches/commit/57263538c79f5a561c449229ac8e068c641285d3))
|
||||
* **YouTube - Hide layout components:** Fix "Hide Hype points" ([#6247](https://github.com/ReVanced/revanced-patches/issues/6247)) ([5821440](https://github.com/ReVanced/revanced-patches/commit/582144026d28e57bb7adcbba39244f3c7cdbc0f3))
|
||||
* **YouTube - Settings:** Add additional languages to ReVanced language preference ([d390b54](https://github.com/ReVanced/revanced-patches/commit/d390b54dab92d75b4e0d3e38344eae489dd69d98))
|
||||
* **YouTube - Settings:** Resolve settings search crash when searching for specific words ([#6231](https://github.com/ReVanced/revanced-patches/issues/6231)) ([76dcfae](https://github.com/ReVanced/revanced-patches/commit/76dcfaefd8679e45a70f265b0239436e60c055cf))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **YouTube - Debugging:** Add setting to block experimental client flags ([#6196](https://github.com/ReVanced/revanced-patches/issues/6196)) ([2e9d695](https://github.com/ReVanced/revanced-patches/commit/2e9d6959c94df7588b9e34b18770e9f437e91926))
|
||||
* **YouTube - Hide layout components:** Add "Hide Hype points" ([#6230](https://github.com/ReVanced/revanced-patches/issues/6230)) ([a52c015](https://github.com/ReVanced/revanced-patches/commit/a52c0153b12c3f6f0ad260e03d2e9850c0466392))
|
||||
* **YouTube - Hide layout components:** Add video description "Hide Featured content" and "Hide Subscribe button" ([#6253](https://github.com/ReVanced/revanced-patches/issues/6253)) ([da4cf94](https://github.com/ReVanced/revanced-patches/commit/da4cf940911a4406e2c9dd558b60305385a80c61))
|
||||
* **YouTube - Hide player flyout menu items:** Add "Hide Listen with YouTube Music" ([#6232](https://github.com/ReVanced/revanced-patches/issues/6232)) ([858edbf](https://github.com/ReVanced/revanced-patches/commit/858edbf3e7f394fcc766d767c8dc54cf5ba24370))
|
||||
* **YouTube Music:** Add `Change miniplayer color` patch ([#6259](https://github.com/ReVanced/revanced-patches/issues/6259)) ([ab808ae](https://github.com/ReVanced/revanced-patches/commit/ab808aeb773592cb26c848d8456478a346ec3bad))
|
||||
* **YouTube Music:** Add `Hide buttons` patch ([#6255](https://github.com/ReVanced/revanced-patches/issues/6255)) ([7a18ebc](https://github.com/ReVanced/revanced-patches/commit/7a18ebc7ab74ba30c5d5284a4856c55cdfc31097))
|
||||
|
||||
# [5.46.0-dev.10](https://github.com/ReVanced/revanced-patches/compare/v5.46.0-dev.9...v5.46.0-dev.10) (2025-11-09)
|
||||
|
||||
|
||||
|
||||
@@ -97,9 +97,9 @@ Thank you for considering contributing to ReVanced Patches. You can find the con
|
||||
|
||||
To build ReVanced Patches, you can follow the [ReVanced documentation](https://github.com/ReVanced/revanced-documentation).
|
||||
|
||||
## 📜 Licence
|
||||
## 📜 License
|
||||
|
||||
ReVanced Patches is licensed under the GPLv3 license. Please see the [license file](LICENSE) for more information.
|
||||
[tl;dr](https://www.tldrlegal.com/license/gnu-general-public-license-v3-gpl-3) you may copy, distribute and modify ReVanced Patches as long as you track changes/dates in source files.
|
||||
Any modifications to ReVanced Patches must also be made available under the GPL,
|
||||
along with build & install instructions.
|
||||
along with build & install instructions.
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
project_id_env: "CROWDIN_PROJECT_ID"
|
||||
api_token_env: "CROWDIN_PERSONAL_TOKEN"
|
||||
|
||||
preserve_hierarchy: false
|
||||
preserve_hierarchy: true
|
||||
files:
|
||||
- source: patches/src/main/resources/addresources/values/strings.xml
|
||||
dest: patches.xml
|
||||
translation: patches/src/main/resources/addresources/values-%android_code%/strings.xml
|
||||
skip_untranslated_strings: true
|
||||
|
||||
20
extensions/all/misc/disable-play-integrity/build.gradle.kts
Normal file
20
extensions/all/misc/disable-play-integrity/build.gradle.kts
Normal file
@@ -0,0 +1,20 @@
|
||||
android {
|
||||
namespace = "app.revanced.extension"
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 21
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
aidl = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly(libs.annotation)
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<manifest/>
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.google.android.play.core.integrity.protocol;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.google.android.play.core.integrity.protocol.IExpressIntegrityServiceCallback;
|
||||
|
||||
interface IExpressIntegrityService {
|
||||
oneway void requestIntegrityToken(in Bundle request, IExpressIntegrityServiceCallback callback) = 2;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.google.android.play.core.integrity.protocol;
|
||||
|
||||
interface IExpressIntegrityServiceCallback {
|
||||
oneway void onRequestExpressIntegrityTokenResult(in Bundle result) = 2;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.google.android.play.core.integrity.protocol;
|
||||
|
||||
import android.os.Bundle;
|
||||
import com.google.android.play.core.integrity.protocol.IIntegrityServiceCallback;
|
||||
|
||||
interface IIntegrityService {
|
||||
oneway void requestIntegrityToken(in Bundle request, IIntegrityServiceCallback callback) = 1;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.google.android.play.core.integrity.protocol;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
interface IIntegrityServiceCallback {
|
||||
oneway void onResult(in Bundle result) = 1;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package android.ext;
|
||||
/** @hide */
|
||||
// Int values that are assigned to packages in this interface can be retrieved at runtime from
|
||||
// ApplicationInfo.ext().getPackageId() or from AndroidPackage.ext().getPackageId() (in system_server).
|
||||
//
|
||||
// PackageIds are assigned to parsed APKs only after they are verified, either by a certificate check
|
||||
// or by a check that the APK is stored on an immutable OS partition.
|
||||
public interface PackageId {
|
||||
String PLAY_STORE_NAME = "com.android.vending";
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package android.os;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
|
||||
/** @hide */
|
||||
public class BinderWrapper implements IBinder {
|
||||
protected final IBinder base;
|
||||
|
||||
public BinderWrapper(IBinder base) {
|
||||
this.base = base;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean transact(int code, @NonNull Parcel data, @Nullable Parcel reply, int flags) throws RemoteException {
|
||||
return base.transact(code, data, reply, flags);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IInterface queryLocalInterface(@NonNull String descriptor) {
|
||||
return base.queryLocalInterface(descriptor);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getInterfaceDescriptor() throws RemoteException {
|
||||
return base.getInterfaceDescriptor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean pingBinder() {
|
||||
return base.pingBinder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBinderAlive() {
|
||||
return base.isBinderAlive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dump(@NonNull FileDescriptor fd, @Nullable String[] args) throws RemoteException {
|
||||
base.dump(fd, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dumpAsync(@NonNull FileDescriptor fd, @Nullable String[] args) throws RemoteException {
|
||||
base.dumpAsync(fd, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void linkToDeath(@NonNull DeathRecipient recipient, int flags) throws RemoteException {
|
||||
base.linkToDeath(recipient, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean unlinkToDeath(@NonNull DeathRecipient recipient, int flags) {
|
||||
return base.unlinkToDeath(recipient, flags);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package app.grapheneos.gmscompat.lib.playintegrity;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.internal.os.FakeBackgroundHandler;
|
||||
import com.google.android.play.core.integrity.protocol.IIntegrityService;
|
||||
import com.google.android.play.core.integrity.protocol.IIntegrityServiceCallback;
|
||||
|
||||
class ClassicPlayIntegrityServiceWrapper extends PlayIntegrityServiceWrapper {
|
||||
|
||||
ClassicPlayIntegrityServiceWrapper(IBinder base) {
|
||||
super(base);
|
||||
requestIntegrityTokenTxnCode = 2; // IIntegrityService.Stub.TRANSACTION_requestIntegrityToken
|
||||
}
|
||||
|
||||
static class TokenRequestStub extends IIntegrityService.Stub {
|
||||
public void requestIntegrityToken(Bundle request, IIntegrityServiceCallback callback) {
|
||||
Runnable r = () -> {
|
||||
var result = new Bundle();
|
||||
// https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/IntegrityErrorCode.html#API_NOT_AVAILABLE
|
||||
final int API_NOT_AVAILABLE = -1;
|
||||
result.putInt("error", API_NOT_AVAILABLE);
|
||||
try {
|
||||
callback.onResult(result);
|
||||
} catch (RemoteException e) {
|
||||
Log.e("IIntegrityService.Stub", "", e);
|
||||
}
|
||||
};
|
||||
FakeBackgroundHandler.getHandler().postDelayed(r, getTokenRequestResultDelay());
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected Binder createTokenRequestStub() {
|
||||
return new TokenRequestStub();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package app.grapheneos.gmscompat.lib.playintegrity;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.BinderWrapper;
|
||||
import android.os.IBinder;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
abstract class PlayIntegrityServiceWrapper extends BinderWrapper {
|
||||
final String TAG;
|
||||
protected int requestIntegrityTokenTxnCode;
|
||||
|
||||
public PlayIntegrityServiceWrapper(IBinder base) {
|
||||
super(base);
|
||||
TAG = getClass().getSimpleName();
|
||||
}
|
||||
|
||||
protected abstract Binder createTokenRequestStub();
|
||||
|
||||
@Override
|
||||
public boolean transact(int code, Parcel data, @Nullable Parcel reply, int flags) throws RemoteException {
|
||||
if (code == requestIntegrityTokenTxnCode) {
|
||||
if (maybeStubOutIntegrityTokenRequest(code, data, reply, flags)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.transact(code, data, reply, flags);
|
||||
}
|
||||
|
||||
private boolean maybeStubOutIntegrityTokenRequest(int code, Parcel data, @Nullable Parcel reply, int flags) {
|
||||
Log.d(TAG, "integrity token request detected");
|
||||
|
||||
try {
|
||||
createTokenRequestStub().transact(code, data, reply, flags);
|
||||
} catch (RemoteException e) {
|
||||
// this is a local call
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected static long getTokenRequestResultDelay() {
|
||||
return 500L;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package app.grapheneos.gmscompat.lib.playintegrity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.ext.PackageId;
|
||||
import android.os.IBinder;
|
||||
import androidx.annotation.Nullable;
|
||||
import app.grapheneos.gmscompat.lib.util.ServiceConnectionWrapper;
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
public class PlayIntegrityUtils {
|
||||
|
||||
public static @Nullable ServiceConnection maybeReplaceServiceConnection(Intent service, ServiceConnection orig) {
|
||||
if (PackageId.PLAY_STORE_NAME.equals(service.getPackage())) {
|
||||
UnaryOperator<IBinder> binderOverride = null;
|
||||
|
||||
final String CLASSIC_SERVICE =
|
||||
"com.google.android.play.core.integrityservice.BIND_INTEGRITY_SERVICE";
|
||||
final String STANDARD_SERVICE =
|
||||
"com.google.android.play.core.expressintegrityservice.BIND_EXPRESS_INTEGRITY_SERVICE";
|
||||
|
||||
String action = service.getAction();
|
||||
if (STANDARD_SERVICE.equals(action)) {
|
||||
binderOverride = StandardPlayIntegrityServiceWrapper::new;
|
||||
} else if (CLASSIC_SERVICE.equals(action)) {
|
||||
binderOverride = ClassicPlayIntegrityServiceWrapper::new;
|
||||
}
|
||||
|
||||
if (binderOverride != null) {
|
||||
return new ServiceConnectionWrapper(orig, binderOverride);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package app.grapheneos.gmscompat.lib.playintegrity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
import com.android.internal.os.FakeBackgroundHandler;
|
||||
import com.google.android.play.core.integrity.protocol.IExpressIntegrityService;
|
||||
import com.google.android.play.core.integrity.protocol.IExpressIntegrityServiceCallback;
|
||||
|
||||
@SuppressLint("LongLogTag")
|
||||
class StandardPlayIntegrityServiceWrapper extends PlayIntegrityServiceWrapper {
|
||||
|
||||
StandardPlayIntegrityServiceWrapper(IBinder base) {
|
||||
super(base);
|
||||
requestIntegrityTokenTxnCode = 3; // IExpressIntegrityService.Stub.TRANSACTION_requestIntegrityToken
|
||||
}
|
||||
|
||||
static class TokenRequestStub extends IExpressIntegrityService.Stub {
|
||||
public void requestIntegrityToken(Bundle request, IExpressIntegrityServiceCallback callback) {
|
||||
Runnable r = () -> {
|
||||
var result = new Bundle();
|
||||
// https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/StandardIntegrityErrorCode.html#API_NOT_AVAILABLE
|
||||
final int API_NOT_AVAILABLE = -1;
|
||||
result.putInt("error", API_NOT_AVAILABLE);
|
||||
try {
|
||||
callback.onRequestExpressIntegrityTokenResult(result);
|
||||
} catch (RemoteException e) {
|
||||
Log.e("IExpressIntegrityService.Stub", "", e);
|
||||
}
|
||||
};
|
||||
FakeBackgroundHandler.getHandler().postDelayed(r, getTokenRequestResultDelay());
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected Binder createTokenRequestStub() {
|
||||
return new TokenRequestStub();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package app.grapheneos.gmscompat.lib.util;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
public class ServiceConnectionWrapper implements ServiceConnection {
|
||||
private final ServiceConnection base;
|
||||
private final UnaryOperator<IBinder> binderOverride;
|
||||
|
||||
public ServiceConnectionWrapper(ServiceConnection base, UnaryOperator<IBinder> binderOverride) {
|
||||
this.base = base;
|
||||
this.binderOverride = binderOverride;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
IBinder override = binderOverride.apply(service);
|
||||
if (override != null) {
|
||||
service = override;
|
||||
}
|
||||
}
|
||||
|
||||
base.onServiceConnected(name, service);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName name) {
|
||||
base.onServiceDisconnected(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindingDied(ComponentName name) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
base.onBindingDied(name);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNullBinding(ComponentName name) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
base.onNullBinding(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package app.revanced.extension.playintegrity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import app.grapheneos.gmscompat.lib.playintegrity.PlayIntegrityUtils;
|
||||
|
||||
public class DisablePlayIntegrityPatch {
|
||||
public static boolean bindService(Context context, Intent service, ServiceConnection conn, int flags) {
|
||||
ServiceConnection override = PlayIntegrityUtils.maybeReplaceServiceConnection(service, conn);
|
||||
if (override != null) {
|
||||
conn = override;
|
||||
}
|
||||
|
||||
return context.bindService(service, conn, flags);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.android.internal.os;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
public class FakeBackgroundHandler {
|
||||
|
||||
public static Handler getHandler() {
|
||||
return new Handler(Looper.getMainLooper());
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,12 @@ import static java.lang.Boolean.FALSE;
|
||||
import static java.lang.Boolean.TRUE;
|
||||
import static app.revanced.extension.shared.settings.Setting.parent;
|
||||
|
||||
import app.revanced.extension.shared.settings.BaseSettings;
|
||||
import app.revanced.extension.shared.settings.YouTubeAndMusicSettings;
|
||||
import app.revanced.extension.shared.settings.BooleanSetting;
|
||||
import app.revanced.extension.shared.settings.EnumSetting;
|
||||
import app.revanced.extension.shared.spoof.ClientType;
|
||||
|
||||
public class Settings extends BaseSettings {
|
||||
public class Settings extends YouTubeAndMusicSettings {
|
||||
|
||||
// Ads
|
||||
public static final BooleanSetting HIDE_VIDEO_ADS = new BooleanSetting("revanced_music_hide_video_ads", TRUE, true);
|
||||
|
||||
15
extensions/nothingx/build.gradle.kts
Normal file
15
extensions/nothingx/build.gradle.kts
Normal file
@@ -0,0 +1,15 @@
|
||||
dependencies {
|
||||
compileOnly(project(":extensions:shared:library"))
|
||||
compileOnly(project(":extensions:nothingx:stub"))
|
||||
}
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
minSdk = 26
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
}
|
||||
1
extensions/nothingx/src/main/AndroidManifest.xml
Normal file
1
extensions/nothingx/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1 @@
|
||||
<manifest/>
|
||||
@@ -0,0 +1,590 @@
|
||||
package app.revanced.extension.nothingx.patches;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Application;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Patches to expose the K1 token for Nothing X app to enable pairing with GadgetBridge.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class ShowK1TokensPatch {
|
||||
|
||||
private static final String TAG = "ReVanced";
|
||||
private static final String PACKAGE_NAME = "com.nothing.smartcenter";
|
||||
private static final String EMPTY_MD5 = "d41d8cd98f00b204e9800998ecf8427e";
|
||||
private static final String PREFS_NAME = "revanced_nothingx_prefs";
|
||||
private static final String KEY_DONT_SHOW_DIALOG = "dont_show_k1_dialog";
|
||||
|
||||
// Colors
|
||||
private static final int COLOR_BG = 0xFF1E1E1E;
|
||||
private static final int COLOR_CARD = 0xFF2D2D2D;
|
||||
private static final int COLOR_TEXT_PRIMARY = 0xFFFFFFFF;
|
||||
private static final int COLOR_TEXT_SECONDARY = 0xFFB0B0B0;
|
||||
private static final int COLOR_ACCENT = 0xFFFF9500;
|
||||
private static final int COLOR_TOKEN_BG = 0xFF3A3A3A;
|
||||
private static final int COLOR_BUTTON_POSITIVE = 0xFFFF9500;
|
||||
private static final int COLOR_BUTTON_NEGATIVE = 0xFFFF6B6B;
|
||||
|
||||
// Match standalone K1: k1:, K1:, k1>, etc.
|
||||
private static final Pattern K1_STANDALONE_PATTERN = Pattern.compile("(?i)(?:k1\\s*[:>]\\s*)([0-9a-f]{32})");
|
||||
// Match combined r3+k1: format (64 chars = r3(32) + k1(32))
|
||||
private static final Pattern K1_COMBINED_PATTERN = Pattern.compile("(?i)r3\\+k1\\s*:\\s*([0-9a-f]{64})");
|
||||
|
||||
private static volatile boolean k1Logged = false;
|
||||
private static volatile boolean lifecycleCallbacksRegistered = false;
|
||||
private static Context appContext;
|
||||
|
||||
/**
|
||||
* Get K1 tokens from database and log files.
|
||||
* Call this after the app initializes.
|
||||
*
|
||||
* @param context Application context
|
||||
*/
|
||||
public static void showK1Tokens(Context context) {
|
||||
if (k1Logged) {
|
||||
return;
|
||||
}
|
||||
|
||||
appContext = context.getApplicationContext();
|
||||
|
||||
Set<String> allTokens = new LinkedHashSet<>();
|
||||
|
||||
// First try to get from database.
|
||||
String dbToken = getK1TokensFromDatabase();
|
||||
if (dbToken != null) {
|
||||
allTokens.add(dbToken);
|
||||
}
|
||||
|
||||
// Then get from log files.
|
||||
Set<String> logTokens = getK1TokensFromLogFiles();
|
||||
allTokens.addAll(logTokens);
|
||||
|
||||
if (allTokens.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Log all found tokens.
|
||||
int index = 1;
|
||||
for (String token : allTokens) {
|
||||
Log.i(TAG, "#" + index++ + ": " + token.toUpperCase());
|
||||
}
|
||||
|
||||
// Register lifecycle callbacks to show dialog when an Activity is ready.
|
||||
registerLifecycleCallbacks(allTokens);
|
||||
|
||||
k1Logged = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register ActivityLifecycleCallbacks to show dialog when first Activity resumes.
|
||||
*
|
||||
* @param tokens Set of K1 tokens to display
|
||||
*/
|
||||
private static void registerLifecycleCallbacks(Set<String> tokens) {
|
||||
if (lifecycleCallbacksRegistered || !(appContext instanceof Application)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Application application = (Application) appContext;
|
||||
application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
|
||||
@Override
|
||||
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(Activity activity) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity) {
|
||||
// Check if user chose not to show dialog.
|
||||
SharedPreferences prefs = activity.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
|
||||
if (prefs.getBoolean(KEY_DONT_SHOW_DIALOG, false)) {
|
||||
application.unregisterActivityLifecycleCallbacks(this);
|
||||
lifecycleCallbacksRegistered = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// Show dialog on first Activity resume.
|
||||
if (tokens != null && !tokens.isEmpty()) {
|
||||
activity.runOnUiThread(() -> showK1TokensDialog(activity, tokens));
|
||||
// Unregister after showing
|
||||
application.unregisterActivityLifecycleCallbacks(this);
|
||||
lifecycleCallbacksRegistered = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(Activity activity) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
}
|
||||
});
|
||||
|
||||
lifecycleCallbacksRegistered = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show dialog with K1 tokens.
|
||||
*
|
||||
* @param activity Activity context
|
||||
* @param tokens Set of K1 tokens
|
||||
*/
|
||||
private static void showK1TokensDialog(Activity activity, Set<String> tokens) {
|
||||
try {
|
||||
// Create main container.
|
||||
LinearLayout mainLayout = new LinearLayout(activity);
|
||||
mainLayout.setOrientation(LinearLayout.VERTICAL);
|
||||
mainLayout.setBackgroundColor(COLOR_BG);
|
||||
mainLayout.setPadding(dpToPx(activity, 24), dpToPx(activity, 16),
|
||||
dpToPx(activity, 24), dpToPx(activity, 16));
|
||||
|
||||
// Title.
|
||||
TextView titleView = new TextView(activity);
|
||||
titleView.setText("K1 Token(s) Found");
|
||||
titleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20);
|
||||
titleView.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
titleView.setTextColor(COLOR_TEXT_PRIMARY);
|
||||
titleView.setGravity(Gravity.CENTER);
|
||||
mainLayout.addView(titleView, new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
|
||||
// Subtitle.
|
||||
TextView subtitleView = new TextView(activity);
|
||||
subtitleView.setText(tokens.size() == 1 ? "1 token found • Tap to copy" : tokens.size() + " tokens found • Tap to copy");
|
||||
subtitleView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
|
||||
subtitleView.setTextColor(COLOR_TEXT_SECONDARY);
|
||||
subtitleView.setGravity(Gravity.CENTER);
|
||||
LinearLayout.LayoutParams subtitleParams = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
subtitleParams.topMargin = dpToPx(activity, 4);
|
||||
subtitleParams.bottomMargin = dpToPx(activity, 16);
|
||||
mainLayout.addView(subtitleView, subtitleParams);
|
||||
|
||||
// Scrollable content.
|
||||
ScrollView scrollView = new ScrollView(activity);
|
||||
scrollView.setVerticalScrollBarEnabled(false);
|
||||
LinearLayout.LayoutParams scrollParams = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
0,
|
||||
1.0f
|
||||
);
|
||||
scrollParams.topMargin = dpToPx(activity, 8);
|
||||
scrollParams.bottomMargin = dpToPx(activity, 16);
|
||||
mainLayout.addView(scrollView, scrollParams);
|
||||
|
||||
LinearLayout tokensContainer = new LinearLayout(activity);
|
||||
tokensContainer.setOrientation(LinearLayout.VERTICAL);
|
||||
scrollView.addView(tokensContainer);
|
||||
|
||||
// Add each token as a card.
|
||||
boolean singleToken = tokens.size() == 1;
|
||||
int index = 1;
|
||||
for (String token : tokens) {
|
||||
LinearLayout tokenCard = createTokenCard(activity, token, index++, singleToken);
|
||||
LinearLayout.LayoutParams cardParams = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
cardParams.bottomMargin = dpToPx(activity, 12);
|
||||
tokensContainer.addView(tokenCard, cardParams);
|
||||
}
|
||||
|
||||
// Info text.
|
||||
TextView infoView = new TextView(activity);
|
||||
infoView.setText(tokens.size() == 1 ? "Tap the token to copy it" : "Tap any token to copy it");
|
||||
infoView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
infoView.setTextColor(COLOR_TEXT_SECONDARY);
|
||||
infoView.setGravity(Gravity.CENTER);
|
||||
infoView.setAlpha(0.7f);
|
||||
LinearLayout.LayoutParams infoParams = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
infoParams.topMargin = dpToPx(activity, 8);
|
||||
mainLayout.addView(infoView, infoParams);
|
||||
|
||||
// Button row.
|
||||
LinearLayout buttonRow = new LinearLayout(activity);
|
||||
buttonRow.setOrientation(LinearLayout.HORIZONTAL);
|
||||
buttonRow.setGravity(Gravity.END);
|
||||
LinearLayout.LayoutParams buttonRowParams = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
buttonRowParams.topMargin = dpToPx(activity, 16);
|
||||
mainLayout.addView(buttonRow, buttonRowParams);
|
||||
|
||||
// "Don't show again" button.
|
||||
Button dontShowButton = new Button(activity);
|
||||
dontShowButton.setText("Don't show again");
|
||||
dontShowButton.setTextColor(Color.WHITE);
|
||||
dontShowButton.setBackgroundColor(Color.TRANSPARENT);
|
||||
dontShowButton.setAllCaps(false);
|
||||
dontShowButton.setTypeface(Typeface.DEFAULT);
|
||||
dontShowButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
|
||||
dontShowButton.setPadding(dpToPx(activity, 16), dpToPx(activity, 8),
|
||||
dpToPx(activity, 16), dpToPx(activity, 8));
|
||||
LinearLayout.LayoutParams dontShowParams = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
dontShowParams.rightMargin = dpToPx(activity, 8);
|
||||
buttonRow.addView(dontShowButton, dontShowParams);
|
||||
|
||||
// "OK" button.
|
||||
Button okButton = new Button(activity);
|
||||
okButton.setText("OK");
|
||||
okButton.setTextColor(Color.BLACK);
|
||||
okButton.setBackgroundColor(COLOR_BUTTON_POSITIVE);
|
||||
okButton.setAllCaps(false);
|
||||
okButton.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
okButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
|
||||
okButton.setPadding(dpToPx(activity, 24), dpToPx(activity, 12),
|
||||
dpToPx(activity, 24), dpToPx(activity, 12));
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
okButton.setElevation(dpToPx(activity, 4));
|
||||
}
|
||||
buttonRow.addView(okButton, new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
));
|
||||
|
||||
// Build dialog.
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
builder.setView(mainLayout);
|
||||
|
||||
final AlertDialog dialog = builder.create();
|
||||
|
||||
// Style the dialog with dark background.
|
||||
if (dialog.getWindow() != null) {
|
||||
dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
|
||||
}
|
||||
|
||||
dialog.show();
|
||||
|
||||
// Set button click listeners after dialog is created.
|
||||
dontShowButton.setOnClickListener(v -> {
|
||||
SharedPreferences prefs = activity.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
|
||||
prefs.edit().putBoolean(KEY_DONT_SHOW_DIALOG, true).apply();
|
||||
Toast.makeText(activity, "Dialog disabled. Clear app data to re-enable.",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
dialog.dismiss();
|
||||
});
|
||||
|
||||
okButton.setOnClickListener(v -> {
|
||||
dialog.dismiss();
|
||||
});
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Failed to show K1 dialog", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a card view for a single token.
|
||||
*/
|
||||
private static LinearLayout createTokenCard(Activity activity, String token, int index, boolean singleToken) {
|
||||
LinearLayout card = new LinearLayout(activity);
|
||||
card.setOrientation(LinearLayout.VERTICAL);
|
||||
card.setBackgroundColor(COLOR_TOKEN_BG);
|
||||
card.setPadding(dpToPx(activity, 16), dpToPx(activity, 12),
|
||||
dpToPx(activity, 16), dpToPx(activity, 12));
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
card.setElevation(dpToPx(activity, 2));
|
||||
}
|
||||
card.setClickable(true);
|
||||
card.setFocusable(true);
|
||||
|
||||
// Token label (only show if multiple tokens).
|
||||
if (!singleToken) {
|
||||
TextView labelView = new TextView(activity);
|
||||
labelView.setText("Token #" + index);
|
||||
labelView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
labelView.setTextColor(COLOR_ACCENT);
|
||||
labelView.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
card.addView(labelView);
|
||||
}
|
||||
|
||||
// Token value.
|
||||
TextView tokenView = new TextView(activity);
|
||||
tokenView.setText(token.toUpperCase());
|
||||
tokenView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
|
||||
tokenView.setTextColor(COLOR_TEXT_PRIMARY);
|
||||
tokenView.setTypeface(Typeface.MONOSPACE);
|
||||
tokenView.setLetterSpacing(0.05f);
|
||||
LinearLayout.LayoutParams tokenParams = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
if (!singleToken) {
|
||||
tokenParams.topMargin = dpToPx(activity, 8);
|
||||
}
|
||||
card.addView(tokenView, tokenParams);
|
||||
|
||||
// Click to copy.
|
||||
card.setOnClickListener(v -> {
|
||||
ClipboardManager clipboard = (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
if (clipboard != null) {
|
||||
clipboard.setText(token.toUpperCase());
|
||||
Toast.makeText(activity, "Token copied!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
return card;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert dp to pixels.
|
||||
*/
|
||||
private static int dpToPx(Context context, float dp) {
|
||||
return (int) TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP,
|
||||
dp,
|
||||
context.getResources().getDisplayMetrics()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get K1 tokens from log files.
|
||||
* Prioritizes pairing K1 tokens over reconnect tokens.
|
||||
*/
|
||||
private static Set<String> getK1TokensFromLogFiles() {
|
||||
Set<String> pairingTokens = new LinkedHashSet<>();
|
||||
Set<String> reconnectTokens = new LinkedHashSet<>();
|
||||
try {
|
||||
File logDir = new File("/data/data/" + PACKAGE_NAME + "/files/log");
|
||||
if (!logDir.exists() || !logDir.isDirectory()) {
|
||||
return pairingTokens;
|
||||
}
|
||||
|
||||
File[] logFiles = logDir.listFiles((dir, name) ->
|
||||
name.endsWith(".log") || name.endsWith(".log.") || name.matches(".*\\.log\\.\\d+"));
|
||||
|
||||
if (logFiles == null || logFiles.length == 0) {
|
||||
return pairingTokens;
|
||||
}
|
||||
|
||||
for (File logFile : logFiles) {
|
||||
try (BufferedReader reader = new BufferedReader(new FileReader(logFile))) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
// Determine if this is a pairing or reconnect context.
|
||||
boolean isPairingContext = line.toLowerCase().contains("watchbind");
|
||||
boolean isReconnectContext = line.toLowerCase().contains("watchreconnect");
|
||||
|
||||
String k1Token = null;
|
||||
|
||||
// First check for combined r3+k1 format (priority).
|
||||
Matcher combinedMatcher = K1_COMBINED_PATTERN.matcher(line);
|
||||
if (combinedMatcher.find()) {
|
||||
String combined = combinedMatcher.group(1);
|
||||
if (combined.length() == 64) {
|
||||
// Second half is the actual K1
|
||||
k1Token = combined.substring(32).toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
// Then check for standalone K1 format (only if not found in combined).
|
||||
if (k1Token == null) {
|
||||
Matcher standaloneMatcher = K1_STANDALONE_PATTERN.matcher(line);
|
||||
if (standaloneMatcher.find()) {
|
||||
String token = standaloneMatcher.group(1);
|
||||
if (token != null && token.length() == 32) {
|
||||
k1Token = token.toLowerCase();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add to appropriate set.
|
||||
if (k1Token != null) {
|
||||
if (isPairingContext && !isReconnectContext) {
|
||||
pairingTokens.add(k1Token);
|
||||
} else {
|
||||
reconnectTokens.add(k1Token);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Skip unreadable files.
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
// Fail silently.
|
||||
}
|
||||
|
||||
// Return pairing tokens first, add reconnect tokens if no pairing tokens found.
|
||||
if (!pairingTokens.isEmpty()) {
|
||||
Log.i(TAG, "Found " + pairingTokens.size() + " pairing K1 token(s)");
|
||||
return pairingTokens;
|
||||
}
|
||||
|
||||
if (!reconnectTokens.isEmpty()) {
|
||||
Log.i(TAG, "Found " + reconnectTokens.size() + " reconnect K1 token(s) (may not work for initial pairing)");
|
||||
}
|
||||
return reconnectTokens;
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to get K1 tokens from the database.
|
||||
*/
|
||||
private static String getK1TokensFromDatabase() {
|
||||
try {
|
||||
File dbDir = new File("/data/data/" + PACKAGE_NAME + "/databases");
|
||||
if (!dbDir.exists() || !dbDir.isDirectory()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
File[] dbFiles = dbDir.listFiles((dir, name) ->
|
||||
name.endsWith(".db") && !name.startsWith("google_app_measurement") && !name.contains("firebase"));
|
||||
|
||||
if (dbFiles == null || dbFiles.length == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (File dbFile : dbFiles) {
|
||||
String token = getK1TokensFromDatabase(dbFile);
|
||||
if (token != null) {
|
||||
return token;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract K1 tokens from a database file.
|
||||
*/
|
||||
private static String getK1TokensFromDatabase(File dbFile) {
|
||||
SQLiteDatabase db = null;
|
||||
try {
|
||||
db = SQLiteDatabase.openDatabase(dbFile.getPath(), null, SQLiteDatabase.OPEN_READONLY);
|
||||
|
||||
// Get all tables.
|
||||
Cursor cursor = db.rawQuery(
|
||||
"SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'",
|
||||
null
|
||||
);
|
||||
|
||||
List<String> tables = new ArrayList<>();
|
||||
while (cursor.moveToNext()) {
|
||||
tables.add(cursor.getString(0));
|
||||
}
|
||||
cursor.close();
|
||||
|
||||
// Scan all columns for 32-char hex strings.
|
||||
for (String table : tables) {
|
||||
Cursor schemaCursor = null;
|
||||
try {
|
||||
schemaCursor = db.rawQuery("PRAGMA table_info(" + table + ")", null);
|
||||
List<String> columns = new ArrayList<>();
|
||||
while (schemaCursor.moveToNext()) {
|
||||
columns.add(schemaCursor.getString(1));
|
||||
}
|
||||
schemaCursor.close();
|
||||
|
||||
for (String column : columns) {
|
||||
Cursor dataCursor = null;
|
||||
try {
|
||||
dataCursor = db.query(table, new String[]{column}, null, null, null, null, null);
|
||||
while (dataCursor.moveToNext()) {
|
||||
String value = dataCursor.getString(0);
|
||||
if (value != null && value.length() == 32 && value.matches("[0-9a-fA-F]{32}")) {
|
||||
// Skip obviously fake tokens (MD5 of empty string).
|
||||
if (!value.equalsIgnoreCase(EMPTY_MD5)) {
|
||||
dataCursor.close();
|
||||
db.close();
|
||||
return value.toLowerCase();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Skip non-string columns.
|
||||
} finally {
|
||||
if (dataCursor != null) {
|
||||
dataCursor.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Continue to next table.
|
||||
} finally {
|
||||
if (schemaCursor != null && !schemaCursor.isClosed()) {
|
||||
schemaCursor.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
} finally {
|
||||
if (db != null && db.isOpen()) {
|
||||
db.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the logged flag (useful for testing or re-pairing).
|
||||
*/
|
||||
public static void resetK1Logged() {
|
||||
k1Logged = false;
|
||||
lifecycleCallbacksRegistered = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the "don't show again" preference.
|
||||
*/
|
||||
public static void resetDontShowPreference() {
|
||||
if (appContext != null) {
|
||||
SharedPreferences prefs = appContext.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
|
||||
prefs.edit().putBoolean(KEY_DONT_SHOW_DIALOG, false).apply();
|
||||
}
|
||||
}
|
||||
}
|
||||
17
extensions/nothingx/stub/build.gradle.kts
Normal file
17
extensions/nothingx/stub/build.gradle.kts
Normal file
@@ -0,0 +1,17 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.library)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "app.revanced.extension"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 26
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
}
|
||||
1
extensions/nothingx/stub/src/main/AndroidManifest.xml
Normal file
1
extensions/nothingx/stub/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1 @@
|
||||
<manifest/>
|
||||
@@ -311,6 +311,10 @@ public class Utils {
|
||||
return resourceId;
|
||||
}
|
||||
|
||||
public static String getResourceString(int id) throws Resources.NotFoundException {
|
||||
return getContext().getResources().getString(id);
|
||||
}
|
||||
|
||||
public static int getResourceInteger(String resourceIdentifierName) throws Resources.NotFoundException {
|
||||
return getContext().getResources().getInteger(getResourceIdentifierOrThrow(resourceIdentifierName, "integer"));
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -71,6 +72,17 @@ public class CustomBrandingPatch {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
*/
|
||||
public static View getLottieViewOrNull(View lottieStartupView) {
|
||||
if (BaseSettings.CUSTOM_BRANDING_ICON.get() == BrandingTheme.ORIGINAL) {
|
||||
return lottieStartupView;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package app.revanced.extension.youtube.patches.components;
|
||||
package app.revanced.extension.shared.patches.components;
|
||||
|
||||
import static app.revanced.extension.shared.StringRef.str;
|
||||
|
||||
@@ -15,13 +15,15 @@ import java.util.regex.Pattern;
|
||||
import app.revanced.extension.shared.Logger;
|
||||
import app.revanced.extension.shared.Utils;
|
||||
import app.revanced.extension.shared.ByteTrieSearch;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.StringFilterGroup;
|
||||
import app.revanced.extension.shared.settings.YouTubeAndMusicSettings;
|
||||
import app.revanced.extension.shared.patches.litho.Filter;
|
||||
|
||||
/**
|
||||
* Allows custom filtering using a path and optionally a proto buffer string.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
final class CustomFilter extends Filter {
|
||||
public final class CustomFilter extends Filter {
|
||||
|
||||
private static void showInvalidSyntaxToast(@NonNull String expression) {
|
||||
Utils.showToastLong(str("revanced_custom_filter_toast_invalid_syntax", expression));
|
||||
@@ -45,7 +47,7 @@ final class CustomFilter extends Filter {
|
||||
@NonNull
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
static Collection<CustomFilterGroup> parseCustomFilterGroups() {
|
||||
String rawCustomFilterText = Settings.CUSTOM_FILTER_STRINGS.get();
|
||||
String rawCustomFilterText = YouTubeAndMusicSettings.CUSTOM_FILTER_STRINGS.get();
|
||||
if (rawCustomFilterText.isBlank()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@@ -100,7 +102,7 @@ final class CustomFilter extends Filter {
|
||||
ByteTrieSearch bufferSearch;
|
||||
|
||||
CustomFilterGroup(boolean startsWith, @NonNull String path) {
|
||||
super(Settings.CUSTOM_FILTER, path);
|
||||
super(YouTubeAndMusicSettings.CUSTOM_FILTER, path);
|
||||
this.startsWith = startsWith;
|
||||
}
|
||||
|
||||
@@ -145,7 +147,7 @@ final class CustomFilter extends Filter {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
public boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
// All callbacks are custom filter groups.
|
||||
CustomFilterGroup custom = (CustomFilterGroup) matchedGroup;
|
||||
@@ -159,4 +161,4 @@ final class CustomFilter extends Filter {
|
||||
|
||||
return custom.bufferSearch.matches(buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
package app.revanced.extension.youtube.patches.components;
|
||||
package app.revanced.extension.shared.patches.litho;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.StringFilterGroup;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.ByteArrayFilterGroup;
|
||||
|
||||
/**
|
||||
* Filters litho based components.
|
||||
*
|
||||
@@ -14,11 +17,11 @@ import java.util.List;
|
||||
* either an identifier or a path.
|
||||
* Then inside {@link #isFiltered(String, String, byte[], StringFilterGroup, FilterContentType, int)}
|
||||
* search for the buffer content using either a {@link ByteArrayFilterGroup} (if searching for 1 pattern)
|
||||
* or a {@link ByteArrayFilterGroupList} (if searching for more than 1 pattern).
|
||||
* or a {@link FilterGroupList.ByteArrayFilterGroupList} (if searching for more than 1 pattern).
|
||||
*
|
||||
* All callbacks must be registered before the constructor completes.
|
||||
*/
|
||||
abstract class Filter {
|
||||
public abstract class Filter {
|
||||
|
||||
public enum FilterContentType {
|
||||
IDENTIFIER,
|
||||
@@ -65,7 +68,7 @@ abstract class Filter {
|
||||
* @param contentIndex Matched index of the identifier or path.
|
||||
* @return True if the litho component should be filtered out.
|
||||
*/
|
||||
boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
public boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
package app.revanced.extension.shared.patches.litho;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import app.revanced.extension.shared.ByteTrieSearch;
|
||||
import app.revanced.extension.shared.Logger;
|
||||
import app.revanced.extension.shared.settings.BooleanSetting;
|
||||
|
||||
public abstract class FilterGroup<T> {
|
||||
public final static class FilterGroupResult {
|
||||
private BooleanSetting setting;
|
||||
private int matchedIndex;
|
||||
private int matchedLength;
|
||||
// In the future it might be useful to include which pattern matched,
|
||||
// but for now that is not needed.
|
||||
|
||||
FilterGroupResult() {
|
||||
this(null, -1, 0);
|
||||
}
|
||||
|
||||
FilterGroupResult(BooleanSetting setting, int matchedIndex, int matchedLength) {
|
||||
setValues(setting, matchedIndex, matchedLength);
|
||||
}
|
||||
|
||||
public void setValues(BooleanSetting setting, int matchedIndex, int matchedLength) {
|
||||
this.setting = setting;
|
||||
this.matchedIndex = matchedIndex;
|
||||
this.matchedLength = matchedLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* A null value if the group has no setting,
|
||||
* or if no match is returned from {@link FilterGroupList#check(Object)}.
|
||||
*/
|
||||
public BooleanSetting getSetting() {
|
||||
return setting;
|
||||
}
|
||||
|
||||
public boolean isFiltered() {
|
||||
return matchedIndex >= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Matched index of first pattern that matched, or -1 if nothing matched.
|
||||
*/
|
||||
public int getMatchedIndex() {
|
||||
return matchedIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Length of the matched filter pattern.
|
||||
*/
|
||||
public int getMatchedLength() {
|
||||
return matchedLength;
|
||||
}
|
||||
}
|
||||
|
||||
protected final BooleanSetting setting;
|
||||
protected final T[] filters;
|
||||
|
||||
/**
|
||||
* Initialize a new filter group.
|
||||
*
|
||||
* @param setting The associated setting.
|
||||
* @param filters The filters.
|
||||
*/
|
||||
@SafeVarargs
|
||||
public FilterGroup(final BooleanSetting setting, final T... filters) {
|
||||
this.setting = setting;
|
||||
this.filters = filters;
|
||||
if (filters.length == 0) {
|
||||
throw new IllegalArgumentException("Must use one or more filter patterns (zero specified)");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return setting == null || setting.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return If {@link FilterGroupList} should include this group when searching.
|
||||
* By default, all filters are included except non enabled settings that require reboot.
|
||||
*/
|
||||
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
|
||||
public boolean includeInSearch() {
|
||||
return isEnabled() || !setting.rebootApp;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getSimpleName() + ": " + (setting == null ? "(null setting)" : setting);
|
||||
}
|
||||
|
||||
public abstract FilterGroupResult check(final T stack);
|
||||
|
||||
|
||||
public static class StringFilterGroup extends FilterGroup<String> {
|
||||
|
||||
public StringFilterGroup(final BooleanSetting setting, final String... filters) {
|
||||
super(setting, filters);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FilterGroupResult check(final String string) {
|
||||
int matchedIndex = -1;
|
||||
int matchedLength = 0;
|
||||
if (isEnabled()) {
|
||||
for (String pattern : filters) {
|
||||
if (!string.isEmpty()) {
|
||||
final int indexOf = string.indexOf(pattern);
|
||||
if (indexOf >= 0) {
|
||||
matchedIndex = indexOf;
|
||||
matchedLength = pattern.length();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new FilterGroupResult(setting, matchedIndex, matchedLength);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If you have more than 1 filter patterns, then all instances of
|
||||
* this class should filtered using {@link FilterGroupList.ByteArrayFilterGroupList#check(byte[])},
|
||||
* which uses a prefix tree to give better performance.
|
||||
*/
|
||||
public static class ByteArrayFilterGroup extends FilterGroup<byte[]> {
|
||||
|
||||
private volatile int[][] failurePatterns;
|
||||
|
||||
// Modified implementation from https://stackoverflow.com/a/1507813
|
||||
private static int indexOf(final byte[] data, final byte[] pattern, final int[] failure) {
|
||||
// Finds the first occurrence of the pattern in the byte array using
|
||||
// KMP matching algorithm.
|
||||
int patternLength = pattern.length;
|
||||
for (int i = 0, j = 0, dataLength = data.length; i < dataLength; i++) {
|
||||
while (j > 0 && pattern[j] != data[i]) {
|
||||
j = failure[j - 1];
|
||||
}
|
||||
if (pattern[j] == data[i]) {
|
||||
j++;
|
||||
}
|
||||
if (j == patternLength) {
|
||||
return i - patternLength + 1;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
private static int[] createFailurePattern(byte[] pattern) {
|
||||
// Computes the failure function using a boot-strapping process,
|
||||
// where the pattern is matched against itself.
|
||||
final int patternLength = pattern.length;
|
||||
final int[] failure = new int[patternLength];
|
||||
|
||||
for (int i = 1, j = 0; i < patternLength; i++) {
|
||||
while (j > 0 && pattern[j] != pattern[i]) {
|
||||
j = failure[j - 1];
|
||||
}
|
||||
if (pattern[j] == pattern[i]) {
|
||||
j++;
|
||||
}
|
||||
failure[i] = j;
|
||||
}
|
||||
return failure;
|
||||
}
|
||||
|
||||
public ByteArrayFilterGroup(BooleanSetting setting, byte[]... filters) {
|
||||
super(setting, filters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the Strings into byte arrays. Used to search for text in binary data.
|
||||
*/
|
||||
public ByteArrayFilterGroup(BooleanSetting setting, String... filters) {
|
||||
super(setting, ByteTrieSearch.convertStringsToBytes(filters));
|
||||
}
|
||||
|
||||
private synchronized void buildFailurePatterns() {
|
||||
if (failurePatterns != null) return; // Thread race and another thread already initialized the search.
|
||||
Logger.printDebug(() -> "Building failure array for: " + this);
|
||||
int[][] failurePatterns = new int[filters.length][];
|
||||
int i = 0;
|
||||
for (byte[] pattern : filters) {
|
||||
failurePatterns[i++] = createFailurePattern(pattern);
|
||||
}
|
||||
this.failurePatterns = failurePatterns; // Must set after initialization finishes.
|
||||
}
|
||||
|
||||
@Override
|
||||
public FilterGroupResult check(final byte[] bytes) {
|
||||
int matchedLength = 0;
|
||||
int matchedIndex = -1;
|
||||
if (isEnabled()) {
|
||||
int[][] failures = failurePatterns;
|
||||
if (failures == null) {
|
||||
buildFailurePatterns(); // Lazy load.
|
||||
failures = failurePatterns;
|
||||
}
|
||||
for (int i = 0, length = filters.length; i < length; i++) {
|
||||
byte[] filter = filters[i];
|
||||
matchedIndex = indexOf(bytes, filter, failures[i]);
|
||||
if (matchedIndex >= 0) {
|
||||
matchedLength = filter.length;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new FilterGroupResult(setting, matchedIndex, matchedLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,22 @@
|
||||
package app.revanced.extension.youtube.patches.components;
|
||||
package app.revanced.extension.shared.patches.litho;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import app.revanced.extension.shared.ByteTrieSearch;
|
||||
import app.revanced.extension.shared.StringTrieSearch;
|
||||
import app.revanced.extension.shared.TrieSearch;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.ByteArrayFilterGroup;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.StringFilterGroup;
|
||||
|
||||
abstract class FilterGroupList<V, T extends FilterGroup<V>> implements Iterable<T> {
|
||||
public abstract class FilterGroupList<V, T extends FilterGroup<V>> implements Iterable<T> {
|
||||
|
||||
private final List<T> filterGroups = new ArrayList<>();
|
||||
private final TrieSearch<V> search = createSearchGraph();
|
||||
|
||||
@SafeVarargs
|
||||
protected final void addAll(final T... groups) {
|
||||
public final void addAll(final T... groups) {
|
||||
filterGroups.addAll(Arrays.asList(groups));
|
||||
|
||||
for (T group : groups) {
|
||||
@@ -41,18 +42,7 @@ abstract class FilterGroupList<V, T extends FilterGroup<V>> implements Iterable<
|
||||
return filterGroups.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forEach(@NonNull Consumer<? super T> action) {
|
||||
filterGroups.forEach(action);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Spliterator<T> spliterator() {
|
||||
return filterGroups.spliterator();
|
||||
}
|
||||
|
||||
protected FilterGroup.FilterGroupResult check(V stack) {
|
||||
public FilterGroup.FilterGroupResult check(V stack) {
|
||||
FilterGroup.FilterGroupResult result = new FilterGroup.FilterGroupResult();
|
||||
search.matches(stack, result);
|
||||
return result;
|
||||
@@ -60,21 +50,21 @@ abstract class FilterGroupList<V, T extends FilterGroup<V>> implements Iterable<
|
||||
}
|
||||
|
||||
protected abstract TrieSearch<V> createSearchGraph();
|
||||
}
|
||||
|
||||
final class StringFilterGroupList extends FilterGroupList<String, StringFilterGroup> {
|
||||
protected StringTrieSearch createSearchGraph() {
|
||||
return new StringTrieSearch();
|
||||
public static final class StringFilterGroupList extends FilterGroupList<String, StringFilterGroup> {
|
||||
protected StringTrieSearch createSearchGraph() {
|
||||
return new StringTrieSearch();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If searching for a single byte pattern, then it is slightly better to use
|
||||
* {@link ByteArrayFilterGroup#check(byte[])} as it uses KMP which is faster
|
||||
* than a prefix tree to search for only 1 pattern.
|
||||
*/
|
||||
final class ByteArrayFilterGroupList extends FilterGroupList<byte[], ByteArrayFilterGroup> {
|
||||
protected ByteTrieSearch createSearchGraph() {
|
||||
return new ByteTrieSearch();
|
||||
/**
|
||||
* If searching for a single byte pattern, then it is slightly better to use
|
||||
* {@link ByteArrayFilterGroup#check(byte[])} as it uses KMP which is faster
|
||||
* than a prefix tree to search for only 1 pattern.
|
||||
*/
|
||||
public static final class ByteArrayFilterGroupList extends FilterGroupList<byte[], ByteArrayFilterGroup> {
|
||||
protected ByteTrieSearch createSearchGraph() {
|
||||
return new ByteTrieSearch();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package app.revanced.extension.youtube.patches.components;
|
||||
package app.revanced.extension.shared.patches.litho;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -7,9 +7,11 @@ import java.nio.ByteBuffer;
|
||||
import java.util.List;
|
||||
|
||||
import app.revanced.extension.shared.Logger;
|
||||
import app.revanced.extension.shared.settings.BaseSettings;
|
||||
import app.revanced.extension.shared.StringTrieSearch;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
import app.revanced.extension.shared.settings.BaseSettings;
|
||||
import app.revanced.extension.shared.settings.YouTubeAndMusicSettings;
|
||||
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.StringFilterGroup;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class LithoFilterPatch {
|
||||
@@ -36,7 +38,7 @@ public final class LithoFilterPatch {
|
||||
builder.append(identifier);
|
||||
builder.append(" Path: ");
|
||||
builder.append(path);
|
||||
if (Settings.DEBUG_PROTOBUFFER.get()) {
|
||||
if (YouTubeAndMusicSettings.DEBUG_PROTOBUFFER.get()) {
|
||||
builder.append(" BufferStrings: ");
|
||||
findAsciiStrings(builder, buffer);
|
||||
}
|
||||
@@ -35,6 +35,15 @@ public class LinkSanitizer {
|
||||
|
||||
public Uri sanitizeUri(Uri uri) {
|
||||
try {
|
||||
String scheme = uri.getScheme();
|
||||
if (scheme == null || !(scheme.equals("http") || scheme.equals("https"))) {
|
||||
// Opening YouTube share sheet 'other' option passes the video title as a URI.
|
||||
// Checking !uri.isHierarchical() works for all cases, except if the
|
||||
// video title starts with / and then it's hierarchical but still an invalid URI.
|
||||
Logger.printDebug(() -> "Ignoring uri: " + uri);
|
||||
return uri;
|
||||
}
|
||||
|
||||
Uri.Builder builder = uri.buildUpon().clearQuery();
|
||||
|
||||
if (!parametersToRemove.isEmpty()) {
|
||||
|
||||
@@ -58,6 +58,23 @@ public abstract class Setting<T> {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Availability based on a single parent setting being disabled.
|
||||
*/
|
||||
public static Availability parentNot(BooleanSetting parent) {
|
||||
return new Availability() {
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return !parent.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Setting<?>> getParentSettings() {
|
||||
return Collections.singletonList(parent);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Availability based on all parents being enabled.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.revanced.extension.shared.settings;
|
||||
|
||||
import static app.revanced.extension.shared.settings.Setting.parent;
|
||||
import static java.lang.Boolean.FALSE;
|
||||
|
||||
public class YouTubeAndMusicSettings extends BaseSettings {
|
||||
// Custom filter
|
||||
public static final BooleanSetting CUSTOM_FILTER = new BooleanSetting("revanced_custom_filter", FALSE);
|
||||
public static final StringSetting CUSTOM_FILTER_STRINGS = new StringSetting("revanced_custom_filter_strings", "", true, parent(CUSTOM_FILTER));
|
||||
|
||||
// Miscellaneous
|
||||
public static final BooleanSetting DEBUG_PROTOBUFFER = new BooleanSetting("revanced_debug_protobuffer", FALSE, false,
|
||||
"revanced_debug_protobuffer_user_dialog_message", parent(BaseSettings.DEBUG));
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class SpoofVideoStreamsPatch {
|
||||
public static boolean spoofingToClientWithNoMultiAudioStreams() {
|
||||
return isPatchIncluded()
|
||||
&& SPOOF_STREAMING_DATA
|
||||
&& preferredClient != ClientType.IPADOS;
|
||||
&& !preferredClient.supportsMultiAudioTracks;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
5
extensions/strava/build.gradle.kts
Normal file
5
extensions/strava/build.gradle.kts
Normal file
@@ -0,0 +1,5 @@
|
||||
dependencies {
|
||||
compileOnly(project(":extensions:shared:library"))
|
||||
compileOnly(project(":extensions:strava:stub"))
|
||||
compileOnly(libs.okhttp)
|
||||
}
|
||||
1
extensions/strava/src/main/AndroidManifest.xml
Normal file
1
extensions/strava/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1 @@
|
||||
<manifest/>
|
||||
@@ -0,0 +1,216 @@
|
||||
package app.revanced.extension.strava;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.provider.MediaStore;
|
||||
import android.webkit.MimeTypeMap;
|
||||
|
||||
import com.strava.core.data.MediaType;
|
||||
import com.strava.photos.data.Media;
|
||||
|
||||
import okhttp3.*;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import app.revanced.extension.shared.Utils;
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public final class AddMediaDownloadPatch {
|
||||
public static final int ACTION_DOWNLOAD = -1;
|
||||
public static final int ACTION_OPEN_LINK = -2;
|
||||
public static final int ACTION_COPY_LINK = -3;
|
||||
|
||||
private static final OkHttpClient client = new OkHttpClient();
|
||||
|
||||
public static boolean handleAction(int actionId, Media media) {
|
||||
String url = getUrl(media);
|
||||
switch (actionId) {
|
||||
case ACTION_DOWNLOAD:
|
||||
String name = media.getId();
|
||||
if (media.getType() == MediaType.VIDEO) {
|
||||
downloadVideo(url, name);
|
||||
} else {
|
||||
downloadPhoto(url, name);
|
||||
}
|
||||
return true;
|
||||
case ACTION_OPEN_LINK:
|
||||
Utils.openLink(url);
|
||||
return true;
|
||||
case ACTION_COPY_LINK:
|
||||
copyLink(url);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void copyLink(CharSequence url) {
|
||||
Utils.setClipboard(url);
|
||||
showInfoToast("link_copied_to_clipboard", "🔗");
|
||||
}
|
||||
|
||||
public static void downloadPhoto(String url, String name) {
|
||||
showInfoToast("loading", "⏳");
|
||||
Utils.runOnBackgroundThread(() -> {
|
||||
try (Response response = fetch(url)) {
|
||||
ResponseBody body = response.body();
|
||||
String mimeType = body.contentType().toString();
|
||||
String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType);
|
||||
ContentResolver resolver = Utils.getContext().getContentResolver();
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(MediaStore.Images.Media.DISPLAY_NAME, name + '.' + extension);
|
||||
values.put(MediaStore.Images.Media.IS_PENDING, 1);
|
||||
values.put(MediaStore.Images.Media.MIME_TYPE, mimeType);
|
||||
values.put(MediaStore.Images.Media.RELATIVE_PATH, Environment.DIRECTORY_PICTURES + "/Strava");
|
||||
Uri collection = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q
|
||||
? MediaStore.Images.Media.getContentUri(MediaStore.VOLUME_EXTERNAL)
|
||||
: MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
|
||||
Uri row = resolver.insert(collection, values);
|
||||
try (OutputStream outputStream = resolver.openOutputStream(row)) {
|
||||
transferTo(body.byteStream(), outputStream);
|
||||
} finally {
|
||||
values.clear();
|
||||
values.put(MediaStore.Images.Media.IS_PENDING, 0);
|
||||
resolver.update(row, values, null);
|
||||
}
|
||||
showInfoToast("yis_2024_local_save_image_success", "✔️");
|
||||
} catch (IOException e) {
|
||||
showErrorToast("download_failure", "❌", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Downloads a video in the M3U8 / HLS (HTTP Live Streaming) format.
|
||||
*/
|
||||
public static void downloadVideo(String url, String name) {
|
||||
// The first request yields multiple URLs with different stream options.
|
||||
// In case of Strava, the first one is always of highest quality.
|
||||
// Each stream can consist of multiple chunks.
|
||||
// The second request yields the URLs of all of these chunks.
|
||||
// Fetch all of them concurrently and pipe their streams into the file in order.
|
||||
showInfoToast("loading", "⏳");
|
||||
Utils.runOnBackgroundThread(() -> {
|
||||
try {
|
||||
String highestQualityStreamUrl;
|
||||
try (Response response = fetch(url)) {
|
||||
highestQualityStreamUrl = replaceFileName(url, lines(response).findFirst().get());
|
||||
}
|
||||
List<Future<Response>> futures;
|
||||
try (Response response = fetch(highestQualityStreamUrl)) {
|
||||
futures = lines(response)
|
||||
.map(line -> replaceFileName(highestQualityStreamUrl, line))
|
||||
.map(chunkUrl -> Utils.submitOnBackgroundThread(() -> fetch(chunkUrl)))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
ContentResolver resolver = Utils.getContext().getContentResolver();
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(MediaStore.Video.Media.DISPLAY_NAME, name + '.' + "mp4");
|
||||
values.put(MediaStore.Video.Media.IS_PENDING, 1);
|
||||
values.put(MediaStore.Video.Media.MIME_TYPE, MimeTypeMap.getSingleton().getMimeTypeFromExtension("mp4"));
|
||||
values.put(MediaStore.Video.Media.RELATIVE_PATH, Environment.DIRECTORY_MOVIES + "/Strava");
|
||||
Uri collection = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q
|
||||
? MediaStore.Video.Media.getContentUri(MediaStore.VOLUME_EXTERNAL)
|
||||
: MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
|
||||
Uri row = resolver.insert(collection, values);
|
||||
try (OutputStream outputStream = resolver.openOutputStream(row)) {
|
||||
Throwable error = null;
|
||||
for (Future<Response> future : futures) {
|
||||
if (error != null) {
|
||||
if (future.cancel(true)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
try (Response response = future.get()) {
|
||||
if (error == null) {
|
||||
transferTo(response.body().byteStream(), outputStream);
|
||||
}
|
||||
} catch (InterruptedException | IOException e) {
|
||||
error = e;
|
||||
} catch (ExecutionException e) {
|
||||
error = e.getCause();
|
||||
}
|
||||
}
|
||||
if (error != null) {
|
||||
throw new IOException(error);
|
||||
}
|
||||
} finally {
|
||||
values.clear();
|
||||
values.put(MediaStore.Video.Media.IS_PENDING, 0);
|
||||
resolver.update(row, values, null);
|
||||
}
|
||||
showInfoToast("yis_2024_local_save_video_success", "✔️");
|
||||
} catch (IOException e) {
|
||||
showErrorToast("download_failure", "❌", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static String getUrl(Media media) {
|
||||
return media.getType() == MediaType.VIDEO
|
||||
? ((Media.Video) media).getVideoUrl()
|
||||
: media.getLargestUrl();
|
||||
}
|
||||
|
||||
private static String getString(String name, String fallback) {
|
||||
int id = Utils.getResourceIdentifier(name, "string");
|
||||
return id != 0
|
||||
? Utils.getResourceString(id)
|
||||
: fallback;
|
||||
}
|
||||
|
||||
private static void showInfoToast(String resourceName, String fallback) {
|
||||
String text = getString(resourceName, fallback);
|
||||
Utils.showToastShort(text);
|
||||
}
|
||||
|
||||
private static void showErrorToast(String resourceName, String fallback, IOException exception) {
|
||||
String text = getString(resourceName, fallback);
|
||||
Utils.showToastLong(text + ' ' + exception.getLocalizedMessage());
|
||||
}
|
||||
|
||||
private static Response fetch(String url) throws IOException {
|
||||
Request request = new Request.Builder().url(url).build();
|
||||
Response response = client.newCall(request).execute();
|
||||
if (!response.isSuccessful()) {
|
||||
throw new IOException("Got HTTP status code " + response.code());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code inputStream.transferTo(outputStream)} is "too new".
|
||||
*/
|
||||
private static void transferTo(InputStream in, OutputStream out) throws IOException {
|
||||
byte[] buffer = new byte[1024 * 8];
|
||||
int length;
|
||||
while ((length = in.read(buffer)) != -1) {
|
||||
out.write(buffer, 0, length);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all file names.
|
||||
*/
|
||||
private static Stream<String> lines(Response response) {
|
||||
BufferedReader reader = new BufferedReader(response.body().charStream());
|
||||
return reader.lines().filter(line -> !line.startsWith("#"));
|
||||
}
|
||||
|
||||
private static String replaceFileName(String uri, String newName) {
|
||||
return uri.substring(0, uri.lastIndexOf('/') + 1) + newName;
|
||||
}
|
||||
}
|
||||
12
extensions/strava/stub/build.gradle.kts
Normal file
12
extensions/strava/stub/build.gradle.kts
Normal file
@@ -0,0 +1,12 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.library)
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "app.revanced.extension"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 21
|
||||
}
|
||||
}
|
||||
1
extensions/strava/stub/src/main/AndroidManifest.xml
Normal file
1
extensions/strava/stub/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1 @@
|
||||
<manifest/>
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.strava.core.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public interface MediaContent extends Serializable {
|
||||
String getCaption();
|
||||
|
||||
String getId();
|
||||
|
||||
String getReferenceId();
|
||||
|
||||
MediaType getType();
|
||||
|
||||
void setCaption(String caption);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.strava.core.data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public final class MediaDimension implements Comparable<MediaDimension>, Serializable {
|
||||
private final int height;
|
||||
private final int width;
|
||||
|
||||
public MediaDimension(int width, int height) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public float getHeightScale() {
|
||||
if (width <= 0 || height <= 0) {
|
||||
return 1f;
|
||||
}
|
||||
return height / width;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public float getWidthScale() {
|
||||
if (width <= 0 || height <= 0) {
|
||||
return 1f;
|
||||
}
|
||||
return width / height;
|
||||
}
|
||||
|
||||
public boolean isLandscape() {
|
||||
return width > 0 && width >= height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(MediaDimension other) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.strava.core.data;
|
||||
|
||||
public enum MediaType {
|
||||
PHOTO(1),
|
||||
VIDEO(2);
|
||||
|
||||
private final int remoteValue;
|
||||
|
||||
private MediaType(int remoteValue) {
|
||||
this.remoteValue = remoteValue;
|
||||
}
|
||||
|
||||
public int getRemoteValue() {
|
||||
return remoteValue;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.strava.core.data;
|
||||
|
||||
import java.util.SortedMap;
|
||||
|
||||
public interface RemoteMediaContent extends MediaContent {
|
||||
MediaDimension getLargestSize();
|
||||
|
||||
String getLargestUrl();
|
||||
|
||||
SortedMap<Integer, MediaDimension> getSizes();
|
||||
|
||||
String getSmallestUrl();
|
||||
|
||||
RemoteMediaStatus getStatus();
|
||||
|
||||
SortedMap<Integer, String> getUrls();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.strava.core.data;
|
||||
|
||||
public enum RemoteMediaStatus {
|
||||
NEW,
|
||||
PENDING,
|
||||
PROCESSED,
|
||||
REPORTED,
|
||||
REINSTATED,
|
||||
DELETED,
|
||||
FAILED
|
||||
}
|
||||
@@ -0,0 +1,286 @@
|
||||
package com.strava.photos.data;
|
||||
|
||||
import com.strava.core.data.MediaDimension;
|
||||
import com.strava.core.data.MediaType;
|
||||
import com.strava.core.data.RemoteMediaContent;
|
||||
import com.strava.core.data.RemoteMediaStatus;
|
||||
import java.util.SortedMap;
|
||||
|
||||
public abstract class Media implements RemoteMediaContent {
|
||||
public static final class Photo extends Media {
|
||||
private final Long activityId;
|
||||
private final String activityName;
|
||||
private final long athleteId;
|
||||
private String caption;
|
||||
private final String createdAt;
|
||||
private final String createdAtLocal;
|
||||
private final String cursor;
|
||||
private final String id;
|
||||
private final SortedMap<Integer, MediaDimension> sizes;
|
||||
private final RemoteMediaStatus status;
|
||||
private final String tag;
|
||||
private final MediaType type;
|
||||
private final SortedMap<Integer, String> urls;
|
||||
|
||||
@Override
|
||||
public Long getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getActivityName() {
|
||||
return activityName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getAthleteId() {
|
||||
return athleteId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCaption() {
|
||||
return caption;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreatedAtLocal() {
|
||||
return createdAtLocal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCursor() {
|
||||
return cursor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedMap<Integer, MediaDimension> getSizes() {
|
||||
return sizes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteMediaStatus getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MediaType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedMap<Integer, String> getUrls() {
|
||||
return urls;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCaption(String caption) {
|
||||
this.caption = caption;
|
||||
}
|
||||
|
||||
public Photo(String id,
|
||||
String caption,
|
||||
SortedMap<Integer, String> urls,
|
||||
SortedMap<Integer, MediaDimension> sizes,
|
||||
long athleteId,
|
||||
String createdAt,
|
||||
String createdAtLocal,
|
||||
Long activityId,
|
||||
String activityName,
|
||||
RemoteMediaStatus status,
|
||||
String tag,
|
||||
String cursor) {
|
||||
this.id = id;
|
||||
this.caption = caption;
|
||||
this.urls = urls;
|
||||
this.sizes = sizes;
|
||||
this.athleteId = athleteId;
|
||||
this.createdAt = createdAt;
|
||||
this.createdAtLocal = createdAtLocal;
|
||||
this.activityId = activityId;
|
||||
this.activityName = activityName;
|
||||
this.status = status;
|
||||
this.tag = tag;
|
||||
this.cursor = cursor;
|
||||
this.type = MediaType.PHOTO;
|
||||
}
|
||||
}
|
||||
|
||||
public static final class Video extends Media {
|
||||
private final Long activityId;
|
||||
private final String activityName;
|
||||
private final long athleteId;
|
||||
private String caption;
|
||||
private final String createdAt;
|
||||
private final String createdAtLocal;
|
||||
private final String cursor;
|
||||
private final Float durationSeconds;
|
||||
private final String id;
|
||||
private final SortedMap<Integer, MediaDimension> sizes;
|
||||
private final RemoteMediaStatus status;
|
||||
private final String tag;
|
||||
private final MediaType type;
|
||||
private final SortedMap<Integer, String> urls;
|
||||
private final String videoUrl;
|
||||
|
||||
@Override
|
||||
public Long getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getActivityName() {
|
||||
return activityName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getAthleteId() {
|
||||
return athleteId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCaption() {
|
||||
return caption;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreatedAtLocal() {
|
||||
return createdAtLocal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCursor() {
|
||||
return cursor;
|
||||
}
|
||||
|
||||
public final Float getDurationSeconds() {
|
||||
return durationSeconds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedMap<Integer, MediaDimension> getSizes() {
|
||||
return sizes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteMediaStatus getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MediaType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SortedMap<Integer, String> getUrls() {
|
||||
return urls;
|
||||
}
|
||||
|
||||
public final String getVideoUrl() {
|
||||
return videoUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCaption(String caption) {
|
||||
this.caption = caption;
|
||||
}
|
||||
|
||||
public Video(String id,
|
||||
String caption,
|
||||
SortedMap<Integer, String> urls,
|
||||
SortedMap<Integer, MediaDimension> sizes,
|
||||
long athleteId,
|
||||
String createdAt,
|
||||
String createdAtLocal,
|
||||
Long activityId,
|
||||
String activityName,
|
||||
RemoteMediaStatus status,
|
||||
String videoUrl,
|
||||
Float durationSeconds,
|
||||
String tag,
|
||||
String cursor) {
|
||||
this.id = id;
|
||||
this.caption = caption;
|
||||
this.urls = urls;
|
||||
this.sizes = sizes;
|
||||
this.athleteId = athleteId;
|
||||
this.createdAt = createdAt;
|
||||
this.createdAtLocal = createdAtLocal;
|
||||
this.activityId = activityId;
|
||||
this.activityName = activityName;
|
||||
this.status = status;
|
||||
this.videoUrl = videoUrl;
|
||||
this.durationSeconds = durationSeconds;
|
||||
this.tag = tag;
|
||||
this.cursor = cursor;
|
||||
this.type = MediaType.VIDEO;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract Long getActivityId();
|
||||
|
||||
public abstract String getActivityName();
|
||||
|
||||
public abstract long getAthleteId();
|
||||
|
||||
public abstract String getCreatedAt();
|
||||
|
||||
public abstract String getCreatedAtLocal();
|
||||
|
||||
public abstract String getCursor();
|
||||
|
||||
@Override
|
||||
public MediaDimension getLargestSize() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLargestUrl() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReferenceId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSmallestUrl() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public abstract String getTag();
|
||||
|
||||
private Media() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package app.revanced.extension.youtube.patches;
|
||||
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class PauseOnAudioInterruptPatch {
|
||||
|
||||
private static final int AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK = -3;
|
||||
private static final int AUDIOFOCUS_LOSS_TRANSIENT = -2;
|
||||
|
||||
/**
|
||||
* Injection point for AudioFocusRequest builder.
|
||||
* Returns true if audio ducking should be disabled (willPauseWhenDucked = true).
|
||||
*/
|
||||
public static boolean shouldPauseOnAudioInterrupt() {
|
||||
return Settings.PAUSE_ON_AUDIO_INTERRUPT.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection point for onAudioFocusChange callback.
|
||||
* Converts AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK to AUDIOFOCUS_LOSS_TRANSIENT
|
||||
* when the setting is enabled, causing YouTube to pause instead of ducking.
|
||||
*/
|
||||
public static int overrideAudioFocusChange(int focusChange) {
|
||||
if (Settings.PAUSE_ON_AUDIO_INTERRUPT.get() && focusChange == AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK) {
|
||||
return AUDIOFOCUS_LOSS_TRANSIENT;
|
||||
}
|
||||
return focusChange;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,9 @@ import java.util.List;
|
||||
import app.revanced.extension.shared.Logger;
|
||||
import app.revanced.extension.shared.Utils;
|
||||
import app.revanced.extension.shared.StringTrieSearch;
|
||||
import app.revanced.extension.shared.patches.litho.Filter;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.ByteArrayFilterGroup;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.StringFilterGroup;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@@ -153,8 +156,8 @@ public final class AdsFilter extends Filter {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
public boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
if (matchedGroup == playerShoppingShelf) {
|
||||
return contentIndex == 0 && playerShoppingShelfBuffer.check(buffer).isFiltered();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package app.revanced.extension.youtube.patches.components;
|
||||
|
||||
import app.revanced.extension.shared.patches.litho.Filter;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.StringFilterGroup;
|
||||
import app.revanced.extension.youtube.patches.playback.quality.AdvancedVideoQualityMenuPatch;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
|
||||
@@ -19,7 +21,7 @@ public final class AdvancedVideoQualityMenuFilter extends Filter {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
public boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
isVideoQualityMenuVisible = true;
|
||||
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package app.revanced.extension.youtube.patches.components;
|
||||
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroupList.ByteArrayFilterGroupList;
|
||||
import app.revanced.extension.shared.patches.litho.Filter;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.ByteArrayFilterGroup;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.StringFilterGroup;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
final class ButtonsFilter extends Filter {
|
||||
public final class ButtonsFilter extends Filter {
|
||||
private static final String COMPACT_CHANNEL_BAR_PATH_PREFIX = "compact_channel_bar.e";
|
||||
private static final String VIDEO_ACTION_BAR_PATH_PREFIX = "video_action_bar.e";
|
||||
private static final String VIDEO_ACTION_BAR_PATH = "video_action_bar.e";
|
||||
@@ -118,7 +122,7 @@ final class ButtonsFilter extends Filter {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
public boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
if (matchedGroup == likeSubscribeGlow) {
|
||||
return (path.startsWith(VIDEO_ACTION_BAR_PATH_PREFIX) || path.startsWith(COMPACT_CHANNEL_BAR_PATH_PREFIX))
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package app.revanced.extension.youtube.patches.components;
|
||||
|
||||
import app.revanced.extension.shared.patches.litho.Filter;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.*;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
import app.revanced.extension.youtube.shared.PlayerType;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
final class CommentsFilter extends Filter {
|
||||
public final class CommentsFilter extends Filter {
|
||||
|
||||
private static final String COMMENT_COMPOSER_PATH = "comment_composer.e";
|
||||
|
||||
@@ -88,8 +90,8 @@ final class CommentsFilter extends Filter {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
public boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
if (matchedGroup == chipBar) {
|
||||
// Playlist sort button uses same components and must only filter if the player is opened.
|
||||
return PlayerType.getCurrent().isMaximizedOrFullscreen()
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package app.revanced.extension.youtube.patches.components;
|
||||
|
||||
import app.revanced.extension.shared.StringTrieSearch;
|
||||
import app.revanced.extension.shared.patches.litho.Filter;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.*;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroupList.*;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
import app.revanced.extension.youtube.shared.PlayerType;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
final class DescriptionComponentsFilter extends Filter {
|
||||
public final class DescriptionComponentsFilter extends Filter {
|
||||
|
||||
private static final String INFOCARDS_SECTION_PATH = "infocards_section.e";
|
||||
|
||||
@@ -44,10 +47,14 @@ final class DescriptionComponentsFilter extends Filter {
|
||||
"video_attributes_section"
|
||||
);
|
||||
|
||||
final StringFilterGroup featuredSection = new StringFilterGroup(
|
||||
Settings.HIDE_FEATURED_SECTION,
|
||||
// "media_lockup", "structured_description_video_lockup"
|
||||
"compact_infocard"
|
||||
final StringFilterGroup featuredLinksSection = new StringFilterGroup(
|
||||
Settings.HIDE_FEATURED_LINKS_SECTION,
|
||||
"media_lockup"
|
||||
);
|
||||
|
||||
final StringFilterGroup featuredVideosSection = new StringFilterGroup(
|
||||
Settings.HIDE_FEATURED_VIDEOS_SECTION,
|
||||
"structured_description_video_lockup"
|
||||
);
|
||||
|
||||
final StringFilterGroup podcastSection = new StringFilterGroup(
|
||||
@@ -76,7 +83,7 @@ final class DescriptionComponentsFilter extends Filter {
|
||||
);
|
||||
|
||||
subscribeButton = new StringFilterGroup(
|
||||
Settings.HIDE_DESCRIPTION_SUBSCRIBE_BUTTON,
|
||||
Settings.HIDE_SUBSCRIBE_BUTTON,
|
||||
"subscribe_button"
|
||||
);
|
||||
|
||||
@@ -110,7 +117,8 @@ final class DescriptionComponentsFilter extends Filter {
|
||||
aiGeneratedVideoSummarySection,
|
||||
askSection,
|
||||
attributesSection,
|
||||
featuredSection,
|
||||
featuredLinksSection,
|
||||
featuredVideosSection,
|
||||
horizontalShelf,
|
||||
howThisWasMadeSection,
|
||||
hypePoints,
|
||||
@@ -123,8 +131,8 @@ final class DescriptionComponentsFilter extends Filter {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
public boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
|
||||
if (matchedGroup == aiGeneratedVideoSummarySection || matchedGroup == hypePoints) {
|
||||
// Only hide if player is open, in case this component is used somewhere else.
|
||||
|
||||
@@ -1,214 +0,0 @@
|
||||
package app.revanced.extension.youtube.patches.components;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import app.revanced.extension.shared.Logger;
|
||||
import app.revanced.extension.shared.settings.BooleanSetting;
|
||||
import app.revanced.extension.shared.ByteTrieSearch;
|
||||
|
||||
abstract class FilterGroup<T> {
|
||||
final static class FilterGroupResult {
|
||||
private BooleanSetting setting;
|
||||
private int matchedIndex;
|
||||
private int matchedLength;
|
||||
// In the future it might be useful to include which pattern matched,
|
||||
// but for now that is not needed.
|
||||
|
||||
FilterGroupResult() {
|
||||
this(null, -1, 0);
|
||||
}
|
||||
|
||||
FilterGroupResult(BooleanSetting setting, int matchedIndex, int matchedLength) {
|
||||
setValues(setting, matchedIndex, matchedLength);
|
||||
}
|
||||
|
||||
public void setValues(BooleanSetting setting, int matchedIndex, int matchedLength) {
|
||||
this.setting = setting;
|
||||
this.matchedIndex = matchedIndex;
|
||||
this.matchedLength = matchedLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* A null value if the group has no setting,
|
||||
* or if no match is returned from {@link FilterGroupList#check(Object)}.
|
||||
*/
|
||||
public BooleanSetting getSetting() {
|
||||
return setting;
|
||||
}
|
||||
|
||||
public boolean isFiltered() {
|
||||
return matchedIndex >= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Matched index of first pattern that matched, or -1 if nothing matched.
|
||||
*/
|
||||
public int getMatchedIndex() {
|
||||
return matchedIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Length of the matched filter pattern.
|
||||
*/
|
||||
public int getMatchedLength() {
|
||||
return matchedLength;
|
||||
}
|
||||
}
|
||||
|
||||
protected final BooleanSetting setting;
|
||||
protected final T[] filters;
|
||||
|
||||
/**
|
||||
* Initialize a new filter group.
|
||||
*
|
||||
* @param setting The associated setting.
|
||||
* @param filters The filters.
|
||||
*/
|
||||
@SafeVarargs
|
||||
public FilterGroup(final BooleanSetting setting, final T... filters) {
|
||||
this.setting = setting;
|
||||
this.filters = filters;
|
||||
if (filters.length == 0) {
|
||||
throw new IllegalArgumentException("Must use one or more filter patterns (zero specified)");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return setting == null || setting.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return If {@link FilterGroupList} should include this group when searching.
|
||||
* By default, all filters are included except non enabled settings that require reboot.
|
||||
*/
|
||||
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
|
||||
public boolean includeInSearch() {
|
||||
return isEnabled() || !setting.rebootApp;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getSimpleName() + ": " + (setting == null ? "(null setting)" : setting);
|
||||
}
|
||||
|
||||
public abstract FilterGroupResult check(final T stack);
|
||||
}
|
||||
|
||||
class StringFilterGroup extends FilterGroup<String> {
|
||||
|
||||
public StringFilterGroup(final BooleanSetting setting, final String... filters) {
|
||||
super(setting, filters);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FilterGroupResult check(final String string) {
|
||||
int matchedIndex = -1;
|
||||
int matchedLength = 0;
|
||||
if (isEnabled()) {
|
||||
for (String pattern : filters) {
|
||||
if (!string.isEmpty()) {
|
||||
final int indexOf = string.indexOf(pattern);
|
||||
if (indexOf >= 0) {
|
||||
matchedIndex = indexOf;
|
||||
matchedLength = pattern.length();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new FilterGroupResult(setting, matchedIndex, matchedLength);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If you have more than 1 filter patterns, then all instances of
|
||||
* this class should filtered using {@link ByteArrayFilterGroupList#check(byte[])},
|
||||
* which uses a prefix tree to give better performance.
|
||||
*/
|
||||
class ByteArrayFilterGroup extends FilterGroup<byte[]> {
|
||||
|
||||
private volatile int[][] failurePatterns;
|
||||
|
||||
// Modified implementation from https://stackoverflow.com/a/1507813
|
||||
private static int indexOf(final byte[] data, final byte[] pattern, final int[] failure) {
|
||||
// Finds the first occurrence of the pattern in the byte array using
|
||||
// KMP matching algorithm.
|
||||
int patternLength = pattern.length;
|
||||
for (int i = 0, j = 0, dataLength = data.length; i < dataLength; i++) {
|
||||
while (j > 0 && pattern[j] != data[i]) {
|
||||
j = failure[j - 1];
|
||||
}
|
||||
if (pattern[j] == data[i]) {
|
||||
j++;
|
||||
}
|
||||
if (j == patternLength) {
|
||||
return i - patternLength + 1;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
private static int[] createFailurePattern(byte[] pattern) {
|
||||
// Computes the failure function using a boot-strapping process,
|
||||
// where the pattern is matched against itself.
|
||||
final int patternLength = pattern.length;
|
||||
final int[] failure = new int[patternLength];
|
||||
|
||||
for (int i = 1, j = 0; i < patternLength; i++) {
|
||||
while (j > 0 && pattern[j] != pattern[i]) {
|
||||
j = failure[j - 1];
|
||||
}
|
||||
if (pattern[j] == pattern[i]) {
|
||||
j++;
|
||||
}
|
||||
failure[i] = j;
|
||||
}
|
||||
return failure;
|
||||
}
|
||||
|
||||
public ByteArrayFilterGroup(BooleanSetting setting, byte[]... filters) {
|
||||
super(setting, filters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the Strings into byte arrays. Used to search for text in binary data.
|
||||
*/
|
||||
public ByteArrayFilterGroup(BooleanSetting setting, String... filters) {
|
||||
super(setting, ByteTrieSearch.convertStringsToBytes(filters));
|
||||
}
|
||||
|
||||
private synchronized void buildFailurePatterns() {
|
||||
if (failurePatterns != null) return; // Thread race and another thread already initialized the search.
|
||||
Logger.printDebug(() -> "Building failure array for: " + this);
|
||||
int[][] failurePatterns = new int[filters.length][];
|
||||
int i = 0;
|
||||
for (byte[] pattern : filters) {
|
||||
failurePatterns[i++] = createFailurePattern(pattern);
|
||||
}
|
||||
this.failurePatterns = failurePatterns; // Must set after initialization finishes.
|
||||
}
|
||||
|
||||
@Override
|
||||
public FilterGroupResult check(final byte[] bytes) {
|
||||
int matchedLength = 0;
|
||||
int matchedIndex = -1;
|
||||
if (isEnabled()) {
|
||||
int[][] failures = failurePatterns;
|
||||
if (failures == null) {
|
||||
buildFailurePatterns(); // Lazy load.
|
||||
failures = failurePatterns;
|
||||
}
|
||||
for (int i = 0, length = filters.length; i < length; i++) {
|
||||
byte[] filter = filters[i];
|
||||
matchedIndex = indexOf(bytes, filter, failures[i]);
|
||||
if (matchedIndex >= 0) {
|
||||
matchedLength = filter.length;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new FilterGroupResult(setting, matchedIndex, matchedLength);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package app.revanced.extension.youtube.patches.components;
|
||||
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
import app.revanced.extension.shared.patches.litho.Filter;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.*;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class HideInfoCardsFilter extends Filter {
|
||||
|
||||
@@ -17,6 +17,8 @@ import app.revanced.extension.shared.Utils;
|
||||
import app.revanced.extension.shared.ByteTrieSearch;
|
||||
import app.revanced.extension.shared.StringTrieSearch;
|
||||
import app.revanced.extension.shared.TrieSearch;
|
||||
import app.revanced.extension.shared.patches.litho.Filter;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.*;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
import app.revanced.extension.youtube.shared.NavigationBar;
|
||||
import app.revanced.extension.youtube.shared.PlayerType;
|
||||
@@ -41,7 +43,7 @@ import app.revanced.extension.youtube.shared.PlayerType;
|
||||
* - When using whole word syntax, some keywords may need additional pluralized variations.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
final class KeywordContentFilter extends Filter {
|
||||
public final class KeywordContentFilter extends Filter {
|
||||
|
||||
/**
|
||||
* Strings found in the buffer for every videos. Full strings should be specified.
|
||||
@@ -554,8 +556,8 @@ final class KeywordContentFilter extends Filter {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
public boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
if (contentIndex != 0 && matchedGroup == startsWithFilter) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,9 @@ import androidx.annotation.Nullable;
|
||||
import app.revanced.extension.shared.Logger;
|
||||
import app.revanced.extension.shared.Utils;
|
||||
import app.revanced.extension.shared.StringTrieSearch;
|
||||
import app.revanced.extension.shared.patches.litho.Filter;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.*;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroupList.*;
|
||||
import app.revanced.extension.youtube.patches.ChangeHeaderPatch;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
import app.revanced.extension.youtube.shared.NavigationBar;
|
||||
@@ -21,22 +24,26 @@ import app.revanced.extension.youtube.shared.PlayerType;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class LayoutComponentsFilter extends Filter {
|
||||
private static final StringTrieSearch mixPlaylistsExceptions = new StringTrieSearch(
|
||||
private static final StringTrieSearch mixPlaylistsContextExceptions = new StringTrieSearch(
|
||||
"V.ED", // Playlist browse id.
|
||||
"java.lang.ref.WeakReference"
|
||||
);
|
||||
private static final ByteArrayFilterGroup mixPlaylistsExceptions2 = new ByteArrayFilterGroup(
|
||||
private static final ByteArrayFilterGroup mixPlaylistsBufferExceptions = new ByteArrayFilterGroup(
|
||||
null,
|
||||
"cell_description_body"
|
||||
"cell_description_body",
|
||||
"channel_profile"
|
||||
);
|
||||
private static final ByteArrayFilterGroup mixPlaylists = new ByteArrayFilterGroup(
|
||||
null,
|
||||
"&list="
|
||||
);
|
||||
|
||||
private static final String PAGE_HEADER_PATH = "page_header.e";
|
||||
|
||||
private final StringTrieSearch exceptions = new StringTrieSearch();
|
||||
private final StringFilterGroup communityPosts;
|
||||
private final StringFilterGroup surveys;
|
||||
private final StringFilterGroup subscribeButton;
|
||||
private final StringFilterGroup notifyMe;
|
||||
private final StringFilterGroup singleItemInformationPanel;
|
||||
private final StringFilterGroup expandableMetadata;
|
||||
@@ -67,8 +74,14 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
"chips_shelf"
|
||||
);
|
||||
|
||||
final var visualSpacer = new StringFilterGroup(
|
||||
Settings.HIDE_VISUAL_SPACER,
|
||||
"cell_divider"
|
||||
);
|
||||
|
||||
addIdentifierCallbacks(
|
||||
chipsShelf
|
||||
chipsShelf,
|
||||
visualSpacer
|
||||
);
|
||||
|
||||
// Paths.
|
||||
@@ -237,8 +250,13 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
"sponsorships"
|
||||
);
|
||||
|
||||
final var crowdfundingBox = new StringFilterGroup(
|
||||
Settings.HIDE_CROWDFUNDING_BOX,
|
||||
"donation_shelf"
|
||||
);
|
||||
|
||||
final var channelWatermark = new StringFilterGroup(
|
||||
Settings.HIDE_VIDEO_CHANNEL_WATERMARK,
|
||||
Settings.HIDE_CHANNEL_WATERMARK,
|
||||
"featured_channel_watermark_overlay"
|
||||
);
|
||||
|
||||
@@ -255,19 +273,28 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
channelProfile = new StringFilterGroup(
|
||||
null,
|
||||
"channel_profile.e",
|
||||
"page_header.e"
|
||||
PAGE_HEADER_PATH
|
||||
);
|
||||
channelProfileBuffer = new ByteArrayFilterGroupList();
|
||||
channelProfileBuffer.addAll(new ByteArrayFilterGroup(
|
||||
Settings.HIDE_VISIT_STORE_BUTTON,
|
||||
"header_store_button"
|
||||
Settings.HIDE_STORE_BUTTON,
|
||||
"store_button"
|
||||
),
|
||||
new ByteArrayFilterGroup(
|
||||
Settings.HIDE_VISIT_COMMUNITY_BUTTON,
|
||||
Settings.HIDE_COMMUNITY_BUTTON,
|
||||
"community_button"
|
||||
),
|
||||
new ByteArrayFilterGroup(
|
||||
Settings.HIDE_JOIN_BUTTON,
|
||||
"sponsor_button"
|
||||
)
|
||||
);
|
||||
|
||||
subscribeButton = new StringFilterGroup(
|
||||
Settings.HIDE_SUBSCRIBE_BUTTON_IN_CHANNEL_PAGE,
|
||||
"subscribe_button"
|
||||
);
|
||||
|
||||
horizontalShelves = new StringFilterGroup(
|
||||
Settings.HIDE_HORIZONTAL_SHELVES,
|
||||
"horizontal_video_shelf.e",
|
||||
@@ -293,6 +320,7 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
compactChannelBar,
|
||||
compactChannelBarInner,
|
||||
communityPosts,
|
||||
crowdfundingBox,
|
||||
emergencyBox,
|
||||
expandableMetadata,
|
||||
forYouShelf,
|
||||
@@ -307,6 +335,7 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
quickActions,
|
||||
relatedVideos,
|
||||
singleItemInformationPanel,
|
||||
subscribeButton,
|
||||
subscribersCommunityGuidelines,
|
||||
subscriptionsChipBar,
|
||||
surveys,
|
||||
@@ -316,7 +345,7 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
public boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
// This identifier is used not only in players but also in search results:
|
||||
// https://github.com/ReVanced/revanced-patches/issues/3245
|
||||
@@ -337,6 +366,10 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
return channelProfileBuffer.check(buffer).isFiltered();
|
||||
}
|
||||
|
||||
if (matchedGroup == subscribeButton) {
|
||||
return path.startsWith(PAGE_HEADER_PATH);
|
||||
}
|
||||
|
||||
if (matchedGroup == communityPosts && NavigationBar.isBackButtonVisible()) {
|
||||
// Allow community posts on channel profile page,
|
||||
// or if viewing an individual channel in the feed.
|
||||
@@ -380,17 +413,15 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Prevent playlist items being hidden, if a mix playlist is present in it.
|
||||
if (mixPlaylistsExceptions.matches(conversionContext.toString())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Prevent hiding the description of some videos accidentally.
|
||||
if (mixPlaylistsExceptions2.check(bytes).isFiltered()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mixPlaylists.check(bytes).isFiltered()) {
|
||||
if (mixPlaylists.check(bytes).isFiltered()
|
||||
// Prevent hiding the description of some videos accidentally.
|
||||
&& !mixPlaylistsBufferExceptions.check(bytes).isFiltered()
|
||||
// Prevent playlist items being hidden, if a mix playlist is present in it.
|
||||
// Check last since it requires creating a context string.
|
||||
//
|
||||
// FIXME: The conversion context passed in does not always generate a valid toString.
|
||||
// This string check may no longer be needed, or the patch may be broken.
|
||||
&& !mixPlaylistsContextExceptions.matches(conversionContext.toString())) {
|
||||
Logger.printDebug(() -> "Filtered mix playlist");
|
||||
return true;
|
||||
}
|
||||
@@ -405,7 +436,7 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
* Injection point.
|
||||
*/
|
||||
public static boolean showWatermark() {
|
||||
return !Settings.HIDE_VIDEO_CHANNEL_WATERMARK.get();
|
||||
return !Settings.HIDE_CHANNEL_WATERMARK.get();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package app.revanced.extension.youtube.patches.components;
|
||||
|
||||
import app.revanced.extension.shared.patches.litho.Filter;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.*;
|
||||
import app.revanced.extension.youtube.patches.playback.speed.CustomPlaybackSpeedPatch;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
|
||||
@@ -36,7 +38,7 @@ public final class PlaybackSpeedMenuFilter extends Filter {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
public boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
if (matchedGroup == oldPlaybackMenuGroup) {
|
||||
isOldPlaybackSpeedMenuVisible = true;
|
||||
|
||||
@@ -3,22 +3,21 @@ package app.revanced.extension.youtube.patches.components;
|
||||
import app.revanced.extension.shared.settings.BaseSettings;
|
||||
import app.revanced.extension.shared.settings.Setting;
|
||||
import app.revanced.extension.shared.spoof.SpoofVideoStreamsPatch;
|
||||
import app.revanced.extension.shared.patches.litho.Filter;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.*;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroupList.*;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
import app.revanced.extension.youtube.shared.ShortsPlayerState;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class PlayerFlyoutMenuItemsFilter extends Filter {
|
||||
public final class PlayerFlyoutMenuItemsFilter extends Filter {
|
||||
|
||||
public static final class HideAudioFlyoutMenuAvailability implements Setting.Availability {
|
||||
private static final boolean AVAILABLE_ON_LAUNCH = !SpoofVideoStreamsPatch.spoofingToClientWithNoMultiAudioStreams();
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
// Check conditions of launch and now. Otherwise if spoofing is changed
|
||||
// without a restart the setting will show as available when it's not.
|
||||
return AVAILABLE_ON_LAUNCH && !SpoofVideoStreamsPatch.spoofingToClientWithNoMultiAudioStreams();
|
||||
return !SpoofVideoStreamsPatch.spoofingToClientWithNoMultiAudioStreams();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -98,7 +97,7 @@ public class PlayerFlyoutMenuItemsFilter extends Filter {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
public boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
if (matchedGroup == videoQualityMenuFooter) {
|
||||
return true;
|
||||
|
||||
@@ -13,6 +13,9 @@ import app.revanced.extension.youtube.patches.VideoInformation;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
import app.revanced.extension.shared.Logger;
|
||||
import app.revanced.extension.shared.TrieSearch;
|
||||
import app.revanced.extension.shared.patches.litho.Filter;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.*;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroupList.*;
|
||||
|
||||
/**
|
||||
* Searches for video id's in the proto buffer of Shorts dislike.
|
||||
@@ -84,13 +87,13 @@ public final class ReturnYouTubeDislikeFilter extends Filter {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
public boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
if (!Settings.RYD_ENABLED.get() || !Settings.RYD_SHORTS.get()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
FilterGroup.FilterGroupResult result = videoIdFilterGroup.check(buffer);
|
||||
FilterGroupResult result = videoIdFilterGroup.check(buffer);
|
||||
if (result.isFiltered()) {
|
||||
String matchedVideoId = findVideoId(buffer);
|
||||
// Matched video will be null if in incognito mode.
|
||||
|
||||
@@ -11,6 +11,9 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import app.revanced.extension.shared.Logger;
|
||||
import app.revanced.extension.shared.patches.litho.Filter;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroup.*;
|
||||
import app.revanced.extension.shared.patches.litho.FilterGroupList.*;
|
||||
import app.revanced.extension.youtube.settings.Settings;
|
||||
import app.revanced.extension.youtube.shared.NavigationBar;
|
||||
import app.revanced.extension.youtube.shared.PlayerType;
|
||||
@@ -44,9 +47,10 @@ public final class ShortsFilter extends Filter {
|
||||
private final StringFilterGroup useTemplateButton;
|
||||
private final ByteArrayFilterGroup useTemplateButtonBuffer;
|
||||
|
||||
private final StringFilterGroup autoDubbedLabel;
|
||||
private final StringFilterGroup subscribeButton;
|
||||
private final StringFilterGroup joinButton;
|
||||
private final StringFilterGroup paidPromotionButton;
|
||||
private final StringFilterGroup paidPromotionLabel;
|
||||
private final StringFilterGroup shelfHeader;
|
||||
|
||||
private final StringFilterGroup suggestedAction;
|
||||
@@ -161,6 +165,18 @@ public final class ShortsFilter extends Filter {
|
||||
"participation_bar.e"
|
||||
);
|
||||
|
||||
StringFilterGroup livePreview = new StringFilterGroup(
|
||||
Settings.HIDE_SHORTS_LIVE_PREVIEW,
|
||||
// Live Shorts preview that can popup while scrolling through Shorts player.
|
||||
// Can be removed if a way to disable live Shorts is found.
|
||||
"live_preview_page_vm.e"
|
||||
);
|
||||
|
||||
autoDubbedLabel = new StringFilterGroup(
|
||||
Settings.HIDE_SHORTS_AUTO_DUBBED_LABEL,
|
||||
"badge."
|
||||
);
|
||||
|
||||
joinButton = new StringFilterGroup(
|
||||
Settings.HIDE_SHORTS_JOIN_BUTTON,
|
||||
"sponsor_button"
|
||||
@@ -171,9 +187,10 @@ public final class ShortsFilter extends Filter {
|
||||
"subscribe_button"
|
||||
);
|
||||
|
||||
paidPromotionButton = new StringFilterGroup(
|
||||
paidPromotionLabel = new StringFilterGroup(
|
||||
Settings.HIDE_PAID_PROMOTION_LABEL,
|
||||
"reel_player_disclosure.e"
|
||||
"reel_player_disclosure.e",
|
||||
"shorts_disclosures.e"
|
||||
);
|
||||
|
||||
shortsActionBar = new StringFilterGroup(
|
||||
@@ -219,10 +236,10 @@ public final class ShortsFilter extends Filter {
|
||||
);
|
||||
|
||||
addPathCallbacks(
|
||||
shortsCompactFeedVideo, joinButton, subscribeButton, paidPromotionButton,
|
||||
shortsCompactFeedVideo, joinButton, subscribeButton, paidPromotionLabel, autoDubbedLabel,
|
||||
shortsActionBar, suggestedAction, pausedOverlayButtons, channelBar, previewComment,
|
||||
fullVideoLinkLabel, videoTitle, useSoundButton, reelSoundMetadata, soundButton, infoPanel,
|
||||
stickers, likeFountain, likeButton, dislikeButton
|
||||
stickers, likeFountain, likeButton, dislikeButton, livePreview
|
||||
);
|
||||
|
||||
//
|
||||
@@ -250,6 +267,12 @@ public final class ShortsFilter extends Filter {
|
||||
// Suggested actions.
|
||||
//
|
||||
suggestedActionsBuffer.addAll(
|
||||
new ByteArrayFilterGroup(
|
||||
Settings.HIDE_SHORTS_PREVIEW_COMMENT,
|
||||
// Preview comment that can popup while a Short is playing.
|
||||
// Uses no bundled icons, and instead the users profile photo is shown.
|
||||
"shorts-comments-panel"
|
||||
),
|
||||
new ByteArrayFilterGroup(
|
||||
Settings.HIDE_SHORTS_SHOP_BUTTON,
|
||||
"yt_outline_bag_"
|
||||
@@ -319,10 +342,11 @@ public final class ShortsFilter extends Filter {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
public boolean isFiltered(String identifier, String path, byte[] buffer,
|
||||
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
|
||||
if (contentType == FilterContentType.PATH) {
|
||||
if (matchedGroup == subscribeButton || matchedGroup == joinButton || matchedGroup == paidPromotionButton) {
|
||||
if (matchedGroup == subscribeButton || matchedGroup == joinButton
|
||||
|| matchedGroup == paidPromotionLabel || matchedGroup == autoDubbedLabel) {
|
||||
// Selectively filter to avoid false positive filtering of other subscribe/join buttons.
|
||||
return path.startsWith(REEL_CHANNEL_BAR_PATH) || path.startsWith(REEL_METAPANEL_PATH);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package app.revanced.extension.youtube.settings;
|
||||
import static java.lang.Boolean.FALSE;
|
||||
import static java.lang.Boolean.TRUE;
|
||||
import static app.revanced.extension.shared.settings.Setting.parent;
|
||||
import static app.revanced.extension.shared.settings.Setting.parentNot;
|
||||
import static app.revanced.extension.shared.settings.Setting.parentsAll;
|
||||
import static app.revanced.extension.shared.settings.Setting.parentsAny;
|
||||
import static app.revanced.extension.youtube.patches.ChangeFormFactorPatch.FormFactor;
|
||||
@@ -31,6 +32,7 @@ import android.graphics.Color;
|
||||
|
||||
import app.revanced.extension.shared.Logger;
|
||||
import app.revanced.extension.shared.Utils;
|
||||
import app.revanced.extension.shared.settings.YouTubeAndMusicSettings;
|
||||
import app.revanced.extension.shared.settings.BaseSettings;
|
||||
import app.revanced.extension.shared.settings.BooleanSetting;
|
||||
import app.revanced.extension.shared.settings.EnumSetting;
|
||||
@@ -48,7 +50,7 @@ import app.revanced.extension.youtube.patches.MiniplayerPatch;
|
||||
import app.revanced.extension.youtube.sponsorblock.SponsorBlockSettings;
|
||||
import app.revanced.extension.youtube.swipecontrols.SwipeControlsConfigurationProvider.SwipeOverlayStyle;
|
||||
|
||||
public class Settings extends BaseSettings {
|
||||
public class Settings extends YouTubeAndMusicSettings {
|
||||
// Video
|
||||
public static final BooleanSetting ADVANCED_VIDEO_QUALITY_MENU = new BooleanSetting("revanced_advanced_video_quality_menu", TRUE);
|
||||
public static final BooleanSetting DISABLE_HDR_VIDEO = new BooleanSetting("revanced_disable_hdr_video", FALSE);
|
||||
@@ -95,7 +97,6 @@ public class Settings extends BaseSettings {
|
||||
public static final BooleanSetting HIDE_CHIPS_SHELF = new BooleanSetting("revanced_hide_chips_shelf", TRUE);
|
||||
public static final BooleanSetting HIDE_COMMUNITY_POSTS = new BooleanSetting("revanced_hide_community_posts", FALSE);
|
||||
public static final BooleanSetting HIDE_COMPACT_BANNER = new BooleanSetting("revanced_hide_compact_banner", TRUE);
|
||||
public static final BooleanSetting HIDE_CROWDFUNDING_BOX = new BooleanSetting("revanced_hide_crowdfunding_box", FALSE, true);
|
||||
public static final BooleanSetting HIDE_DOODLES = new BooleanSetting("revanced_hide_doodles", FALSE, true, "revanced_hide_doodles_user_dialog_message");
|
||||
public static final BooleanSetting HIDE_EXPANDABLE_CARD = new BooleanSetting("revanced_hide_expandable_card", TRUE);
|
||||
public static final BooleanSetting HIDE_FILTER_BAR_FEED_IN_FEED = new BooleanSetting("revanced_hide_filter_bar_feed_in_feed", FALSE, true);
|
||||
@@ -115,6 +116,7 @@ public class Settings extends BaseSettings {
|
||||
public static final BooleanSetting HIDE_UPLOAD_TIME = new BooleanSetting("revanced_hide_upload_time", FALSE, "revanced_hide_upload_time_user_dialog_message");
|
||||
public static final BooleanSetting HIDE_VIDEO_RECOMMENDATION_LABELS = new BooleanSetting("revanced_hide_video_recommendation_labels", TRUE);
|
||||
public static final BooleanSetting HIDE_VIEW_COUNT = new BooleanSetting("revanced_hide_view_count", FALSE, "revanced_hide_view_count_user_dialog_message");
|
||||
public static final BooleanSetting HIDE_VISUAL_SPACER = new BooleanSetting("revanced_hide_visual_spacer", TRUE);
|
||||
|
||||
// Alternative thumbnails
|
||||
public static final EnumSetting<ThumbnailOption> ALT_THUMBNAIL_HOME = new EnumSetting<>("revanced_alt_thumbnail_home", ThumbnailOption.ORIGINAL);
|
||||
@@ -136,11 +138,13 @@ public class Settings extends BaseSettings {
|
||||
parentsAny(HIDE_KEYWORD_CONTENT_HOME, HIDE_KEYWORD_CONTENT_SUBSCRIPTIONS, HIDE_KEYWORD_CONTENT_SEARCH));
|
||||
|
||||
// Channel page
|
||||
public static final BooleanSetting HIDE_COMMUNITY_BUTTON = new BooleanSetting("revanced_hide_community_button", TRUE);
|
||||
public static final BooleanSetting HIDE_FOR_YOU_SHELF = new BooleanSetting("revanced_hide_for_you_shelf", FALSE);
|
||||
public static final BooleanSetting HIDE_JOIN_BUTTON = new BooleanSetting("revanced_hide_join_button", FALSE);
|
||||
public static final BooleanSetting HIDE_LINKS_PREVIEW = new BooleanSetting("revanced_hide_links_preview", TRUE);
|
||||
public static final BooleanSetting HIDE_MEMBERS_SHELF = new BooleanSetting("revanced_hide_members_shelf", TRUE);
|
||||
public static final BooleanSetting HIDE_VISIT_COMMUNITY_BUTTON = new BooleanSetting("revanced_hide_visit_community_button", TRUE);
|
||||
public static final BooleanSetting HIDE_VISIT_STORE_BUTTON = new BooleanSetting("revanced_hide_visit_store_button", TRUE);
|
||||
public static final BooleanSetting HIDE_STORE_BUTTON = new BooleanSetting("revanced_hide_store_button", TRUE);
|
||||
public static final BooleanSetting HIDE_SUBSCRIBE_BUTTON_IN_CHANNEL_PAGE = new BooleanSetting("revanced_hide_subscribe_button_in_channel_page", FALSE);
|
||||
|
||||
// Player
|
||||
public static final BooleanSetting COPY_VIDEO_URL = new BooleanSetting("revanced_copy_video_url", FALSE);
|
||||
@@ -154,6 +158,8 @@ public class Settings extends BaseSettings {
|
||||
public static final BooleanSetting HIDE_CAPTIONS_BUTTON = new BooleanSetting("revanced_hide_captions_button", FALSE);
|
||||
public static final BooleanSetting HIDE_CAST_BUTTON = new BooleanSetting("revanced_hide_cast_button", TRUE, true);
|
||||
public static final BooleanSetting HIDE_CHANNEL_BAR = new BooleanSetting("revanced_hide_channel_bar", FALSE);
|
||||
public static final BooleanSetting HIDE_CHANNEL_WATERMARK = new BooleanSetting("revanced_hide_channel_watermark", TRUE);
|
||||
public static final BooleanSetting HIDE_CROWDFUNDING_BOX = new BooleanSetting("revanced_hide_crowdfunding_box", FALSE, true);
|
||||
public static final BooleanSetting HIDE_EMERGENCY_BOX = new BooleanSetting("revanced_hide_emergency_box", TRUE);
|
||||
public static final BooleanSetting HIDE_ENDSCREEN_CARDS = new BooleanSetting("revanced_hide_endscreen_cards", FALSE);
|
||||
public static final BooleanSetting HIDE_END_SCREEN_SUGGESTED_VIDEO = new BooleanSetting("revanced_end_screen_suggested_video", FALSE, true);
|
||||
@@ -168,7 +174,6 @@ public class Settings extends BaseSettings {
|
||||
public static final BooleanSetting HIDE_RELATED_VIDEOS = new BooleanSetting("revanced_hide_related_videos", FALSE);
|
||||
public static final BooleanSetting HIDE_SUBSCRIBERS_COMMUNITY_GUIDELINES = new BooleanSetting("revanced_hide_subscribers_community_guidelines", TRUE);
|
||||
public static final BooleanSetting HIDE_TIMED_REACTIONS = new BooleanSetting("revanced_hide_timed_reactions", TRUE);
|
||||
public static final BooleanSetting HIDE_VIDEO_CHANNEL_WATERMARK = new BooleanSetting("revanced_hide_channel_watermark", TRUE);
|
||||
public static final BooleanSetting OPEN_VIDEOS_FULLSCREEN_PORTRAIT = new BooleanSetting("revanced_open_videos_fullscreen_portrait", FALSE);
|
||||
public static final BooleanSetting PLAYBACK_SPEED_DIALOG_BUTTON = new BooleanSetting("revanced_playback_speed_dialog_button", FALSE);
|
||||
public static final BooleanSetting VIDEO_QUALITY_DIALOG_BUTTON = new BooleanSetting("revanced_video_quality_dialog_button", FALSE);
|
||||
@@ -210,13 +215,14 @@ public class Settings extends BaseSettings {
|
||||
public static final BooleanSetting HIDE_ASK_SECTION = new BooleanSetting("revanced_hide_ask_section", FALSE);
|
||||
public static final BooleanSetting HIDE_ATTRIBUTES_SECTION = new BooleanSetting("revanced_hide_attributes_section", FALSE);
|
||||
public static final BooleanSetting HIDE_CHAPTERS_SECTION = new BooleanSetting("revanced_hide_chapters_section", TRUE);
|
||||
public static final BooleanSetting HIDE_FEATURED_SECTION = new BooleanSetting("revanced_hide_featured_section", TRUE);
|
||||
public static final BooleanSetting HIDE_HOW_THIS_WAS_MADE_SECTION = new BooleanSetting("revanced_hide_how_this_was_made_section", FALSE);
|
||||
public static final BooleanSetting HIDE_HYPE_POINTS = new BooleanSetting("revanced_hide_hype_points", FALSE);
|
||||
public static final BooleanSetting HIDE_INFO_CARDS_SECTION = new BooleanSetting("revanced_hide_info_cards_section", TRUE);
|
||||
public static final BooleanSetting HIDE_FEATURED_LINKS_SECTION = new BooleanSetting("revanced_hide_featured_links_section", FALSE, parentNot(HIDE_INFO_CARDS_SECTION));
|
||||
public static final BooleanSetting HIDE_FEATURED_VIDEOS_SECTION = new BooleanSetting("revanced_hide_featured_videos_section", FALSE, parentNot(HIDE_INFO_CARDS_SECTION));
|
||||
public static final BooleanSetting HIDE_SUBSCRIBE_BUTTON = new BooleanSetting("revanced_hide_subscribe_button", FALSE, parentNot(HIDE_INFO_CARDS_SECTION));
|
||||
public static final BooleanSetting HIDE_KEY_CONCEPTS_SECTION = new BooleanSetting("revanced_hide_key_concepts_section", FALSE);
|
||||
public static final BooleanSetting HIDE_PODCAST_SECTION = new BooleanSetting("revanced_hide_podcast_section", TRUE);
|
||||
public static final BooleanSetting HIDE_DESCRIPTION_SUBSCRIBE_BUTTON = new BooleanSetting("revanced_hide_description_subscribe_button", TRUE);
|
||||
public static final BooleanSetting HIDE_TRANSCRIPT_SECTION = new BooleanSetting("revanced_hide_transcript_section", TRUE);
|
||||
|
||||
// Action buttons
|
||||
@@ -228,11 +234,11 @@ public class Settings extends BaseSettings {
|
||||
public static final BooleanSetting HIDE_HYPE_BUTTON = new BooleanSetting("revanced_hide_hype_button", FALSE);
|
||||
public static final BooleanSetting HIDE_LIKE_DISLIKE_BUTTON = new BooleanSetting("revanced_hide_like_dislike_button", FALSE);
|
||||
public static final BooleanSetting HIDE_PROMOTE_BUTTON = new BooleanSetting("revanced_hide_promote_button", FALSE);
|
||||
public static final BooleanSetting HIDE_REMIX_BUTTON = new BooleanSetting("revanced_hide_remix_button", TRUE);
|
||||
public static final BooleanSetting HIDE_REMIX_BUTTON = new BooleanSetting("revanced_hide_remix_button", FALSE);
|
||||
public static final BooleanSetting HIDE_REPORT_BUTTON = new BooleanSetting("revanced_hide_report_button", FALSE);
|
||||
public static final BooleanSetting HIDE_SAVE_BUTTON = new BooleanSetting("revanced_hide_save_button", FALSE);
|
||||
public static final BooleanSetting HIDE_SHARE_BUTTON = new BooleanSetting("revanced_hide_share_button", FALSE);
|
||||
public static final BooleanSetting HIDE_SHOP_BUTTON = new BooleanSetting("revanced_hide_shop_button", FALSE);
|
||||
public static final BooleanSetting HIDE_SHOP_BUTTON = new BooleanSetting("revanced_hide_shop_button", TRUE);
|
||||
public static final BooleanSetting HIDE_STOP_ADS_BUTTON = new BooleanSetting("revanced_hide_stop_ads_button", TRUE);
|
||||
public static final BooleanSetting HIDE_THANKS_BUTTON = new BooleanSetting("revanced_hide_thanks_button", TRUE);
|
||||
|
||||
@@ -269,11 +275,6 @@ public class Settings extends BaseSettings {
|
||||
public static final BooleanSetting CHANGE_START_PAGE_ALWAYS = new BooleanSetting("revanced_change_start_page_always", FALSE, true,
|
||||
new ChangeStartPageTypeAvailability());
|
||||
public static final StringSetting SPOOF_APP_VERSION_TARGET = new StringSetting("revanced_spoof_app_version_target", "19.01.34", true, parent(SPOOF_APP_VERSION));
|
||||
|
||||
// Custom filter
|
||||
public static final BooleanSetting CUSTOM_FILTER = new BooleanSetting("revanced_custom_filter", FALSE);
|
||||
public static final StringSetting CUSTOM_FILTER_STRINGS = new StringSetting("revanced_custom_filter_strings", "", true, parent(CUSTOM_FILTER));
|
||||
|
||||
// Navigation buttons
|
||||
public static final BooleanSetting HIDE_HOME_BUTTON = new BooleanSetting("revanced_hide_home_button", FALSE, true);
|
||||
public static final BooleanSetting HIDE_CREATE_BUTTON = new BooleanSetting("revanced_hide_create_button", TRUE, true);
|
||||
@@ -292,6 +293,7 @@ public class Settings extends BaseSettings {
|
||||
public static final BooleanSetting DISABLE_RESUMING_SHORTS_PLAYER = new BooleanSetting("revanced_disable_resuming_shorts_player", FALSE);
|
||||
public static final BooleanSetting DISABLE_SHORTS_BACKGROUND_PLAYBACK = new BooleanSetting("revanced_shorts_disable_background_playback", FALSE);
|
||||
public static final EnumSetting<ShortsPlayerType> SHORTS_PLAYER_TYPE = new EnumSetting<>("revanced_shorts_player_type", ShortsPlayerType.SHORTS_PLAYER);
|
||||
public static final BooleanSetting HIDE_SHORTS_AUTO_DUBBED_LABEL = new BooleanSetting("revanced_hide_shorts_auto_dubbed_label", FALSE);
|
||||
public static final BooleanSetting HIDE_SHORTS_CHANNEL_BAR = new BooleanSetting("revanced_hide_shorts_channel_bar", FALSE);
|
||||
public static final BooleanSetting HIDE_SHORTS_COMMENTS_BUTTON = new BooleanSetting("revanced_hide_shorts_comments_button", FALSE);
|
||||
public static final BooleanSetting HIDE_SHORTS_DISLIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_dislike_button", FALSE);
|
||||
@@ -306,11 +308,12 @@ public class Settings extends BaseSettings {
|
||||
public static final BooleanSetting HIDE_SHORTS_JOIN_BUTTON = new BooleanSetting("revanced_hide_shorts_join_button", TRUE);
|
||||
public static final BooleanSetting HIDE_SHORTS_LIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_like_button", FALSE);
|
||||
public static final BooleanSetting HIDE_SHORTS_LIKE_FOUNTAIN = new BooleanSetting("revanced_hide_shorts_like_fountain", TRUE);
|
||||
public static final BooleanSetting HIDE_SHORTS_LIVE_PREVIEW = new BooleanSetting("revanced_hide_shorts_live_preview", FALSE);
|
||||
public static final BooleanSetting HIDE_SHORTS_LOCATION_LABEL = new BooleanSetting("revanced_hide_shorts_location_label", FALSE);
|
||||
public static final BooleanSetting HIDE_SHORTS_NAVIGATION_BAR = new BooleanSetting("revanced_hide_shorts_navigation_bar", FALSE, true);
|
||||
public static final BooleanSetting HIDE_SHORTS_PAUSED_OVERLAY_BUTTONS = new BooleanSetting("revanced_hide_shorts_paused_overlay_buttons", FALSE);
|
||||
public static final BooleanSetting HIDE_SHORTS_PREVIEW_COMMENT = new BooleanSetting("revanced_hide_shorts_preview_comment", TRUE);
|
||||
public static final BooleanSetting HIDE_SHORTS_REMIX_BUTTON = new BooleanSetting("revanced_hide_shorts_remix_button", TRUE);
|
||||
public static final BooleanSetting HIDE_SHORTS_REMIX_BUTTON = new BooleanSetting("revanced_hide_shorts_remix_button", FALSE);
|
||||
public static final BooleanSetting HIDE_SHORTS_SAVE_SOUND_BUTTON = new BooleanSetting("revanced_hide_shorts_save_sound_button", TRUE);
|
||||
public static final BooleanSetting HIDE_SHORTS_SEARCH = new BooleanSetting("revanced_hide_shorts_search", FALSE);
|
||||
public static final BooleanSetting HIDE_SHORTS_SEARCH_SUGGESTIONS = new BooleanSetting("revanced_hide_shorts_search_suggestions", TRUE);
|
||||
@@ -349,6 +352,7 @@ public class Settings extends BaseSettings {
|
||||
public static final IntegerSetting ANNOUNCEMENT_LAST_ID = new IntegerSetting("revanced_announcement_last_id", -1, false, false);
|
||||
public static final BooleanSetting LOOP_VIDEO = new BooleanSetting("revanced_loop_video", FALSE);
|
||||
public static final BooleanSetting LOOP_VIDEO_BUTTON = new BooleanSetting("revanced_loop_video_button", FALSE);
|
||||
public static final BooleanSetting PAUSE_ON_AUDIO_INTERRUPT = new BooleanSetting("revanced_pause_on_audio_interrupt", FALSE, true);
|
||||
public static final BooleanSetting BYPASS_URL_REDIRECTS = new BooleanSetting("revanced_bypass_url_redirects", TRUE);
|
||||
public static final BooleanSetting DISABLE_HAPTIC_FEEDBACK_CHAPTERS = new BooleanSetting("revanced_disable_haptic_feedback_chapters", FALSE);
|
||||
public static final BooleanSetting DISABLE_HAPTIC_FEEDBACK_PRECISE_SEEKING = new BooleanSetting("revanced_disable_haptic_feedback_precise_seeking", FALSE);
|
||||
@@ -360,8 +364,6 @@ public class Settings extends BaseSettings {
|
||||
public static final EnumSetting<ClientType> SPOOF_VIDEO_STREAMS_CLIENT_TYPE = new EnumSetting<>("revanced_spoof_video_streams_client_type", ClientType.ANDROID_VR_1_43_32, true, parent(SPOOF_VIDEO_STREAMS));
|
||||
public static final BooleanSetting SPOOF_VIDEO_STREAMS_AV1 = new BooleanSetting("revanced_spoof_video_streams_av1", FALSE, true,
|
||||
"revanced_spoof_video_streams_av1_user_dialog_message", new SpoofClientAv1Availability());
|
||||
public static final BooleanSetting DEBUG_PROTOBUFFER = new BooleanSetting("revanced_debug_protobuffer", FALSE, false,
|
||||
"revanced_debug_protobuffer_user_dialog_message", parent(BaseSettings.DEBUG));
|
||||
|
||||
// Swipe controls
|
||||
public static final BooleanSetting SWIPE_CHANGE_VIDEO = new BooleanSetting("revanced_swipe_change_video", FALSE, true);
|
||||
@@ -374,7 +376,7 @@ public class Settings extends BaseSettings {
|
||||
public static final IntegerSetting SWIPE_MAGNITUDE_THRESHOLD = new IntegerSetting("revanced_swipe_threshold", 30, true,
|
||||
parentsAny(SWIPE_BRIGHTNESS, SWIPE_VOLUME));
|
||||
public static final IntegerSetting SWIPE_VOLUME_SENSITIVITY = new IntegerSetting("revanced_swipe_volume_sensitivity", 1, true, parent(SWIPE_VOLUME));
|
||||
public static final EnumSetting<SwipeOverlayStyle> SWIPE_OVERLAY_STYLE = new EnumSetting<>("revanced_swipe_overlay_style", SwipeOverlayStyle.HORIZONTAL,true,
|
||||
public static final EnumSetting<SwipeOverlayStyle> SWIPE_OVERLAY_STYLE = new EnumSetting<>("revanced_swipe_overlay_style", SwipeOverlayStyle.HORIZONTAL, true,
|
||||
parentsAny(SWIPE_BRIGHTNESS, SWIPE_VOLUME));
|
||||
public static final IntegerSetting SWIPE_OVERLAY_TEXT_SIZE = new IntegerSetting("revanced_swipe_text_overlay_size", 14, true,
|
||||
parentsAny(SWIPE_BRIGHTNESS, SWIPE_VOLUME));
|
||||
@@ -403,7 +405,9 @@ public class Settings extends BaseSettings {
|
||||
|
||||
// SponsorBlock
|
||||
public static final BooleanSetting SB_ENABLED = new BooleanSetting("sb_enabled", TRUE);
|
||||
/** Do not use id setting directly. Instead use {@link SponsorBlockSettings}. */
|
||||
/**
|
||||
* Do not use id setting directly. Instead use {@link SponsorBlockSettings}.
|
||||
*/
|
||||
public static final StringSetting SB_PRIVATE_USER_ID = new StringSetting("sb_private_user_id_Do_Not_Share", "", parent(SB_ENABLED));
|
||||
public static final IntegerSetting SB_CREATE_NEW_SEGMENT_STEP = new IntegerSetting("sb_create_new_segment_step", 150, parent(SB_ENABLED));
|
||||
public static final BooleanSetting SB_VOTING_BUTTON = new BooleanSetting("sb_voting_button", FALSE, parent(SB_ENABLED));
|
||||
@@ -452,7 +456,7 @@ public class Settings extends BaseSettings {
|
||||
public static final StringSetting SB_CATEGORY_UNSUBMITTED_COLOR = new StringSetting("sb_unsubmitted_color", "#FFFFFFFF", false, false);
|
||||
|
||||
// Deprecated migrations
|
||||
private static final StringSetting DEPRECATED_SEEKBAR_CUSTOM_COLOR_PRIMARY = new StringSetting("revanced_seekbar_custom_color_value", "#FF0033");
|
||||
private static final StringSetting DEPRECATED_SEEKBAR_CUSTOM_COLOR_PRIMARY = new StringSetting("revanced_seekbar_custom_color_value", "#FF0033");
|
||||
|
||||
private static final FloatSetting DEPRECATED_SB_CATEGORY_SPONSOR_OPACITY = new FloatSetting("sb_sponsor_opacity", 0.8f, false, false);
|
||||
private static final FloatSetting DEPRECATED_SB_CATEGORY_SELF_PROMO_OPACITY = new FloatSetting("sb_selfpromo_opacity", 0.8f, false, false);
|
||||
@@ -504,7 +508,7 @@ public class Settings extends BaseSettings {
|
||||
// or is spoofing to a version the same or newer than this app.
|
||||
if (!SPOOF_APP_VERSION_TARGET.isSetToDefault() &&
|
||||
(SPOOF_APP_VERSION_TARGET.get().compareTo(SPOOF_APP_VERSION_TARGET.defaultValue) < 0
|
||||
|| (Utils.getAppVersionName().compareTo(SPOOF_APP_VERSION_TARGET.get()) <= 0))) {
|
||||
|| (Utils.getAppVersionName().compareTo(SPOOF_APP_VERSION_TARGET.get()) <= 0))) {
|
||||
Logger.printInfo(() -> "Resetting spoof app version");
|
||||
SPOOF_APP_VERSION_TARGET.resetToDefault();
|
||||
SPOOF_APP_VERSION.resetToDefault();
|
||||
|
||||
@@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M
|
||||
org.gradle.parallel = true
|
||||
android.useAndroidX = true
|
||||
kotlin.code.style = official
|
||||
version = 5.46.0-dev.10
|
||||
version = 5.50.0-dev.1
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
public final class DisableReelsScrollingPatchKt {
|
||||
public static final fun getDisableReelsScrollingPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/all/misc/activity/exportall/ExportAllActivitiesPatchKt {
|
||||
public static final fun getExportAllActivitiesPatch ()Lapp/revanced/patcher/patch/ResourcePatch;
|
||||
}
|
||||
@@ -56,6 +60,10 @@ public final class app/revanced/patches/all/misc/connectivity/telephony/sim/spoo
|
||||
public static final fun getSpoofSimCountryPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/all/misc/connectivity/telephony/sim/spoof/SpoofSimProviderPatchKt {
|
||||
public static final fun getSpoofSimProviderPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/all/misc/connectivity/wifi/spoof/SpoofWifiPatchKt {
|
||||
public static final fun getSpoofWifiPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -96,6 +104,10 @@ public final class app/revanced/patches/all/misc/packagename/ChangePackageNamePa
|
||||
public static final fun setPackageNameOption (Lapp/revanced/patcher/patch/Option;)V
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/all/misc/playintegrity/DisablePlayIntegrityKt {
|
||||
public static final fun getDisablePlayIntegrityPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/all/misc/resources/AddResourcesPatchKt {
|
||||
public static final fun addResource (Ljava/lang/String;Lapp/revanced/util/resource/BaseResource;)Z
|
||||
public static final fun addResources (Lapp/revanced/patcher/patch/Patch;Lkotlin/jvm/functions/Function1;)Z
|
||||
@@ -112,6 +124,10 @@ public final class app/revanced/patches/all/misc/screencapture/RemoveScreenCaptu
|
||||
public static final fun getRemoveScreenCaptureRestrictionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/all/misc/screenshot/PreventScreenshotDetectionPatchKt {
|
||||
public static final fun getPreventScreenshotDetectionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/all/misc/screenshot/RemoveScreenshotRestrictionPatchKt {
|
||||
public static final fun getRemoveScreenshotRestrictionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -168,6 +184,10 @@ public final class app/revanced/patches/cieid/restrictions/root/BypassRootChecks
|
||||
public static final fun getBypassRootChecksPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/com/sbs/ondemand/tv/RemoveAdsPatchKt {
|
||||
public static final fun getRemoveAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/cricbuzz/ads/DisableAdsPatchKt {
|
||||
public static final fun getDisableAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -180,6 +200,10 @@ public final class app/revanced/patches/crunchyroll/ads/HideAdsPatchKt {
|
||||
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/disneyplus/ads/SkipAdsPatchKt {
|
||||
public static final fun getSkipAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/duolingo/ad/DisableAdsPatchKt {
|
||||
public static final fun getDisableAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -256,6 +280,10 @@ public final class app/revanced/patches/iconpackstudio/misc/pro/UnlockProPatchKt
|
||||
public static final fun getUnlockProPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/idaustria/detection/deviceintegrity/RemoveDeviceIntegrityChecksPatchKt {
|
||||
public static final fun getRemoveDeviceIntegrityChecksPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/idaustria/detection/root/RootDetectionPatchKt {
|
||||
public static final fun getRootDetectionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -276,10 +304,18 @@ public final class app/revanced/patches/instagram/feed/LimitFeedToFollowedProfil
|
||||
public static final fun getLimitFeedToFollowedProfiles ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/instagram/ghost/story/AnonymousStoryViewingPatchKt {
|
||||
public static final fun getAnonymousStoryViewingPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/instagram/hide/explore/HideExploreFeedKt {
|
||||
public static final fun getHideExploreFeedPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/instagram/hide/highlightsTray/HideHighlightsTrayPatchKt {
|
||||
public static final fun getHideHighlightsTrayPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/instagram/hide/navigation/HideNavigationButtonsKt {
|
||||
public static final fun getHideNavigationButtonsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -304,6 +340,10 @@ public final class app/revanced/patches/instagram/misc/links/OpenLinksExternally
|
||||
public static final fun getOpenLinksExternallyPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/instagram/misc/removeBuildExpiredPopup/RemoveBuildExpiredPopupPatchKt {
|
||||
public static final fun getRemoveBuildExpiredPopupPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/instagram/misc/share/domain/ChangeLinkSharingDomainPatchKt {
|
||||
public static final fun getChangeLinkSharingDomainPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -316,10 +356,22 @@ public final class app/revanced/patches/instagram/misc/signature/SignatureCheckP
|
||||
public static final fun getSignatureCheckPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/instagram/story/flipping/DisableStoryAutoFlippingPatchKt {
|
||||
public static final fun getDisableStoryAutoFlippingPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/irplus/ad/RemoveAdsPatchKt {
|
||||
public static final fun getRemoveAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/letterboxd/ads/HideAdsPatchKt {
|
||||
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/letterboxd/unlock/unlockAppIcons/UnlockAppIconsPatchKt {
|
||||
public static final fun getUnlockAppIconsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/lightroom/misc/login/DisableMandatoryLoginPatchKt {
|
||||
public static final fun getDisableMandatoryLoginPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -328,6 +380,10 @@ public final class app/revanced/patches/lightroom/misc/premium/UnlockPremiumPatc
|
||||
public static final fun getUnlockPremiumPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/lightroom/misc/version/DisableVersionCheckPatchKt {
|
||||
public static final fun getDisableVersionCheckPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/memegenerator/detection/license/LicenseValidationPatchKt {
|
||||
public static final fun getLicenseValidationPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -416,6 +472,10 @@ public final class app/revanced/patches/music/layout/compactheader/HideCategoryB
|
||||
public static final fun getHideCategoryBar ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/music/layout/hide/general/HideLayoutComponentsPatchKt {
|
||||
public static final fun getHideLayoutComponentsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/music/layout/miniplayercolor/ChangeMiniplayerColorKt {
|
||||
public static final fun getChangeMiniplayerColor ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -441,6 +501,10 @@ public final class app/revanced/patches/music/misc/androidauto/BypassCertificate
|
||||
public static final fun getBypassCertificateChecksPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/music/misc/androidauto/UnlockAndroidAutoMediaBrowserPatchKt {
|
||||
public static final fun getUnlockAndroidAutoMediaBrowserPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/music/misc/backgroundplayback/BackgroundPlaybackPatchKt {
|
||||
public static final fun getBackgroundPlaybackPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -465,6 +529,10 @@ public final class app/revanced/patches/music/misc/gms/GmsCoreSupportPatchKt {
|
||||
public static final fun getGmsCoreSupportPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/music/misc/litho/filter/LithoFilterPatchKt {
|
||||
public static final fun getLithoFilterPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/music/misc/privacy/SanitizeSharingLinksPatchKt {
|
||||
public static final fun getSanitizeSharingLinksPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -521,6 +589,14 @@ public final class app/revanced/patches/nfctoolsse/misc/pro/UnlockProPatchKt {
|
||||
public static final fun getUnlockProPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/nothingx/misc/extension/SharedExtensionPatchKt {
|
||||
public static final fun getSharedExtensionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/nothingx/misc/logk1token/ShowK1TokenPatchsKt {
|
||||
public static final fun getShowK1TokensPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/nunl/ads/HideAdsPatchKt {
|
||||
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -549,6 +625,10 @@ public final class app/revanced/patches/pandora/misc/EnableUnlimitedSkipsPatchKt
|
||||
public static final fun getEnableUnlimitedSkipsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/peacocktv/ads/HideAdsPatchKt {
|
||||
public static final fun getHideAdsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/photomath/detection/deviceid/SpoofDeviceIdPatchKt {
|
||||
public static final fun getGetDeviceIdPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -605,6 +685,14 @@ public final class app/revanced/patches/protonmail/signature/RemoveSentFromSigna
|
||||
public static final fun getRemoveSentFromSignaturePatch ()Lapp/revanced/patcher/patch/ResourcePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/protonvpn/delay/RemoveDelayPatchKt {
|
||||
public static final fun getRemoveDelayPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/protonvpn/splittunneling/UnlockSplitTunnelingKt {
|
||||
public static final fun getUnlockSplitTunnelingPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/rar/misc/annoyances/purchasereminder/HidePurchaseReminderPatchKt {
|
||||
public static final fun getHidePurchaseReminderPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -864,6 +952,10 @@ public final class app/revanced/patches/shared/misc/hex/Replacement {
|
||||
public final fun getReplacementBytesPadded ()[B
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/shared/misc/litho/filter/LithoFilterPatchKt {
|
||||
public static final fun getAddLithoFilter ()Lkotlin/jvm/functions/Function1;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/shared/misc/mapping/ResourceElement {
|
||||
public final fun component1 ()Ljava/lang/String;
|
||||
public final fun component2 ()Ljava/lang/String;
|
||||
@@ -888,6 +980,10 @@ public final class app/revanced/patches/shared/misc/pairip/license/DisableLicens
|
||||
public static final fun getDisableLicenseCheckPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/shared/misc/privacy/DisableSentryTelemetryKt {
|
||||
public static final fun getDisableSentryTelemetryPatch ()Lapp/revanced/patcher/patch/ResourcePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/shared/misc/settings/SettingsPatchKt {
|
||||
public static final fun overrideThemeColors (Ljava/lang/String;Ljava/lang/String;)V
|
||||
public static final fun settingsPatch (Ljava/util/List;Ljava/util/Set;)Lapp/revanced/patcher/patch/ResourcePatch;
|
||||
@@ -1140,6 +1236,34 @@ public final class app/revanced/patches/stocard/layout/HideStoryBubblesPatchKt {
|
||||
public static final fun getHideStoryBubblesPatch ()Lapp/revanced/patcher/patch/ResourcePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/strava/groupkudos/AddGiveGroupKudosButtonToGroupActivityKt {
|
||||
public static final fun getAddGiveGroupKudosButtonToGroupActivity ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/strava/media/download/AddMediaDownloadPatchKt {
|
||||
public static final fun getAddMediaDownloadPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/strava/media/upload/OverwriteMediaUploadParametersPatchKt {
|
||||
public static final fun getOverwriteMediaUploadParametersPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/strava/misc/extension/SharedExtensionPatchKt {
|
||||
public static final fun getSharedExtensionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/strava/password/EnablePasswordLoginPatchKt {
|
||||
public static final fun getEnablePasswordLoginPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/strava/privacy/BlockSnowplowTrackingPatchKt {
|
||||
public static final fun getBlockSnowplowTrackingPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/strava/quickedit/DisableQuickEditPatchKt {
|
||||
public static final fun getDisableQuickEditPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/strava/subscription/UnlockSubscriptionPatchKt {
|
||||
public static final fun getUnlockSubscriptionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -1620,6 +1744,10 @@ public final class app/revanced/patches/youtube/misc/announcements/Announcements
|
||||
public static final fun getAnnouncementsPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/youtube/misc/audiofocus/PauseOnAudioInterruptPatchKt {
|
||||
public static final fun getPauseOnAudioInterruptPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatchKt {
|
||||
public static final fun getAutoRepeatPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||
}
|
||||
@@ -1915,6 +2043,7 @@ public final class app/revanced/util/BytecodeUtilsKt {
|
||||
public static final fun indexOfFirstResourceIdOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/String;)I
|
||||
public static final fun injectHideViewCall (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;IILjava/lang/String;Ljava/lang/String;)V
|
||||
public static final fun literal (Lapp/revanced/patcher/FingerprintBuilder;Lkotlin/jvm/functions/Function0;)V
|
||||
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;)V
|
||||
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;B)V
|
||||
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;C)V
|
||||
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;D)V
|
||||
@@ -1924,7 +2053,6 @@ public final class app/revanced/util/BytecodeUtilsKt {
|
||||
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;Ljava/lang/String;)V
|
||||
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;S)V
|
||||
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;Z)V
|
||||
public static synthetic fun returnEarly$default (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;ZILjava/lang/Object;)V
|
||||
public static final fun returnLate (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;B)V
|
||||
public static final fun returnLate (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;C)V
|
||||
public static final fun returnLate (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;D)V
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
import org.w3c.dom.*
|
||||
import javax.xml.parsers.DocumentBuilderFactory
|
||||
import javax.xml.transform.OutputKeys
|
||||
import javax.xml.transform.TransformerFactory
|
||||
import javax.xml.transform.dom.DOMSource
|
||||
import javax.xml.transform.stream.StreamResult
|
||||
|
||||
group = "app.revanced"
|
||||
|
||||
patches {
|
||||
@@ -22,25 +29,6 @@ dependencies {
|
||||
compileOnly(project(":patches:stub"))
|
||||
}
|
||||
|
||||
tasks {
|
||||
register<JavaExec>("preprocessCrowdinStrings") {
|
||||
description = "Preprocess strings for Crowdin push"
|
||||
|
||||
dependsOn(compileKotlin)
|
||||
|
||||
classpath = sourceSets["main"].runtimeClasspath
|
||||
mainClass.set("app.revanced.util.CrowdinPreprocessorKt")
|
||||
|
||||
args = listOf(
|
||||
"src/main/resources/addresources/values/strings.xml",
|
||||
// Ideally this would use build/tmp/crowdin/strings.xml
|
||||
// But using that does not work with Crowdin pull because
|
||||
// it does not recognize the strings.xml file belongs to this project.
|
||||
"src/main/resources/addresources/values/strings.xml"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
freeCompilerArgs = listOf("-Xcontext-receivers")
|
||||
@@ -50,12 +38,96 @@ kotlin {
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
name = "GitHubPackages"
|
||||
name = "githubPackages"
|
||||
url = uri("https://maven.pkg.github.com/revanced/revanced-patches")
|
||||
credentials {
|
||||
username = System.getenv("GITHUB_ACTOR")
|
||||
password = System.getenv("GITHUB_TOKEN")
|
||||
}
|
||||
credentials(PasswordCredentials::class)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("processStringsForCrowdin") {
|
||||
description = "Process strings file for Crowdin by commenting out non-standard tags."
|
||||
|
||||
doLast {
|
||||
// Comment out the non-standard tags. Otherwise, Crowdin interprets the file
|
||||
// not as Android but instead a generic xml file where strings are
|
||||
// identified by xml position and not key
|
||||
val stringsXmlFile = project.projectDir.resolve("src/main/resources/addresources/values/strings.xml")
|
||||
|
||||
val builder = DocumentBuilderFactory.newInstance().apply {
|
||||
isIgnoringComments = false
|
||||
isCoalescing = false
|
||||
isNamespaceAware = false
|
||||
}.newDocumentBuilder()
|
||||
|
||||
val document = builder.newDocument()
|
||||
val root = document.createElement("resources").also(document::appendChild)
|
||||
|
||||
fun walk(node: Node, appId: String? = null, patchId: String? = null, insideResources: Boolean = false) {
|
||||
fun walkChildren(el: Element, appId: String?, patchId: String?, insideResources: Boolean) {
|
||||
val children = el.childNodes
|
||||
for (i in 0 until children.length) {
|
||||
walk(children.item(i), appId, patchId, insideResources)
|
||||
}
|
||||
}
|
||||
when (node.nodeType) {
|
||||
Node.COMMENT_NODE -> {
|
||||
val comment = document.createComment(node.nodeValue)
|
||||
if (insideResources) root.appendChild(comment) else document.insertBefore(comment, root)
|
||||
}
|
||||
|
||||
Node.ELEMENT_NODE -> {
|
||||
val element = node as Element
|
||||
|
||||
when (element.tagName) {
|
||||
"resources" -> walkChildren(element, appId, patchId, insideResources = true)
|
||||
|
||||
"app" -> {
|
||||
val newAppId = element.getAttribute("id")
|
||||
|
||||
root.appendChild(document.createComment(" <app id=\"$newAppId\"> "))
|
||||
walkChildren(element, newAppId, patchId, insideResources)
|
||||
root.appendChild(document.createComment(" </app> "))
|
||||
}
|
||||
|
||||
"patch" -> {
|
||||
val newPatchId = element.getAttribute("id")
|
||||
|
||||
root.appendChild(document.createComment(" <patch id=\"$newPatchId\"> "))
|
||||
walkChildren(element, appId, newPatchId, insideResources)
|
||||
root.appendChild(document.createComment(" </patch> "))
|
||||
}
|
||||
|
||||
"string" -> {
|
||||
val name = element.getAttribute("name")
|
||||
val value = element.textContent
|
||||
val fullName = "$appId.$patchId.$name"
|
||||
|
||||
val stringElement = document.createElement("string")
|
||||
stringElement.setAttribute("name", fullName)
|
||||
stringElement.appendChild(document.createTextNode(value))
|
||||
root.appendChild(stringElement)
|
||||
}
|
||||
|
||||
else -> walkChildren(element, appId, patchId, insideResources)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
builder.parse(stringsXmlFile).let {
|
||||
val topLevel = it.childNodes
|
||||
for (i in 0 until topLevel.length) {
|
||||
val node = topLevel.item(i)
|
||||
if (node != it.documentElement) walk(node)
|
||||
}
|
||||
|
||||
walk(it.documentElement)
|
||||
}
|
||||
|
||||
TransformerFactory.newInstance().newTransformer().apply {
|
||||
setOutputProperty(OutputKeys.INDENT, "yes")
|
||||
setOutputProperty(OutputKeys.ENCODING, "utf-8")
|
||||
}.transform(DOMSource(document), StreamResult(stringsXmlFile))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,105 +1,9 @@
|
||||
package app.revanced.patches.all.misc.connectivity.telephony.sim.spoof
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patcher.patch.stringOption
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.all.misc.transformation.transformInstructionsPatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
import com.android.tools.smali.dexlib2.immutable.reference.ImmutableMethodReference
|
||||
import com.android.tools.smali.dexlib2.util.MethodUtil
|
||||
import java.util.*
|
||||
|
||||
@Deprecated("Patch was renamed", ReplaceWith("spoofSimProviderPatch"))
|
||||
@Suppress("unused")
|
||||
val spoofSimCountryPatch = bytecodePatch(
|
||||
name = "Spoof SIM country",
|
||||
description = "Spoofs country information returned by the SIM card provider.",
|
||||
use = false,
|
||||
) {
|
||||
val countries = Locale.getISOCountries().associateBy { Locale("", it).displayCountry }
|
||||
|
||||
fun isoCountryPatchOption(
|
||||
key: String,
|
||||
title: String,
|
||||
) = stringOption(
|
||||
key,
|
||||
null,
|
||||
countries,
|
||||
title,
|
||||
"ISO-3166-1 alpha-2 country code equivalent for the SIM provider's country code.",
|
||||
false,
|
||||
validator = { it: String? -> it == null || it.uppercase() in countries.values },
|
||||
)
|
||||
|
||||
val networkCountryIso by isoCountryPatchOption(
|
||||
"networkCountryIso",
|
||||
"Network ISO country code",
|
||||
)
|
||||
|
||||
val simCountryIso by isoCountryPatchOption(
|
||||
"simCountryIso",
|
||||
"SIM ISO country code",
|
||||
)
|
||||
|
||||
dependsOn(
|
||||
transformInstructionsPatch(
|
||||
filterMap = { _, _, instruction, instructionIndex ->
|
||||
if (instruction !is ReferenceInstruction) return@transformInstructionsPatch null
|
||||
|
||||
val reference = instruction.reference as? MethodReference ?: return@transformInstructionsPatch null
|
||||
|
||||
val match = MethodCall.entries.firstOrNull { search ->
|
||||
MethodUtil.methodSignaturesMatch(reference, search.reference)
|
||||
} ?: return@transformInstructionsPatch null
|
||||
|
||||
val iso = when (match) {
|
||||
MethodCall.NetworkCountryIso -> networkCountryIso
|
||||
MethodCall.SimCountryIso -> simCountryIso
|
||||
}?.lowercase()
|
||||
|
||||
iso?.let { instructionIndex to it }
|
||||
},
|
||||
transform = { mutableMethod, entry: Pair<Int, String> ->
|
||||
transformMethodCall(entry, mutableMethod)
|
||||
},
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
private fun transformMethodCall(
|
||||
entry: Pair<Int, String>,
|
||||
mutableMethod: MutableMethod,
|
||||
) {
|
||||
val (instructionIndex, methodCallValue) = entry
|
||||
|
||||
val register = mutableMethod.getInstruction<OneRegisterInstruction>(instructionIndex + 1).registerA
|
||||
|
||||
mutableMethod.replaceInstruction(
|
||||
instructionIndex + 1,
|
||||
"const-string v$register, \"$methodCallValue\"",
|
||||
)
|
||||
}
|
||||
|
||||
private enum class MethodCall(
|
||||
val reference: MethodReference,
|
||||
) {
|
||||
NetworkCountryIso(
|
||||
ImmutableMethodReference(
|
||||
"Landroid/telephony/TelephonyManager;",
|
||||
"getNetworkCountryIso",
|
||||
emptyList(),
|
||||
"Ljava/lang/String;",
|
||||
),
|
||||
),
|
||||
SimCountryIso(
|
||||
ImmutableMethodReference(
|
||||
"Landroid/telephony/TelephonyManager;",
|
||||
"getSimCountryIso",
|
||||
emptyList(),
|
||||
"Ljava/lang/String;",
|
||||
),
|
||||
),
|
||||
}
|
||||
val spoofSimCountryPatch = bytecodePatch {
|
||||
dependsOn(spoofSimProviderPatch)
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
package app.revanced.patches.all.misc.connectivity.telephony.sim.spoof
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patcher.patch.intOption
|
||||
import app.revanced.patcher.patch.stringOption
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.all.misc.transformation.transformInstructionsPatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
import com.android.tools.smali.dexlib2.immutable.reference.ImmutableMethodReference
|
||||
import com.android.tools.smali.dexlib2.util.MethodUtil
|
||||
import java.util.Locale
|
||||
|
||||
@Suppress("unused")
|
||||
val spoofSimProviderPatch = bytecodePatch(
|
||||
name = "Spoof SIM provider",
|
||||
description = "Spoofs information about the SIM card provider.",
|
||||
use = false,
|
||||
) {
|
||||
val countries = Locale.getISOCountries().associateBy { Locale("", it).displayCountry }
|
||||
|
||||
fun isoCountryPatchOption(
|
||||
key: String,
|
||||
title: String,
|
||||
) = stringOption(
|
||||
key,
|
||||
null,
|
||||
countries,
|
||||
title,
|
||||
"ISO-3166-1 alpha-2 country code equivalent for the SIM provider's country code.",
|
||||
false,
|
||||
validator = { it: String? -> it == null || it.uppercase() in countries.values },
|
||||
)
|
||||
|
||||
fun isMccMncValid(it: Int?): Boolean = it == null || (it >= 10000 && it <= 999999)
|
||||
|
||||
val networkCountryIso by isoCountryPatchOption(
|
||||
"networkCountryIso",
|
||||
"Network ISO country code",
|
||||
)
|
||||
|
||||
val networkOperator by intOption(
|
||||
key = "networkOperator",
|
||||
title = "MCC+MNC network operator code",
|
||||
description = "The 5 or 6 digits MCC+MNC (Mobile Country Code + Mobile Network Code) of the network operator.",
|
||||
validator = { isMccMncValid(it) }
|
||||
)
|
||||
|
||||
val networkOperatorName by stringOption(
|
||||
key = "networkOperatorName",
|
||||
title = "Network operator name",
|
||||
description = "The full name of the network operator.",
|
||||
)
|
||||
|
||||
val simCountryIso by isoCountryPatchOption(
|
||||
"simCountryIso",
|
||||
"SIM ISO country code",
|
||||
)
|
||||
|
||||
val simOperator by intOption(
|
||||
key = "simOperator",
|
||||
title = "MCC+MNC SIM operator code",
|
||||
description = "The 5 or 6 digits MCC+MNC (Mobile Country Code + Mobile Network Code) of the SIM operator.",
|
||||
validator = { isMccMncValid(it) }
|
||||
)
|
||||
|
||||
val simOperatorName by stringOption(
|
||||
key = "simOperatorName",
|
||||
title = "SIM operator name",
|
||||
description = "The full name of the SIM operator.",
|
||||
)
|
||||
|
||||
dependsOn(
|
||||
transformInstructionsPatch(
|
||||
filterMap = { _, _, instruction, instructionIndex ->
|
||||
if (instruction !is ReferenceInstruction) return@transformInstructionsPatch null
|
||||
|
||||
val reference = instruction.reference as? MethodReference ?: return@transformInstructionsPatch null
|
||||
|
||||
val match = MethodCall.entries.firstOrNull { search ->
|
||||
MethodUtil.methodSignaturesMatch(reference, search.reference)
|
||||
} ?: return@transformInstructionsPatch null
|
||||
|
||||
val replacement = when (match) {
|
||||
MethodCall.NetworkCountryIso -> networkCountryIso?.lowercase()
|
||||
MethodCall.NetworkOperator -> networkOperator?.toString()
|
||||
MethodCall.NetworkOperatorName -> networkOperatorName
|
||||
MethodCall.SimCountryIso -> simCountryIso?.lowercase()
|
||||
MethodCall.SimOperator -> simOperator?.toString()
|
||||
MethodCall.SimOperatorName -> simOperatorName
|
||||
}
|
||||
replacement?.let { instructionIndex to it }
|
||||
},
|
||||
transform = ::transformMethodCall,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
private fun transformMethodCall(
|
||||
mutableMethod: MutableMethod,
|
||||
entry: Pair<Int, String>,
|
||||
) {
|
||||
val (instructionIndex, methodCallValue) = entry
|
||||
|
||||
// Get the register which would have contained the return value
|
||||
val register = mutableMethod.getInstruction<OneRegisterInstruction>(instructionIndex + 1).registerA
|
||||
|
||||
// Replace the move-result instruction with our fake value
|
||||
mutableMethod.replaceInstruction(
|
||||
instructionIndex + 1,
|
||||
"const-string v$register, \"$methodCallValue\"",
|
||||
)
|
||||
}
|
||||
|
||||
private enum class MethodCall(
|
||||
val reference: MethodReference,
|
||||
) {
|
||||
NetworkCountryIso(
|
||||
ImmutableMethodReference(
|
||||
"Landroid/telephony/TelephonyManager;",
|
||||
"getNetworkCountryIso",
|
||||
emptyList(),
|
||||
"Ljava/lang/String;",
|
||||
),
|
||||
),
|
||||
NetworkOperator(
|
||||
ImmutableMethodReference(
|
||||
"Landroid/telephony/TelephonyManager;",
|
||||
"getNetworkOperator",
|
||||
emptyList(),
|
||||
"Ljava/lang/String;",
|
||||
),
|
||||
),
|
||||
NetworkOperatorName(
|
||||
ImmutableMethodReference(
|
||||
"Landroid/telephony/TelephonyManager;",
|
||||
"getNetworkOperatorName",
|
||||
emptyList(),
|
||||
"Ljava/lang/String;",
|
||||
),
|
||||
),
|
||||
SimCountryIso(
|
||||
ImmutableMethodReference(
|
||||
"Landroid/telephony/TelephonyManager;",
|
||||
"getSimCountryIso",
|
||||
emptyList(),
|
||||
"Ljava/lang/String;",
|
||||
),
|
||||
),
|
||||
SimOperator(
|
||||
ImmutableMethodReference(
|
||||
"Landroid/telephony/TelephonyManager;",
|
||||
"getSimOperator",
|
||||
emptyList(),
|
||||
"Ljava/lang/String;",
|
||||
),
|
||||
),
|
||||
SimOperatorName(
|
||||
ImmutableMethodReference(
|
||||
"Landroid/telephony/TelephonyManager;",
|
||||
"getSimOperatorName",
|
||||
emptyList(),
|
||||
"Ljava/lang/String;",
|
||||
),
|
||||
),
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package app.revanced.patches.all.misc.playintegrity
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patches.all.misc.transformation.transformInstructionsPatch
|
||||
import app.revanced.util.getReference
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
|
||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
import com.android.tools.smali.dexlib2.immutable.reference.ImmutableMethodReference
|
||||
import com.android.tools.smali.dexlib2.util.MethodUtil
|
||||
|
||||
private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/playintegrity/DisablePlayIntegrityPatch;"
|
||||
|
||||
private val CONTEXT_BIND_SERVICE_METHOD_REFERENCE = ImmutableMethodReference(
|
||||
"Landroid/content/Context;",
|
||||
"bindService",
|
||||
listOf("Landroid/content/Intent;", "Landroid/content/ServiceConnection;", "I"),
|
||||
"Z"
|
||||
)
|
||||
|
||||
|
||||
@Suppress("unused")
|
||||
val disablePlayIntegrityPatch = bytecodePatch(
|
||||
name = "Disable Play Integrity",
|
||||
description = "Prevents apps from using Play Integrity by pretending it is not available.",
|
||||
use = false,
|
||||
) {
|
||||
extendWith("extensions/all/misc/disable-play-integrity.rve")
|
||||
|
||||
dependsOn(
|
||||
transformInstructionsPatch(
|
||||
filterMap = filterMap@{ classDef, method, instruction, instructionIndex ->
|
||||
val reference = instruction
|
||||
.getReference<MethodReference>()
|
||||
?.takeIf {
|
||||
MethodUtil.methodSignaturesMatch(CONTEXT_BIND_SERVICE_METHOD_REFERENCE, it)
|
||||
}
|
||||
?: return@filterMap null
|
||||
|
||||
Triple(instruction as Instruction35c, instructionIndex, reference.parameterTypes)
|
||||
},
|
||||
transform = { method, entry ->
|
||||
val (instruction, index, parameterTypes) = entry
|
||||
val parameterString = parameterTypes.joinToString(separator = "")
|
||||
val registerString = "v${instruction.registerC}, v${instruction.registerD}, v${instruction.registerE}, v${instruction.registerF}"
|
||||
|
||||
method.replaceInstruction(
|
||||
index,
|
||||
"invoke-static { $registerString }, $EXTENSION_CLASS_DESCRIPTOR->bindService(Landroid/content/Context;$parameterString)Z"
|
||||
)
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package app.revanced.patches.all.misc.screenshot
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patches.all.misc.transformation.transformInstructionsPatch
|
||||
import app.revanced.util.getReference
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
import com.android.tools.smali.dexlib2.immutable.reference.ImmutableMethodReference
|
||||
import com.android.tools.smali.dexlib2.util.MethodUtil
|
||||
|
||||
private val registerScreenCaptureCallbackMethodReference = ImmutableMethodReference(
|
||||
"Landroid/app/Activity;",
|
||||
"registerScreenCaptureCallback",
|
||||
listOf(
|
||||
"Ljava/util/concurrent/Executor;",
|
||||
"Landroid/app/Activity\$ScreenCaptureCallback;",
|
||||
),
|
||||
"V"
|
||||
)
|
||||
|
||||
private val unregisterScreenCaptureCallbackMethodReference = ImmutableMethodReference(
|
||||
"Landroid/app/Activity;",
|
||||
"unregisterScreenCaptureCallback",
|
||||
listOf(
|
||||
"Landroid/app/Activity\$ScreenCaptureCallback;",
|
||||
),
|
||||
"V"
|
||||
)
|
||||
|
||||
@Suppress("unused")
|
||||
val preventScreenshotDetectionPatch = bytecodePatch(
|
||||
name = "Prevent screenshot detection",
|
||||
description = "Removes the registration of all screen capture callbacks. This prevents the app from detecting screenshots.",
|
||||
use = false
|
||||
) {
|
||||
dependsOn(transformInstructionsPatch(
|
||||
filterMap = { _, _, instruction, instructionIndex ->
|
||||
if (instruction.opcode != Opcode.INVOKE_VIRTUAL) return@transformInstructionsPatch null
|
||||
|
||||
val reference = instruction.getReference<MethodReference>() ?: return@transformInstructionsPatch null
|
||||
|
||||
instructionIndex.takeIf {
|
||||
MethodUtil.methodSignaturesMatch(reference, registerScreenCaptureCallbackMethodReference) ||
|
||||
MethodUtil.methodSignaturesMatch(reference, unregisterScreenCaptureCallbackMethodReference)
|
||||
}
|
||||
},
|
||||
transform = { mutableMethod, instructionIndex ->
|
||||
mutableMethod.removeInstruction(instructionIndex)
|
||||
}
|
||||
))
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package app.revanced.patches.com.sbs.ondemand.tv
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
|
||||
internal val shouldShowAdvertisingTVFingerprint = fingerprint {
|
||||
returns("Z")
|
||||
custom { method, classDef ->
|
||||
method.name == "getShouldShowAdvertisingTV" &&
|
||||
classDef.type == "Lcom/sbs/ondemand/common/InMemoryStorage;"
|
||||
}
|
||||
}
|
||||
|
||||
internal val shouldShowPauseAdFingerprint = fingerprint {
|
||||
returns("Z")
|
||||
custom { method, classDef ->
|
||||
method.name == "shouldShowPauseAd" &&
|
||||
classDef.type == "Lcom/sbs/ondemand/player/viewmodels/PauseAdController;"
|
||||
}
|
||||
}
|
||||
|
||||
internal val requestAdStreamFingerprint = fingerprint {
|
||||
returns("V")
|
||||
custom { method, classDef ->
|
||||
method.name == "requestAdStream\$player_googleStoreTvRelease" &&
|
||||
classDef.type == "Lcom/sbs/ondemand/player/viewmodels/AdsController;"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package app.revanced.patches.com.sbs.ondemand.tv
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patches.shared.misc.pairip.license.disableLicenseCheckPatch
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
@Suppress("unused")
|
||||
val removeAdsPatch = bytecodePatch(
|
||||
name = "Remove ads",
|
||||
description = "Removes pre-roll, pause and on-demand advertisements from SBS On Demand TV.",
|
||||
) {
|
||||
compatibleWith("com.sbs.ondemand.tv")
|
||||
|
||||
dependsOn(disableLicenseCheckPatch)
|
||||
|
||||
execute {
|
||||
shouldShowAdvertisingTVFingerprint.method.returnEarly(true)
|
||||
shouldShowPauseAdFingerprint.method.returnEarly(false)
|
||||
|
||||
// Remove on-demand pre-roll advertisements using exception handling.
|
||||
// Exception handling is used instead of returnEarly() because:
|
||||
// 1. returnEarly() causes black screen when the app waits for ad content that never comes.
|
||||
// 2. SBS app has built-in exception handling in handleProviderFailure().
|
||||
// 3. Exception triggers fallbackToAkamaiProvider() which loads actual content.
|
||||
// 4. This preserves the intended app flow: first try ads, then fail gracefully, then load content.
|
||||
requestAdStreamFingerprint.method.addInstructions(
|
||||
0,
|
||||
"""
|
||||
new-instance v0, Ljava/lang/RuntimeException;
|
||||
const-string v1, "Ad stream disabled"
|
||||
invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
|
||||
throw v0
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.revanced.patches.disneyplus.ads
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
|
||||
internal val insertionGetPointsFingerprint = fingerprint {
|
||||
returns("Ljava/util/List")
|
||||
custom { method, _ ->
|
||||
method.name == "getPoints" &&
|
||||
method.definingClass == "Lcom/dss/sdk/internal/media/Insertion;"
|
||||
}
|
||||
}
|
||||
|
||||
internal val insertionGetRangesFingerprint = fingerprint {
|
||||
returns("Ljava/util/List")
|
||||
custom { method, _ ->
|
||||
method.name == "getRanges" &&
|
||||
method.definingClass == "Lcom/dss/sdk/internal/media/Insertion;"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package app.revanced.patches.disneyplus.ads
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
|
||||
@Suppress("unused")
|
||||
val skipAdsPatch = bytecodePatch(
|
||||
name = "Skip ads",
|
||||
description = "Automatically skips ads.",
|
||||
) {
|
||||
compatibleWith("com.disney.disneyplus")
|
||||
|
||||
execute {
|
||||
arrayOf(insertionGetPointsFingerprint, insertionGetRangesFingerprint).forEach {
|
||||
it.method.addInstructions(
|
||||
0,
|
||||
"""
|
||||
new-instance v0, Ljava/util/ArrayList;
|
||||
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
||||
return-object v0
|
||||
""",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package app.revanced.patches.idaustria.detection.deviceintegrity
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
internal val isDeviceBootloaderOpenFingerprint = fingerprint {
|
||||
accessFlags(AccessFlags.PUBLIC)
|
||||
returns("Ljava/lang/Object;")
|
||||
custom { method, classDef ->
|
||||
method.name == "isDeviceBootloaderOpen" &&
|
||||
classDef.endsWith("/DeviceIntegrityCheckProviderImpl;")
|
||||
}
|
||||
}
|
||||
|
||||
internal val isDeviceRootedFingerprint = fingerprint {
|
||||
accessFlags(AccessFlags.PUBLIC)
|
||||
returns("Z")
|
||||
custom { method, classDef ->
|
||||
method.name == "isDeviceRooted" &&
|
||||
classDef.endsWith("/DeviceIntegrityCheckProviderImpl;")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package app.revanced.patches.idaustria.detection.deviceintegrity
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
|
||||
@Suppress("unused")
|
||||
val removeDeviceIntegrityChecksPatch = bytecodePatch(
|
||||
name = "Remove device integrity checks",
|
||||
description = "Removes the check for root permissions and unlocked bootloader.",
|
||||
) {
|
||||
compatibleWith("at.gv.oe.app")
|
||||
|
||||
execute {
|
||||
isDeviceRootedFingerprint.method.returnEarly(false)
|
||||
|
||||
isDeviceBootloaderOpenFingerprint.method.apply {
|
||||
addInstructions(
|
||||
0,
|
||||
"""
|
||||
const/4 v0, 0x0
|
||||
invoke-static { v0 }, Lkotlin/coroutines/jvm/internal/Boxing;->boxBoolean(Z)Ljava/lang/Boolean;
|
||||
move-result-object v0
|
||||
return-object v0
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package app.revanced.patches.idaustria.detection.root
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
internal val attestationSupportedCheckFingerprint = fingerprint {
|
||||
accessFlags(AccessFlags.PUBLIC)
|
||||
returns("V")
|
||||
custom { method, classDef ->
|
||||
method.name == "attestationSupportCheck" &&
|
||||
classDef.endsWith("/DeviceIntegrityCheck;")
|
||||
}
|
||||
}
|
||||
|
||||
internal val bootloaderCheckFingerprint = fingerprint {
|
||||
accessFlags(AccessFlags.PUBLIC)
|
||||
returns("Z")
|
||||
custom { method, classDef ->
|
||||
method.name == "bootloaderCheck" &&
|
||||
classDef.endsWith("/DeviceIntegrityCheck;")
|
||||
}
|
||||
}
|
||||
|
||||
internal val rootCheckFingerprint = fingerprint {
|
||||
accessFlags(AccessFlags.PUBLIC)
|
||||
returns("V")
|
||||
custom { method, classDef ->
|
||||
method.name == "rootCheck" &&
|
||||
classDef.endsWith("/DeviceIntegrityCheck;")
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,10 @@
|
||||
package app.revanced.patches.idaustria.detection.root
|
||||
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patches.shared.PATCH_DESCRIPTION_REMOVE_ROOT_DETECTION
|
||||
import app.revanced.patches.shared.PATCH_NAME_REMOVE_ROOT_DETECTION
|
||||
import app.revanced.util.returnEarly
|
||||
import app.revanced.patches.idaustria.detection.deviceintegrity.removeDeviceIntegrityChecksPatch
|
||||
|
||||
@Deprecated("Patch was superseded", ReplaceWith("removeDeviceIntegrityChecksPatch"))
|
||||
@Suppress("unused")
|
||||
val rootDetectionPatch = bytecodePatch(
|
||||
name = PATCH_NAME_REMOVE_ROOT_DETECTION,
|
||||
description = PATCH_DESCRIPTION_REMOVE_ROOT_DETECTION
|
||||
) {
|
||||
compatibleWith("at.gv.oe.app")
|
||||
|
||||
execute {
|
||||
setOf(
|
||||
attestationSupportedCheckFingerprint,
|
||||
bootloaderCheckFingerprint,
|
||||
rootCheckFingerprint,
|
||||
).forEach { it.method.returnEarly(true) }
|
||||
}
|
||||
val rootDetectionPatch = bytecodePatch {
|
||||
dependsOn(removeDeviceIntegrityChecksPatch)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package app.revanced.patches.instagram.ghost.story
|
||||
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.util.Utils.trimIndentMultiline
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
@Suppress("unused")
|
||||
val anonymousStoryViewingPatch = bytecodePatch(
|
||||
name = "Anonymous story viewing",
|
||||
description = """
|
||||
View stories without sending any information to the server.
|
||||
Your view will not appear in the story viewers list.
|
||||
Note: Since no data is sent, a story you have already viewed may appear as new on another device.
|
||||
""".trimIndentMultiline(),
|
||||
use = false
|
||||
) {
|
||||
compatibleWith("com.instagram.android")
|
||||
|
||||
execute {
|
||||
// Prevent the hashmap of the seen media to be filled
|
||||
setMediaSeenHashmapFingerprint.method.returnEarly()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.revanced.patches.instagram.ghost.story
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
|
||||
internal val setMediaSeenHashmapFingerprint = fingerprint {
|
||||
parameters()
|
||||
returns("V")
|
||||
strings("media/seen/")
|
||||
}
|
||||
@@ -1,29 +1,7 @@
|
||||
package app.revanced.patches.instagram.hide.explore
|
||||
|
||||
import app.revanced.patcher.Fingerprint
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatchContext
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
context(BytecodePatchContext)
|
||||
internal fun Fingerprint.replaceJsonFieldWithBogus(
|
||||
key: String,
|
||||
) {
|
||||
val targetStringIndex = stringMatches!!.first { match -> match.string == key }.index
|
||||
val targetStringRegister = method.getInstruction<OneRegisterInstruction>(targetStringIndex).registerA
|
||||
|
||||
/**
|
||||
* Replacing the JSON key we want to skip with a random string that is not a valid JSON key.
|
||||
* This way the feeds array will never be populated.
|
||||
* Received JSON keys that are not handled are simply ignored, so there are no side effects.
|
||||
*/
|
||||
method.replaceInstruction(
|
||||
targetStringIndex,
|
||||
"const-string v$targetStringRegister, \"BOGUS\"",
|
||||
)
|
||||
}
|
||||
import app.revanced.patches.instagram.shared.replaceStringWithBogus
|
||||
|
||||
@Suppress("unused")
|
||||
val hideExploreFeedPatch = bytecodePatch(
|
||||
@@ -34,6 +12,6 @@ val hideExploreFeedPatch = bytecodePatch(
|
||||
compatibleWith("com.instagram.android")
|
||||
|
||||
execute {
|
||||
exploreResponseJsonParserFingerprint.replaceJsonFieldWithBogus(EXPLORE_KEY_TO_BE_HIDDEN)
|
||||
exploreResponseJsonParserFingerprint.replaceStringWithBogus(EXPLORE_KEY_TO_BE_HIDDEN)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.revanced.patches.instagram.hide.highlightsTray
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
|
||||
internal const val TARGET_STRING = "highlights_tray"
|
||||
|
||||
internal val highlightsUrlBuilderFingerprint = fingerprint {
|
||||
strings(TARGET_STRING,"X-IG-Accept-Hint")
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package app.revanced.patches.instagram.hide.highlightsTray
|
||||
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patches.instagram.shared.replaceStringWithBogus
|
||||
|
||||
@Suppress("unused")
|
||||
val hideHighlightsTrayPatch = bytecodePatch(
|
||||
name = "Hide highlights tray",
|
||||
description = "Hides the highlights tray in profile section.",
|
||||
use = false
|
||||
) {
|
||||
compatibleWith("com.instagram.android")
|
||||
|
||||
execute {
|
||||
highlightsUrlBuilderFingerprint.replaceStringWithBogus(TARGET_STRING)
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,13 @@ val hideNavigationButtonsPatch = bytecodePatch(
|
||||
|
||||
dependsOn(sharedExtensionPatch)
|
||||
|
||||
val hideHome by booleanOption(
|
||||
key = "hideHome",
|
||||
default = false,
|
||||
title = "Hide Home",
|
||||
description = "Permanently hides the Home button. App starts at next available tab." // On the "homecoming" / current instagram layout.
|
||||
)
|
||||
|
||||
val hideReels by booleanOption(
|
||||
key = "hideReels",
|
||||
default = true,
|
||||
@@ -35,6 +42,27 @@ val hideNavigationButtonsPatch = bytecodePatch(
|
||||
description = "Permanently hides the Reels button."
|
||||
)
|
||||
|
||||
val hideDirect by booleanOption(
|
||||
key = "hideDirect",
|
||||
default = false,
|
||||
title = "Hide Direct",
|
||||
description = "Permanently hides the Direct button."
|
||||
)
|
||||
|
||||
val hideSearch by booleanOption(
|
||||
key = "hideSearch",
|
||||
default = false,
|
||||
title = "Hide Search",
|
||||
description = "Permanently hides the Search button."
|
||||
)
|
||||
|
||||
val hideProfile by booleanOption(
|
||||
key = "hideProfile",
|
||||
default = false,
|
||||
title = "Hide Profile",
|
||||
description = "Permanently hides the Profile button."
|
||||
)
|
||||
|
||||
val hideCreate by booleanOption(
|
||||
key = "hideCreate",
|
||||
default = true,
|
||||
@@ -43,7 +71,7 @@ val hideNavigationButtonsPatch = bytecodePatch(
|
||||
)
|
||||
|
||||
execute {
|
||||
if (!hideReels!! && !hideCreate!!) {
|
||||
if (!hideHome!! &&!hideReels!! && !hideDirect!! && !hideSearch!! && !hideProfile!! && !hideCreate!!) {
|
||||
return@execute Logger.getLogger(this::class.java.name).warning(
|
||||
"No hide navigation buttons options are enabled. No changes made."
|
||||
)
|
||||
@@ -76,6 +104,13 @@ val hideNavigationButtonsPatch = bytecodePatch(
|
||||
"""
|
||||
}
|
||||
|
||||
if (hideHome!!) {
|
||||
addInstructionsAtControlFlowLabel(
|
||||
returnIndex,
|
||||
instructionsRemoveButtonByName("fragment_feed")
|
||||
)
|
||||
}
|
||||
|
||||
if (hideReels!!) {
|
||||
addInstructionsAtControlFlowLabel(
|
||||
returnIndex,
|
||||
@@ -83,12 +118,33 @@ val hideNavigationButtonsPatch = bytecodePatch(
|
||||
)
|
||||
}
|
||||
|
||||
if (hideDirect!!) {
|
||||
addInstructionsAtControlFlowLabel(
|
||||
returnIndex,
|
||||
instructionsRemoveButtonByName("fragment_direct_tab")
|
||||
)
|
||||
}
|
||||
if (hideSearch!!) {
|
||||
addInstructionsAtControlFlowLabel(
|
||||
returnIndex,
|
||||
instructionsRemoveButtonByName("fragment_search")
|
||||
)
|
||||
}
|
||||
|
||||
if (hideCreate!!) {
|
||||
addInstructionsAtControlFlowLabel(
|
||||
returnIndex,
|
||||
instructionsRemoveButtonByName("fragment_share")
|
||||
)
|
||||
}
|
||||
|
||||
if (hideProfile!!) {
|
||||
addInstructionsAtControlFlowLabel(
|
||||
returnIndex,
|
||||
instructionsRemoveButtonByName("fragment_profile")
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package app.revanced.patches.instagram.hide.suggestions
|
||||
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patches.instagram.hide.explore.replaceJsonFieldWithBogus
|
||||
import app.revanced.patches.instagram.shared.replaceStringWithBogus
|
||||
|
||||
@Suppress("unused")
|
||||
val hideSuggestedContent = bytecodePatch(
|
||||
@@ -13,7 +13,7 @@ val hideSuggestedContent = bytecodePatch(
|
||||
|
||||
execute {
|
||||
FEED_ITEM_KEYS_TO_BE_HIDDEN.forEach { key ->
|
||||
feedItemParseFromJsonFingerprint.replaceJsonFieldWithBogus(key)
|
||||
feedItemParseFromJsonFingerprint.replaceStringWithBogus(key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
package app.revanced.patches.instagram.misc.removeBuildExpiredPopup
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
import app.revanced.util.literal
|
||||
|
||||
internal const val MILLISECOND_IN_A_DAY_LITERAL = 0x5265c00L
|
||||
|
||||
internal val appUpdateLockoutBuilderFingerprint = fingerprint {
|
||||
strings("android.hardware.sensor.hinge_angle")
|
||||
literal { MILLISECOND_IN_A_DAY_LITERAL }
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package app.revanced.patches.instagram.misc.removeBuildExpiredPopup
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.instructions
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
|
||||
@Suppress("unused")
|
||||
val removeBuildExpiredPopupPatch = bytecodePatch(
|
||||
name = "Remove build expired popup",
|
||||
description = "Removes the popup that appears after a while, when the app version ages.",
|
||||
) {
|
||||
compatibleWith("com.instagram.android")
|
||||
|
||||
execute {
|
||||
appUpdateLockoutBuilderFingerprint.method.apply {
|
||||
val longToIntIndex = instructions.first { it.opcode == Opcode.LONG_TO_INT }.location.index
|
||||
val appAgeRegister = getInstruction<TwoRegisterInstruction>(longToIntIndex).registerA
|
||||
|
||||
// Set app age to 0 days old such that the build expired popup doesn't appear.
|
||||
addInstruction(longToIntIndex + 1, "const v$appAgeRegister, 0x0")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ internal val storyUrlResponseJsonParserFingerprint = fingerprint {
|
||||
}
|
||||
|
||||
internal val profileUrlResponseJsonParserFingerprint = fingerprint {
|
||||
strings("profile_to_share_url", "ProfileUrlResponse")
|
||||
strings("profile_to_share_url")
|
||||
custom { method, _ -> method.name == "parseFromJson" }
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,9 @@ import app.revanced.util.returnEarly
|
||||
@Suppress("unused")
|
||||
val signatureCheckPatch = bytecodePatch(
|
||||
name = "Disable signature check",
|
||||
description = "Disables the signature check that causes the app to crash on startup."
|
||||
description = "Disables the signature check that can cause the app to crash on startup. " +
|
||||
"Including this patch may cause issues with sharing or opening external Instagram links.",
|
||||
use = false
|
||||
) {
|
||||
compatibleWith("com.instagram.android")
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patches.instagram.reels.clipsSwipeRefreshLayoutOnInterceptTouchEventFingerprint
|
||||
import app.revanced.patches.instagram.reels.clipsViewPagerImplGetViewAtIndexFingerprint
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
@Suppress("unused")
|
||||
val disableReelsScrollingPatch = bytecodePatch(
|
||||
name = "Disable Reels scrolling",
|
||||
description = "Disables the endless scrolling behavior in Instagram Reels, preventing swiping to the next Reel. " +
|
||||
"Note: On a clean install, the 'Tip' animation may appear but will stop on its own after a few seconds.",
|
||||
use = false
|
||||
) {
|
||||
compatibleWith("com.instagram.android")
|
||||
|
||||
execute {
|
||||
val viewPagerField = clipsViewPagerImplGetViewAtIndexFingerprint.classDef.fields.first {
|
||||
it.type == "Landroidx/viewpager2/widget/ViewPager2;"
|
||||
}
|
||||
|
||||
// Disable user input on the ViewPager2 to prevent scrolling.
|
||||
clipsViewPagerImplGetViewAtIndexFingerprint.method.addInstructions(
|
||||
0,
|
||||
"""
|
||||
iget-object v0, p0, $viewPagerField
|
||||
const/4 v1, 0x0
|
||||
invoke-virtual { v0, v1 }, Landroidx/viewpager2/widget/ViewPager2;->setUserInputEnabled(Z)V
|
||||
"""
|
||||
)
|
||||
|
||||
// Return false in onInterceptTouchEvent to disable pull-to-refresh.
|
||||
clipsSwipeRefreshLayoutOnInterceptTouchEventFingerprint.method.returnEarly(false)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.instagram.reels
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
|
||||
internal val clipsViewPagerImplGetViewAtIndexFingerprint = fingerprint {
|
||||
strings("ClipsViewPagerImpl_getViewAtIndex")
|
||||
}
|
||||
|
||||
internal val clipsSwipeRefreshLayoutOnInterceptTouchEventFingerprint = fingerprint {
|
||||
parameters("Landroid/view/MotionEvent;")
|
||||
custom { _, classDef -> classDef.type == "Linstagram/features/clips/viewer/ui/ClipsSwipeRefreshLayout;" }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package app.revanced.patches.instagram.shared
|
||||
|
||||
import app.revanced.patcher.Fingerprint
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatchContext
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
context(BytecodePatchContext)
|
||||
internal fun Fingerprint.replaceStringWithBogus(
|
||||
targetString: String,
|
||||
) {
|
||||
val targetStringIndex = stringMatches!!.first { match -> match.string == targetString }.index
|
||||
val targetStringRegister = method.getInstruction<OneRegisterInstruction>(targetStringIndex).registerA
|
||||
|
||||
/**
|
||||
* Replaces the 'target string' with 'BOGUS'.
|
||||
* This is usually done when we need to override a JSON key or url,
|
||||
* to skip with a random string that is not a valid JSON key.
|
||||
*/
|
||||
method.replaceInstruction(
|
||||
targetStringIndex,
|
||||
"const-string v$targetStringRegister, \"BOGUS\"",
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package app.revanced.patches.instagram.story.flipping
|
||||
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
@Suppress("unused")
|
||||
val disableStoryAutoFlippingPatch = bytecodePatch(
|
||||
name = "Disable story auto flipping",
|
||||
description = "Disable stories automatically flipping/skipping after some seconds.",
|
||||
use = false
|
||||
) {
|
||||
compatibleWith("com.instagram.android")
|
||||
|
||||
execute {
|
||||
onStoryTimeoutActionFingerprint.method.returnEarly()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.revanced.patches.instagram.story.flipping
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
|
||||
internal val onStoryTimeoutActionFingerprint = fingerprint {
|
||||
parameters("Ljava/lang/Object;")
|
||||
returns("V")
|
||||
strings("userSession")
|
||||
custom { _, classDef ->
|
||||
classDef.type == "Linstagram/features/stories/fragment/ReelViewerFragment;"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package app.revanced.patches.letterboxd.ads
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
|
||||
internal const val admobHelperClassName = "Lcom/letterboxd/letterboxd/helpers/AdmobHelper;"
|
||||
|
||||
internal val admobHelperSetShowAdsFingerprint = fingerprint {
|
||||
custom { method, classDef ->
|
||||
method.name == "setShowAds" && classDef.type == admobHelperClassName
|
||||
}
|
||||
}
|
||||
|
||||
internal val admobHelperShouldShowAdsFingerprint = fingerprint {
|
||||
custom { method, classDef ->
|
||||
method.name == "shouldShowAds" && classDef.type == admobHelperClassName
|
||||
}
|
||||
}
|
||||
|
||||
internal val filmFragmentShowAdsFingerprint = fingerprint {
|
||||
custom { method, classDef ->
|
||||
method.name == "showAds" && classDef.type.endsWith("/FilmFragment;")
|
||||
}
|
||||
}
|
||||
|
||||
internal val memberExtensionShowAdsFingerprint = fingerprint {
|
||||
custom { method, classDef ->
|
||||
method.name == "showAds" && classDef.type.endsWith("/AMemberExtensionKt;")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
package app.revanced.patches.letterboxd.ads
|
||||
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
@Suppress("unused")
|
||||
val hideAdsPatch = bytecodePatch(
|
||||
name = "Hide ads",
|
||||
) {
|
||||
compatibleWith("com.letterboxd.letterboxd")
|
||||
|
||||
execute {
|
||||
admobHelperSetShowAdsFingerprint.method.addInstruction(0, "const p1, 0x0")
|
||||
listOf(admobHelperShouldShowAdsFingerprint, filmFragmentShowAdsFingerprint, memberExtensionShowAdsFingerprint).forEach {
|
||||
it.method.returnEarly(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.revanced.patches.letterboxd.unlock.unlockAppIcons
|
||||
|
||||
import app.revanced.patcher.fingerprint
|
||||
|
||||
internal val getCanChangeAppIconFingerprint = fingerprint {
|
||||
custom { method, classDef ->
|
||||
method.name == "getCanChangeAppIcon" && classDef.type.endsWith("SettingsAppIconFragment;")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
package app.revanced.patches.letterboxd.unlock.unlockAppIcons
|
||||
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.util.returnEarly
|
||||
|
||||
@Suppress("unused")
|
||||
val unlockAppIconsPatch = bytecodePatch(
|
||||
name = "Unlock app icons",
|
||||
) {
|
||||
compatibleWith("com.letterboxd.letterboxd")
|
||||
|
||||
execute {
|
||||
getCanChangeAppIconFingerprint.method.returnEarly(true)
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user