Compare commits
98 Commits
v1.0.0-dev
...
v2.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb6c805f55 | ||
|
|
c5dfe3e842 | ||
|
|
4290a4e820 | ||
|
|
1f6b450df3 | ||
|
|
d9f05ffdf8 | ||
|
|
ddc693e909 | ||
|
|
a29de19d4c | ||
|
|
c6d50e8450 | ||
|
|
f0aeece867 | ||
|
|
015443d9db | ||
|
|
fde42c5bae | ||
|
|
b4ae564102 | ||
|
|
aabbe110b9 | ||
|
|
35b86c7d78 | ||
|
|
e101af72d4 | ||
|
|
59509a307e | ||
|
|
ccf0218b6c | ||
|
|
d5597fb002 | ||
|
|
0515a500c6 | ||
|
|
636aac1a28 | ||
|
|
8ff6c159fa | ||
|
|
a84766aad9 | ||
|
|
a120be4a79 | ||
|
|
8cba2c0f8f | ||
|
|
579297efa3 | ||
|
|
9094a69be8 | ||
|
|
20c77c1769 | ||
|
|
fcc450efb4 | ||
|
|
f02e8b13ac | ||
|
|
4c4f7adbce | ||
|
|
6662be893c | ||
|
|
41cf8e3fa9 | ||
|
|
aec1602a39 | ||
|
|
e00281819c | ||
|
|
48cf778d56 | ||
|
|
e6506bd4b4 | ||
|
|
3a29b6db64 | ||
|
|
cecee8f70e | ||
|
|
e5cad5f022 | ||
|
|
85e584f65a | ||
|
|
78fe1b67ea | ||
|
|
9c33d67d80 | ||
|
|
16d234e761 | ||
|
|
635f65e5a1 | ||
|
|
3ef5d2a29d | ||
|
|
5797e15b06 | ||
|
|
c987357959 | ||
|
|
e452969cdd | ||
|
|
7484f52bc4 | ||
|
|
938dd030b0 | ||
|
|
990806118f | ||
|
|
6ae1e1d0aa | ||
|
|
ed6a0e5403 | ||
|
|
d48a8e93a2 | ||
|
|
51f0a011a7 | ||
|
|
0a6a9e9f4b | ||
|
|
8669a22689 | ||
|
|
1e44644c73 | ||
|
|
5c31dd409f | ||
|
|
354a1c81ab | ||
|
|
76fb0b3797 | ||
|
|
06ea9cb23f | ||
|
|
efd7c4c8eb | ||
|
|
ee80ef909f | ||
|
|
0e76fbfc1b | ||
|
|
14b520395e | ||
|
|
0f204afa2a | ||
|
|
d71290f6f1 | ||
|
|
114e78171f | ||
|
|
0cfead3914 | ||
|
|
4a20de0410 | ||
|
|
f69bd0e636 | ||
|
|
eed04277d1 | ||
|
|
df05aecdcf | ||
|
|
680371ab30 | ||
|
|
a465f89354 | ||
|
|
4c633847b2 | ||
|
|
75f03dbf28 | ||
|
|
9c2934d617 | ||
|
|
5e94f464fc | ||
|
|
a3f5c11050 | ||
|
|
09e837d2e0 | ||
|
|
fcb80dc71f | ||
|
|
a63446e0e2 | ||
|
|
d3873e6568 | ||
|
|
8105cc0ac6 | ||
|
|
433ea02c04 | ||
|
|
c97feb1cd8 | ||
|
|
aa365d684a | ||
|
|
285aac5679 | ||
|
|
c53222ce69 | ||
|
|
21ae984acb | ||
|
|
d1b1e5a6cd | ||
|
|
0e465eb7f8 | ||
|
|
5b2d834a3e | ||
|
|
0aabe37152 | ||
|
|
89bb26b09c | ||
|
|
4e85cc4cbb |
8
.github/workflows/release.yml
vendored
@@ -12,7 +12,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@@ -28,12 +28,14 @@ jobs:
|
|||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: "lts/*"
|
node-version: "lts/*"
|
||||||
- name: Make gradlew executable
|
- name: Setup Android SDK
|
||||||
run: chmod +x gradlew
|
uses: android-actions/setup-android@v2
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: ./gradlew build clean
|
run: ./gradlew build clean
|
||||||
|
- name: Install Android build-tools
|
||||||
|
run: sdkmanager "build-tools;32.0.0"
|
||||||
- name: Setup semantic-release
|
- name: Setup semantic-release
|
||||||
run: npm install -g semantic-release @semantic-release/git @semantic-release/changelog gradle-semantic-release-plugin -D
|
run: npm install -g semantic-release @semantic-release/git @semantic-release/changelog gradle-semantic-release-plugin -D
|
||||||
- name: Release
|
- name: Release
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
"assets": [
|
"assets": [
|
||||||
{
|
{
|
||||||
"path": "build/libs/*.jar"
|
"path": "build/libs/*.jar"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "build/libs/*.dex"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
358
CHANGELOG.md
@@ -1,3 +1,361 @@
|
|||||||
|
## [2.0.2](https://github.com/revanced/revanced-patches/compare/v2.0.1...v2.0.2) (2022-06-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* some more refactoring of integrations, add hide-watermark patch ([#63](https://github.com/revanced/revanced-patches/issues/63)) ([feb09c5](https://github.com/revanced/revanced-patches/commit/feb09c56f475e2537a67d3636b08737848158a8e))
|
||||||
|
|
||||||
|
## [2.0.1](https://github.com/revanced/revanced-patches/compare/v2.0.0...v2.0.1) (2022-06-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* invalid string in strings list ([f08b53b](https://github.com/revanced/revanced-patches/commit/f08b53b07d93bd8ac6e7da376ea6e6023e53076e))
|
||||||
|
* migrate to new `proxy` api ([db32ffe](https://github.com/revanced/revanced-patches/commit/db32ffe56a8e73177bef724ee10eda9a28b367b8))
|
||||||
|
|
||||||
|
# [2.0.0](https://github.com/revanced/revanced-patches/compare/v1.11.0...v2.0.0) (2022-06-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Code Refactoring
|
||||||
|
|
||||||
|
* migrate from `Signature` to `Fingerprint` ([084078e](https://github.com/revanced/revanced-patches/commit/084078e7f1852ccd2045e3fa8aedc25a7fd5faa8))
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* Not backwards compatible, since a lot of classes where renamed.
|
||||||
|
|
||||||
|
# [1.11.0](https://github.com/revanced/revanced-patches/compare/v1.10.5...v1.11.0) (2022-06-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add youtube version 17.24.35 ([ec626cc](https://github.com/revanced/revanced-patches/commit/ec626ccfa2bcf14b722d08110382de009a1c12b4))
|
||||||
|
* add youtube version 17.24.35 ([adc60a6](https://github.com/revanced/revanced-patches/commit/adc60a6fa09f6a21800ba51b8ca888d11a17e870))
|
||||||
|
|
||||||
|
## [1.10.5](https://github.com/revanced/revanced-patches/compare/v1.10.4...v1.10.5) (2022-06-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* put back proper variable ([#61](https://github.com/revanced/revanced-patches/issues/61)) ([d26c423](https://github.com/revanced/revanced-patches/commit/d26c4233031fd418eb37c8f05e9bc1857e0572e6))
|
||||||
|
|
||||||
|
## [1.10.4](https://github.com/revanced/revanced-patches/compare/v1.10.3...v1.10.4) (2022-06-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* missing brackets at inlining ([8936c8a](https://github.com/revanced/revanced-patches/commit/8936c8aaedb56817cda5eec5f4a8c32f433862aa))
|
||||||
|
|
||||||
|
## [1.10.3](https://github.com/revanced/revanced-patches/compare/v1.10.2...v1.10.3) (2022-06-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* get create button view register by more reliable means ([#59](https://github.com/revanced/revanced-patches/issues/59)) ([6ab821e](https://github.com/revanced/revanced-patches/commit/6ab821e377176f4e9f1b7ec2b58a924fa40299db))
|
||||||
|
|
||||||
|
## [1.10.2](https://github.com/revanced/revanced-patches/compare/v1.10.1...v1.10.2) (2022-06-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* `disable-create-button` not working with prebuilt jar file ([#55](https://github.com/revanced/revanced-patches/issues/55)) ([78be64a](https://github.com/revanced/revanced-patches/commit/78be64accc2023281c0c376849cdb0213622dc5c))
|
||||||
|
|
||||||
|
## [1.10.1](https://github.com/revanced/revanced-patches/compare/v1.10.0...v1.10.1) (2022-06-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* patcher not propagating dexlib ([980c486](https://github.com/revanced/revanced-patches/commit/980c48673259496d793bc7f864ad355188dcf7b6))
|
||||||
|
* update patcher version ([e3d0bb7](https://github.com/revanced/revanced-patches/commit/e3d0bb7ee1923ea996cf637267c62d233a74c7fa))
|
||||||
|
|
||||||
|
# [1.10.0](https://github.com/revanced/revanced-patches/compare/v1.9.1...v1.10.0) (2022-06-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add compatibility for YouTube v17.23.36 and v17.24.34 ([1812bc3](https://github.com/revanced/revanced-patches/commit/1812bc39e0e88f1ab02ae8127e9000780eedf49c))
|
||||||
|
|
||||||
|
## [1.9.1](https://github.com/revanced/revanced-patches/compare/v1.9.0...v1.9.1) (2022-06-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* update patcher version ([5f54bc9](https://github.com/revanced/revanced-patches/commit/5f54bc9aa8fd8b83448141a9b05746e3e977369d))
|
||||||
|
|
||||||
|
# [1.9.0](https://github.com/revanced/revanced-patches/compare/v1.8.2...v1.9.0) (2022-06-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* use `install` mode by default ([c2b2993](https://github.com/revanced/revanced-patches/commit/c2b299336a984d66a2d066e5ebe9c4f9bee5c2aa))
|
||||||
|
|
||||||
|
## [1.8.2](https://github.com/revanced/revanced-patches/compare/v1.8.1...v1.8.2) (2022-06-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* migrate to breaking changes from patcher ([2c0a419](https://github.com/revanced/revanced-patches/commit/2c0a4196fed2fbdcd454ed882b720898d3050c51))
|
||||||
|
* old usage of `toInstructions` extension method ([65ddd52](https://github.com/revanced/revanced-patches/commit/65ddd522dca19e0590d9cb6fdb2d85ad7b98481e))
|
||||||
|
|
||||||
|
## [1.8.1](https://github.com/revanced/revanced-patches/compare/v1.8.0...v1.8.1) (2022-06-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add execute permission to `./gradlew` file ([ff7a560](https://github.com/revanced/revanced-patches/commit/ff7a5602f68428111fea6c60cbea694592039ef1))
|
||||||
|
|
||||||
|
# [1.8.0](https://github.com/revanced/revanced-patches/compare/v1.7.0...v1.8.0) (2022-06-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* bump compatibility of patches for Youtube to v17.23.35 ([3748d05](https://github.com/revanced/revanced-patches/commit/3748d0533e62a8871ab2202ce9b61170a90dae62))
|
||||||
|
|
||||||
|
# [1.7.0](https://github.com/revanced/revanced-patches/compare/v1.6.4...v1.7.0) (2022-06-20)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* `disable-fullscreen-panels` patch ([3bf0561](https://github.com/revanced/revanced-patches/commit/3bf056163500b006d1a20c5f3a3e0c92fec13bd8))
|
||||||
|
|
||||||
|
## [1.6.4](https://github.com/revanced/revanced-patches/compare/v1.6.3...v1.6.4) (2022-06-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* update patcher version ([#35](https://github.com/revanced/revanced-patches/issues/35)) ([1a379df](https://github.com/revanced/revanced-patches/commit/1a379dfd974b9f92d4bd0d5d7a4711eb6d1060b3)), closes [#34](https://github.com/revanced/revanced-patches/issues/34)
|
||||||
|
|
||||||
|
## [1.6.3](https://github.com/revanced/revanced-patches/compare/v1.6.2...v1.6.3) (2022-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* wrong dex path ([170fbbb](https://github.com/revanced/revanced-patches/commit/170fbbb99e4a2dbe3e0febe44d07a692aa9d7224))
|
||||||
|
|
||||||
|
## [1.6.2](https://github.com/revanced/revanced-patches/compare/v1.6.1...v1.6.2) (2022-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* broken gradle task ([91483a8](https://github.com/revanced/revanced-patches/commit/91483a8fbf92559d079dc52f846f5f871f5d6b5c))
|
||||||
|
|
||||||
|
## [1.6.1](https://github.com/revanced/revanced-patches/compare/v1.6.0...v1.6.1) (2022-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* broken gradle task ([4d07961](https://github.com/revanced/revanced-patches/commit/4d07961c8afd24da7f8879d11419147f2e100f05))
|
||||||
|
|
||||||
|
# [1.6.0](https://github.com/revanced/revanced-patches/compare/v1.5.3...v1.6.0) (2022-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* broken gradle task ([28e3f55](https://github.com/revanced/revanced-patches/commit/28e3f554ea6a7144416523fe48ce7adbb613b263))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* generate dex files using gradle task ([c34c1be](https://github.com/revanced/revanced-patches/commit/c34c1be21f50b4f720a7cd81e0dfe5ef6330caab))
|
||||||
|
|
||||||
|
## [1.5.3](https://github.com/revanced/revanced-patches/compare/v1.5.2...v1.5.3) (2022-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* forgot about this ([7102a25](https://github.com/revanced/revanced-patches/commit/7102a25dc618f19b324b01870d23f5418f375b2a))
|
||||||
|
|
||||||
|
## [1.5.2](https://github.com/revanced/revanced-patches/compare/v1.5.1...v1.5.2) (2022-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* dummy task for Gradle semantic-release plugin ([f6a8911](https://github.com/revanced/revanced-patches/commit/f6a8911906dfe52fcdb685daf7a02d6d0052cba9))
|
||||||
|
* releases ([30d5c9a](https://github.com/revanced/revanced-patches/commit/30d5c9a67ccf88ca6ac00d0a9f2a2e330f8092dd))
|
||||||
|
|
||||||
|
## [1.5.1](https://github.com/revanced/revanced-patches/compare/v1.5.0...v1.5.1) (2022-06-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Reverts
|
||||||
|
|
||||||
|
* Revert "Changed app name to ReVanced (#21)" (#24) ([70a48c5](https://github.com/revanced/revanced-patches/commit/70a48c5f35cd236612352a1dbbf50487625e6e96)), closes [#21](https://github.com/revanced/revanced-patches/issues/21) [#24](https://github.com/revanced/revanced-patches/issues/24)
|
||||||
|
|
||||||
|
# [1.5.0](https://github.com/revanced/revanced-patches/compare/v1.4.0...v1.5.0) (2022-06-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* sync version ([6170e36](https://github.com/revanced/revanced-patches/commit/6170e3689d9c8998be94a8464352af620cccd11b))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* `hide-cast-button` patch ([2cd531e](https://github.com/revanced/revanced-patches/commit/2cd531eb5a334f3cf91cba4556f07e863cd9ec1b))
|
||||||
|
|
||||||
|
# [1.4.0](https://github.com/revanced/revanced-patches/compare/v1.3.1...v1.4.0) (2022-06-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add size `48px` for `custom-branding` patch ([f81872b](https://github.com/revanced/revanced-patches/commit/f81872b8e41da215517fdb59364130d8ce681607))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* `premium-heading` patch ([78913bf](https://github.com/revanced/revanced-patches/commit/78913bf1e80f5b91d0dee506fdfe3f875e8e6988))
|
||||||
|
|
||||||
|
## [1.3.1](https://github.com/revanced/revanced-patches/compare/v1.3.0...v1.3.1) (2022-06-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* `custom-branding` patch failing to get resources ([efb6d4c](https://github.com/revanced/revanced-patches/commit/efb6d4c2be515185fc9bd29c40ce202f0d684cee))
|
||||||
|
|
||||||
|
# [1.3.0](https://github.com/revanced/revanced-patches/compare/v1.2.2...v1.3.0) (2022-06-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* `custom-branding` patch ([0d65ea8](https://github.com/revanced/revanced-patches/commit/0d65ea8cdb0e02287f6be6855cd3d28823a61e70))
|
||||||
|
|
||||||
|
## [1.2.2](https://github.com/revanced/revanced-patches/compare/v1.2.1...v1.2.2) (2022-06-13)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* environment variable not found in gradle build script ([0da15fb](https://github.com/revanced/revanced-patches/commit/0da15fb0effac0566d080d7b85e9fbe46c3dd34d))
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/revanced/revanced-patches/compare/v1.2.0...v1.2.1) (2022-06-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Performance Improvements
|
||||||
|
|
||||||
|
* fix high battery consumption due to chromecast not working with `microg` ([dd8b01a](https://github.com/revanced/revanced-patches/commit/dd8b01a5c5d75b00ea4d04ce35bc43942c1b0409))
|
||||||
|
|
||||||
|
# [1.2.0](https://github.com/revanced/revanced-patches/compare/v1.1.0...v1.2.0) (2022-06-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* migrate to `include` annotation ([110bbf1](https://github.com/revanced/revanced-patches/commit/110bbf143a9cec8dce1f0416cff40f8d93055e96))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* `microg-patch` ([48bbd57](https://github.com/revanced/revanced-patches/commit/48bbd574a52c8bf6834b26facfe7384b830f944a))
|
||||||
|
* updated all patches to support v17.22.36 of `com.android.google.youtube` ([e12dc11](https://github.com/revanced/revanced-patches/commit/e12dc11b670c2b0c414741616e0a646e8421e418))
|
||||||
|
|
||||||
|
# [1.1.0](https://github.com/revanced/revanced-patches/compare/v1.0.0...v1.1.0) (2022-06-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* generate & upload dex files ([#18](https://github.com/revanced/revanced-patches/issues/18)) ([e6f5355](https://github.com/revanced/revanced-patches/commit/e6f53553a98c164c4eb926fb273358ed506e00a4))
|
||||||
|
|
||||||
|
# 1.0.0 (2022-06-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* `create-button-signature` ([a173f6e](https://github.com/revanced/revanced-patches/commit/a173f6e5a7e65943657e2072e8a72a4a680e5277))
|
||||||
|
* `enable-seekbar-tapping` patch ([52fd726](https://github.com/revanced/revanced-patches/commit/52fd726d9b0d2efbd0f9742fc84ad01ccdcff168))
|
||||||
|
* `Index` in wrong package ([2f9360f](https://github.com/revanced/revanced-patches/commit/2f9360f57cc8415564534fbbd8bd5e2a83a1b629))
|
||||||
|
* `minimized-playback` & `old-quality-layout` wrong opcodes ([b45d175](https://github.com/revanced/revanced-patches/commit/b45d175c6f1ece6da894ab16128c2644d262c9c7))
|
||||||
|
* `minimized-playback` patch ([55677a4](https://github.com/revanced/revanced-patches/commit/55677a44ff965c0b92c3f1d771bd68c12c142ad4))
|
||||||
|
* `SignatureChecker` not handling nullable field `methodMetadata` ([17bcf78](https://github.com/revanced/revanced-patches/commit/17bcf786a85ccf1f7d9f5a66a044a3c26def09bb))
|
||||||
|
* accidentally removed code in refactor ([0077e26](https://github.com/revanced/revanced-patches/commit/0077e26d23cc112b671a41614a55348fac2c88ca))
|
||||||
|
* add missing `trimIndent()` to string literals ([76d3c71](https://github.com/revanced/revanced-patches/commit/76d3c71b67edebd79f2cdb1bb28e4d2969d72223))
|
||||||
|
* add missing opcode for `create-button-method` ([0a398ef](https://github.com/revanced/revanced-patches/commit/0a398ef364f91a0dd9608df1a036a2515476ccf2))
|
||||||
|
* attempt on all patches ([3395d69](https://github.com/revanced/revanced-patches/commit/3395d69747103a4bdf314297aa0bfa6ef6a0fc36))
|
||||||
|
* breaking changes by `revanced-patcher` dependency ([e12e484](https://github.com/revanced/revanced-patches/commit/e12e484e3796c5c9c8505b677838cdf8432f2e79))
|
||||||
|
* breaking changes by `revanced-patcher` dependency ([7e485b4](https://github.com/revanced/revanced-patches/commit/7e485b4ffe204d724809aeb9bd9f693a35ded94d))
|
||||||
|
* breaking changes of the patcher ([1a49bbd](https://github.com/revanced/revanced-patches/commit/1a49bbdbc4ff6f427934259536218e161908b449))
|
||||||
|
* breaking patcher changes ([50f9cc5](https://github.com/revanced/revanced-patches/commit/50f9cc52acfd5bc23330ecd23d8d85678a9d3eee))
|
||||||
|
* breaking patcher changes ([cbb9e2c](https://github.com/revanced/revanced-patches/commit/cbb9e2cd1fa829e1d1dd92dbd40131b11ae6a05b))
|
||||||
|
* breaking patcher changes ([581d1b0](https://github.com/revanced/revanced-patches/commit/581d1b0ca7d15adcdb1ab6116ef035acfe701757))
|
||||||
|
* bugfixes in `microg` ([a43b33b](https://github.com/revanced/revanced-patches/commit/a43b33bdbb2b36e0a8f991fa11dfeeec34de01f9))
|
||||||
|
* clean after building ([a2df3fb](https://github.com/revanced/revanced-patches/commit/a2df3fbc9761b07f3010542fa8684ade00e4dc91))
|
||||||
|
* disable `hide-suggestions-patch` patch until fixed ([99099ea](https://github.com/revanced/revanced-patches/commit/99099ea0bc12f5f25896967db642442df69d0c4f))
|
||||||
|
* incorrect endIndex (fixed in Patcher) ([424788e](https://github.com/revanced/revanced-patches/commit/424788edd777110cdaff97500556d18628f33385))
|
||||||
|
* loop in `amoled` patch ([c4c86b6](https://github.com/revanced/revanced-patches/commit/c4c86b65fd8b2463c1d86ad2e46ec9f08e60d47c))
|
||||||
|
* migrate patches to latest patcher api changes ([8a0ee03](https://github.com/revanced/revanced-patches/commit/8a0ee03a71cf4a000c9a7246d0e64ed8291a5127))
|
||||||
|
* missing extension method `doRecursively` ([e9c9460](https://github.com/revanced/revanced-patches/commit/e9c946008ee912652d288e515b83b52ae2d239d8))
|
||||||
|
* modified opcode for `show-video-ads-constructor` ([a0dcea3](https://github.com/revanced/revanced-patches/commit/a0dcea3a13f68cae449dfaf445b542e339c83ff0))
|
||||||
|
* multiple bugs in patches ([e37201d](https://github.com/revanced/revanced-patches/commit/e37201d0ceef474696857a0d8845950c888194d0))
|
||||||
|
* name for `IntegrationsPatch` ([e46ef02](https://github.com/revanced/revanced-patches/commit/e46ef02302825d62b57912b2747a25f858036bb7))
|
||||||
|
* print instruction index of warning ([9e29aee](https://github.com/revanced/revanced-patches/commit/9e29aeeeff222412f6c45cf7e4879f8ec53ca6ee))
|
||||||
|
* publish releases ([83916f9](https://github.com/revanced/revanced-patches/commit/83916f96d27989dcbb35c0ba6ef326a16b470501))
|
||||||
|
* remove `HideSuggestionsPatch` from `Index` ([f32e474](https://github.com/revanced/revanced-patches/commit/f32e4747b512c675b807ff5eebfd0b8e66173fba))
|
||||||
|
* remove unused patches ([d12e92a](https://github.com/revanced/revanced-patches/commit/d12e92aead677fefa9dcb48748d783225b65fab1))
|
||||||
|
* signature checker with changes of patcher ([e82459d](https://github.com/revanced/revanced-patches/commit/e82459d37759e1a5a860d3e7fcdf69d95b06858e))
|
||||||
|
* spelling mistake ([52f9147](https://github.com/revanced/revanced-patches/commit/52f9147ee8d591f786397d174dc02a141d9250a9))
|
||||||
|
* tests failing ([102793f](https://github.com/revanced/revanced-patches/commit/102793f24f8bf7c7fd254968b29d65da7b2b962f))
|
||||||
|
* update `HomeAdsPatch` ([62f1801](https://github.com/revanced/revanced-patches/commit/62f1801e9cbee53c0be3413c245161bd941e4aec))
|
||||||
|
* update patches ([91b8ec8](https://github.com/revanced/revanced-patches/commit/91b8ec81f33417798546c32db708fe09ada3930c))
|
||||||
|
* use the latest version of patcher dependency ([fe4a439](https://github.com/revanced/revanced-patches/commit/fe4a439cb2bc5e385ae13e8e155f25bb15e74633))
|
||||||
|
* version in package metadata of music ([b299205](https://github.com/revanced/revanced-patches/commit/b299205aa7cde82f1f55fc598de3ff8d80b8bcb0))
|
||||||
|
* **VideoAds:** remove `istore1` opcode ([dc4ec57](https://github.com/revanced/revanced-patches/commit/dc4ec574414c5df959efa0ca8f1cd39a812fedf8))
|
||||||
|
* write while reading resources and remove checking for "." in resource extensions ([7bc6094](https://github.com/revanced/revanced-patches/commit/7bc60943cb2350e89dac091ec9c98c5effd0b8a9))
|
||||||
|
* wrong access flag in signature for `Create button patch` ([9fbb89d](https://github.com/revanced/revanced-patches/commit/9fbb89d05336a256a0759eea6095e073946c45e5))
|
||||||
|
* wrong annotation and signature in patches ([a0fdee8](https://github.com/revanced/revanced-patches/commit/a0fdee81a6d6773603520e7c3040ae8637642d58))
|
||||||
|
* wrong opcode for `create-button-method` ([3214650](https://github.com/revanced/revanced-patches/commit/32146506f139aebc44cd5faffb7706b8b9c21c3d))
|
||||||
|
* wrong opcode pattern for `create-button-method` ([f4d8a85](https://github.com/revanced/revanced-patches/commit/f4d8a8525bc64b90748b21979d463977a21dcd85))
|
||||||
|
* wrong opcode pattern for `enable-seekbar-tapping-signature` ([1d83395](https://github.com/revanced/revanced-patches/commit/1d833957ed3e01188770c85e3d84e483419bd797))
|
||||||
|
* wrong opcode pattern for signature in `Hide suggestions patch` ([535aee0](https://github.com/revanced/revanced-patches/commit/535aee08408b990c80f5966c13fa84666a8b35d0))
|
||||||
|
* wrong patches in `upgrade-tab-remover` ([5182290](https://github.com/revanced/revanced-patches/commit/518229031ceca049ad790f7b77b19405d39f0ce1))
|
||||||
|
* wrong signature for `hide-reels-signature` ([2d9ff2a](https://github.com/revanced/revanced-patches/commit/2d9ff2af0a991d7721f3741187716a3b08bb4029))
|
||||||
|
* wrong signatures for patch `Old Quality Layout Patch` ([823e503](https://github.com/revanced/revanced-patches/commit/823e503d84037bdf27b09f17e63383f963c76854))
|
||||||
|
* wrong versions of patches ([a112b22](https://github.com/revanced/revanced-patches/commit/a112b22ce6e685204caab6f95f511e26ef95806b))
|
||||||
|
|
||||||
|
|
||||||
|
### Code Refactoring
|
||||||
|
|
||||||
|
* Rename `net.revanced` to `app.revanced` ([68ea89f](https://github.com/revanced/revanced-patches/commit/68ea89f15e9ea077df0d0ac20a40b735bb5ae26c))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* `Dependencies` annotation ([85806bb](https://github.com/revanced/revanced-patches/commit/85806bb355e342ecb33d4ee1e76f9edf89b2c2ee))
|
||||||
|
* `GeneralBytecodeAds` and `GeneralResourceAds` patch ([f99bbef](https://github.com/revanced/revanced-patches/commit/f99bbef4c911ac2492166c7a3792ea11ffceffab))
|
||||||
|
* `hide-shorts-button` patch ([88352ee](https://github.com/revanced/revanced-patches/commit/88352ee6ecd23faa4a7fd9f7495e67fa1d3e33bd))
|
||||||
|
* `tastebuilder-remover` for music ([a6aeca3](https://github.com/revanced/revanced-patches/commit/a6aeca31bd80b8c4a8acd071e22faca6e136bdb0))
|
||||||
|
* Add (WIP) Signature Checker ([ae4c7b2](https://github.com/revanced/revanced-patches/commit/ae4c7b29f211c461de460f97f3a8656e795adafb))
|
||||||
|
* add `amoled` patch ([d61bac4](https://github.com/revanced/revanced-patches/commit/d61bac4f8243d0ef72ca91c7c1d5facd858d515e))
|
||||||
|
* add home ads patch ([36cddd1](https://github.com/revanced/revanced-patches/commit/36cddd1488683e19e2b927e34c80a4f0f3cace35))
|
||||||
|
* add patches compatibility to the newest version ([799401d](https://github.com/revanced/revanced-patches/commit/799401ddf99da0aaa5f52c39d3d3d4061370fd75))
|
||||||
|
* add publishing to package registry ([b475e09](https://github.com/revanced/revanced-patches/commit/b475e09577db4dda7bbb45dbf170d78772834a6d))
|
||||||
|
* add semantic-release ([d60f1d0](https://github.com/revanced/revanced-patches/commit/d60f1d06798d312b158b71691ecc87e828dccbc1))
|
||||||
|
* added `codecs-unlock` patch ([e5fd7ce](https://github.com/revanced/revanced-patches/commit/e5fd7cece94b1ff5342178f59b29576db806e0f6))
|
||||||
|
* begin `MicroG Patch` ([91474ba](https://github.com/revanced/revanced-patches/commit/91474ba07376c13e7a71685dfd8b6e6913ed5ee9))
|
||||||
|
* display metadata for each signature in `SignatureChecker` ([736a71f](https://github.com/revanced/revanced-patches/commit/736a71fac21a32dbb1eef9c3a9f0d3005e7d9ca0))
|
||||||
|
* get required register dynamically ([0924ca2](https://github.com/revanced/revanced-patches/commit/0924ca2ad30ae865dcc0fd484cb0da517e827352))
|
||||||
|
* Initial commit ([bee5f2f](https://github.com/revanced/revanced-patches/commit/bee5f2faed882271ed059b0435e6e1aa91f93dbd))
|
||||||
|
* integrations patch ([19c0b0d](https://github.com/revanced/revanced-patches/commit/19c0b0d194bb97c7248ea7a9b081176961653b9d))
|
||||||
|
* migrate to dalvik patches ([e088c67](https://github.com/revanced/revanced-patches/commit/e088c671081bcf75586ccc1c4bdbed9366e93874))
|
||||||
|
* MinimizedPlayback, CreateButtonRemover ([cc08c6c](https://github.com/revanced/revanced-patches/commit/cc08c6c3d38879dd4672ec671631b34aa2e3cc77))
|
||||||
|
* OldQualityLayout, HideSuggestions, HideReels, EnableSeekbarTapping ([04a7cff](https://github.com/revanced/revanced-patches/commit/04a7cfff20d2734b1c92713de4e7e08a3b93ee85))
|
||||||
|
* Patches for YouTube Music ([b60c9d3](https://github.com/revanced/revanced-patches/commit/b60c9d33b611bb4d5b55bb419652bc14b0309792))
|
||||||
|
* remove obsolete patch `Hide suggestions patch` ([e65c6f2](https://github.com/revanced/revanced-patches/commit/e65c6f240ed23a54271d20a90fc57ec65cafc02d))
|
||||||
|
* update MicroG patch to latest version ([c24f806](https://github.com/revanced/revanced-patches/commit/c24f8063a04f89aea2d2f7087a435738de7dfeae))
|
||||||
|
* update patches to latest version ([bad25de](https://github.com/revanced/revanced-patches/commit/bad25dec1d73137f8b7a1bf4daaceb2279b4d48c))
|
||||||
|
* use supplier instead of KClass ([08af6e5](https://github.com/revanced/revanced-patches/commit/08af6e54af79ef9ef4fb3372a348ce9b6fba4d20))
|
||||||
|
* use supplier instead of KClass ([91aa019](https://github.com/revanced/revanced-patches/commit/91aa019f8d3d87fbf7affeb7abc2b02ba87af5c3))
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* signature of patches was changed
|
||||||
|
* signature of patches was changed
|
||||||
|
* Package name was changed from "net.revanced" to "app.revanced"
|
||||||
|
|
||||||
|
# [1.0.0-dev.16](https://github.com/revanced/revanced-patches/compare/v1.0.0-dev.15...v1.0.0-dev.16) (2022-06-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add patches compatibility to the newest version ([799401d](https://github.com/revanced/revanced-patches/commit/799401ddf99da0aaa5f52c39d3d3d4061370fd75))
|
||||||
|
|
||||||
# [1.0.0-dev.15](https://github.com/revanced/revanced-patches/compare/v1.0.0-dev.14...v1.0.0-dev.15) (2022-06-05)
|
# [1.0.0-dev.15](https://github.com/revanced/revanced-patches/compare/v1.0.0-dev.14...v1.0.0-dev.15) (2022-06-05)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
# revanced-patches
|
Repo for all ReVanced patches
|
||||||
Repo for all ReVanced patches
|
|
||||||
|
|||||||
@@ -1,59 +1,60 @@
|
|||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "1.6.21"
|
kotlin("jvm") version "1.7.0"
|
||||||
java
|
|
||||||
`maven-publish`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "app.revanced"
|
group = "app.revanced"
|
||||||
|
|
||||||
|
val githubUsername: String = project.findProperty("gpr.user") as? String ?: System.getenv("GITHUB_ACTOR")
|
||||||
|
val githubPassword: String = project.findProperty("gpr.key") as? String ?: System.getenv("GITHUB_TOKEN")
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
maven {
|
maven {
|
||||||
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher") // note the "r"!
|
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
|
||||||
credentials {
|
credentials {
|
||||||
// DO NOT set these variables in the project's gradle.properties.
|
username = githubUsername
|
||||||
// Instead, you should set them in:
|
password = githubPassword
|
||||||
// Windows: %homepath%\.gradle\gradle.properties
|
|
||||||
// Linux: ~/.gradle/gradle.properties
|
|
||||||
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR") // DO NOT CHANGE!
|
|
||||||
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN") // DO NOT CHANGE!
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.21")
|
implementation(kotlin("stdlib"))
|
||||||
|
|
||||||
implementation("app.revanced:revanced-patcher:1.0.0-dev.18")
|
implementation("app.revanced:revanced-patcher:2.0.1")
|
||||||
implementation("org.jetbrains.kotlin:kotlin-reflect:1.6.21")
|
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
tasks {
|
||||||
withSourcesJar()
|
register<DefaultTask>("generateDex") {
|
||||||
withJavadocJar()
|
description = "Generate dex files from build"
|
||||||
}
|
dependsOn(build)
|
||||||
|
|
||||||
val isGitHubCI = System.getenv("GITHUB_ACTOR") != null
|
doLast {
|
||||||
|
val androidHome = System.getenv("ANDROID_HOME") ?: throw GradleException("ANDROID_HOME not found")
|
||||||
|
val d8 = "${androidHome}/build-tools/32.0.0/d8"
|
||||||
|
val input = configurations.archives.get().allArtifacts.files.files.first().absolutePath
|
||||||
|
val output = input.replace(".jar", ".dex")
|
||||||
|
val work = File("${buildDir}/libs")
|
||||||
|
|
||||||
publishing {
|
exec {
|
||||||
repositories {
|
workingDir = work
|
||||||
if (isGitHubCI) {
|
commandLine = listOf(d8, input)
|
||||||
maven {
|
}
|
||||||
name = "GitHubPackages"
|
|
||||||
url = uri("https://maven.pkg.github.com/revanced/revanced-patches") // note the "s"!
|
exec {
|
||||||
credentials {
|
workingDir = work
|
||||||
username = System.getenv("GITHUB_ACTOR")
|
commandLine = listOf("mv", "classes.dex", output)
|
||||||
password = System.getenv("GITHUB_TOKEN")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
mavenLocal()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
publications {
|
// Dummy task to fix the Gradle semantic-release plugin.
|
||||||
register<MavenPublication>("gpr") {
|
// Remove this if you forked it to support building only.
|
||||||
from(components["java"])
|
// Tracking issue: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
||||||
}
|
register<DefaultTask>("publish") {
|
||||||
|
group = "publish"
|
||||||
|
description = "Dummy task"
|
||||||
|
dependsOn(named("generateDex"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 1.0.0-dev.15
|
version = 2.0.2
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ internal fun MutableMethodImplementation.injectHideCall(
|
|||||||
) {
|
) {
|
||||||
this.addInstruction(
|
this.addInstruction(
|
||||||
index,
|
index,
|
||||||
"invoke-static { v$register }, Lfi/razerman/youtube/XAdRemover;->HideView(Landroid/view/View;)V".toInstruction()
|
"invoke-static { v$register }, Lapp/revanced/integrations/patches/HideHomeAdsPatch;->HideHomeAds(Landroid/view/View;)V".toInstruction()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,18 +19,18 @@ internal fun Node.doRecursively(action: (Node) -> Unit) {
|
|||||||
for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action)
|
for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun String.startsWithAny(vararg prefix: String): Boolean {
|
internal fun String.startsWithAny(vararg prefixes: String): Boolean {
|
||||||
for (_prefix in prefix)
|
for (prefix in prefixes)
|
||||||
if (this.startsWith(_prefix))
|
if (this.startsWith(prefix))
|
||||||
return true
|
return true
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun String.containsAny(vararg others: String): Boolean {
|
internal fun String.equalsAny(vararg other: String): Boolean {
|
||||||
for (other in others)
|
for (_other in other)
|
||||||
if (this.contains(other))
|
if (this == _other)
|
||||||
return true
|
return true
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
package app.revanced.patches.music.audio.codecs.signatures
|
package app.revanced.patches.music.audio.codecs.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher. fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("all-codecs-reference-signature")
|
@Name("all-codecs-reference-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Laari;",
|
"Laari;",
|
||||||
"b",
|
"b",
|
||||||
@@ -18,7 +18,7 @@ import org.jf.dexlib2.Opcode
|
|||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@CodecsUnlockCompatibility
|
@CodecsUnlockCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object AllCodecsReferenceSignature : MethodSignature(
|
object AllCodecsReferenceFingerprint : MethodFingerprint(
|
||||||
"J", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
|
"J", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
|
||||||
Opcode.INVOKE_STATIC,
|
Opcode.INVOKE_STATIC,
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
package app.revanced.patches.music.audio.codecs.signatures
|
package app.revanced.patches.music.audio.codecs.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("codec-lock-signature")
|
@Name("codec-lock-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Labwj;",
|
"Labwj;",
|
||||||
"a",
|
"a",
|
||||||
@@ -18,7 +18,7 @@ import org.jf.dexlib2.Opcode
|
|||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@CodecsUnlockCompatibility
|
@CodecsUnlockCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object CodecsLockSignature : MethodSignature(
|
object CodecsLockFingerprint : MethodFingerprint(
|
||||||
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L", "L", "L"), listOf(
|
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L", "L", "L"), listOf(
|
||||||
Opcode.INVOKE_STATIC,
|
Opcode.INVOKE_STATIC,
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
@@ -3,16 +3,16 @@ package app.revanced.patches.music.audio.codecs.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.data.implementation.toMethodWalker
|
import app.revanced.patcher.data.impl.toMethodWalker
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.util.smali.toInstruction
|
import app.revanced.patcher.util.smali.toInstruction
|
||||||
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
||||||
import app.revanced.patches.music.audio.codecs.signatures.AllCodecsReferenceSignature
|
import app.revanced.patches.music.audio.codecs.fingerprints.AllCodecsReferenceFingerprint
|
||||||
import app.revanced.patches.music.audio.codecs.signatures.CodecsLockSignature
|
import app.revanced.patches.music.audio.codecs.fingerprints.CodecsLockFingerprint
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("codecs-unlock")
|
@Name("codecs-unlock")
|
||||||
@@ -21,19 +21,19 @@ import app.revanced.patches.music.audio.codecs.signatures.CodecsLockSignature
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class CodecsUnlockPatch : BytecodePatch(
|
class CodecsUnlockPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
CodecsLockSignature, AllCodecsReferenceSignature
|
CodecsLockFingerprint, AllCodecsReferenceFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
var result = signatures.first().result!!
|
var result = CodecsLockFingerprint.result!!
|
||||||
|
|
||||||
val implementation = result.method.implementation!!
|
val implementation = result.mutableMethod.implementation!!
|
||||||
|
|
||||||
val instructionIndex = result.scanResult.startIndex
|
val instructionIndex = result.patternScanResult!!.startIndex
|
||||||
|
|
||||||
result = signatures.last().result!!
|
result = AllCodecsReferenceFingerprint.result!!
|
||||||
val codecMethod =
|
val codecMethod =
|
||||||
data.toMethodWalker(result.immutableMethod).nextMethod(result.scanResult.startIndex).getMethod()
|
data.toMethodWalker(result.method).nextMethod(result.patternScanResult!!.startIndex).getMethod()
|
||||||
|
|
||||||
implementation.replaceInstruction(
|
implementation.replaceInstruction(
|
||||||
instructionIndex,
|
instructionIndex,
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
@Name("audio-only-enabler-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lgmd;",
|
||||||
|
"d"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@ExclusiveAudioCompatibility
|
||||||
|
@Version(
|
||||||
|
"0.0.1"
|
||||||
|
)
|
||||||
|
object AudioOnlyEnablerFingerprint: MethodFingerprint(
|
||||||
|
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
|
Opcode.INVOKE_INTERFACE,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
|
Opcode.INVOKE_INTERFACE,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.INVOKE_VIRTUAL,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.CHECK_CAST,
|
||||||
|
Opcode.IF_NEZ,
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
|
Opcode.INVOKE_VIRTUAL,
|
||||||
|
Opcode.MOVE_RESULT,
|
||||||
|
Opcode.GOTO,
|
||||||
|
Opcode.INVOKE_VIRTUAL,
|
||||||
|
Opcode.MOVE_RESULT,
|
||||||
|
Opcode.RETURN
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
package app.revanced.patches.music.audio.exclusiveaudio.signatures
|
package app.revanced.patches.music.audio.exclusiveaudio.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("exclusive-audio-signature")
|
@Name("exclusive-audio-fingerprints")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Lgmd;", "c"
|
"Lgmd;", "c"
|
||||||
)
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@ExclusiveAudioCompatibility
|
@ExclusiveAudioCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object ExclusiveAudioSignature : MethodSignature(
|
object ExclusiveAudioFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
listOf("L", "Z"),
|
listOf("L", "Z"),
|
||||||
@@ -1,23 +1,19 @@
|
|||||||
package app.revanced.patches.music.audio.exclusiveaudio.patch
|
package app.revanced.patches.music.audio.exclusiveaudio.patch
|
||||||
|
|
||||||
|
import AudioOnlyEnablerFingerprint
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.addInstruction
|
||||||
|
import app.revanced.patcher.extensions.replaceInstruction
|
||||||
|
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultError
|
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.DirectPatternScanMethod
|
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
|
||||||
import app.revanced.patcher.util.smali.toInstruction
|
|
||||||
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
||||||
import app.revanced.patches.music.audio.exclusiveaudio.signatures.ExclusiveAudioSignature
|
import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.ExclusiveAudioFingerprint
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("exclusive-audio-playback")
|
@Name("exclusive-audio-playback")
|
||||||
@@ -26,45 +22,16 @@ import org.jf.dexlib2.Opcode
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class ExclusiveAudioPatch : BytecodePatch(
|
class ExclusiveAudioPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
ExclusiveAudioSignature
|
ExclusiveAudioFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result = signatures.first().result!!.findParentMethod(@Name("audio-only-enabler-method") @MatchingMethod(
|
ExclusiveAudioFingerprint.resolve(data, AudioOnlyEnablerFingerprint.result!!.classDef)
|
||||||
"Lgmd;",
|
|
||||||
"d"
|
|
||||||
) @DirectPatternScanMethod @ExclusiveAudioCompatibility @Version(
|
|
||||||
"0.0.1"
|
|
||||||
) object : MethodSignature(
|
|
||||||
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.INVOKE_INTERFACE,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.INVOKE_INTERFACE,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.CHECK_CAST,
|
|
||||||
Opcode.IF_NEZ,
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT,
|
|
||||||
Opcode.GOTO,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT,
|
|
||||||
Opcode.RETURN
|
|
||||||
)
|
|
||||||
) {}) ?: return PatchResultError("Required parent method could not be found.")
|
|
||||||
|
|
||||||
val implementation = result.method.implementation!!
|
val method = ExclusiveAudioFingerprint.result!!.mutableMethod
|
||||||
implementation.replaceInstruction(
|
method.replaceInstruction(method.implementation!!.instructions.count() - 1, "const/4 v0, 0x1")
|
||||||
implementation.instructions.count() - 1, "const/4 v0, 0x1".toInstruction()
|
method.addInstruction("return v0")
|
||||||
)
|
|
||||||
implementation.addInstruction(
|
|
||||||
"return v0".toInstruction()
|
|
||||||
)
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
package app.revanced.patches.music.layout.tastebuilder.signatures
|
package app.revanced.patches.music.layout.tastebuilder.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.music.layout.tastebuilder.annotations.RemoveTasteBuilderCompatibility
|
import app.revanced.patches.music.layout.tastebuilder.annotations.RemoveTasteBuilderCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("taste-builder-constructor")
|
@Name("taste-builder-constructor-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Lkyu;", "<init>"
|
"Lkyu;", "<init>"
|
||||||
)
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@RemoveTasteBuilderCompatibility
|
@RemoveTasteBuilderCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object TasteBuilderConstructorSignature : MethodSignature(
|
object TasteBuilderConstructorFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L"), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L"), listOf(
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
@@ -3,15 +3,14 @@ package app.revanced.patches.music.layout.tastebuilder.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.util.smali.toInstructions
|
|
||||||
import app.revanced.patches.music.layout.tastebuilder.annotations.RemoveTasteBuilderCompatibility
|
import app.revanced.patches.music.layout.tastebuilder.annotations.RemoveTasteBuilderCompatibility
|
||||||
import app.revanced.patches.music.layout.tastebuilder.signatures.TasteBuilderConstructorSignature
|
import app.revanced.patches.music.layout.tastebuilder.fingerprints.TasteBuilderConstructorFingerprint
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@@ -21,24 +20,20 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class RemoveTasteBuilderPatch : BytecodePatch(
|
class RemoveTasteBuilderPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
TasteBuilderConstructorSignature
|
TasteBuilderConstructorFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result = signatures.first().result!!
|
val result = TasteBuilderConstructorFingerprint.result!!
|
||||||
val implementation = result.method.implementation!!
|
val method = result.mutableMethod
|
||||||
|
|
||||||
val insertIndex = result.scanResult.endIndex - 8
|
val insertIndex = result.patternScanResult!!.endIndex - 8
|
||||||
|
val register = (method.implementation!!.instructions[insertIndex] as Instruction22c).registerA
|
||||||
val register = (implementation.instructions[insertIndex] as Instruction22c).registerA
|
method.addInstructions(
|
||||||
|
insertIndex, """
|
||||||
val instructionList = """
|
|
||||||
const/16 v1, 0x8
|
const/16 v1, 0x8
|
||||||
invoke-virtual {v${register}, v1}, Landroid/view/View;->setVisibility(I)V
|
invoke-virtual {v${register}, v1}, Landroid/view/View;->setVisibility(I)V
|
||||||
""".trimIndent().toInstructions().toMutableList()
|
"""
|
||||||
|
|
||||||
implementation.addInstructions(
|
|
||||||
insertIndex, instructionList
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
package app.revanced.patches.music.layout.upgradebutton.signatures
|
package app.revanced.patches.music.layout.upgradebutton.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.music.layout.upgradebutton.annotations.RemoveUpgradeButtonCompatibility
|
import app.revanced.patches.music.layout.upgradebutton.annotations.RemoveUpgradeButtonCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("pivot-bar-constructor")
|
@Name("pivot-bar-constructor-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Lhfu;", "<init2>"
|
"Lhfu;", "<init2>"
|
||||||
)
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@RemoveUpgradeButtonCompatibility
|
@RemoveUpgradeButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object PivotBarConstructorSignature : MethodSignature(
|
object PivotBarConstructorFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||||
listOf("L", "Z"),
|
listOf("L", "Z"),
|
||||||
@@ -3,15 +3,15 @@ package app.revanced.patches.music.layout.upgradebutton.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.util.smali.toInstructions
|
import app.revanced.patcher.util.smali.toInstructions
|
||||||
import app.revanced.patches.music.layout.upgradebutton.annotations.RemoveUpgradeButtonCompatibility
|
import app.revanced.patches.music.layout.upgradebutton.annotations.RemoveUpgradeButtonCompatibility
|
||||||
import app.revanced.patches.music.layout.upgradebutton.signatures.PivotBarConstructorSignature
|
import app.revanced.patches.music.layout.upgradebutton.fingerprints.PivotBarConstructorFingerprint
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction22t
|
import org.jf.dexlib2.builder.instruction.BuilderInstruction22t
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
||||||
@@ -20,20 +20,20 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
|||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("upgrade-button-remover")
|
@Name("upgrade-button-remover")
|
||||||
@Description("Remove the upgrade tab from t he pivot bar in YouTube music.")
|
@Description("Remove the upgrade tab from the pivot bar in YouTube music.")
|
||||||
@RemoveUpgradeButtonCompatibility
|
@RemoveUpgradeButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class RemoveUpgradeButtonPatch : BytecodePatch(
|
class RemoveUpgradeButtonPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
PivotBarConstructorSignature
|
PivotBarConstructorFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result = signatures.first().result!!
|
val result = PivotBarConstructorFingerprint.result!!
|
||||||
val implementation = result.method.implementation!!
|
val implementation = result.mutableMethod.implementation!!
|
||||||
|
|
||||||
val pivotBarElementFieldRef =
|
val pivotBarElementFieldRef =
|
||||||
(implementation.instructions[result.scanResult.endIndex - 1] as Instruction22c).reference
|
(implementation.instructions[result.patternScanResult!!.endIndex - 1] as Instruction22c).reference
|
||||||
|
|
||||||
val register = (implementation.instructions.first() as Instruction35c).registerC
|
val register = (implementation.instructions.first() as Instruction35c).registerC
|
||||||
// first compile all the needed instructions
|
// first compile all the needed instructions
|
||||||
@@ -43,19 +43,19 @@ class RemoveUpgradeButtonPatch : BytecodePatch(
|
|||||||
const/4 v2, 0x3
|
const/4 v2, 0x3
|
||||||
invoke-interface {v0, v2}, Ljava/util/List;->remove(I)Ljava/lang/Object;
|
invoke-interface {v0, v2}, Ljava/util/List;->remove(I)Ljava/lang/Object;
|
||||||
iput-object v0, v$register, $pivotBarElementFieldRef
|
iput-object v0, v$register, $pivotBarElementFieldRef
|
||||||
""".trimIndent().toInstructions().toMutableList()
|
""".toInstructions().toMutableList()
|
||||||
|
|
||||||
|
|
||||||
// replace the instruction to retain the label at given index
|
// replace the instruction to retain the label at given index
|
||||||
implementation.replaceInstruction(
|
implementation.replaceInstruction(
|
||||||
result.scanResult.endIndex - 1, instructionList[0] // invoke-interface
|
result.patternScanResult!!.endIndex - 1, instructionList[0] // invoke-interface
|
||||||
)
|
)
|
||||||
// do not forget to remove this instruction since we added it already
|
// do not forget to remove this instruction since we added it already
|
||||||
instructionList.removeFirst()
|
instructionList.removeFirst()
|
||||||
|
|
||||||
val exitInstruction = instructionList.last() // iput-object
|
val exitInstruction = instructionList.last() // iput-object
|
||||||
implementation.addInstruction(
|
implementation.addInstruction(
|
||||||
result.scanResult.endIndex, exitInstruction
|
result.patternScanResult!!.endIndex, exitInstruction
|
||||||
)
|
)
|
||||||
// do not forget to remove this instruction since we added it already
|
// do not forget to remove this instruction since we added it already
|
||||||
instructionList.removeLast()
|
instructionList.removeLast()
|
||||||
@@ -64,13 +64,13 @@ class RemoveUpgradeButtonPatch : BytecodePatch(
|
|||||||
instructionList.add(
|
instructionList.add(
|
||||||
2, // if-le
|
2, // if-le
|
||||||
BuilderInstruction22t(
|
BuilderInstruction22t(
|
||||||
Opcode.IF_LE, 1, 2, implementation.newLabelForIndex(result.scanResult.endIndex)
|
Opcode.IF_LE, 1, 2, implementation.newLabelForIndex(result.patternScanResult!!.endIndex)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
implementation.addInstructions(
|
implementation.addInstructions(
|
||||||
result.scanResult.endIndex, instructionList
|
result.patternScanResult!!.endIndex, instructionList
|
||||||
)
|
)
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
package app.revanced.patches.music.premium.backgroundplay.signatures
|
package app.revanced.patches.music.premium.backgroundplay.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.music.premium.backgroundplay.annotations.BackgroundPlayCompatibility
|
import app.revanced.patches.music.premium.backgroundplay.annotations.BackgroundPlayCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("background-playback-disabler-signature")
|
@Name("background-playback-disabler-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Lafgf;", "e"
|
"Lafgf;", "e"
|
||||||
)
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@BackgroundPlayCompatibility
|
@BackgroundPlayCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object BackgroundPlaybackDisableSignature : MethodSignature(
|
object BackgroundPlaybackDisableFingerprint : MethodFingerprint(
|
||||||
"Z", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), listOf(
|
"Z", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), listOf(
|
||||||
Opcode.CONST_4,
|
Opcode.CONST_4,
|
||||||
Opcode.IF_EQZ,
|
Opcode.IF_EQZ,
|
||||||
@@ -3,15 +3,14 @@ package app.revanced.patches.music.premium.backgroundplay.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.util.smali.toInstructions
|
|
||||||
import app.revanced.patches.music.premium.backgroundplay.annotations.BackgroundPlayCompatibility
|
import app.revanced.patches.music.premium.backgroundplay.annotations.BackgroundPlayCompatibility
|
||||||
import app.revanced.patches.music.premium.backgroundplay.signatures.BackgroundPlaybackDisableSignature
|
import app.revanced.patches.music.premium.backgroundplay.fingerprints.BackgroundPlaybackDisableFingerprint
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("background-play")
|
@Name("background-play")
|
||||||
@@ -20,16 +19,16 @@ import app.revanced.patches.music.premium.backgroundplay.signatures.BackgroundPl
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class BackgroundPlayPatch : BytecodePatch(
|
class BackgroundPlayPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
BackgroundPlaybackDisableSignature
|
BackgroundPlaybackDisableFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
signatures.first().result!!.method.implementation!!.addInstructions(
|
BackgroundPlaybackDisableFingerprint.result!!.mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
const/4 v0, 0x1
|
const/4 v0, 0x1
|
||||||
return v0
|
return v0
|
||||||
""".trimIndent().toInstructions()
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.19.36", "17.20.37")
|
"com.google.android.youtube", arrayOf("17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34","17.24.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package app.revanced.patches.youtube.ad.general.bytecode.extensions
|
|||||||
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.softCompareTo
|
import app.revanced.patcher.extensions.softCompareTo
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultError
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import org.jf.dexlib2.builder.BuilderInstruction
|
import org.jf.dexlib2.builder.BuilderInstruction
|
||||||
|
|||||||
@@ -4,15 +4,14 @@ import app.revanced.extensions.injectHideCall
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.data.implementation.proxy
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Dependencies
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultError
|
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import app.revanced.patcher.util.smali.toInstructions
|
import app.revanced.patcher.util.smali.toInstructions
|
||||||
@@ -43,7 +42,7 @@ import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
|
|||||||
@Dependencies(
|
@Dependencies(
|
||||||
dependencies = [ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class, GeneralResourceAdsPatch::class]
|
dependencies = [ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class, GeneralResourceAdsPatch::class]
|
||||||
)
|
)
|
||||||
@Name("general-bytecode-ads")
|
@Name("general-ads")
|
||||||
@Description("Patch to remove general ads in bytecode.")
|
@Description("Patch to remove general ads in bytecode.")
|
||||||
@GeneralAdsCompatibility
|
@GeneralAdsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
@@ -148,11 +147,11 @@ class GeneralBytecodeAdsPatch : BytecodePatch(
|
|||||||
mutableClass!!.findMutableMethodOf(method)
|
mutableClass!!.findMutableMethodOf(method)
|
||||||
|
|
||||||
// TODO: dynamically get registers
|
// TODO: dynamically get registers
|
||||||
mutableMethod!!.implementation!!.addInstructions(
|
mutableMethod!!.addInstructions(
|
||||||
insertIndex, """
|
insertIndex, """
|
||||||
const/16 v1, 0x8
|
const/16 v1, 0x8
|
||||||
invoke-virtual {v0,v1}, Landroid/widget/FrameLayout;->setVisibility(I)V
|
invoke-virtual {v0,v1}, Landroid/widget/FrameLayout;->setVisibility(I)V
|
||||||
""".trimIndent().toInstructions()
|
"""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,25 +241,23 @@ class GeneralBytecodeAdsPatch : BytecodePatch(
|
|||||||
BuilderInstruction21t(Opcode.IF_EQZ, 1, lithoRemoveLabel)
|
BuilderInstruction21t(Opcode.IF_EQZ, 1, lithoRemoveLabel)
|
||||||
|
|
||||||
// create blocks
|
// create blocks
|
||||||
val parameters = lithoMethod.parameterTypes.joinToString("") { it }
|
|
||||||
val registers = lithoMethodImplementation.registerCount
|
|
||||||
val block1 = """
|
val block1 = """
|
||||||
invoke-static/range {p3}, $thisType->getTemplateName($templateNameParameterType)Ljava/lang/String;
|
invoke-static/range {p3}, $thisType->getTemplateName($templateNameParameterType)Ljava/lang/String;
|
||||||
move-result-object v0
|
move-result-object v0
|
||||||
""".trimIndent().toInstructions(parameters, registers, false)
|
""".toInstructions(lithoMethod)
|
||||||
val block2 = """
|
val block2 = """
|
||||||
move-object/from16 v1, p3
|
move-object/from16 v1, p3
|
||||||
iget-object v2, v1, $templateNameParameterType->b:Ljava/nio/ByteBuffer;
|
iget-object v2, v1, $templateNameParameterType->b:Ljava/nio/ByteBuffer;
|
||||||
invoke-static {v0, v2}, Lfi/razerman/youtube/litho/LithoAdRemoval;->containsAd(Ljava/lang/String;Ljava/nio/ByteBuffer;)Z
|
invoke-static {v0, v2}, Lapp/revanced/integrations/patches/GeneralBytecodeAdsPatch;->containsAd(Ljava/lang/String;Ljava/nio/ByteBuffer;)Z
|
||||||
move-result v1
|
move-result v1
|
||||||
""".trimIndent().toInstructions(parameters, registers, false)
|
""".toInstructions(lithoMethod)
|
||||||
val block3 = """
|
val block3 = """
|
||||||
move-object/from16 v2, p1
|
move-object/from16 v2, p1
|
||||||
invoke-static {v2}, $descriptor1
|
invoke-static {v2}, $descriptor1
|
||||||
move-result-object v0
|
move-result-object v0
|
||||||
iget-object v0, v0, $descriptor2
|
iget-object v0, v0, $descriptor2
|
||||||
return-object v0
|
return-object v0
|
||||||
""".trimIndent().toInstructions(parameters, registers, false)
|
""".toInstructions(lithoMethod)
|
||||||
|
|
||||||
// insert blocks and branch instructions
|
// insert blocks and branch instructions
|
||||||
lithoMethodImplementation.insertBlocks(
|
lithoMethodImplementation.insertBlocks(
|
||||||
@@ -371,7 +368,7 @@ class GeneralBytecodeAdsPatch : BytecodePatch(
|
|||||||
const v0, $lithoConstant
|
const v0, $lithoConstant
|
||||||
invoke-static {p0, v0}, ${descriptors[1]}
|
invoke-static {p0, v0}, ${descriptors[1]}
|
||||||
move-result-object p0
|
move-result-object p0
|
||||||
""".trimIndent().toInstructions()
|
""".toInstructions()
|
||||||
val block2 = """
|
val block2 = """
|
||||||
invoke-static {p0}, ${descriptors[2]}
|
invoke-static {p0}, ${descriptors[2]}
|
||||||
move-result-object p0
|
move-result-object p0
|
||||||
@@ -379,12 +376,12 @@ class GeneralBytecodeAdsPatch : BytecodePatch(
|
|||||||
move-result-object v0
|
move-result-object v0
|
||||||
invoke-static {v0}, ${this.type}->getIsEmpty(Ljava/lang/String;)Z
|
invoke-static {v0}, ${this.type}->getIsEmpty(Ljava/lang/String;)Z
|
||||||
move-result v0
|
move-result v0
|
||||||
""".trimIndent().toInstructions()
|
""".toInstructions()
|
||||||
val block3 = """
|
val block3 = """
|
||||||
invoke-virtual {p0}, ${descriptors[3]}
|
invoke-virtual {p0}, ${descriptors[3]}
|
||||||
move-result-object p0
|
move-result-object p0
|
||||||
return-object p0
|
return-object p0
|
||||||
""".trimIndent().toInstructions()
|
""".toInstructions()
|
||||||
|
|
||||||
// create target instruction
|
// create target instruction
|
||||||
val targetInstruction = BuilderInstruction11n(Opcode.CONST_4, 1, 0)
|
val targetInstruction = BuilderInstruction11n(Opcode.CONST_4, 1, 0)
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ import app.revanced.extensions.startsWithAny
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.ResourceData
|
import app.revanced.patcher.data.impl.ResourceData
|
||||||
import app.revanced.patcher.patch.annotations.Dependencies
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
import app.revanced.patcher.patch.implementation.ResourcePatch
|
import app.revanced.patcher.patch.impl.ResourcePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patches.youtube.ad.general.annotation.GeneralAdsCompatibility
|
import app.revanced.patches.youtube.ad.general.annotation.GeneralAdsCompatibility
|
||||||
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34","17.24.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
package app.revanced.patches.youtube.ad.video.signatures
|
package app.revanced.patches.youtube.ad.video.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("show-video-ads-constructor-signature")
|
@Name("show-video-ads-constructor-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Laair",
|
"Laair",
|
||||||
"<init>",
|
"<init>",
|
||||||
@@ -18,7 +18,7 @@ import org.jf.dexlib2.Opcode
|
|||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@VideoAdsCompatibility
|
@VideoAdsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object ShowVideoAdsConstructorSignature : MethodSignature(
|
object ShowVideoAdsConstructorFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L"), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L"), listOf(
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
Opcode.NEW_INSTANCE,
|
Opcode.NEW_INSTANCE,
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
@Name("show-video-ads-method-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
definingClass = "zai"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@VideoAdsCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object ShowVideoAdsFingerprint : MethodFingerprint(
|
||||||
|
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"), null
|
||||||
|
)
|
||||||
@@ -1,25 +1,20 @@
|
|||||||
package app.revanced.patches.youtube.ad.video.patch
|
package app.revanced.patches.youtube.ad.video.patch
|
||||||
|
|
||||||
|
import ShowVideoAdsFingerprint
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Dependencies
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultError
|
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.DirectPatternScanMethod
|
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
|
||||||
import app.revanced.patcher.util.smali.toInstructions
|
|
||||||
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
||||||
import app.revanced.patches.youtube.ad.video.signatures.ShowVideoAdsConstructorSignature
|
import app.revanced.patches.youtube.ad.video.fingerprints.ShowVideoAdsConstructorFingerprint
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Dependencies(dependencies = [IntegrationsPatch::class])
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
@@ -29,23 +24,18 @@ import org.jf.dexlib2.AccessFlags
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class VideoAdsPatch : BytecodePatch(
|
class VideoAdsPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
ShowVideoAdsConstructorSignature
|
ShowVideoAdsConstructorFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result =
|
ShowVideoAdsFingerprint.resolve(data, ShowVideoAdsConstructorFingerprint.result!!.classDef)
|
||||||
signatures.first().result!!.findParentMethod(@Name("show-video-ads-method-signature") @MatchingMethod(
|
|
||||||
definingClass = "zai"
|
|
||||||
) @DirectPatternScanMethod @VideoAdsCompatibility @Version("0.0.1") object : MethodSignature(
|
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"), null
|
|
||||||
) {}) ?: return PatchResultError("Required parent method could not be found.")
|
|
||||||
|
|
||||||
// Override the parameter by calling shouldShowAds and setting the parameter to the result
|
// Override the parameter by calling shouldShowAds and setting the parameter to the result
|
||||||
result.method.implementation!!.addInstructions(
|
ShowVideoAdsFingerprint.result!!.mutableMethod.addInstructions(
|
||||||
0, """
|
0, """
|
||||||
invoke-static { }, Lfi/vanced/libraries/youtube/whitelisting/Whitelist;->shouldShowAds()Z
|
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
|
||||||
move-result v1
|
move-result v1
|
||||||
""".trimIndent().toInstructions()
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.17.34", "17.19.36")
|
"com.google.android.youtube", arrayOf("17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34","17.24.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
package app.revanced.patches.youtube.interaction.seekbar.signatures
|
package app.revanced.patches.youtube.interaction.seekbar.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.youtube.interaction.seekbar.annotation.SeekbarTappingCompatibility
|
import app.revanced.patches.youtube.interaction.seekbar.annotation.SeekbarTappingCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("enable-seekbar-tapping-signature")
|
@Name("enable-seekbar-tapping-fingerprint")
|
||||||
@MatchingMethod("Lfbl;", "onTouchEvent")
|
@MatchingMethod("Lfbl;", "onTouchEvent")
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@SeekbarTappingCompatibility
|
@SeekbarTappingCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object SeekbarTappingSignature : MethodSignature(
|
object SeekbarTappingFingerprint : MethodFingerprint(
|
||||||
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
|
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.MOVE_RESULT_WIDE,
|
Opcode.MOVE_RESULT_WIDE,
|
||||||
@@ -1,21 +1,21 @@
|
|||||||
package app.revanced.patches.youtube.interaction.seekbar.signatures
|
package app.revanced.patches.youtube.interaction.seekbar.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.youtube.interaction.seekbar.annotation.SeekbarTappingCompatibility
|
import app.revanced.patches.youtube.interaction.seekbar.annotation.SeekbarTappingCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("enable-seekbar-tapping-parent")
|
@Name("enable-seekbar-tapping-parent-fingerprint")
|
||||||
@MatchingMethod("Lzmx;", "I")
|
@MatchingMethod("Lzmx;", "I")
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@SeekbarTappingCompatibility
|
@SeekbarTappingCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object SeekbarTappingParentSignature : MethodSignature(
|
object SeekbarTappingParentFingerprint : MethodFingerprint(
|
||||||
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
@@ -3,18 +3,17 @@ package app.revanced.patches.youtube.interaction.seekbar.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Dependencies
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultError
|
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.util.smali.toInstructions
|
|
||||||
import app.revanced.patches.youtube.interaction.seekbar.annotation.SeekbarTappingCompatibility
|
import app.revanced.patches.youtube.interaction.seekbar.annotation.SeekbarTappingCompatibility
|
||||||
import app.revanced.patches.youtube.interaction.seekbar.signatures.SeekbarTappingParentSignature
|
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.SeekbarTappingFingerprint
|
||||||
import app.revanced.patches.youtube.interaction.seekbar.signatures.SeekbarTappingSignature
|
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.SeekbarTappingParentFingerprint
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
||||||
@@ -30,16 +29,16 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class EnableSeekbarTappingPatch : BytecodePatch(
|
class EnableSeekbarTappingPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
SeekbarTappingParentSignature, SeekbarTappingSignature
|
SeekbarTappingParentFingerprint, SeekbarTappingFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
var result = signatures.first().result!!
|
var result = SeekbarTappingParentFingerprint.result!!
|
||||||
|
|
||||||
val tapSeekMethods = mutableMapOf<String, Method>()
|
val tapSeekMethods = mutableMapOf<String, Method>()
|
||||||
|
|
||||||
// find the methods which tap the seekbar
|
// find the methods which tap the seekbar
|
||||||
for (it in result.definingClassProxy.immutableClass.methods) {
|
for (it in result.classDef.methods) {
|
||||||
if (it.implementation == null) continue
|
if (it.implementation == null) continue
|
||||||
|
|
||||||
val instructions = it.implementation!!.instructions
|
val instructions = it.implementation!!.instructions
|
||||||
@@ -58,38 +57,38 @@ class EnableSeekbarTappingPatch : BytecodePatch(
|
|||||||
if (literal == 2) tapSeekMethods["O"] = it
|
if (literal == 2) tapSeekMethods["O"] = it
|
||||||
}
|
}
|
||||||
|
|
||||||
// replace map because we dont need the upper one anymore
|
// replace map because we don't need the upper one anymore
|
||||||
result = signatures.last().result!!
|
result = SeekbarTappingFingerprint.result!!
|
||||||
|
|
||||||
val implementation = result.method.implementation!!
|
val implementation = result.mutableMethod.implementation!!
|
||||||
|
|
||||||
// if tap-seeking is enabled, do not invoke the two methods below
|
// if tap-seeking is enabled, do not invoke the two methods below
|
||||||
val pMethod = tapSeekMethods["P"]!!
|
val pMethod = tapSeekMethods["P"]!!
|
||||||
val oMethod = tapSeekMethods["O"]!!
|
val oMethod = tapSeekMethods["O"]!!
|
||||||
|
|
||||||
// get the required register
|
// get the required register
|
||||||
val instruction = implementation.instructions[result.scanResult.endIndex]
|
val instruction = implementation.instructions[result.patternScanResult!!.endIndex]
|
||||||
if (instruction.opcode != Opcode.INVOKE_VIRTUAL) return PatchResultError("Could not find the correct register")
|
if (instruction.opcode != Opcode.INVOKE_VIRTUAL) return PatchResultError("Could not find the correct register")
|
||||||
val register = (instruction as Instruction35c).registerC
|
val register = (instruction as Instruction35c).registerC
|
||||||
|
|
||||||
// the instructions are written in reverse order.
|
// the instructions are written in reverse order.
|
||||||
implementation.addInstructions(
|
result.mutableMethod.addInstructions(
|
||||||
result.scanResult.endIndex + 1, """
|
result.patternScanResult!!.endIndex + 1, """
|
||||||
invoke-virtual { v$register, v2 }, ${oMethod.definingClass}->${oMethod.name}(I)V
|
invoke-virtual { v$register, v2 }, ${oMethod.definingClass}->${oMethod.name}(I)V
|
||||||
invoke-virtual { v$register, v2 }, ${pMethod.definingClass}->${pMethod.name}(I)V
|
invoke-virtual { v$register, v2 }, ${pMethod.definingClass}->${pMethod.name}(I)V
|
||||||
""".trimIndent().toInstructions()
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
// if tap-seeking is disabled, do not invoke the two methods above by jumping to the else label
|
// if tap-seeking is disabled, do not invoke the two methods above by jumping to the else label
|
||||||
val elseLabel = implementation.newLabelForIndex(result.scanResult.endIndex + 1)
|
val elseLabel = implementation.newLabelForIndex(result.patternScanResult!!.endIndex + 1)
|
||||||
implementation.addInstruction(
|
implementation.addInstruction(
|
||||||
result.scanResult.endIndex + 1, BuilderInstruction21t(Opcode.IF_EQZ, 0, elseLabel)
|
result.patternScanResult!!.endIndex + 1, BuilderInstruction21t(Opcode.IF_EQZ, 0, elseLabel)
|
||||||
)
|
)
|
||||||
implementation.addInstructions(
|
result.mutableMethod.addInstructions(
|
||||||
result.scanResult.endIndex + 1, """
|
result.patternScanResult!!.endIndex + 1, """
|
||||||
invoke-static { }, Lfi/razerman/youtube/preferences/BooleanPreferences;->isTapSeekingEnabled()Z
|
invoke-static { }, Lapp/revanced/integrations/patches/SeekbarTappingPatch;->isTapSeekingEnabled()Z
|
||||||
move-result v0
|
move-result v0
|
||||||
""".trimIndent().toInstructions()
|
"""
|
||||||
)
|
)
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34","17.24.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ package app.revanced.patches.youtube.layout.amoled.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.ResourceData
|
import app.revanced.patcher.data.impl.ResourceData
|
||||||
import app.revanced.patcher.patch.annotations.Dependencies
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.ResourcePatch
|
import app.revanced.patcher.patch.impl.ResourcePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patches.youtube.layout.amoled.annotations.AmoledCompatibility
|
import app.revanced.patches.youtube.layout.amoled.annotations.AmoledCompatibility
|
||||||
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.branding.header.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility(
|
||||||
|
[Package(
|
||||||
|
"com.google.android.youtube", arrayOf()
|
||||||
|
)]
|
||||||
|
)
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class PremiumHeadingCompatibility
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.branding.header.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.impl.ResourceData
|
||||||
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.impl.ResourcePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patches.youtube.layout.branding.header.annotations.PremiumHeadingCompatibility
|
||||||
|
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||||
|
import java.nio.file.Files
|
||||||
|
import java.nio.file.StandardCopyOption
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Dependencies(
|
||||||
|
dependencies = [FixLocaleConfigErrorPatch::class]
|
||||||
|
)
|
||||||
|
@Name("premium-heading")
|
||||||
|
@Description("Show the premium branding on the the YouTube home screen.")
|
||||||
|
@PremiumHeadingCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class PremiumHeadingPatch : ResourcePatch() {
|
||||||
|
override fun execute(data: ResourceData): PatchResult {
|
||||||
|
val resDirectory = data.get("res")
|
||||||
|
if (!resDirectory.isDirectory) return PatchResultError("The res folder can not be found.")
|
||||||
|
|
||||||
|
val (original, replacement) = "yt_premium_wordmark_header" to "yt_wordmark_header"
|
||||||
|
val modes = arrayOf("light", "dark")
|
||||||
|
|
||||||
|
arrayOf("xxxhdpi", "xxhdpi", "xhdpi", "hdpi", "mdpi").forEach { size ->
|
||||||
|
val headingDirectory = resDirectory.resolve("drawable-$size")
|
||||||
|
modes.forEach {mode ->
|
||||||
|
Files.copy(
|
||||||
|
headingDirectory.resolve("${original}_$mode.png").toPath(),
|
||||||
|
headingDirectory.resolve("${replacement}_$mode.png").toPath(),
|
||||||
|
StandardCopyOption.REPLACE_EXISTING
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.branding.icon.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility(
|
||||||
|
[Package(
|
||||||
|
"com.google.android.youtube", arrayOf()
|
||||||
|
)]
|
||||||
|
)
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class CustomBrandingCompatibility
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.branding.icon.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.impl.ResourceData
|
||||||
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.impl.ResourcePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patches.youtube.layout.branding.icon.annotations.CustomBrandingCompatibility
|
||||||
|
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||||
|
import java.nio.file.Files
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Dependencies(
|
||||||
|
dependencies = [FixLocaleConfigErrorPatch::class]
|
||||||
|
)
|
||||||
|
@Name("custom-branding")
|
||||||
|
@Description("Change the branding of YouTube.")
|
||||||
|
@CustomBrandingCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class CustomBrandingPatch : ResourcePatch() {
|
||||||
|
override fun execute(data: ResourceData): PatchResult {
|
||||||
|
val resDirectory = data.get("res")
|
||||||
|
if (!resDirectory.isDirectory) return PatchResultError("The res folder can not be found.")
|
||||||
|
|
||||||
|
val iconNames = arrayOf(
|
||||||
|
"adaptiveproduct_youtube_background_color_108",
|
||||||
|
"adaptiveproduct_youtube_foreground_color_108",
|
||||||
|
"ic_launcher",
|
||||||
|
"ic_launcher_round"
|
||||||
|
)
|
||||||
|
|
||||||
|
mapOf(
|
||||||
|
"xxxhdpi" to 192,
|
||||||
|
"xxhdpi" to 144,
|
||||||
|
"xhdpi" to 96,
|
||||||
|
"hdpi" to 72,
|
||||||
|
"mdpi" to 48
|
||||||
|
).forEach { (iconDirectory, size) ->
|
||||||
|
iconNames.forEach iconLoop@{ iconName ->
|
||||||
|
val iconFile = this.javaClass.classLoader.getResourceAsStream("branding/$size/$iconName.png")
|
||||||
|
?: return PatchResultError("The icon $iconName can not be found.")
|
||||||
|
|
||||||
|
Files.write(
|
||||||
|
resDirectory.resolve("mipmap-$iconDirectory").resolve("$iconName.png").toPath(), iconFile.readAllBytes()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.castbutton.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility(
|
||||||
|
[Package(
|
||||||
|
"com.google.android.youtube", arrayOf()
|
||||||
|
)]
|
||||||
|
)
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class CastButtonCompatibility
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.castbutton.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patches.youtube.layout.castbutton.annotations.CastButtonCompatibility
|
||||||
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
|
@Name("hide-cast-button")
|
||||||
|
@Description("Patch to hide the cast button.")
|
||||||
|
@CastButtonCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class HideCastButtonPatch : BytecodePatch(listOf()) {
|
||||||
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
|
data.classes.forEach { classDef ->
|
||||||
|
classDef.methods.forEach { method ->
|
||||||
|
if (classDef.type.endsWith("MediaRouteButton;") && method.name == "setVisibility") {
|
||||||
|
val setVisibilityMethod =
|
||||||
|
data.proxy(classDef).resolve().methods.first { it.name == "setVisibility" }
|
||||||
|
|
||||||
|
setVisibilityMethod.addInstructions(
|
||||||
|
0, """
|
||||||
|
invoke-static {p1}, Lapp/revanced/integrations/patches/HideCastButtonPatch;->getCastButtonOverrideV2(I)I
|
||||||
|
move-result p1
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34","17.24.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
package app.revanced.patches.youtube.layout.createbutton.signatures
|
package app.revanced.patches.youtube.layout.createbutton.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.youtube.layout.createbutton.annotations.CreateButtonCompatibility
|
import app.revanced.patches.youtube.layout.createbutton.annotations.CreateButtonCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("create-button-signature")
|
@Name("create-button-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Lknw", "z"
|
"Lknw", "z"
|
||||||
)
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@CreateButtonCompatibility
|
@CreateButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object CreateButtonSignature : MethodSignature(
|
object CreateButtonFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
listOf("Z"),
|
listOf("Z"),
|
||||||
@@ -3,44 +3,62 @@ package app.revanced.patches.youtube.layout.createbutton.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
|
import app.revanced.patcher.extensions.addInstruction
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Dependencies
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultError
|
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.util.smali.toInstruction
|
|
||||||
import app.revanced.patches.youtube.layout.createbutton.annotations.CreateButtonCompatibility
|
import app.revanced.patches.youtube.layout.createbutton.annotations.CreateButtonCompatibility
|
||||||
import app.revanced.patches.youtube.layout.createbutton.signatures.CreateButtonSignature
|
import app.revanced.patches.youtube.layout.createbutton.fingerprints.CreateButtonFingerprint
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
|
import app.revanced.patches.youtube.misc.mapping.patch.ResourceIdMappingProviderResourcePatch
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||||
|
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||||
|
import org.jf.dexlib2.iface.reference.MethodReference
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Dependencies(dependencies = [IntegrationsPatch::class])
|
@Dependencies(dependencies = [IntegrationsPatch::class, ResourceIdMappingProviderResourcePatch::class])
|
||||||
@Name("disable-create-button")
|
@Name("disable-create-button")
|
||||||
@Description("Disable the create button.")
|
@Description("Disable the create button.")
|
||||||
@CreateButtonCompatibility
|
@CreateButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class CreateButtonRemoverPatch : BytecodePatch(
|
class CreateButtonRemoverPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
CreateButtonSignature
|
CreateButtonFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result = signatures.first().result!!
|
val result = CreateButtonFingerprint.result!!
|
||||||
|
|
||||||
// Get the required register which holds the view object we need to pass to the method hideCreateButton
|
// Get the required register which holds the view object we need to pass to the method hideCreateButton
|
||||||
val implementation = result.method.implementation!!
|
val implementation = result.mutableMethod.implementation!!
|
||||||
val instruction = implementation.instructions[result.scanResult.endIndex + 1]
|
|
||||||
if (instruction.opcode != Opcode.INVOKE_STATIC) return PatchResultError("Could not find the correct register")
|
val imageOnlyLayout = ResourceIdMappingProviderResourcePatch.resourceMappings["image_only_tab"]
|
||||||
val register = (instruction as Instruction35c).registerC
|
?: return PatchResultError("Required resource could not be found in the map")
|
||||||
|
|
||||||
|
val imageOnlyLayoutConstIndex =
|
||||||
|
implementation.instructions.indexOfFirst { (it as? WideLiteralInstruction)?.wideLiteral == imageOnlyLayout }
|
||||||
|
|
||||||
|
val (instructionIndex, instruction) = implementation.instructions.drop(imageOnlyLayoutConstIndex).withIndex()
|
||||||
|
.first {
|
||||||
|
(((it.value as? ReferenceInstruction)?.reference) as? MethodReference)?.definingClass?.contains("PivotBar")
|
||||||
|
?: false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (instruction.opcode != Opcode.INVOKE_VIRTUAL) return PatchResultError("Could not find the correct instruction")
|
||||||
|
|
||||||
|
val moveResultIndex = imageOnlyLayoutConstIndex + instructionIndex + 1
|
||||||
|
val moveResultInstruction = implementation.instructions[moveResultIndex] as OneRegisterInstruction
|
||||||
|
|
||||||
// Hide the button view via proxy by passing it to the hideCreateButton method
|
// Hide the button view via proxy by passing it to the hideCreateButton method
|
||||||
implementation.addInstruction(
|
result.mutableMethod.addInstruction(
|
||||||
result.scanResult.endIndex + 1,
|
moveResultIndex + 1,
|
||||||
"invoke-static { v$register }, Lfi/razerman/youtube/XAdRemover;->hideCreateButton(Landroid/view/View;)V".toInstruction()
|
"invoke-static { v${moveResultInstruction.registerA} }, Lapp/revanced/integrations/patches/HideCreateButtonPatch;->hideCreateButton(Landroid/view/View;)V"
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.fullscreenpanels.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility(
|
||||||
|
[Package(
|
||||||
|
"com.google.android.youtube", arrayOf("17.23.35", "17.23.36", "17.24.34","17.24.35")
|
||||||
|
)]
|
||||||
|
)
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class FullscreenPanelsCompatibility
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.fullscreenpanels.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patches.youtube.layout.fullscreenpanels.annotations.FullscreenPanelsCompatibility
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("disable-fullscreen-panels")
|
||||||
|
@Description("Disable comments panel in fullscreen view.")
|
||||||
|
@FullscreenPanelsCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class FullscreenPanelsRemovalPatch : BytecodePatch(listOf()) {
|
||||||
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
|
val classDef = data.classes.first { it.type.endsWith("FullscreenEngagementPanelOverlay;") }
|
||||||
|
val method = data.proxy(classDef).resolve().methods.first { it.name == "<init>" }
|
||||||
|
val implementation = method.implementation!!
|
||||||
|
|
||||||
|
method.addInstructions(
|
||||||
|
implementation.instructions.count() - 1,
|
||||||
|
"""
|
||||||
|
const/4 v1, 0x0
|
||||||
|
iput-boolean v1, v0, ${classDef.type}->a:Z
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34","17.24.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
package app.revanced.patches.youtube.layout.minimizedplayback.signatures
|
package app.revanced.patches.youtube.layout.minimizedplayback.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.youtube.layout.minimizedplayback.annotations.MinimizedPlaybackCompatibility
|
import app.revanced.patches.youtube.layout.minimizedplayback.annotations.MinimizedPlaybackCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("minimized-playback-manager-signature")
|
@Name("minimized-playback-manager-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Lyuf", "n"
|
"Lyuf", "n"
|
||||||
)
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@MinimizedPlaybackCompatibility
|
@MinimizedPlaybackCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object MinimizedPlaybackManagerSignature : MethodSignature(
|
object MinimizedPlaybackManagerFingerprint : MethodFingerprint(
|
||||||
"Z",
|
"Z",
|
||||||
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||||
listOf("L"),
|
listOf("L"),
|
||||||
@@ -3,15 +3,14 @@ package app.revanced.patches.youtube.layout.minimizedplayback.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.util.smali.toInstructions
|
|
||||||
import app.revanced.patches.youtube.layout.minimizedplayback.annotations.MinimizedPlaybackCompatibility
|
import app.revanced.patches.youtube.layout.minimizedplayback.annotations.MinimizedPlaybackCompatibility
|
||||||
import app.revanced.patches.youtube.layout.minimizedplayback.signatures.MinimizedPlaybackManagerSignature
|
import app.revanced.patches.youtube.layout.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint
|
||||||
|
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@@ -21,17 +20,17 @@ import app.revanced.patches.youtube.layout.minimizedplayback.signatures.Minimize
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class MinimizedPlaybackPatch : BytecodePatch(
|
class MinimizedPlaybackPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
MinimizedPlaybackManagerSignature
|
MinimizedPlaybackManagerFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
// Instead of removing all instructions like Vanced,
|
// Instead of removing all instructions like Vanced,
|
||||||
// we return the method at the beginning instead
|
// we return the method at the beginning instead
|
||||||
signatures.first().result!!.method.implementation!!.addInstructions(
|
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstructions(
|
||||||
0, """
|
0, """
|
||||||
const/4 v0, 0x1
|
const/4 v0, 0x1
|
||||||
return v0
|
return v0
|
||||||
""".trimIndent().toInstructions()
|
"""
|
||||||
)
|
)
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.17.34", "17.19.36")
|
"com.google.android.youtube", arrayOf("17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34","17.24.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patches.youtube.layout.oldqualitylayout.annotations.OldQualityLayoutCompatibility
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
@Name("old-quality-fingerprint")
|
||||||
|
@MatchingMethod(definingClass = "Libh")
|
||||||
|
@FuzzyPatternScanMethod(2)
|
||||||
|
@OldQualityLayoutCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object OldQualityFingerprint : MethodFingerprint(
|
||||||
|
"L", AccessFlags.FINAL or AccessFlags.PRIVATE, listOf("Z"), listOf(
|
||||||
|
Opcode.CONST_4,
|
||||||
|
Opcode.INVOKE_VIRTUAL,
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
|
Opcode.INVOKE_VIRTUAL,
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
|
Opcode.GOTO,
|
||||||
|
Opcode.IGET_OBJECT,
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
package app.revanced.patches.youtube.layout.oldqualitylayout.signatures
|
package app.revanced.patches.youtube.layout.oldqualitylayout.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.youtube.layout.oldqualitylayout.annotations.OldQualityLayoutCompatibility
|
import app.revanced.patches.youtube.layout.oldqualitylayout.annotations.OldQualityLayoutCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("old-quality-parent-method-signature")
|
@Name("old-quality-parent-method-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Libh", "<init>"
|
"Libh", "<init>"
|
||||||
)
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@OldQualityLayoutCompatibility
|
@OldQualityLayoutCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object OldQualityParentSignature : MethodSignature(
|
object OldQualityParentFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||||
listOf("L", "L", "L", "L", "L", "L", "L"),
|
listOf("L", "L", "L", "L", "L", "L", "L"),
|
||||||
@@ -1,25 +1,21 @@
|
|||||||
package app.revanced.patches.youtube.layout.oldqualitylayout.patch
|
package app.revanced.patches.youtube.layout.oldqualitylayout.patch
|
||||||
|
|
||||||
|
import OldQualityFingerprint
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
|
||||||
import app.revanced.patcher.patch.annotations.Dependencies
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultError
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
|
||||||
import app.revanced.patcher.util.smali.toInstructions
|
|
||||||
import app.revanced.patches.youtube.layout.oldqualitylayout.annotations.OldQualityLayoutCompatibility
|
import app.revanced.patches.youtube.layout.oldqualitylayout.annotations.OldQualityLayoutCompatibility
|
||||||
import app.revanced.patches.youtube.layout.oldqualitylayout.signatures.OldQualityParentSignature
|
import app.revanced.patches.youtube.layout.oldqualitylayout.fingerprints.OldQualityParentFingerprint
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
||||||
|
|
||||||
@@ -31,37 +27,26 @@ import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class OldQualityLayoutPatch : BytecodePatch(
|
class OldQualityLayoutPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
OldQualityParentSignature
|
OldQualityParentFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result = signatures.first().result!!.findParentMethod(@Name("old-quality-signature") @MatchingMethod(
|
OldQualityFingerprint.resolve(data, OldQualityParentFingerprint.result!!.classDef)
|
||||||
definingClass = "Libh"
|
val result = OldQualityFingerprint.result
|
||||||
) @FuzzyPatternScanMethod(2) @OldQualityLayoutCompatibility @Version("0.0.1") object : MethodSignature(
|
?: return PatchResultError("Required parent method could not be found.")
|
||||||
"L", AccessFlags.FINAL or AccessFlags.PRIVATE, listOf("Z"), listOf(
|
|
||||||
Opcode.CONST_4,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.GOTO,
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
)
|
|
||||||
) {}) ?: return PatchResultError("Required parent method could not be found.")
|
|
||||||
|
|
||||||
val implementation = result.method.implementation!!
|
val implementation = result.mutableMethod.implementation!!
|
||||||
|
|
||||||
// if useOldStyleQualitySettings == true, jump over all instructions
|
// if useOldStyleQualitySettings == true, jump over all instructions
|
||||||
val jmpInstruction = BuilderInstruction21t(
|
val jmpInstruction = BuilderInstruction21t(
|
||||||
Opcode.IF_NEZ, 0, implementation.instructions[result.scanResult.endIndex].location.labels.first()
|
Opcode.IF_NEZ, 0, implementation.instructions[result.patternScanResult!!.endIndex].location.labels.first()
|
||||||
)
|
)
|
||||||
implementation.addInstruction(5, jmpInstruction)
|
implementation.addInstruction(5, jmpInstruction)
|
||||||
implementation.addInstructions(
|
result.mutableMethod.addInstructions(
|
||||||
0, """
|
0, """
|
||||||
invoke-static { }, Lfi/razerman/youtube/XGlobals;->useOldStyleQualitySettings()Z
|
invoke-static { }, Lapp/revanced/integrations/patches/OldStyleQualityPatch;->useOldStyleQualitySettings()Z
|
||||||
move-result v0
|
move-result v0
|
||||||
""".trimIndent().toInstructions()
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.23.35", "17.23.36", "17.24.34","17.24.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
package app.revanced.patches.youtube.layout.reels.signatures
|
package app.revanced.patches.youtube.layout.reels.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility
|
import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
@Name("hide-reels-signature")
|
@Name("hide-reels-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Ljvy", "<init>"
|
"Ljvy", "<init>"
|
||||||
)
|
)
|
||||||
@FuzzyPatternScanMethod(3) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(3) // FIXME: Test this threshold and find the best value.
|
||||||
@HideReelsCompatibility
|
@HideReelsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object HideReelsSignature : MethodSignature(
|
object HideReelsFingerprint : MethodFingerprint(
|
||||||
null, AccessFlags.PROTECTED or AccessFlags.FINAL, listOf("L", "L"), null,
|
null, AccessFlags.PROTECTED or AccessFlags.FINAL, listOf("L", "L"), null,
|
||||||
listOf("multiReelDismissalCallback", "reelItemRenderers", "reelDismissalInfo")
|
listOf("multiReelDismissalCallback", "reelItemRenderers", "reelDismissalInfo")
|
||||||
)
|
)
|
||||||
@@ -2,34 +2,33 @@ package app.revanced.patches.youtube.layout.reels.patch
|
|||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.extensions.addInstruction
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.util.smali.toInstruction
|
|
||||||
import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility
|
import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility
|
||||||
import app.revanced.patches.youtube.layout.reels.signatures.HideReelsSignature
|
import app.revanced.patches.youtube.layout.reels.fingerprints.HideReelsFingerprint
|
||||||
|
|
||||||
//@Patch TODO: converted to litho
|
//@Patch TODO: this is currently in the general-bytecode-ads patch due to the integrations having a preference for including reels or not. Move it here.
|
||||||
@Name("hide-reels")
|
@Name("hide-reels")
|
||||||
@Description("Hide reels on the page.")
|
@Description("Hide reels on the page.")
|
||||||
@HideReelsCompatibility
|
@HideReelsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class HideReelsPatch : BytecodePatch(
|
class HideReelsPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
HideReelsSignature
|
HideReelsFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result = signatures.first().result!!
|
val result = HideReelsFingerprint.result!!
|
||||||
val implementation = result.method.implementation!!
|
|
||||||
|
|
||||||
// HideReel will hide the reel view before it is being used,
|
// HideReel will hide the reel view before it is being used,
|
||||||
// so we pass the view to the HideReel method
|
// so we pass the view to the HideReel method
|
||||||
implementation.addInstruction(
|
result.mutableMethod.addInstruction(
|
||||||
result.scanResult.endIndex,
|
result.patternScanResult!!.endIndex,
|
||||||
"invoke-static { v2 }, Lfi/razerman/youtube/XAdRemover;->HideReel(Landroid/view/View;)V".toInstruction()
|
"invoke-static { v2 }, Lapp/revanced/integrations/patches/HideReelsPatch;->HideReel(Landroid/view/View;)V"
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34","17.24.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
package app.revanced.patches.youtube.layout.shorts.button.signatures
|
package app.revanced.patches.youtube.layout.shorts.button.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.youtube.layout.shorts.button.annotations.ShortsButtonCompatibility
|
import app.revanced.patches.youtube.layout.shorts.button.annotations.ShortsButtonCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("pivotbar-buttons-tabenum-signature")
|
@Name("pivotbar-buttons-tabenum-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Lknw", "z"
|
"Lknw;", "z"
|
||||||
)
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@ShortsButtonCompatibility
|
@ShortsButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object PivotBarButtonTabenumSignature : MethodSignature(
|
object PivotBarButtonTabEnumFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
listOf("Z"),
|
listOf("Z"),
|
||||||
@@ -42,4 +42,4 @@ object PivotBarButtonTabenumSignature : MethodSignature(
|
|||||||
Opcode.INVOKE_STATIC, // SomeEnum.fromValue(tabOrdinal)
|
Opcode.INVOKE_STATIC, // SomeEnum.fromValue(tabOrdinal)
|
||||||
Opcode.MOVE_RESULT_OBJECT
|
Opcode.MOVE_RESULT_OBJECT
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
package app.revanced.patches.youtube.layout.shorts.button.signatures
|
package app.revanced.patches.youtube.layout.shorts.button.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.youtube.layout.shorts.button.annotations.ShortsButtonCompatibility
|
import app.revanced.patches.youtube.layout.shorts.button.annotations.ShortsButtonCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("pivotbar-buttons-view-signature")
|
@Name("pivotbar-buttons-view-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Lknw", "z"
|
"Lknw;", "z"
|
||||||
)
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@ShortsButtonCompatibility
|
@ShortsButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object PivotBarButtonsViewSignature : MethodSignature(
|
object PivotBarButtonsViewFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
listOf("Z"),
|
listOf("Z"),
|
||||||
@@ -3,52 +3,53 @@ package app.revanced.patches.youtube.layout.shorts.button.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
|
import app.revanced.patcher.extensions.addInstruction
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Dependencies
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.util.smali.toInstruction
|
|
||||||
import app.revanced.patches.youtube.layout.shorts.button.annotations.ShortsButtonCompatibility
|
import app.revanced.patches.youtube.layout.shorts.button.annotations.ShortsButtonCompatibility
|
||||||
import app.revanced.patches.youtube.layout.shorts.button.signatures.PivotBarButtonTabenumSignature
|
import app.revanced.patches.youtube.layout.shorts.button.fingerprints.PivotBarButtonTabEnumFingerprint
|
||||||
import app.revanced.patches.youtube.layout.shorts.button.signatures.PivotBarButtonsViewSignature
|
import app.revanced.patches.youtube.layout.shorts.button.fingerprints.PivotBarButtonsViewFingerprint
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction11x
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Dependencies(dependencies = [IntegrationsPatch::class])
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
@Name("shorts-button")
|
@Name("disable-shorts-button")
|
||||||
@Description("Hide the shorts button.")
|
@Description("Hide the shorts button.")
|
||||||
@ShortsButtonCompatibility
|
@ShortsButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class ShortsButtonRemoverPatch : BytecodePatch(
|
class ShortsButtonRemoverPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
PivotBarButtonTabenumSignature, PivotBarButtonsViewSignature
|
PivotBarButtonTabEnumFingerprint, PivotBarButtonsViewFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result1 = signatures.first().result!!
|
val tabEnumResult = PivotBarButtonTabEnumFingerprint.result!!
|
||||||
val implementation1 = result1.method.implementation!!
|
val tabEnumImplementation = tabEnumResult.mutableMethod.implementation!!
|
||||||
val moveEnumInstruction = implementation1.instructions[result1.scanResult.endIndex]
|
val moveEnumInstruction = tabEnumImplementation.instructions[tabEnumResult.patternScanResult!!.endIndex]
|
||||||
val enumRegister = (moveEnumInstruction as Instruction11x).registerA
|
val enumRegister = (moveEnumInstruction as OneRegisterInstruction).registerA
|
||||||
|
|
||||||
|
val buttonsViewResult = PivotBarButtonsViewFingerprint.result!!
|
||||||
|
val buttonsViewImplementation = buttonsViewResult.mutableMethod.implementation!!
|
||||||
|
val moveViewInstruction = buttonsViewImplementation.instructions[buttonsViewResult.patternScanResult!!.endIndex]
|
||||||
|
val viewRegister = (moveViewInstruction as OneRegisterInstruction).registerA
|
||||||
|
|
||||||
val result2 = signatures.last().result!!
|
|
||||||
val implementation2 = result2.method.implementation!!
|
|
||||||
val moveViewInstruction = implementation2.instructions[result2.scanResult.endIndex]
|
|
||||||
val viewRegister = (moveViewInstruction as Instruction11x).registerA
|
|
||||||
|
|
||||||
// Save the tab enum in XGlobals to avoid smali/register workarounds
|
// Save the tab enum in XGlobals to avoid smali/register workarounds
|
||||||
implementation1.addInstruction(
|
tabEnumResult.mutableMethod.addInstruction(
|
||||||
result1.scanResult.endIndex + 1,
|
tabEnumResult.patternScanResult!!.endIndex + 1,
|
||||||
"sput-object v$enumRegister, Lfi/razerman/youtube/XGlobals;->lastPivotTab:Ljava/lang/Enum;".toInstruction()
|
"sput-object v$enumRegister, Lapp/revanced/integrations/patches/HideShortsButtonPatch;->lastPivotTab:Ljava/lang/Enum;"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Hide the button view via proxy by passing it to the hideShortsButton method
|
// Hide the button view via proxy by passing it to the hideShortsButton method
|
||||||
// It only hides it if the last tab name is "TAB_SHORTS"
|
// It only hides it if the last tab name is "TAB_SHORTS"
|
||||||
implementation2.addInstruction(
|
buttonsViewResult.mutableMethod.addInstruction(
|
||||||
result2.scanResult.endIndex + 2,
|
buttonsViewResult.patternScanResult!!.endIndex + 2,
|
||||||
"invoke-static { v$viewRegister }, Lfi/razerman/youtube/XAdRemover;->hideShortsButton(Landroid/view/View;)V".toInstruction()
|
"invoke-static { v$viewRegister }, Lapp/revanced/integrations/patches/HideShortsButtonPatch;->hideShortsButton(Landroid/view/View;)V"
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.watermark.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility(
|
||||||
|
[Package(
|
||||||
|
"com.google.android.youtube", arrayOf("17.24.34", "17.24.35")
|
||||||
|
)]
|
||||||
|
)
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class HideWatermarkCompatibility
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.watermark.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patches.youtube.layout.watermark.annotations.HideWatermarkCompatibility
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
@Name("hide-watermark-signature")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Ljvy;", "<init>"
|
||||||
|
)
|
||||||
|
@FuzzyPatternScanMethod(3)
|
||||||
|
@HideWatermarkCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object HideWatermarkFingerprint : MethodFingerprint (
|
||||||
|
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L", "L"), null ,null, null
|
||||||
|
)
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.watermark.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patches.youtube.layout.watermark.annotations.HideWatermarkCompatibility
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
@Name("hide-watermark-parent-signature")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Ljvy;", "<init>"
|
||||||
|
)
|
||||||
|
@FuzzyPatternScanMethod(3)
|
||||||
|
@HideWatermarkCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object HideWatermarkParentFingerprint : MethodFingerprint (
|
||||||
|
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, null, null, listOf("player_overlay_in_video_programming"), null
|
||||||
|
)
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.watermark.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.extensions.removeInstruction
|
||||||
|
import app.revanced.patcher.extensions.removeInstructions
|
||||||
|
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
|
import app.revanced.patches.youtube.layout.watermark.annotations.HideWatermarkCompatibility
|
||||||
|
import app.revanced.patches.youtube.layout.watermark.fingerprints.HideWatermarkParentFingerprint
|
||||||
|
import app.revanced.patches.youtube.layout.watermark.fingerprints.HideWatermarkFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Dependencies(dependencies = [IntegrationsPatch::class])
|
||||||
|
@Name("hide-watermark")
|
||||||
|
@Description("Hide Watermark on the page.")
|
||||||
|
@HideWatermarkCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class HideWatermarkPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
HideWatermarkParentFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
|
HideWatermarkFingerprint.resolve(data, HideWatermarkParentFingerprint.result!!.classDef)
|
||||||
|
val result = HideWatermarkFingerprint.result
|
||||||
|
?: return PatchResultError("Required parent method could not be found.")
|
||||||
|
|
||||||
|
val method = result.mutableMethod
|
||||||
|
val line = method.implementation!!.instructions.size - 5
|
||||||
|
|
||||||
|
method.removeInstruction(line)
|
||||||
|
method.addInstructions(
|
||||||
|
line, """
|
||||||
|
invoke-static {}, Lapp/revanced/integrations/patches/BrandingWaterMarkPatch;->isBrandingWatermarkShown()Z
|
||||||
|
move-result p2
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.03.38", "17.14.35", "17.17.34", "17.19.36")
|
"com.google.android.youtube", arrayOf("17.03.38", "17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34","17.24.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
package app.revanced.patches.youtube.misc.integrations.signatures
|
package app.revanced.patches.youtube.misc.integrations.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.youtube.misc.integrations.annotations.IntegrationsCompatibility
|
import app.revanced.patches.youtube.misc.integrations.annotations.IntegrationsCompatibility
|
||||||
|
|
||||||
@Name("init-signature")
|
@Name("init-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Lacuu", "onCreate"
|
"Lacuu", "onCreate"
|
||||||
)
|
)
|
||||||
@IntegrationsCompatibility
|
@IntegrationsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object InitSignature : MethodSignature(
|
object InitFingerprint : MethodFingerprint(
|
||||||
null, null, null, null,
|
null, null, null, null,
|
||||||
listOf("Application creation")
|
listOf("Application creation")
|
||||||
)
|
)
|
||||||
@@ -3,17 +3,17 @@ package app.revanced.patches.youtube.misc.integrations.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultError
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
|
||||||
import app.revanced.patcher.util.smali.toInstructions
|
import app.revanced.patcher.util.smali.toInstructions
|
||||||
import app.revanced.patches.youtube.misc.integrations.annotations.IntegrationsCompatibility
|
import app.revanced.patches.youtube.misc.integrations.annotations.IntegrationsCompatibility
|
||||||
import app.revanced.patches.youtube.misc.integrations.signatures.InitSignature
|
import app.revanced.patches.youtube.misc.integrations.fingerprints.InitFingerprint
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.immutable.ImmutableMethod
|
import org.jf.dexlib2.immutable.ImmutableMethod
|
||||||
import org.jf.dexlib2.immutable.ImmutableMethodImplementation
|
import org.jf.dexlib2.immutable.ImmutableMethodImplementation
|
||||||
@@ -24,26 +24,27 @@ import org.jf.dexlib2.immutable.ImmutableMethodImplementation
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class IntegrationsPatch : BytecodePatch(
|
class IntegrationsPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
InitSignature
|
InitFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
if (data.findClass("Lapp/revanced/integrations/Globals") == null)
|
if (data.findClass("Lapp/revanced/integrations/utils/ReVancedUtils") == null)
|
||||||
return PatchResultError("Integrations have not been merged yet. This patch can not succeed without the integrations.")
|
return PatchResultError("Integrations have not been merged yet. This patch can not succeed without the integrations.")
|
||||||
|
|
||||||
val result = signatures.first().result!!
|
val result = InitFingerprint.result!!
|
||||||
|
|
||||||
val implementation = result.method.implementation!!
|
val method = result.mutableMethod
|
||||||
|
val implementation = method.implementation!!
|
||||||
val count = implementation.registerCount - 1
|
val count = implementation.registerCount - 1
|
||||||
|
|
||||||
implementation.addInstructions(
|
method.addInstructions(
|
||||||
result.scanResult.endIndex + 1, """
|
0, """
|
||||||
invoke-static {v$count}, Lpl/jakubweg/StringRef;->setContext(Landroid/content/Context;)V
|
invoke-static {v$count}, Lapp/revanced/integrations/sponsorblock/StringRef;->setContext(Landroid/content/Context;)V
|
||||||
sput-object v$count, Lapp/revanced/integrations/Globals;->context:Landroid/content/Context;
|
sput-object v$count, Lapp/revanced/integrations/utils/ReVancedUtils;->context:Landroid/content/Context;
|
||||||
""".trimIndent().toInstructions()
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
val classDef = result.definingClassProxy.resolve()
|
val classDef = result.mutableClass
|
||||||
classDef.methods.add(
|
classDef.methods.add(
|
||||||
ImmutableMethod(
|
ImmutableMethod(
|
||||||
classDef.type,
|
classDef.type,
|
||||||
@@ -55,10 +56,10 @@ class IntegrationsPatch : BytecodePatch(
|
|||||||
null,
|
null,
|
||||||
ImmutableMethodImplementation(
|
ImmutableMethodImplementation(
|
||||||
1, """
|
1, """
|
||||||
invoke-static { }, Lapp/revanced/integrations/Globals;->getAppContext()Landroid/content/Context;
|
invoke-static { }, Lapp/revanced/integrations/utils/ReVancedUtils;->getAppContext()Landroid/content/Context;
|
||||||
move-result-object v0
|
move-result-object v0
|
||||||
return-object v0
|
return-object v0
|
||||||
""".trimIndent().toInstructions(), null, null
|
""".toInstructions(), null, null
|
||||||
)
|
)
|
||||||
).toMutable()
|
).toMutable()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.17.34", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34","17.24.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ package app.revanced.patches.youtube.misc.manifest.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.ResourceData
|
import app.revanced.patcher.data.impl.ResourceData
|
||||||
import app.revanced.patcher.patch.implementation.ResourcePatch
|
import app.revanced.patcher.patch.impl.ResourcePatch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patches.youtube.misc.manifest.annotations.FixLocaleConfigErrorCompatibility
|
import app.revanced.patches.youtube.misc.manifest.annotations.FixLocaleConfigErrorCompatibility
|
||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import app.revanced.extensions.doRecursively
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.ResourceData
|
import app.revanced.patcher.data.impl.ResourceData
|
||||||
import app.revanced.patcher.patch.implementation.ResourcePatch
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.impl.ResourcePatch
|
||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
@Name("resource-id-mapping-provider-resource-patch-dependency")
|
@Name("resource-id-mapping-provider-resource-patch-dependency")
|
||||||
@@ -20,7 +20,7 @@ class ResourceIdMappingProviderResourcePatch : ResourcePatch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun execute(data: ResourceData): PatchResult {
|
override fun execute(data: ResourceData): PatchResult {
|
||||||
data.getXmlEditor("res/values/public.xml").use { editor ->
|
data.xmlEditor["res/values/public.xml"].use { editor ->
|
||||||
resourceMappings = buildMap {
|
resourceMappings = buildMap {
|
||||||
editor.file.documentElement.doRecursively { node ->
|
editor.file.documentElement.doRecursively { node ->
|
||||||
if (node !is Element) return@doRecursively
|
if (node !is Element) return@doRecursively
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.youtube", arrayOf("17.14.35", "17.19.36")
|
"com.google.android.youtube", arrayOf("17.14.35", "17.19.36", "17.20.37", "17.22.36", "17.23.35", "17.23.36", "17.24.34","17.24.35")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.microg.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
|
|
||||||
|
@Name("cast-context-fetch-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lvvz;", "a"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@MicroGPatchCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object CastContextFetchFingerprint : MethodFingerprint(
|
||||||
|
null, null, null, null,
|
||||||
|
listOf("Error fetching CastContext.")
|
||||||
|
)
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.microg.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
|
|
||||||
|
@Name("cast-module-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Llqh;", "c"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@MicroGPatchCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object CastDynamiteModuleFingerprint : MethodFingerprint(
|
||||||
|
null, null, null, null,
|
||||||
|
listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
|
||||||
|
)
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.microg.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
|
|
||||||
|
@Name("cast-context-fetch-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lmcf;", "c"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@MicroGPatchCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object CastDynamiteModuleV2Fingerprint : MethodFingerprint(
|
||||||
|
null, null, null, null,
|
||||||
|
listOf("Failed to load module via V2: ")
|
||||||
|
)
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
package app.revanced.patches.youtube.misc.microg.signatures
|
package app.revanced.patches.youtube.misc.microg.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("google-play-utility-signature")
|
@Name("google-play-utility-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Llss;", "b"
|
"Llss;", "b"
|
||||||
)
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@MicroGPatchCompatibility
|
@MicroGPatchCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object GooglePlayUtilitySignature : MethodSignature(
|
object GooglePlayUtilityFingerprint : MethodFingerprint(
|
||||||
"I", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L"), listOf(
|
"I", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L"), listOf(
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
package app.revanced.patches.youtube.misc.microg.signatures
|
package app.revanced.patches.youtube.misc.microg.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("google-play-sig-check-signature")
|
@Name("google-play-sig-check-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Ldwn;", "d"
|
"Ldwn;", "d"
|
||||||
)
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@MicroGPatchCompatibility
|
@MicroGPatchCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object IntegrityCheckSignature : MethodSignature(
|
object IntegrityCheckFingerprint : MethodFingerprint(
|
||||||
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L"), listOf(
|
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L"), listOf(
|
||||||
Opcode.MOVE_OBJECT_FROM16,
|
Opcode.MOVE_OBJECT_FROM16,
|
||||||
Opcode.CONST_STRING,
|
Opcode.CONST_STRING,
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.microg.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
|
|
||||||
|
@Name("google-play-prime-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lpag;", "d"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@MicroGPatchCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object PrimeFingerprint : MethodFingerprint(
|
||||||
|
null, null, null, null, listOf("com.google.android.GoogleCamera", "com.android.vending")
|
||||||
|
)
|
||||||
@@ -1,23 +1,23 @@
|
|||||||
package app.revanced.patches.youtube.misc.microg.signatures
|
package app.revanced.patches.youtube.misc.microg.fingerprints
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("google-play-service-checker-signature")
|
@Name("google-play-service-checker-fingerprint")
|
||||||
@MatchingMethod(
|
@MatchingMethod(
|
||||||
"Llss;", "d"
|
"Llss;", "d"
|
||||||
)
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@MicroGPatchCompatibility
|
@MicroGPatchCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
object ServiceCheckSignature : MethodSignature(
|
object ServiceCheckFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "I"), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "I"), listOf(
|
||||||
Opcode.SGET_OBJECT,
|
Opcode.SGET_OBJECT,
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
@@ -1,32 +1,26 @@
|
|||||||
package app.revanced.patches.youtube.misc.microg.patch.bytecode
|
package app.revanced.patches.youtube.misc.microg.patch.bytecode
|
||||||
|
|
||||||
import app.revanced.extensions.containsAny
|
import app.revanced.extensions.equalsAny
|
||||||
import app.revanced.extensions.startsWithAny
|
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.BytecodeData
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.data.implementation.proxy
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
import app.revanced.patcher.patch.annotations.Dependencies
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.DirectPatternScanMethod
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
||||||
import app.revanced.patcher.util.smali.toInstruction
|
import app.revanced.patches.youtube.layout.castbutton.patch.HideCastButtonPatch
|
||||||
import app.revanced.patcher.util.smali.toInstructions
|
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||||
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
|
import app.revanced.patches.youtube.misc.microg.patch.resource.MicroGResourcePatch
|
||||||
import app.revanced.patches.youtube.misc.microg.patch.resource.enum.StringReplaceMode
|
import app.revanced.patches.youtube.misc.microg.patch.resource.enum.StringReplaceMode
|
||||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.BASE_MICROG_PACKAGE_NAME
|
import app.revanced.patches.youtube.misc.microg.shared.Constants.BASE_MICROG_PACKAGE_NAME
|
||||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_PACKAGE_NAME
|
import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_PACKAGE_NAME
|
||||||
import app.revanced.patches.youtube.misc.microg.signatures.GooglePlayUtilitySignature
|
import app.revanced.patches.youtube.misc.microg.fingerprints.*
|
||||||
import app.revanced.patches.youtube.misc.microg.signatures.IntegrityCheckSignature
|
|
||||||
import app.revanced.patches.youtube.misc.microg.signatures.PrimeSignature
|
|
||||||
import app.revanced.patches.youtube.misc.microg.signatures.ServiceCheckSignature
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
import org.jf.dexlib2.builder.MutableMethodImplementation
|
import org.jf.dexlib2.builder.MutableMethodImplementation
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21c
|
import org.jf.dexlib2.builder.instruction.BuilderInstruction21c
|
||||||
@@ -34,19 +28,31 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction21c
|
|||||||
import org.jf.dexlib2.iface.reference.StringReference
|
import org.jf.dexlib2.iface.reference.StringReference
|
||||||
import org.jf.dexlib2.immutable.reference.ImmutableStringReference
|
import org.jf.dexlib2.immutable.reference.ImmutableStringReference
|
||||||
|
|
||||||
// @Patch TODO: finish patch
|
@Patch
|
||||||
@Name("microg-bytecode-patch")
|
@Dependencies(
|
||||||
|
dependencies = [
|
||||||
|
MicroGResourcePatch::class,
|
||||||
|
HideCastButtonPatch::class,
|
||||||
|
FixLocaleConfigErrorPatch::class
|
||||||
|
]
|
||||||
|
)
|
||||||
|
@Name("microg-support")
|
||||||
@Description("Patch to allow YouTube ReVanced to run without root and under a different package name.")
|
@Description("Patch to allow YouTube ReVanced to run without root and under a different package name.")
|
||||||
@MicroGPatchCompatibility
|
@MicroGPatchCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class MicroGBytecodePatch : BytecodePatch(
|
class MicroGBytecodePatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
IntegrityCheckSignature, ServiceCheckSignature, GooglePlayUtilitySignature, PrimeSignature
|
IntegrityCheckFingerprint,
|
||||||
|
ServiceCheckFingerprint,
|
||||||
|
GooglePlayUtilityFingerprint,
|
||||||
|
CastDynamiteModuleFingerprint,
|
||||||
|
CastDynamiteModuleV2Fingerprint,
|
||||||
|
CastContextFetchFingerprint,
|
||||||
|
PrimeFingerprint,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
// smali patches
|
disablePlayServiceChecksAndFixCastIssues()
|
||||||
disablePlayServiceChecks()
|
|
||||||
data.classes.forEach { classDef ->
|
data.classes.forEach { classDef ->
|
||||||
var proxiedClass: MutableClass? = null
|
var proxiedClass: MutableClass? = null
|
||||||
|
|
||||||
@@ -54,35 +60,37 @@ class MicroGBytecodePatch : BytecodePatch(
|
|||||||
val implementation = method.implementation ?: return@methodLoop
|
val implementation = method.implementation ?: return@methodLoop
|
||||||
|
|
||||||
var proxiedImplementation: MutableMethodImplementation? = null
|
var proxiedImplementation: MutableMethodImplementation? = null
|
||||||
|
|
||||||
implementation.instructions.forEachIndexed { i, instruction ->
|
implementation.instructions.forEachIndexed { i, instruction ->
|
||||||
if (instruction.opcode != Opcode.CONST_STRING) return@forEachIndexed
|
if (instruction.opcode != Opcode.CONST_STRING) return@forEachIndexed
|
||||||
|
|
||||||
val stringValue = ((instruction as Instruction21c).reference as StringReference).string
|
val stringValue = ((instruction as Instruction21c).reference as StringReference).string
|
||||||
|
|
||||||
val replaceMode =
|
val replaceMode = if (stringValue.equalsAny(
|
||||||
if (stringValue == "com.google" || stringValue == "com.google.android.gms" ||
|
"com.google.android.gms",
|
||||||
stringValue.startsWithAny(
|
"com.google.android.c2dm.intent.REGISTER",
|
||||||
"com.google.iid",
|
"com.google.android.c2dm.permission.SEND",
|
||||||
"com.google.android.gms.chimera",
|
"com.google.iid.TOKEN_REQUEST",
|
||||||
"com.google.android.c2dm",
|
"com.google",
|
||||||
) || stringValue.containsAny(
|
"com.google.android.gms.auth.accounts",
|
||||||
"com.google.android.gms.auth.accounts",
|
"com.google.android.c2dm.intent.REGISTRATION",
|
||||||
"com.google.android.gsf",
|
"com.google.android.gsf.action.GET_GLS",
|
||||||
"content://com.google.settings"
|
"com.google.android.gsf.login",
|
||||||
)
|
"content://com.google.settings/partner",
|
||||||
) {
|
"content://com.google.android.gsf.gservices",
|
||||||
StringReplaceMode.REPLACE_WITH_MICROG
|
"content://com.google.android.gsf.gservices/prefix",
|
||||||
} else if (stringValue.startsWith("com.google.android.gms.chimera.container")) // https://github.com/TeamVanced/VancedMicroG/pull/139/file
|
"com.google.android.c2dm.intent.RECEIVE"
|
||||||
StringReplaceMode.DO_NOT_REPLACE
|
)
|
||||||
else if (stringValue.startsWithAny(
|
) {
|
||||||
"com.google.android.youtube.SuggestionsProvider",
|
StringReplaceMode.REPLACE_WITH_MICROG
|
||||||
"com.google.android.youtube.fileprovider"
|
} else if (stringValue.equalsAny(
|
||||||
)
|
"com.google.android.youtube.SuggestionsProvider", "com.google.android.youtube.fileprovider"
|
||||||
) {
|
)
|
||||||
StringReplaceMode.REPLACE_WITH_REVANCED
|
) {
|
||||||
} else {
|
StringReplaceMode.REPLACE_WITH_REVANCED
|
||||||
StringReplaceMode.DO_NOT_REPLACE
|
} else {
|
||||||
}
|
StringReplaceMode.DO_NOT_REPLACE
|
||||||
|
}
|
||||||
|
|
||||||
if (replaceMode != StringReplaceMode.DO_NOT_REPLACE) {
|
if (replaceMode != StringReplaceMode.DO_NOT_REPLACE) {
|
||||||
if (proxiedClass == null) {
|
if (proxiedClass == null) {
|
||||||
@@ -110,27 +118,20 @@ class MicroGBytecodePatch : BytecodePatch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// replace string back
|
|
||||||
val implementation =
|
|
||||||
signatures.elementAt(2).result!!.findParentMethod(@Name("do-not-replace-method") @MatchingMethod(
|
|
||||||
"Llpe;", "c"
|
|
||||||
) @DirectPatternScanMethod @MicroGPatchCompatibility @Version("0.0.1") object : MethodSignature(
|
|
||||||
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), null, listOf("com.google.android.gms")
|
|
||||||
) {})!!.method.implementation!!
|
|
||||||
|
|
||||||
implementation.replaceInstruction(
|
|
||||||
implementation.instructions.indexOfFirst { it.opcode == Opcode.CONST_STRING },
|
|
||||||
"const-string v0, \"com.google.android.gms\"".toInstruction()
|
|
||||||
)
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun disablePlayServiceChecks() {
|
private fun disablePlayServiceChecksAndFixCastIssues() {
|
||||||
for (i in 0 until signatures.count() - 1) {
|
listOf(
|
||||||
val result = signatures.elementAt(i).result!!
|
IntegrityCheckFingerprint,
|
||||||
val stringInstructions = when (result.immutableMethod.returnType.first()) {
|
ServiceCheckFingerprint,
|
||||||
|
GooglePlayUtilityFingerprint,
|
||||||
|
CastDynamiteModuleFingerprint,
|
||||||
|
CastDynamiteModuleV2Fingerprint,
|
||||||
|
CastContextFetchFingerprint
|
||||||
|
).forEach { fingerprint ->
|
||||||
|
val result = fingerprint.result!!
|
||||||
|
val stringInstructions = when (result.method.returnType.first()) {
|
||||||
'L' -> """
|
'L' -> """
|
||||||
const/4 v0, 0x0
|
const/4 v0, 0x0
|
||||||
return-object v0
|
return-object v0
|
||||||
@@ -144,12 +145,13 @@ class MicroGBytecodePatch : BytecodePatch(
|
|||||||
|
|
||||||
else -> throw Exception("This case should never happen.")
|
else -> throw Exception("This case should never happen.")
|
||||||
}
|
}
|
||||||
result.method.implementation!!.addInstructions(
|
result.mutableMethod.addInstructions(
|
||||||
0, stringInstructions.trimIndent().toInstructions()
|
0, stringInstructions
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val implementation = signatures.last().result!!.method.implementation!!
|
val primeMethod = PrimeFingerprint.result!!.mutableMethod
|
||||||
|
val implementation = primeMethod.implementation!!
|
||||||
|
|
||||||
var register = 2
|
var register = 2
|
||||||
val index = implementation.instructions.indexOfFirst {
|
val index = implementation.instructions.indexOfFirst {
|
||||||
@@ -162,8 +164,8 @@ class MicroGBytecodePatch : BytecodePatch(
|
|||||||
return@indexOfFirst true
|
return@indexOfFirst true
|
||||||
}
|
}
|
||||||
|
|
||||||
implementation.replaceInstruction(
|
primeMethod.replaceInstruction(
|
||||||
index, "const-string v$register, \"$REVANCED_PACKAGE_NAME\"".toInstruction()
|
index, "const-string v$register, \"$REVANCED_PACKAGE_NAME\""
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,67 +3,55 @@ package app.revanced.patches.youtube.misc.microg.patch.resource
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.implementation.ResourceData
|
import app.revanced.patcher.data.impl.ResourceData
|
||||||
import app.revanced.patcher.patch.implementation.ResourcePatch
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
import app.revanced.patcher.patch.impl.ResourcePatch
|
||||||
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
||||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.BASE_MICROG_PACKAGE_NAME
|
import app.revanced.patches.youtube.misc.microg.shared.Constants.BASE_MICROG_PACKAGE_NAME
|
||||||
|
import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_APP_NAME
|
||||||
import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_PACKAGE_NAME
|
import app.revanced.patches.youtube.misc.microg.shared.Constants.REVANCED_PACKAGE_NAME
|
||||||
|
|
||||||
// @Patch TODO: finish patch
|
|
||||||
@Name("microg-resource-patch")
|
@Name("microg-resource-patch")
|
||||||
@Description("Resource patch to allow YouTube ReVanced to run without root and under a different package name.")
|
@Description("Resource patch to allow YouTube ReVanced to run without root and under a different package name.")
|
||||||
@MicroGPatchCompatibility
|
@MicroGPatchCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class MicroGResourcePatch : ResourcePatch() {
|
class MicroGResourcePatch : ResourcePatch() {
|
||||||
override fun execute(data: ResourceData): PatchResult {
|
override fun execute(data: ResourceData): PatchResult {
|
||||||
|
data.xmlEditor["res/xml/settings_fragment.xml"].use {
|
||||||
|
val settingsElementIntent = it.file.createElement("intent")
|
||||||
|
settingsElementIntent.setAttribute("android:targetPackage", "$BASE_MICROG_PACKAGE_NAME.android.gms")
|
||||||
|
settingsElementIntent.setAttribute("android:targetClass", "org.microg.gms.ui.SettingsActivity")
|
||||||
|
|
||||||
|
val settingsElement = it.file.createElement("Preference")
|
||||||
|
settingsElement.setAttribute("android:title", "MicroG")
|
||||||
|
settingsElement.appendChild(settingsElementIntent)
|
||||||
|
|
||||||
|
it.file.firstChild.appendChild(settingsElement)
|
||||||
|
}
|
||||||
|
|
||||||
val manifest = data.get("AndroidManifest.xml").readText()
|
val manifest = data.get("AndroidManifest.xml").readText()
|
||||||
|
|
||||||
data.get("AndroidManifest.xml").writeText(
|
data.get("AndroidManifest.xml").writeText(
|
||||||
manifest.replace(
|
manifest.replace(
|
||||||
"package=\"com.google.android.youtube\"", "package=\"$REVANCED_PACKAGE_NAME\""
|
"package=\"com.google.android.youtube", "package=\"$REVANCED_PACKAGE_NAME"
|
||||||
).replace(
|
).replace(
|
||||||
" android:label=\"@string/application_name\" ", " android:label=\"{APP_NAME}\" "
|
"android:label=\"@string/application_name", "android:label=\"$REVANCED_APP_NAME"
|
||||||
).replace(
|
).replace(
|
||||||
"<uses-permission android:name=\"com.google.android.youtube.permission.C2D_MESSAGE\"",
|
"android:authorities=\"com.google.android.youtube", "android:authorities=\"$REVANCED_PACKAGE_NAME"
|
||||||
"<uses-permission android:name=\"$REVANCED_PACKAGE_NAME.permission.C2D_MESSAGE\""
|
|
||||||
).replace(
|
).replace(
|
||||||
"<permission android:name=\"com.google.android.youtube.permission.C2D_MESSAGE\"",
|
"com.google.android.youtube.permission.C2D_MESSAGE", "$REVANCED_PACKAGE_NAME.permission.C2D_MESSAGE"
|
||||||
"<permission android:name=\"$REVANCED_PACKAGE_NAME.permission.C2D_MESSAGE\""
|
).replace( // TODO: might not be needed
|
||||||
|
"com.google.android.youtube.lifecycle-trojan", "$REVANCED_PACKAGE_NAME.lifecycle-trojan"
|
||||||
|
).replace( // TODO: might not be needed
|
||||||
|
"com.google.android.youtube.photopicker_images", "$REVANCED_PACKAGE_NAME.photopicker_images"
|
||||||
).replace(
|
).replace(
|
||||||
"<provider android:authorities=\"com.google.android.youtube.lifecycle-trojan\"",
|
"com.google.android.c2dm", "$BASE_MICROG_PACKAGE_NAME.android.c2dm"
|
||||||
"<provider android:authorities=\"$REVANCED_PACKAGE_NAME.lifecycle-trojan\""
|
|
||||||
).replace(
|
).replace(
|
||||||
"\"com.google.android.youtube.fileprovider\"", "\"$REVANCED_PACKAGE_NAME.fileprovider\""
|
"</queries>", "<package android:name=\"$BASE_MICROG_PACKAGE_NAME.android.gms\"/></queries>"
|
||||||
).replace(
|
|
||||||
"<provider android:authorities=\"com.google.android.youtube.photopicker_images\"",
|
|
||||||
"<provider android:authorities=\"$REVANCED_PACKAGE_NAME.photopicker_images\""
|
|
||||||
).replace("com.google.android.c2dm", "$BASE_MICROG_PACKAGE_NAME.android.c2dm").replace(
|
|
||||||
" </queries>",
|
|
||||||
" <package android:name=\"$BASE_MICROG_PACKAGE_NAME.android.gms\"/>\n </queries>"
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
val replacement = arrayOf(
|
|
||||||
Pair(
|
|
||||||
"com.google.android.youtube.SuggestionProvider", "$REVANCED_PACKAGE_NAME.SuggestionProvider"
|
|
||||||
), Pair(
|
|
||||||
"com.google.android.youtube.fileprovider", "$REVANCED_PACKAGE_NAME.fileprovider"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
data.forEach {
|
|
||||||
if (it.extension != "xml") return@forEach
|
|
||||||
|
|
||||||
// TODO: use a reader and only replace strings where needed instead of reading & writing the entire file
|
|
||||||
var content = it.readText()
|
|
||||||
replacement.filter { translation -> content.contains(translation.first) }.forEach { translation ->
|
|
||||||
content = content.replace(translation.first, translation.second)
|
|
||||||
}
|
|
||||||
it.writeText(content)
|
|
||||||
}
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,4 +3,5 @@ package app.revanced.patches.youtube.misc.microg.shared
|
|||||||
object Constants {
|
object Constants {
|
||||||
internal const val BASE_MICROG_PACKAGE_NAME = "com.mgoogle"
|
internal const val BASE_MICROG_PACKAGE_NAME = "com.mgoogle"
|
||||||
internal const val REVANCED_PACKAGE_NAME = "app.revanced.android.youtube"
|
internal const val REVANCED_PACKAGE_NAME = "app.revanced.android.youtube"
|
||||||
|
internal const val REVANCED_APP_NAME = "YouTube ReVanced"
|
||||||
}
|
}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.misc.microg.signatures
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.signature.implementation.method.MethodSignature
|
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.DirectPatternScanMethod
|
|
||||||
import app.revanced.patcher.signature.implementation.method.annotation.MatchingMethod
|
|
||||||
import app.revanced.patches.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
|
||||||
|
|
||||||
@Name("google-play-prime-signature")
|
|
||||||
@MatchingMethod(
|
|
||||||
"Lpag;", "d"
|
|
||||||
)
|
|
||||||
@DirectPatternScanMethod
|
|
||||||
@MicroGPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object PrimeSignature : MethodSignature(
|
|
||||||
null, null, null, null, listOf("com.google.android.GoogleCamera", "com.android.vending")
|
|
||||||
)
|
|
||||||
|
After Width: | Height: | Size: 483 B |
|
After Width: | Height: | Size: 5.0 KiB |
BIN
src/main/resources/branding/144/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
src/main/resources/branding/144/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 163 B |
|
After Width: | Height: | Size: 6.1 KiB |
BIN
src/main/resources/branding/192/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
src/main/resources/branding/192/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 191 B |
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/main/resources/branding/48/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src/main/resources/branding/48/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 276 B |
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/main/resources/branding/72/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
src/main/resources/branding/72/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 343 B |
|
After Width: | Height: | Size: 2.9 KiB |
BIN
src/main/resources/branding/96/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |