Compare commits

...

34 Commits

Author SHA1 Message Date
semantic-release-bot
c91df0f29c chore(release): 3.2.0-dev.4 [skip ci]
# [3.2.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.3...v3.2.0-dev.4) (2023-12-21)

### Bug Fixes

* **Tiktok - Remember clear display:** Use correct name ([2c83b86](2c83b86297))
2023-12-21 14:34:43 +00:00
oSumAtrIX
2c83b86297 fix(Tiktok - Remember clear display): Use correct name 2023-12-21 15:32:18 +01:00
semantic-release-bot
5ceda29fce chore(release): 3.2.0-dev.3 [skip ci]
# [3.2.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.2...v3.2.0-dev.3) (2023-12-21)

### Features

* **Tiktok:** Add `Remember clear mode` patch ([#2509](https://github.com/ReVanced/revanced-patches/issues/2509)) ([fcacd0f](fcacd0f30d))
2023-12-21 14:26:26 +00:00
d4rkk3y
fcacd0f30d feat(Tiktok): Add Remember clear mode patch (#2509)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-12-21 15:24:23 +01:00
semantic-release-bot
4f0c756b36 chore(release): 3.2.0-dev.2 [skip ci]
# [3.2.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.1...v3.2.0-dev.2) (2023-12-19)

### Features

* **Public API:** Deprecate `HideEmailAddressPatch` ([8ad9d7d](8ad9d7dedd))
* **YouTube:** Remove `Hide email address` patch ([b81c999](b81c99920b))
2023-12-19 17:51:13 +00:00
oSumAtrIX
8ad9d7dedd feat(Public API): Deprecate HideEmailAddressPatch 2023-12-19 18:48:58 +01:00
oSumAtrIX
b81c99920b feat(YouTube): Remove Hide email address patch 2023-12-19 18:48:26 +01:00
semantic-release-bot
cfb23652e1 chore(release): 3.2.0-dev.1 [skip ci]
# [3.2.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v3.1.0...v3.2.0-dev.1) (2023-12-18)

### Bug Fixes

* **YouTube - SponsorBlock:** Export local statistics with saved settings ([b9ee462](b9ee4625b6))

### Features

* **Public API:** Make `BottomControlsResource#addControls` public ([#2514](https://github.com/ReVanced/revanced-patches/issues/2514)) ([26565fd](26565fdb91))
2023-12-18 19:08:19 +00:00
Aunali321
26565fdb91 feat(Public API): Make BottomControlsResource#addControls public (#2514)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-12-18 20:06:20 +01:00
Caner Karaca
5a14b17338 build: Automate bumping dependencies (#2436)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-12-17 20:22:03 +01:00
LisoUseInAIKyrios
b9ee4625b6 fix(YouTube - SponsorBlock): Export local statistics with saved settings 2023-12-16 15:23:58 +04:00
oSumAtrIX
7a98270e4a chore: Fix grammar in task description 2023-12-14 01:14:49 +01:00
semantic-release-bot
5633048550 chore(release): 3.1.0 [skip ci]
# [3.1.0](https://github.com/ReVanced/revanced-patches/compare/v3.0.1...v3.1.0) (2023-12-12)

### Bug Fixes

* **Boost for Reddit - Spoof client:** Fix account login by removing user agent patch ([0f829ed](0f829ed747))
* Solve build errors by using correct syntax ([40684cd](40684cd1fe))
* **Sync for Reddit - Spoof client:** Fix account login by removing user agent patch ([c10956b](c10956ba14))

### Features

* **IconPackStudio - Unlock pro:** Constrain to last working version ([#3410](https://github.com/ReVanced/revanced-patches/issues/3410)) ([36fc818](36fc818f90))
2023-12-12 22:18:18 +00:00
oSumAtrIX
49c5e16c2e chore: Merge branch dev to main (#3407) 2023-12-12 23:16:25 +01:00
semantic-release-bot
a46f9ddd2d chore(release): 3.1.0-dev.1 [skip ci]
# [3.1.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v3.0.1...v3.1.0-dev.1) (2023-12-12)

### Bug Fixes

* **Boost for Reddit - Spoof client:** Fix account login by removing user agent patch ([0f829ed](0f829ed747))
* Solve build errors by using correct syntax ([40684cd](40684cd1fe))
* **Sync for Reddit - Spoof client:** Fix account login by removing user agent patch ([c10956b](c10956ba14))

### Features

* **IconPackStudio - Unlock pro:** Constrain to last working version ([#3410](https://github.com/ReVanced/revanced-patches/issues/3410)) ([36fc818](36fc818f90))
2023-12-12 22:02:36 +00:00
oSumAtrIX
40684cd1fe fix: Solve build errors by using correct syntax 2023-12-12 23:00:28 +01:00
oSumAtrIX
0f829ed747 fix(Boost for Reddit - Spoof client): Fix account login by removing user agent patch 2023-12-12 22:42:46 +01:00
oSumAtrIX
c10956ba14 fix(Sync for Reddit - Spoof client): Fix account login by removing user agent patch 2023-12-12 22:42:46 +01:00
Bceez
36fc818f90 feat(IconPackStudio - Unlock pro): Constrain to last working version (#3410) 2023-12-12 21:49:22 +01:00
LisoUseInAIKyrios
3ae2dbaad7 chore(YouTube): Fix settings UI typos 2023-12-12 20:51:26 +04:00
semantic-release-bot
9c843cbf6e chore(release): 3.0.1 [skip ci]
## [3.0.1](https://github.com/ReVanced/revanced-patches/compare/v3.0.0...v3.0.1) (2023-12-12)

### Bug Fixes

* **YouTube Music - GmsCore support:** Change from correct package name to prevent the patch from failing ([42ae7b3](42ae7b3f2a))
2023-12-12 00:55:15 +00:00
oSumAtrIX
7387323de5 chore: Merge branch dev to main (#3400) 2023-12-12 01:53:21 +01:00
semantic-release-bot
22f32865a2 chore(release): 3.0.1-dev.1 [skip ci]
## [3.0.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v3.0.0...v3.0.1-dev.1) (2023-12-12)

### Bug Fixes

* **YouTube Music - GmsCore support:** Change from correct package name to prevent the patch from failing ([42ae7b3](42ae7b3f2a))
2023-12-12 00:53:09 +00:00
oSumAtrIX
5f8b96466f refactor: Simplify implementation 2023-12-12 01:50:32 +01:00
oSumAtrIX
42ae7b3f2a fix(YouTube Music - GmsCore support): Change from correct package name to prevent the patch from failing 2023-12-12 01:50:18 +01:00
semantic-release-bot
7b56550a0a chore(release): 3.0.0 [skip ci]
# [3.0.0](https://github.com/ReVanced/revanced-patches/compare/v2.202.0...v3.0.0) (2023-12-12)

### Bug Fixes

* Use correct class loader to load resources ([17f44ca](17f44ca780))
* **YouTube - GmsCore support:** Check for availability earlier to prevent crashing without any notice ([a4a4822](a4a4822ed8))
* **YouTube - Minimized playback:** Fix PIP incorrectly shown for some Shorts playback ([#3364](https://github.com/ReVanced/revanced-patches/issues/3364)) ([e6a1573](e6a1573c59))
* **YouTube - Return YouTube Dislike:** Prevent the first Short opened from freezing the UI ([#3359](https://github.com/ReVanced/revanced-patches/issues/3359)) ([aaad913](aaad91333f))

### Features

* Allow choosing the vendor of GmsCore via patch options ([#3347](https://github.com/ReVanced/revanced-patches/issues/3347)) ([55bc7ec](55bc7ecbae))
* **Infinity for Reddit - Spoof client:** Support latest version ([0ceb163](0ceb163ffa))
* **Infinity for Reddit:** Add `Unlock subscription` patch ([080b357](080b357a79))
* **Photomath:** Constrain patches to last working version ([3bd6640](3bd66406cc))
* Publish as a library ([#3356](https://github.com/ReVanced/revanced-patches/issues/3356)) ([d3acdea](d3acdead51))
* **Tiktok:** Bump compatibility to `32.5.3` ([#3389](https://github.com/ReVanced/revanced-patches/issues/3389)) ([37c461f](37c461f5c7))
* **Twitch - Settings:** Support version `16.1.0` and `15.4.1` ([#3377](https://github.com/ReVanced/revanced-patches/issues/3377)) ([ba58edb](ba58edbd7f))
* **Twitter - Dynamic Color:** Remove blue icon and update app name ([#3384](https://github.com/ReVanced/revanced-patches/issues/3384)) ([6a03c1f](6a03c1f8c3))
* **YouTube - Alternative Thumbnails:** Add option to use DeArrow ([#3378](https://github.com/ReVanced/revanced-patches/issues/3378)) ([dbe123c](dbe123c93c))
* **YouTube:** Add `Change start page` patch ([f03e57b](f03e57b112))
* **YouTube:** Clarify patch descriptions ([#3350](https://github.com/ReVanced/revanced-patches/issues/3350)) ([4672118](4672118e88))

### BREAKING CHANGES

* **Tiktok:** This removes a patch but consolidates it into another.
* Various APIs have been moved to `GmsCoreSupportAbstractPatch`
2023-12-12 00:13:19 +00:00
oSumAtrIX
e6766c3a5f chore: Merge branch dev to main (#3358) 2023-12-12 01:11:25 +01:00
semantic-release-bot
e840d03d63 chore(release): 3.0.0-dev.11 [skip ci]
# [3.0.0-dev.11](https://github.com/ReVanced/revanced-patches/compare/v3.0.0-dev.10...v3.0.0-dev.11) (2023-12-12)

### Features

* **Tiktok:** Bump compatibility to `32.5.3` ([#3389](https://github.com/ReVanced/revanced-patches/issues/3389)) ([37c461f](37c461f5c7))

### BREAKING CHANGES

* **Tiktok:** This removes a patch but consolidates it into another.
2023-12-12 00:09:27 +00:00
d4rkk3y
37c461f5c7 feat(Tiktok): Bump compatibility to 32.5.3 (#3389)
BREAKING CHANGE: This removes a patch but consolidates it into another.
2023-12-12 01:07:01 +01:00
semantic-release-bot
6202072061 chore(release): 3.0.0-dev.10 [skip ci]
# [3.0.0-dev.10](https://github.com/ReVanced/revanced-patches/compare/v3.0.0-dev.9...v3.0.0-dev.10) (2023-12-11)

### Features

* **YouTube:** Add `Change start page` patch ([f03e57b](f03e57b112))
2023-12-11 23:43:52 +00:00
oSumAtrIX
f03e57b112 feat(YouTube): Add Change start page patch 2023-12-12 00:42:01 +01:00
semantic-release-bot
e2e0efd7ae chore(release): 3.0.0-dev.9 [skip ci]
# [3.0.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v3.0.0-dev.8...v3.0.0-dev.9) (2023-12-11)

### Bug Fixes

* **YouTube - GmsCore support:** Check for availability earlier to prevent crashing without any notice ([a4a4822](a4a4822ed8))
2023-12-11 22:07:41 +00:00
oSumAtrIX
a4a4822ed8 fix(YouTube - GmsCore support): Check for availability earlier to prevent crashing without any notice 2023-12-11 23:05:39 +01:00
oSumAtrIX
6b35561394 build: Simplify enabling local build cache 2023-12-11 22:39:44 +01:00
46 changed files with 674 additions and 4831 deletions

16
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
- package-ecosystem: npm
directory: /
schedule:
interval: monthly
- package-ecosystem: gradle
directory: /
schedule:
interval: monthly

View File

@@ -0,0 +1,18 @@
name: Update Gradle wrapper
on:
schedule:
- cron: "0 0 1 * *"
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Gradle Wrapper
uses: gradle-update/update-gradle-wrapper-action@v1
with:
target-branch: dev

View File

@@ -1,3 +1,136 @@
# [3.2.0-dev.4](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.3...v3.2.0-dev.4) (2023-12-21)
### Bug Fixes
* **Tiktok - Remember clear display:** Use correct name ([d7e44cb](https://github.com/ReVanced/revanced-patches/commit/d7e44cb887396bba27ee81c70c006f0cc247c56d))
# [3.2.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.2...v3.2.0-dev.3) (2023-12-21)
### Features
* **Tiktok:** Add `Remember clear mode` patch ([#2509](https://github.com/ReVanced/revanced-patches/issues/2509)) ([048bf59](https://github.com/ReVanced/revanced-patches/commit/048bf592ef93ee5138aa1886be1644501f88964a))
# [3.2.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v3.2.0-dev.1...v3.2.0-dev.2) (2023-12-19)
### Features
* **Public API:** Deprecate `HideEmailAddressPatch` ([866bceb](https://github.com/ReVanced/revanced-patches/commit/866bcebdd990b964d3dfd5aea792e7fffaedbf44))
* **YouTube:** Remove `Hide email address` patch ([3b84305](https://github.com/ReVanced/revanced-patches/commit/3b84305a6b97800cb147f86c642f19689548aca5))
# [3.2.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v3.1.0...v3.2.0-dev.1) (2023-12-18)
### Bug Fixes
* **YouTube - SponsorBlock:** Export local statistics with saved settings ([f8365b4](https://github.com/ReVanced/revanced-patches/commit/f8365b4e3585328506887022ac6168045ac110b9))
### Features
* **Public API:** Make `BottomControlsResource#addControls` public ([#2514](https://github.com/ReVanced/revanced-patches/issues/2514)) ([f4e2257](https://github.com/ReVanced/revanced-patches/commit/f4e2257072ca02003f7c272d6c0c8ef1aa6032ae))
# [3.1.0](https://github.com/ReVanced/revanced-patches/compare/v3.0.1...v3.1.0) (2023-12-12)
### Bug Fixes
* **Boost for Reddit - Spoof client:** Fix account login by removing user agent patch ([42a5de9](https://github.com/ReVanced/revanced-patches/commit/42a5de98becee7fc027c3e7143e071a3447f7077))
* Solve build errors by using correct syntax ([3f5a5bf](https://github.com/ReVanced/revanced-patches/commit/3f5a5bf2ab061e7be2f430dc3f5fd64d5c842677))
* **Sync for Reddit - Spoof client:** Fix account login by removing user agent patch ([d90786e](https://github.com/ReVanced/revanced-patches/commit/d90786e26d9c0e581284aab0d9d6d5097da2bfda))
### Features
* **IconPackStudio - Unlock pro:** Constrain to last working version ([#3410](https://github.com/ReVanced/revanced-patches/issues/3410)) ([fb6ee8a](https://github.com/ReVanced/revanced-patches/commit/fb6ee8a8976b64477171f70229e161188c39efcd))
# [3.1.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v3.0.1...v3.1.0-dev.1) (2023-12-12)
### Bug Fixes
* **Boost for Reddit - Spoof client:** Fix account login by removing user agent patch ([42a5de9](https://github.com/ReVanced/revanced-patches/commit/42a5de98becee7fc027c3e7143e071a3447f7077))
* Solve build errors by using correct syntax ([3f5a5bf](https://github.com/ReVanced/revanced-patches/commit/3f5a5bf2ab061e7be2f430dc3f5fd64d5c842677))
* **Sync for Reddit - Spoof client:** Fix account login by removing user agent patch ([d90786e](https://github.com/ReVanced/revanced-patches/commit/d90786e26d9c0e581284aab0d9d6d5097da2bfda))
### Features
* **IconPackStudio - Unlock pro:** Constrain to last working version ([#3410](https://github.com/ReVanced/revanced-patches/issues/3410)) ([fb6ee8a](https://github.com/ReVanced/revanced-patches/commit/fb6ee8a8976b64477171f70229e161188c39efcd))
## [3.0.1](https://github.com/ReVanced/revanced-patches/compare/v3.0.0...v3.0.1) (2023-12-12)
### Bug Fixes
* **YouTube Music - GmsCore support:** Change from correct package name to prevent the patch from failing ([284a7f0](https://github.com/ReVanced/revanced-patches/commit/284a7f0b1a7b46e36b5f3dd132bb36d6d3fef584))
## [3.0.1-dev.1](https://github.com/ReVanced/revanced-patches/compare/v3.0.0...v3.0.1-dev.1) (2023-12-12)
### Bug Fixes
* **YouTube Music - GmsCore support:** Change from correct package name to prevent the patch from failing ([284a7f0](https://github.com/ReVanced/revanced-patches/commit/284a7f0b1a7b46e36b5f3dd132bb36d6d3fef584))
# [3.0.0](https://github.com/ReVanced/revanced-patches/compare/v2.202.0...v3.0.0) (2023-12-12)
### Bug Fixes
* Use correct class loader to load resources ([1d5f1f8](https://github.com/ReVanced/revanced-patches/commit/1d5f1f83be1f4eb78381887cd59f1649f1ed6d71))
* **YouTube - GmsCore support:** Check for availability earlier to prevent crashing without any notice ([dab8900](https://github.com/ReVanced/revanced-patches/commit/dab8900e22498a86c7a1c2fd8f1bcc29dec1272c))
* **YouTube - Minimized playback:** Fix PIP incorrectly shown for some Shorts playback ([#3364](https://github.com/ReVanced/revanced-patches/issues/3364)) ([84607ff](https://github.com/ReVanced/revanced-patches/commit/84607ff5f4bd30d328cdc4e1d46070a86d6c56bf))
* **YouTube - Return YouTube Dislike:** Prevent the first Short opened from freezing the UI ([#3359](https://github.com/ReVanced/revanced-patches/issues/3359)) ([e024409](https://github.com/ReVanced/revanced-patches/commit/e024409219bfbccc32c337d95da24b7146b6c7b7))
### Features
* Allow choosing the vendor of GmsCore via patch options ([#3347](https://github.com/ReVanced/revanced-patches/issues/3347)) ([161261c](https://github.com/ReVanced/revanced-patches/commit/161261cfeab4616764d20efe46fcfd483299741c))
* **Infinity for Reddit - Spoof client:** Support latest version ([ca42fd9](https://github.com/ReVanced/revanced-patches/commit/ca42fd93656eae6a5f5f0086e3cf574fb6f4f11e))
* **Infinity for Reddit:** Add `Unlock subscription` patch ([840b29e](https://github.com/ReVanced/revanced-patches/commit/840b29e9891243a4ccabb6ade5ad6ac92984efc2))
* **Photomath:** Constrain patches to last working version ([f9a5dc6](https://github.com/ReVanced/revanced-patches/commit/f9a5dc6c91f37e9d7018e631739ca61511940d29))
* Publish as a library ([#3356](https://github.com/ReVanced/revanced-patches/issues/3356)) ([4b878ee](https://github.com/ReVanced/revanced-patches/commit/4b878eeeda7d8b97ddd0911077b701c36dec5e43))
* **Tiktok:** Bump compatibility to `32.5.3` ([#3389](https://github.com/ReVanced/revanced-patches/issues/3389)) ([96cdc10](https://github.com/ReVanced/revanced-patches/commit/96cdc102dd64e3134ec0ac5cc22c956b80c95e0b))
* **Twitch - Settings:** Support version `16.1.0` and `15.4.1` ([#3377](https://github.com/ReVanced/revanced-patches/issues/3377)) ([062310d](https://github.com/ReVanced/revanced-patches/commit/062310dcc3923568c96171420c7fb9c0c2144233))
* **Twitter - Dynamic Color:** Remove blue icon and update app name ([#3384](https://github.com/ReVanced/revanced-patches/issues/3384)) ([3db6615](https://github.com/ReVanced/revanced-patches/commit/3db6615568e399aa13dac093868df3d0e1ebc4c3))
* **YouTube - Alternative Thumbnails:** Add option to use DeArrow ([#3378](https://github.com/ReVanced/revanced-patches/issues/3378)) ([41217f6](https://github.com/ReVanced/revanced-patches/commit/41217f61e600e47dd6812864bff22ee054521d3c))
* **YouTube:** Add `Change start page` patch ([ad9ba37](https://github.com/ReVanced/revanced-patches/commit/ad9ba37c0568bd303d807b3ddf1a22daa8f8ec59))
* **YouTube:** Clarify patch descriptions ([#3350](https://github.com/ReVanced/revanced-patches/issues/3350)) ([f2b9df4](https://github.com/ReVanced/revanced-patches/commit/f2b9df4e22a1c537cbd383087a3d724c3cdc1784))
### BREAKING CHANGES
* **Tiktok:** This removes a patch but consolidates it into another.
* Various APIs have been moved to `GmsCoreSupportAbstractPatch`
# [3.0.0-dev.11](https://github.com/ReVanced/revanced-patches/compare/v3.0.0-dev.10...v3.0.0-dev.11) (2023-12-12)
### Features
* **Tiktok:** Bump compatibility to `32.5.3` ([#3389](https://github.com/ReVanced/revanced-patches/issues/3389)) ([96cdc10](https://github.com/ReVanced/revanced-patches/commit/96cdc102dd64e3134ec0ac5cc22c956b80c95e0b))
### BREAKING CHANGES
* **Tiktok:** This removes a patch but consolidates it into another.
# [3.0.0-dev.10](https://github.com/ReVanced/revanced-patches/compare/v3.0.0-dev.9...v3.0.0-dev.10) (2023-12-11)
### Features
* **YouTube:** Add `Change start page` patch ([ad9ba37](https://github.com/ReVanced/revanced-patches/commit/ad9ba37c0568bd303d807b3ddf1a22daa8f8ec59))
# [3.0.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v3.0.0-dev.8...v3.0.0-dev.9) (2023-12-11)
### Bug Fixes
* **YouTube - GmsCore support:** Check for availability earlier to prevent crashing without any notice ([dab8900](https://github.com/ReVanced/revanced-patches/commit/dab8900e22498a86c7a1c2fd8f1bcc29dec1272c))
# [3.0.0-dev.8](https://github.com/ReVanced/revanced-patches/compare/v3.0.0-dev.7...v3.0.0-dev.8) (2023-12-11)

View File

@@ -418,7 +418,6 @@ public final class app/revanced/patches/reddit/customclients/baconreader/api/Spo
public final class app/revanced/patches/reddit/customclients/boostforreddit/api/SpoofClientPatch : app/revanced/patches/reddit/customclients/AbstractSpoofClientPatch {
public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/boostforreddit/api/SpoofClientPatch;
public fun patchClientId (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
public fun patchUserAgent (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
}
public final class app/revanced/patches/reddit/customclients/infinityforreddit/api/SpoofClientPatch : app/revanced/patches/reddit/customclients/AbstractSpoofClientPatch {
@@ -482,7 +481,6 @@ public final class app/revanced/patches/reddit/customclients/syncforreddit/api/S
public static final field INSTANCE Lapp/revanced/patches/reddit/customclients/syncforreddit/api/SpoofClientPatch;
public fun patchClientId (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
public fun patchMiscellaneous (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
public fun patchUserAgent (Ljava/util/Set;Lapp/revanced/patcher/data/BytecodeContext;)V
}
public final class app/revanced/patches/reddit/customclients/syncforreddit/detection/piracy/DisablePiracyDetectionPatch : app/revanced/patcher/patch/BytecodePatch {
@@ -521,6 +519,10 @@ public final class app/revanced/patches/serviceportalbund/detection/root/RootDet
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}
public final class app/revanced/patches/shared/fingerprints/HomeActivityFingerprint : app/revanced/patches/shared/integrations/AbstractIntegrationsPatch$IntegrationsFingerprint {
public static final field INSTANCE Lapp/revanced/patches/shared/fingerprints/HomeActivityFingerprint;
}
public abstract class app/revanced/patches/shared/integrations/AbstractIntegrationsPatch : app/revanced/patcher/patch/BytecodePatch {
public fun <init> (Ljava/lang/String;Ljava/util/Set;)V
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
@@ -810,14 +812,14 @@ public final class app/revanced/patches/ticktick/misc/themeunlock/UnlockProPatch
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}
public final class app/revanced/patches/tiktok/ad/HideAdsPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/tiktok/ad/HideAdsPatch;
public final class app/revanced/patches/tiktok/feedfilter/FeedFilterPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/tiktok/feedfilter/FeedFilterPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}
public final class app/revanced/patches/tiktok/feedfilter/FeedFilterPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/tiktok/feedfilter/FeedFilterPatch;
public final class app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearDisplayPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/tiktok/interaction/cleardisplay/RememberClearDisplayPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}
@@ -1338,6 +1340,16 @@ public final class app/revanced/patches/youtube/layout/spoofappversion/SpoofAppV
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}
public final class app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}
public final class app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint {
public static final field INSTANCE Lapp/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint;
}
public final class app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch : app/revanced/patcher/patch/BytecodePatch {
public static final field INSTANCE Lapp/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch;
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
@@ -1458,6 +1470,7 @@ public final class app/revanced/patches/youtube/misc/minimizedplayback/Minimized
public final class app/revanced/patches/youtube/misc/playercontrols/BottomControlsResourcePatch : app/revanced/patcher/patch/ResourcePatch, java/io/Closeable {
public static final field INSTANCE Lapp/revanced/patches/youtube/misc/playercontrols/BottomControlsResourcePatch;
public final fun addControls (Ljava/lang/String;)V
public fun close ()V
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
public fun execute (Lapp/revanced/patcher/data/ResourceContext;)V

View File

@@ -1,7 +1,7 @@
import org.gradle.kotlin.dsl.support.listFilesOrdered
plugins {
kotlin("jvm") version "1.9.10"
kotlin("jvm") version "1.9.21"
alias(libs.plugins.binary.compatibility.validator)
`maven-publish`
}
@@ -49,7 +49,7 @@ tasks.withType(Jar::class) {
tasks {
register<DefaultTask>("generateBundle") {
description = "Generate dex files from build and bundle them in the jar file"
description = "Generate DEX files and add them in the JAR file"
dependsOn(build)

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 3.0.0-dev.8
version = 3.2.0-dev.4

View File

@@ -1,7 +1,7 @@
[versions]
revanced-patcher = "19.1.0"
smali = "3.0.3"
guava = "32.1.2-jre"
guava = "32.1.3-jre"
gson = "2.10.1"
binary-compatibility-validator = "0.13.2"

Binary file not shown.

View File

@@ -1,6 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae
distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dist
zipStorePath=wrapper/dists

17
gradlew vendored
View File

@@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -201,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \

4463
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
{
"devDependencies": {
"@saithodev/semantic-release-backmerge": "^3.2.1",
"@saithodev/semantic-release-backmerge": "^4.0.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"gradle-semantic-release-plugin": "^1.8.0",
"semantic-release": "^22.0.8"
"semantic-release": "^22.0.12"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -4,6 +4,6 @@ rootProject.name = "revanced-patches"
buildCache {
local {
isEnabled = !System.getenv().containsKey("CI")
isEnabled = "CI" !in System.getenv()
}
}

View File

@@ -9,7 +9,7 @@ import app.revanced.patches.iconpackstudio.misc.pro.fingerprints.CheckProFingerp
@Patch(
name = "Unlock pro",
compatiblePackages = [CompatiblePackage("ginlemon.iconpackstudio")]
compatiblePackages = [CompatiblePackage("ginlemon.iconpackstudio", ["2.2 build 016"])]
)
@Suppress("unused")
object UnlockProPatch : BytecodePatch(

View File

@@ -9,8 +9,8 @@ import app.revanced.patches.youtube.misc.gms.fingerprints.CastContextFetchFinger
@Suppress("unused")
object GmsCoreSupportPatch : AbstractGmsCoreSupportPatch(
fromPackageName = REVANCED_MUSIC_PACKAGE_NAME,
toPackageName = MUSIC_PACKAGE_NAME,
fromPackageName = MUSIC_PACKAGE_NAME,
toPackageName = REVANCED_MUSIC_PACKAGE_NAME,
primeMethodFingerprint = PrimeMethodFingerprint,
earlyReturnFingerprints = setOf(
ServiceCheckFingerprint,

View File

@@ -4,7 +4,6 @@ import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.fingerprint.MethodFingerprintResult
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
import app.revanced.patches.reddit.customclients.Constants.OAUTH_USER_AGENT
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.LoginActivityOnCreateFingerprint
@@ -25,20 +24,4 @@ object SpoofClientPatch : AbstractSpoofClientPatch(
"""
)
}
override fun Set<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {
first().let { result ->
result.mutableMethod.apply {
val insertIndex = result.scanResult.patternScanResult!!.endIndex
addInstructions(
insertIndex,
"""
const-string v7, "$OAUTH_USER_AGENT"
invoke-virtual {v4, v7}, Landroid/webkit/WebSettings;->setUserAgentString(Ljava/lang/String;)V
"""
)
}
}
}
}

View File

@@ -1,18 +1,17 @@
package app.revanced.patches.reddit.customclients.syncforreddit.api
import app.revanced.util.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.fingerprint.MethodFingerprintResult
import app.revanced.patches.reddit.customclients.AbstractSpoofClientPatch
import app.revanced.patches.reddit.customclients.Constants.OAUTH_USER_AGENT
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.GetAuthorizationStringFingerprint
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.GetBearerTokenFingerprint
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.ImgurImageAPIFingerprint
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.LoadBrowserURLFingerprint
import app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.DisablePiracyDetectionPatch
import app.revanced.util.exception
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.StringReference
@@ -76,18 +75,4 @@ object SpoofClientPatch : AbstractSpoofClientPatch(
"const-string v1, \"https://api.imgur.com/3/image\""
)
}
override fun Set<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext) {
first().let { result ->
val insertIndex = result.scanResult.patternScanResult!!.startIndex
result.mutableMethod.addInstructions(
insertIndex,
"""
const-string v0, "$OAUTH_USER_AGENT"
invoke-virtual {p1, v0}, Landroid/webkit/WebSettings;->setUserAgentString(Ljava/lang/String;)V
"""
)
}
}
}

View File

@@ -0,0 +1,9 @@
package app.revanced.patches.shared.fingerprints
import app.revanced.patches.shared.integrations.AbstractIntegrationsPatch.IntegrationsFingerprint
object HomeActivityFingerprint : IntegrationsFingerprint(
customFingerprint = { methodDef, classDef ->
methodDef.name == "onCreate" && classDef.type.endsWith("Shell_HomeActivity;")
},
)

View File

@@ -13,9 +13,11 @@ import app.revanced.patches.shared.misc.gms.AbstractGmsCoreSupportPatch.Constant
import app.revanced.patches.shared.misc.gms.fingerprints.GmsCoreSupportFingerprint
import app.revanced.patches.shared.misc.gms.fingerprints.GmsCoreSupportFingerprint.GET_GMS_CORE_VENDOR_METHOD_NAME
import app.revanced.util.exception
import app.revanced.util.getReference
import app.revanced.util.returnEarly
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21c
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
import com.android.tools.smali.dexlib2.iface.reference.StringReference
import com.android.tools.smali.dexlib2.immutable.reference.ImmutableStringReference
@@ -169,23 +171,20 @@ abstract class AbstractGmsCoreSupportPatch(
}
}
private fun transformPrimeMethod(packageName: String) = primeMethodFingerprint.result?.mutableMethod?.apply {
var register = 2
val index = getInstructions().indexOfFirst {
if (it.opcode != Opcode.CONST_STRING) return@indexOfFirst false
private fun transformPrimeMethod(packageName: String) {
primeMethodFingerprint.result?.mutableMethod?.apply {
var register = 2
val instructionString = ((it as Instruction21c).reference as StringReference).string
if (instructionString != fromPackageName) return@indexOfFirst false
val index = getInstructions().indexOfFirst {
if (it.getReference<StringReference>()?.string != fromPackageName) return@indexOfFirst false
register = it.registerA
return@indexOfFirst true
}
register = (it as OneRegisterInstruction).registerA
return@indexOfFirst true
}
replaceInstruction(
index, "const-string v$register, \"$packageName\""
)
replaceInstruction(index, "const-string v$register, \"$packageName\"")
} ?: throw primeMethodFingerprint.exception
}
?: throw primeMethodFingerprint.exception
/**
* A collection of permissions, intents and content provider authorities

View File

@@ -1,51 +0,0 @@
package app.revanced.patches.tiktok.ad
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.tiktok.ad.fingerprints.ConvertHelpFeedItemListFingerprint
import app.revanced.patches.tiktok.ad.fingerprints.FeedItemListCloneFingerprint
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
@Patch(
name = "Hide ads",
compatiblePackages = [
CompatiblePackage("com.ss.android.ugc.trill", ["30.8.4"]),
CompatiblePackage("com.zhiliaoapp.musically", ["30.8.4"])
]
)
@Suppress("unused")
object HideAdsPatch : BytecodePatch(
setOf(FeedItemListCloneFingerprint, ConvertHelpFeedItemListFingerprint)
) {
override fun execute(context: BytecodeContext) {
listOf(
FeedItemListCloneFingerprint,
ConvertHelpFeedItemListFingerprint
).forEach { fingerprint ->
val method = fingerprint.result!!.mutableMethod
// iterate all instructions in the clone method
for ((index, instruction) in method.implementation!!.instructions.withIndex()) {
// conditions for the instruction we need
if (instruction.opcode.ordinal != Opcode.IPUT_OBJECT.ordinal) continue
val preloadAdsFieldInstruction = (instruction as? ReferenceInstruction)
if ((preloadAdsFieldInstruction?.reference as? FieldReference)?.name != "preloadAds") continue
// set null instead of the field "preloadAds"
val overrideRegister = (preloadAdsFieldInstruction as TwoRegisterInstruction).registerA
method.addInstruction(
index,
"const/4 v$overrideRegister, 0x0"
)
return@forEach
}
throw PatchException("Can not find required instruction.")
}
}
}

View File

@@ -1,10 +0,0 @@
package app.revanced.patches.tiktok.ad.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint
internal object ConvertHelpFeedItemListFingerprint : MethodFingerprint(
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/ConvertHelp;") &&
methodDef.name.endsWith("${'$'}FeedItemList")
}
)

View File

@@ -1,9 +0,0 @@
package app.revanced.patches.tiktok.ad.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint
internal object FeedItemListCloneFingerprint : MethodFingerprint(
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/FeedItemList;") && methodDef.name == "clone"
}
)

View File

@@ -1,8 +1,8 @@
package app.revanced.patches.tiktok.feedfilter
import app.revanced.util.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.getInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
@@ -10,31 +10,35 @@ import app.revanced.patches.tiktok.feedfilter.fingerprints.FeedApiServiceLIZFing
import app.revanced.patches.tiktok.misc.integrations.IntegrationsPatch
import app.revanced.patches.tiktok.misc.settings.SettingsPatch
import app.revanced.patches.tiktok.misc.settings.fingerprints.SettingsStatusLoadFingerprint
import app.revanced.util.exception
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@Patch(
name = "Feed filter",
description = "Filters tiktok videos: removing ads, removing livestreams.",
description = "Removes ads, livestreams, stories, image videos " +
"and videos with a specific amount of views or likes from the feed.",
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
compatiblePackages = [
CompatiblePackage("com.ss.android.ugc.trill"),
CompatiblePackage("com.zhiliaoapp.musically")
CompatiblePackage("com.ss.android.ugc.trill", ["32.5.3"]),
CompatiblePackage("com.zhiliaoapp.musically", ["32.5.3"])
]
)
@Suppress("unused")
object FeedFilterPatch : BytecodePatch(setOf(FeedApiServiceLIZFingerprint, SettingsStatusLoadFingerprint)) {
object FeedFilterPatch : BytecodePatch(
setOf(FeedApiServiceLIZFingerprint, SettingsStatusLoadFingerprint)
) {
override fun execute(context: BytecodeContext) {
val method = FeedApiServiceLIZFingerprint.result!!.mutableMethod
for ((index, instruction) in method.implementation!!.instructions.withIndex()) {
if (instruction.opcode != Opcode.RETURN_OBJECT) continue
val feedItemsRegister = (instruction as OneRegisterInstruction).registerA
method.addInstruction(
index,
"invoke-static {v$feedItemsRegister}, Lapp/revanced/tiktok/feedfilter/FeedItemsFilter;->filter(Lcom/ss/android/ugc/aweme/feed/model/FeedItemList;)V"
FeedApiServiceLIZFingerprint.result?.mutableMethod?.apply {
val returnFeedItemInstruction = getInstructions().first { it.opcode == Opcode.RETURN_OBJECT }
val feedItemsRegister = (returnFeedItemInstruction as OneRegisterInstruction).registerA
addInstruction(
returnFeedItemInstruction.location.index,
"invoke-static { v$feedItemsRegister }, " +
"Lapp/revanced/tiktok/feedfilter/FeedItemsFilter;->filter(Lcom/ss/android/ugc/aweme/feed/model/FeedItemList;)V"
)
break
}
} ?: throw FeedApiServiceLIZFingerprint.exception
SettingsStatusLoadFingerprint.result?.mutableMethod?.addInstruction(
0,

View File

@@ -1,12 +1,9 @@
package app.revanced.patches.tiktok.feedfilter.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
internal object FeedApiServiceLIZFingerprint : MethodFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC or AccessFlags.SYNTHETIC,
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/FeedApiService;") && methodDef.name == "LIZ"
methodDef.definingClass.endsWith("/FeedApiService;") && methodDef.name == "fetchFeedList"
}
)

View File

@@ -0,0 +1,79 @@
package app.revanced.patches.tiktok.interaction.cleardisplay
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.tiktok.interaction.cleardisplay.fingerprints.OnClearDisplayEventFingerprint
import app.revanced.patches.tiktok.interaction.cleardisplay.fingerprints.OnRenderFirstFrameFingerprint
import app.revanced.util.exception
import app.revanced.util.indexOfFirstInstruction
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction22c
@Patch(
name = "Remember clear display",
description = "Remembers the clear display configurations in between videos.",
compatiblePackages = [
CompatiblePackage("com.ss.android.ugc.trill", ["32.5.3"]),
CompatiblePackage("com.zhiliaoapp.musically", ["32.5.3"])
]
)
@Suppress("unused")
object RememberClearDisplayPatch : BytecodePatch(
setOf(
OnClearDisplayEventFingerprint,
OnRenderFirstFrameFingerprint
)
) {
override fun execute(context: BytecodeContext) {
OnClearDisplayEventFingerprint.result?.mutableMethod?.let {
// region Hook the "Clear display" configuration save event to remember the state of clear display.
val isEnabledIndex = it.indexOfFirstInstruction { opcode == Opcode.IGET_BOOLEAN } + 1
val isEnabledRegister = it.getInstruction<Instruction22c>(isEnabledIndex - 1).registerA
it.addInstructions(
isEnabledIndex,
"invoke-static { v$isEnabledRegister }, " +
"Lapp/revanced/tiktok/cleardisplay/RememberClearDisplayPatch;->rememberClearDisplayState(Z)V"
)
// endregion
// region Override the "Clear display" configuration load event to load the state of clear display.
val clearDisplayEventClass = it.parameters[0].type
OnRenderFirstFrameFingerprint.result?.mutableMethod?.apply {
addInstructionsWithLabels(
0,
"""
# Create a new clearDisplayEvent and post it to the EventBus (https://github.com/greenrobot/EventBus)
# The state of clear display.
invoke-static { }, Lapp/revanced/tiktok/cleardisplay/RememberClearDisplayPatch;->getClearDisplayState()Z
move-result v3
if-eqz v3, :clear_display_disabled
# Clear display type such as 0 = LONG_PRESS, 1 = SCREEN_RECORD etc.
const/4 v1, 0x0
# Name of the clear display type which is equivalent to the clear display type.
const-string v2, "long_press"
new-instance v0, $clearDisplayEventClass
invoke-direct { v0, v1, v2, v3 }, $clearDisplayEventClass-><init>(ILjava/lang/String;Z)V
invoke-virtual { v0 }, $clearDisplayEventClass->post()Lcom/ss/android/ugc/governance/eventbus/IEvent;
""",
ExternalLabel("clear_display_disabled", getInstruction(0))
)
} ?: throw OnRenderFirstFrameFingerprint.exception
// endregion
} ?: throw OnClearDisplayEventFingerprint.exception
}
}

View File

@@ -0,0 +1,10 @@
package app.revanced.patches.tiktok.interaction.cleardisplay.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint
internal object OnClearDisplayEventFingerprint : MethodFingerprint(
customFingerprint = { methodDef, _ ->
// Internally the feature is called "Clear mode".
methodDef.definingClass.endsWith("/ClearModePanelComponent;") && methodDef.name == "onClearModeEvent"
}
)

View File

@@ -0,0 +1,9 @@
package app.revanced.patches.tiktok.interaction.cleardisplay.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint
internal object OnRenderFirstFrameFingerprint : MethodFingerprint(
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/BaseListFragmentPanel;") && methodDef.name == "onRenderFirstFrame"
}
)

View File

@@ -4,10 +4,9 @@ import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
@@ -18,18 +17,19 @@ import app.revanced.patches.tiktok.interaction.downloads.fingerprints.DownloadPa
import app.revanced.patches.tiktok.misc.integrations.IntegrationsPatch
import app.revanced.patches.tiktok.misc.settings.SettingsPatch
import app.revanced.patches.tiktok.misc.settings.fingerprints.SettingsStatusLoadFingerprint
import app.revanced.util.exception
import app.revanced.util.indexOfFirstInstruction
import com.android.tools.smali.dexlib2.Opcode
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.StringReference
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
@Patch(
name = "Downloads",
description = "Removes download restrictions and changes the default path to download to.",
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
compatiblePackages = [
CompatiblePackage("com.ss.android.ugc.trill", ["30.8.4"]),
CompatiblePackage("com.zhiliaoapp.musically", ["30.8.4"])
CompatiblePackage("com.ss.android.ugc.trill", ["32.5.3"]),
CompatiblePackage("com.zhiliaoapp.musically", ["32.5.3"])
]
)
@Suppress("unused")
@@ -43,86 +43,83 @@ object DownloadsPatch : BytecodePatch(
)
) {
override fun execute(context: BytecodeContext) {
val method1 = ACLCommonShareFingerprint.result!!.mutableMethod
method1.replaceInstructions(
0,
"""
const/4 v0, 0x0
return v0
"""
)
val method2 = ACLCommonShareFingerprint2.result!!.mutableMethod
method2.replaceInstructions(
0,
"""
const/4 v0, 0x2
return v0
"""
)
//Download videos without watermark.
val method3 = ACLCommonShareFingerprint3.result!!.mutableMethod
method3.addInstructionsWithLabels(
0,
"""
invoke-static {}, Lapp/revanced/tiktok/download/DownloadsPatch;->shouldRemoveWatermark()Z
move-result v0
if-eqz v0, :noremovewatermark
const/4 v0, 0x1
return v0
:noremovewatermark
nop
"""
)
//Change the download path patch
val method4 = DownloadPathParentFingerprint.result!!.mutableMethod
val implementation4 = method4.implementation
val instructions = implementation4!!.instructions
var targetOffset = -1
//Search for the target method called instruction offset.
for ((index, instruction) in instructions.withIndex()) {
if (instruction.opcode != Opcode.CONST_STRING) continue
val reference = (instruction as ReferenceInstruction).reference as StringReference
if (reference.string != "video/mp4") continue
val targetInstruction = instructions[index + 1]
if (targetInstruction.opcode != Opcode.INVOKE_STATIC) continue
targetOffset = index + 1
break
}
if (targetOffset == -1) throw PatchException("Can not find download path uri method.")
//Change videos' download path.
val downloadUriMethod = context
.toMethodWalker(DownloadPathParentFingerprint.result!!.method)
.nextMethod(targetOffset, true)
.getMethod() as MutableMethod
downloadUriMethod.implementation!!.instructions.forEachIndexed { index, instruction ->
if (instruction.opcode == Opcode.SGET_OBJECT) {
val overrideRegister = (instruction as OneRegisterInstruction).registerA
downloadUriMethod.addInstructions(
index + 1,
fun MethodFingerprint.getMethod() = result?.mutableMethod ?: throw exception
mapOf<MethodFingerprint, MutableMethod.() -> Unit>(
ACLCommonShareFingerprint to {
replaceInstructions(
0,
"""
invoke-static {}, Lapp/revanced/tiktok/download/DownloadsPatch;->getDownloadPath()Ljava/lang/String;
move-result-object v$overrideRegister
const/4 v0, 0x0
return v0
"""
)
}
if (instruction.opcode == Opcode.CONST_STRING) {
val string = ((instruction as ReferenceInstruction).reference as StringReference).string
if (string.contains("/Camera")) {
val overrideRegister = (instruction as OneRegisterInstruction).registerA
val overrideString = string.replace("/Camera", "")
downloadUriMethod.replaceInstruction(
index,
"""
const-string v$overrideRegister, "$overrideString"
"""
},
ACLCommonShareFingerprint2 to {
replaceInstructions(
0,
"""
const/4 v0, 0x2
return v0
"""
)
},
// Download videos without watermark.
ACLCommonShareFingerprint3 to {
addInstructionsWithLabels(
0,
"""
invoke-static {}, Lapp/revanced/tiktok/download/DownloadsPatch;->shouldRemoveWatermark()Z
move-result v0
if-eqz v0, :noremovewatermark
const/4 v0, 0x1
return v0
:noremovewatermark
nop
"""
)
},
// Change the download path patch.
DownloadPathParentFingerprint to {
val targetIndex = indexOfFirstInstruction { opcode == Opcode.INVOKE_STATIC }
val downloadUriMethod = context
.toMethodWalker(this)
.nextMethod(targetIndex, true)
.getMethod() as MutableMethod
val firstIndex = downloadUriMethod.indexOfFirstInstruction {
opcode == Opcode.INVOKE_DIRECT && ((this as Instruction35c).reference as MethodReference).name == "<init>"
}
val secondIndex = downloadUriMethod.indexOfFirstInstruction {
opcode == Opcode.INVOKE_STATIC && ((this as Instruction35c).reference as MethodReference).returnType.contains(
"Uri"
)
}
downloadUriMethod.addInstructions(
secondIndex,
"""
invoke-static {}, Lapp/revanced/tiktok/download/DownloadsPatch;->getDownloadPath()Ljava/lang/String;
move-result-object v0
"""
)
downloadUriMethod.addInstructions(
firstIndex,
"""
invoke-static {}, Lapp/revanced/tiktok/download/DownloadsPatch;->getDownloadPath()Ljava/lang/String;
move-result-object v0
"""
)
},
SettingsStatusLoadFingerprint to {
addInstruction(
0,
"invoke-static {}, Lapp/revanced/tiktok/settingsmenu/SettingsStatus;->enableDownload()V"
)
}
).forEach { (fingerprint, patch) ->
fingerprint.getMethod().patch()
}
val method5 = SettingsStatusLoadFingerprint.result!!.mutableMethod
method5.addInstruction(
0,
"invoke-static {}, Lapp/revanced/tiktok/settingsmenu/SettingsStatus;->enableDownload()V"
)
}
}
}

View File

@@ -3,13 +3,22 @@ package app.revanced.patches.tiktok.interaction.downloads.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
internal object DownloadPathParentFingerprint : MethodFingerprint(
"V",
AccessFlags.PUBLIC or AccessFlags.FINAL,
"L",
AccessFlags.PUBLIC or AccessFlags.STATIC,
strings = listOf(
"code",
"reason",
"params insufficient"
"video/mp4"
),
parameters = listOf(
"L",
"L"
),
opcodes = listOf(
Opcode.CONST_STRING,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.RETURN_OBJECT
)
)

View File

@@ -7,27 +7,36 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.tiktok.interaction.speed.fingerprints.SpeedControlParentFingerprint
import app.revanced.util.exception
import app.revanced.util.indexOfFirstInstruction
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
@Patch(
name = "Playback speed",
description = "Enables the playback speed option for all videos.",
compatiblePackages = [
CompatiblePackage("com.ss.android.ugc.trill"),
CompatiblePackage("com.zhiliaoapp.musically")
CompatiblePackage("com.ss.android.ugc.trill", ["32.5.3"]),
CompatiblePackage("com.zhiliaoapp.musically", ["32.5.3"])
]
)
@Suppress("unused")
object PlaybackSpeedPatch : BytecodePatch(setOf(SpeedControlParentFingerprint)) {
override fun execute(context: BytecodeContext) {
val parentMethod = SpeedControlParentFingerprint.result!!.mutableMethod
val parentMethodInstructions = parentMethod.implementation!!.instructions
for ((index, instruction) in parentMethodInstructions.withIndex()) {
if (instruction.opcode != Opcode.INVOKE_VIRTUAL) continue
SpeedControlParentFingerprint.result?.mutableMethod?.apply {
val targetMethodCallIndex = indexOfFirstInstruction {
if (opcode == Opcode.INVOKE_STATIC) {
val paramsTypes = ((this as Instruction35c).reference as MethodReference).parameterTypes
paramsTypes.size == 1 && paramsTypes[0].contains("/Aweme;")
} else false
}
val isSpeedEnableMethod = context
.toMethodWalker(parentMethod)
.nextMethod(index, true)
.toMethodWalker(this)
.nextMethod(targetMethodCallIndex, true)
.getMethod() as MutableMethod
isSpeedEnableMethod.addInstructions(
0,
"""
@@ -35,7 +44,6 @@ object PlaybackSpeedPatch : BytecodePatch(setOf(SpeedControlParentFingerprint))
return v0
"""
)
break
}
} ?: throw SpeedControlParentFingerprint.exception
}
}

View File

@@ -5,12 +5,9 @@ import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
internal object SpeedControlParentFingerprint : MethodFingerprint(
returnType = "L",
accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL,
parameters = listOf(
"L"
),
strings = listOf(
"playback_speed"
"onStopTrackingTouch, hasTouchMove=",
", isCurVideoPaused: ",
"already_shown_edge_speed_guide"
)
)

View File

@@ -1,6 +1,5 @@
package app.revanced.patches.tiktok.misc.settings
import app.revanced.util.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
@@ -14,17 +13,19 @@ import app.revanced.patches.tiktok.misc.settings.fingerprints.AdPersonalizationA
import app.revanced.patches.tiktok.misc.settings.fingerprints.AddSettingsEntryFingerprint
import app.revanced.patches.tiktok.misc.settings.fingerprints.SettingsEntryFingerprint
import app.revanced.patches.tiktok.misc.settings.fingerprints.SettingsEntryInfoFingerprint
import app.revanced.util.exception
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction35c
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction22c
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
@Patch(
name = "Settings",
description = "Adds ReVanced settings to TikTok.",
dependencies = [IntegrationsPatch::class],
compatiblePackages = [
CompatiblePackage("com.ss.android.ugc.trill", ["30.8.4"]),
CompatiblePackage("com.zhiliaoapp.musically", ["30.8.4"])
CompatiblePackage("com.ss.android.ugc.trill", ["32.5.3"]),
CompatiblePackage("com.zhiliaoapp.musically", ["32.5.3"])
]
)
object SettingsPatch : BytecodePatch(
@@ -57,31 +58,31 @@ object SettingsPatch : BytecodePatch(
?: throw SettingsEntryInfoFingerprint.exception
// Create a settings entry for 'revanced settings' and add it to settings fragment
AddSettingsEntryFingerprint.result?.apply {
scanResult.patternScanResult?.startIndex?.let {
val settingsEntries = mutableMethod.getInstruction(it + 3)
val addEntry = mutableMethod.getInstruction<BuilderInstruction35c>(it + 5)
val register1 = addEntry.registerC
val register2 = addEntry.registerD
// Add the settings entry created to the settings fragment
mutableMethod.addInstructions(
it + 6,
listOf(
settingsEntries,
addEntry
)
)
// These instructions call a method that create a settings entry use reflection base on the class name of classes that construct settings entry
mutableMethod.addInstructions(
it + 6,
"""
const-string v$register1, "$settingsButtonClass"
const-string v$register2, "$settingsButtonInfoClass"
invoke-static {v$register1, v$register2}, $CREATE_SETTINGS_ENTRY_METHOD_DESCRIPTOR
move-result-object v$register2
"""
)
AddSettingsEntryFingerprint.result?.mutableMethod?.apply {
val markIndex = implementation!!.instructions.indexOfFirst {
it.opcode == Opcode.IGET_OBJECT && ((it as Instruction22c).reference as FieldReference).name == "headerUnit"
}
val getUnitManager = getInstruction(markIndex + 2)
val addEntry = getInstruction(markIndex + 1)
addInstructions(
markIndex + 2,
listOf(
getUnitManager,
addEntry
)
)
addInstructions(
markIndex + 2,
"""
const-string v0, "$settingsButtonClass"
const-string v1, "$settingsButtonInfoClass"
invoke-static {v0, v1}, $CREATE_SETTINGS_ENTRY_METHOD_DESCRIPTOR
move-result-object v0
"""
)
} ?: throw AddSettingsEntryFingerprint.exception
// Initialize the settings menu once the replaced setting entry is clicked.
@@ -98,10 +99,10 @@ object SettingsPatch : BytecodePatch(
"""
invoke-static {v$thisRegister}, $INITIALIZE_SETTINGS_METHOD_DESCRIPTOR
move-result v$usableRegister
if-eqz v$usableRegister, :notrevanced
if-eqz v$usableRegister, :do_not_open
return-void
""",
ExternalLabel("notrevanced", getInstruction(initializeSettingsIndex))
ExternalLabel("do_not_open", getInstruction(initializeSettingsIndex))
)
} ?: throw AdPersonalizationActivityOnCreateFingerprint.exception
}

View File

@@ -1,22 +1,10 @@
package app.revanced.patches.tiktok.misc.settings.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.Opcode
internal object AddSettingsEntryFingerprint : MethodFingerprint(
opcodes = listOf(
Opcode.CONST_CLASS,
Opcode.APUT_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.IGET_OBJECT,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.IGET_OBJECT,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
),
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/SettingNewVersionFragment;") &&
methodDef.name == "onViewCreated"
methodDef.name == "initUnitManger"
}
)

View File

@@ -1,6 +1,5 @@
package app.revanced.patches.tiktok.misc.spoof.sim
import app.revanced.util.findMutableMethodOf
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
@@ -10,8 +9,9 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.tiktok.misc.integrations.IntegrationsPatch
import app.revanced.patches.tiktok.misc.settings.fingerprints.SettingsStatusLoadFingerprint
import app.revanced.patches.tiktok.misc.settings.SettingsPatch
import app.revanced.patches.tiktok.misc.settings.fingerprints.SettingsStatusLoadFingerprint
import app.revanced.util.findMutableMethodOf
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
@@ -39,7 +39,7 @@ object SpoofSimPatch : BytecodePatch() {
)
override fun execute(context: BytecodeContext) {
// Find all api call to check sim information
// Find all api call to check sim information.
buildMap {
context.classes.forEach { classDef ->
classDef.methods.let { methods ->
@@ -81,7 +81,7 @@ object SpoofSimPatch : BytecodePatch() {
}
}
// Enable patch in settings
// Enable patch in settings.
with(SettingsStatusLoadFingerprint.result!!.mutableMethod) {
addInstruction(
0,
@@ -90,7 +90,7 @@ object SpoofSimPatch : BytecodePatch() {
}
}
// Patch Android API and return fake sim information
// Patch Android API and return fake sim information.
private fun MutableMethod.replaceReference(index: Int, replacement: String) {
val resultReg = getInstruction<OneRegisterInstruction>(index + 1).registerA

View File

@@ -28,30 +28,39 @@ internal object CopyVideoUrlResourcePatch : ResourcePatch() {
SwitchPreference(
"revanced_copy_video_url",
StringResource("revanced_copy_video_url_title", "Show copy video URL button"),
StringResource("revanced_copy_video_url_summary_on", "Button is shown. Tap to copy video URL. Tap and hold to copy video URL with timestamp"),
StringResource(
"revanced_copy_video_url_summary_on",
"Button is shown. Tap to copy video URL. Tap and hold to copy video URL with timestamp"
),
StringResource("revanced_copy_video_url_summary_off", "Button is not shown")
),
SwitchPreference(
"revanced_copy_video_url_timestamp",
StringResource("revanced_copy_video_url_timestamp_title", "Show copy timestamp URL button"),
StringResource("revanced_copy_video_url_timestamp_summary_on", "Button is shown. Tap to copy video URL with timestamp. Tap and hold to copy video without timestamp"),
StringResource(
"revanced_copy_video_url_timestamp_summary_on",
"Button is shown. Tap to copy video URL with timestamp. Tap and hold to copy video without timestamp"
),
StringResource("revanced_copy_video_url_timestamp_summary_off", "Button is not shown")
)
),
StringResource("revanced_copy_video_url_preference_screen_summary", "Settings related to copy URL buttons in video player")
StringResource(
"revanced_copy_video_url_preference_screen_summary",
"Settings related to copy URL buttons in video player"
)
)
)
context.copyResources("copyvideourl", ResourceGroup(
resourceDirectoryName = "drawable",
"revanced_yt_copy.xml",
"revanced_yt_copy_timestamp.xml"
)
context.copyResources(
"copyvideourl", ResourceGroup(
resourceDirectoryName = "drawable",
"revanced_yt_copy.xml",
"revanced_yt_copy_timestamp.xml"
)
)
// merge strings
context.mergeStrings("copyvideourl/host/values/strings.xml")
BottomControlsResourcePatch.addControls("copyvideourl/host/layout/${BottomControlsResourcePatch.TARGET_RESOURCE_NAME}")
BottomControlsResourcePatch.addControls("copyvideourl")
}
}

View File

@@ -28,27 +28,35 @@ internal object ExternalDownloadsResourcePatch : ResourcePatch() {
"revanced_external_downloader",
StringResource("revanced_external_downloader_title", "Show external download button"),
StringResource("revanced_external_downloader_summary_on", "Download button shown in player"),
StringResource("revanced_external_downloader_summary_off", "Download button not shown in player")
StringResource(
"revanced_external_downloader_summary_off",
"Download button not shown in player"
)
),
TextPreference(
"revanced_external_downloader_name",
StringResource("revanced_external_downloader_name_title", "Downloader package name"),
StringResource("revanced_external_downloader_name_summary", "Package name of your installed external downloader app, such as NewPipe or Seal"),
StringResource(
"revanced_external_downloader_name_summary",
"Package name of your installed external downloader app, such as NewPipe or Seal"
),
InputType.TEXT
)
),
StringResource("revanced_external_downloader_preference_screen_summary", "Settings for using an external downloader")
StringResource(
"revanced_external_downloader_preference_screen_summary",
"Settings for using an external downloader"
)
)
)
// Copy strings
context.mergeStrings("downloads/host/values/strings.xml")
// Copy resources
context.copyResources("downloads", ResourceGroup("drawable", "revanced_yt_download_button.xml"))
context.copyResources(
"downloads",
ResourceGroup("drawable", "revanced_yt_download_button.xml")
)
// Add download button node
BottomControlsResourcePatch.addControls("downloads/host/layout/${BottomControlsResourcePatch.TARGET_RESOURCE_NAME}")
BottomControlsResourcePatch.addControls("downloads")
}
}

View File

@@ -1,6 +1,5 @@
package app.revanced.patches.youtube.layout.hide.personalinformation
import app.revanced.util.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
@@ -9,10 +8,11 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.youtube.layout.hide.personalinformation.fingerprints.AccountSwitcherAccessibilityLabelFingerprint
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.util.exception
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@Deprecated("This patch is no longer working and will be removed in a future release.")
@Patch(
name = "Hide email address",
description = "Hides the email address in the account switcher.",
dependencies = [IntegrationsPatch::class, HideEmailAddressResourcePatch::class],
compatiblePackages = [

View File

@@ -0,0 +1,78 @@
package app.revanced.patches.youtube.layout.startpage
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.shared.fingerprints.HomeActivityFingerprint
import app.revanced.patches.shared.settings.preference.impl.ArrayResource
import app.revanced.patches.shared.settings.preference.impl.ListPreference
import app.revanced.patches.shared.settings.preference.impl.StringResource
import app.revanced.patches.youtube.layout.startpage.fingerprints.StartActivityFingerprint
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.settings.SettingsPatch
import app.revanced.util.exception
@Patch(
name = "Change start page",
description = "Changes the start page of the app.",
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
compatiblePackages = [
CompatiblePackage(
"com.google.android.youtube"
)
]
)
@Suppress("unused")
object ChangeStartPagePatch : BytecodePatch(
setOf(HomeActivityFingerprint)
) {
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
"Lapp/revanced/integrations/patches/ChangeStartPagePatch;"
override fun execute(context: BytecodeContext) {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
ListPreference(
"revanced_start_page",
StringResource(
"revanced_start_page_title",
"Set start page"
),
ArrayResource(
"revanced_start_page_entries",
listOf(
StringResource("revanced_start_page_home_entry_0", "Default"),
StringResource("revanced_start_page_home_entry_1", "Home"),
StringResource("revanced_start_page_search_entry_2", "Search"),
StringResource("revanced_start_page_subscriptions_entry_3", "Subscriptions"),
StringResource("revanced_start_page_explore_entry_4", "Explore"),
StringResource("revanced_start_page_shorts_entry_5", "Shorts"),
)
),
ArrayResource(
"revanced_start_page_values",
listOf(
StringResource("revanced_start_page_home_value_0", ""),
StringResource("revanced_start_page_home_value_1", "MAIN"),
StringResource("revanced_start_page_search_value_2", "open.search"),
StringResource("revanced_start_page_subscriptions_value_3", "open.subscriptions"),
StringResource("revanced_start_page_explore_value_4", "open.explore"),
StringResource("revanced_start_page_shorts_value_5", "open.shorts"),
)
),
default = ""
)
)
StartActivityFingerprint.resolve(
context,
HomeActivityFingerprint.result?.classDef ?: throw HomeActivityFingerprint.exception
)
StartActivityFingerprint.result?.mutableMethod?.addInstruction(
0,
"invoke-static { p1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->changeIntent(Landroid/content/Intent;)V"
) ?: throw StartActivityFingerprint.exception
}
}

View File

@@ -0,0 +1,7 @@
package app.revanced.patches.youtube.layout.startpage.fingerprints
import app.revanced.patcher.fingerprint.MethodFingerprint
object StartActivityFingerprint : MethodFingerprint(
parameters = listOf("Landroid/content/Intent;"),
)

View File

@@ -125,9 +125,9 @@ object AlternativeThumbnailsPatch : BytecodePatch(
),
SwitchPreference(
"revanced_alt_thumbnail_dearrow_connection_toast",
StringResource("revanced_alt_thumbnail_dearrow_connection_toast_title", "Show toast if API is not available"),
StringResource("revanced_alt_thumbnail_dearrow_connection_toast_summary_on", "Toast shown if DeArrow is not available"),
StringResource("revanced_alt_thumbnail_dearrow_connection_toast_summary_off", "Toast not shown if DeArrow is not available")
StringResource("revanced_alt_thumbnail_dearrow_connection_toast_title", "Show a toast if API is not available"),
StringResource("revanced_alt_thumbnail_dearrow_connection_toast_summary_on", "Toast is shown if DeArrow is not available"),
StringResource("revanced_alt_thumbnail_dearrow_connection_toast_summary_off", "Toast is not shown if DeArrow is not available")
),
TextPreference(
"revanced_alt_thumbnail_dearrow_api_url",
@@ -148,7 +148,7 @@ object AlternativeThumbnailsPatch : BytecodePatch(
),
StringResource(
"revanced_alt_thumbnail_dearrow_about_summary",
"DeArrow provides crowd sourced thumbnails for YouTube videos. " +
"DeArrow provides crowd-sourced thumbnails for YouTube videos. " +
"These thumbnails are often more relevant than those provided by YouTube. " +
"If enabled, video URLs will be sent to the API server and no other data is sent."
+ "\\n\\nTap here to learn more about DeArrow"
@@ -160,8 +160,8 @@ object AlternativeThumbnailsPatch : BytecodePatch(
SwitchPreference(
"revanced_alt_thumbnail_stills",
StringResource("revanced_alt_thumbnail_stills_title", "Enable still video captures"),
StringResource("revanced_alt_thumbnail_stills_summary_on", "Using YouTube video still captures"),
StringResource("revanced_alt_thumbnail_stills_summary_off", "Not using YouTube video still captures")
StringResource("revanced_alt_thumbnail_stills_summary_on", "Using YouTube still video captures"),
StringResource("revanced_alt_thumbnail_stills_summary_off", "Not using YouTube still video captures")
),
ListPreference(
"revanced_alt_thumbnail_stills_time",

View File

@@ -2,6 +2,7 @@ package app.revanced.patches.youtube.misc.gms
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patches.shared.fingerprints.HomeActivityFingerprint
import app.revanced.patches.shared.misc.gms.AbstractGmsCoreSupportPatch
import app.revanced.patches.youtube.layout.buttons.cast.HideCastButtonPatch
import app.revanced.patches.youtube.misc.fix.playback.ClientSpoofPatch
@@ -9,7 +10,6 @@ import app.revanced.patches.youtube.misc.gms.Constants.REVANCED_YOUTUBE_PACKAGE_
import app.revanced.patches.youtube.misc.gms.Constants.YOUTUBE_PACKAGE_NAME
import app.revanced.patches.youtube.misc.gms.GmsCoreSupportResourcePatch.gmsCoreVendorOption
import app.revanced.patches.youtube.misc.gms.fingerprints.*
import app.revanced.patches.youtube.shared.fingerprints.WatchWhileActivityFingerprint
import app.revanced.util.exception
@@ -50,17 +50,17 @@ object GmsCoreSupportPatch : AbstractGmsCoreSupportPatch(
CastDynamiteModuleV2Fingerprint,
CastContextFetchFingerprint,
PrimeMethodFingerprint,
WatchWhileActivityFingerprint
HomeActivityFingerprint,
)
) {
override val gmsCoreVendor by gmsCoreVendorOption
override fun execute(context: BytecodeContext) {
// Check the availability of GmsCore.
WatchWhileActivityFingerprint.result?.mutableMethod?.addInstruction(
HomeActivityFingerprint.result?.mutableMethod?.addInstruction(
0,
"invoke-static {}, Lapp/revanced/integrations/patches/GmsCoreSupport;->checkAvailability()V"
) ?: throw WatchWhileActivityFingerprint.exception
) ?: throw HomeActivityFingerprint.exception
super.execute(context)
}

View File

@@ -16,4 +16,4 @@ object IntegrationsPatch : AbstractIntegrationsPatch(
EmbeddedPlayerFingerprint,
APIPlayerServiceFingerprint,
),
)
)

View File

@@ -11,15 +11,15 @@ import java.io.Closeable
object BottomControlsResourcePatch : ResourcePatch(), Closeable {
internal var bottomUiContainerResourceId: Long = -1
internal const val TARGET_RESOURCE_NAME = "youtube_controls_bottom_ui_container.xml"
private const val TARGET_RESOURCE_NAME = "youtube_controls_bottom_ui_container.xml"
private const val TARGET_RESOURCE = "res/layout/$TARGET_RESOURCE_NAME"
// The element to the left of the element being added.
private var lastLeftOf = "fullscreen_button"
private lateinit var resourceContext: ResourceContext
private lateinit var targetXmlEditor: DomFileEditor
// The element to which to add the new elements to
private var lastLeftOf = "fullscreen_button"
override fun execute(context: ResourceContext) {
resourceContext = context
targetXmlEditor = context.xmlEditor[TARGET_RESOURCE]
@@ -30,46 +30,44 @@ object BottomControlsResourcePatch : ResourcePatch(), Closeable {
/**
* Add new controls to the bottom of the YouTube player.
* @param hostYouTubeControlsBottomUiResourceName The hosting resource name containing the elements.
*
* @param resourceDirectoryName The name of the directory containing the hosting resource.
*/
internal fun addControls(hostYouTubeControlsBottomUiResourceName: String) {
val sourceXmlEditor =
resourceContext.xmlEditor[this::class.java.classLoader.getResourceAsStream(
hostYouTubeControlsBottomUiResourceName
)!!]
fun addControls(resourceDirectoryName: String) {
val sourceXmlEditor = resourceContext.xmlEditor[
this::class.java.classLoader.getResourceAsStream(
"$resourceDirectoryName/host/layout/$TARGET_RESOURCE_NAME"
)!!
]
val targetElement =
"android.support.constraint.ConstraintLayout"
val targetElement = "android.support.constraint.ConstraintLayout"
val hostElements = sourceXmlEditor.file.getElementsByTagName(targetElement).item(0).childNodes
val destinationResourceFile = targetXmlEditor.file
val destinationElement =
destinationResourceFile.getElementsByTagName(targetElement).item(0)
val destinationElement = destinationResourceFile.getElementsByTagName(targetElement).item(0)
for (index in 1 until hostElements.length) {
val element = hostElements.item(index).cloneNode(true)
// if the element has no attributes theres no point to adding it to the destination
// If the element has no attributes there's no point to adding it to the destination.
if (!element.hasAttributes()) continue
// set the elements lastLeftOf attribute to the lastLeftOf value
// Set the elements lastLeftOf attribute to the lastLeftOf value.
val namespace = "@+id"
element.attributes.getNamedItem("yt:layout_constraintRight_toLeftOf").nodeValue =
"$namespace/$lastLeftOf"
// set lastLeftOf attribute to the current element
// Set lastLeftOf attribute to the current element.
val nameSpaceLength = 5
lastLeftOf = element.attributes.getNamedItem("android:id").nodeValue.substring(nameSpaceLength)
// copy the element
// Add the element.
destinationResourceFile.adoptNode(element)
destinationElement.appendChild(element)
}
sourceXmlEditor.close()
}
override fun close() {
targetXmlEditor.close()
}
override fun close() = targetXmlEditor.close()
}

View File

@@ -26,9 +26,9 @@
<string name="revanced_ryd_compact_layout_summary_on">Like button styled for minimum width</string>
<string name="revanced_ryd_compact_layout_summary_off">Like button styled for best appearance</string>
<string name="ryd_toast_on_connection_error_title">Show toast if API is not available</string>
<string name="ryd_toast_on_connection_error_summary_on">Toast shown if ReturnYouTubeDislike API is not available</string>
<string name="ryd_toast_on_connection_error_summary_off">Toast not shown if ReturnYouTubeDislike API is not available</string>
<string name="ryd_toast_on_connection_error_title">Show a toast if API is not available</string>
<string name="ryd_toast_on_connection_error_summary_on">Toast is shown if Return YouTube Dislike is not available</string>
<string name="ryd_toast_on_connection_error_summary_off">Toast is not shown if Return YouTube Dislike is not available</string>
<string name="revanced_ryd_about">About</string>
<string name="revanced_ryd_attribution_title">ReturnYouTubeDislike.com</string>

View File

@@ -14,8 +14,8 @@
<string name="sb_enable_auto_hide_skip_segment_button_sum_on">Skip button hides after a few seconds</string>
<string name="sb_enable_auto_hide_skip_segment_button_sum_off">Skip button displayed for entire segment</string>
<string name="sb_general_skiptoast">Show a toast when skipping automatically</string>
<string name="sb_general_skiptoast_sum_on">Toast shown when a segment is automatically skipped. Tap here to see an example</string>
<string name="sb_general_skiptoast_sum_off">Toast not shown. Tap here to see an example</string>
<string name="sb_general_skiptoast_sum_on">Toast is shown when a segment is automatically skipped. Tap here to see an example</string>
<string name="sb_general_skiptoast_sum_off">Toast is not shown. Tap here to see an example</string>
<string name="sb_general_time_without">Show video length without segments</string>
<string name="sb_general_time_without_sum_on">Video length minus all segments, shown in parentheses next to the full video length</string>
<string name="sb_general_time_without_sum_off">Full video length shown</string>
@@ -35,9 +35,9 @@
<string name="sb_guidelines_popup_open">Show me</string>
<string name="sb_general">General</string>
<string name="sb_toast_on_connection_error_title">Show toast if API is not available</string>
<string name="sb_toast_on_connection_error_summary_on">Toast shown if SponsorBlock API is not available</string>
<string name="sb_toast_on_connection_error_summary_off">Toast not shown if SponsorBlock API is not available</string>
<string name="sb_toast_on_connection_error_title">Show a toast if API is not available</string>
<string name="sb_toast_on_connection_error_summary_on">Toast is shown if SponsorBlock is not available</string>
<string name="sb_toast_on_connection_error_summary_off">Toast is not shown if SponsorBlock is not available</string>
<string name="sb_general_skipcount">Enable skip count tracking</string>
<string name="sb_general_skipcount_sum_on">Lets the SponsorBlock leaderboard know how much time is saved. A message is sent to the leaderboard each time a segment is skipped</string>
<string name="sb_general_skipcount_sum_off">Skip count tracking is not enabled</string>
@@ -176,9 +176,9 @@
<string name="sb_stats_self_saved" formatted="false">You\'ve skipped &lt;b>%s&lt;/b> segments</string>
<string name="sb_stats_self_saved_sum" formatted="false">That\'s &lt;b>%s&lt;/b></string>
<string name="sb_stats_self_saved_reset_title">Reset skipped segments counter?</string>
<string name="sb_stats_saved_hour_format" formatted="false">%d hours %d minutes</string>
<string name="sb_stats_saved_minute_format" formatted="false">%d minutes %d seconds</string>
<string name="sb_stats_saved_second_format" formatted="false">%d seconds</string>
<string name="sb_stats_saved_hour_format" formatted="false">%s hours %s minutes</string>
<string name="sb_stats_saved_minute_format" formatted="false">%s minutes %s seconds</string>
<string name="sb_stats_saved_second_format" formatted="false">%s seconds</string>
<string name="sb_color_dot_label">Color:</string>
<string name="sb_color_changed">Color changed</string>