mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-07 09:53:55 +01:00
Compare commits
318 Commits
v1.0.0-dev
...
v2.24.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eef7e87bbf | ||
|
|
535f621f20 | ||
|
|
695a0d14ad | ||
|
|
f70e54545b | ||
|
|
353f036a72 | ||
|
|
4d305775a0 | ||
|
|
d726443ca0 | ||
|
|
c5046edf8d | ||
|
|
e15d6afed1 | ||
|
|
f5055997c7 | ||
|
|
e6f41988dc | ||
|
|
c8567d35ef | ||
|
|
cea92cacfd | ||
|
|
8f83fc1edf | ||
|
|
b9e33d0d08 | ||
|
|
7df8f6b42a | ||
|
|
ac117f04df | ||
|
|
d3bb96d8b3 | ||
|
|
a31e4b4df3 | ||
|
|
90144fc55a | ||
|
|
12d1c36a3f | ||
|
|
a7fce11015 | ||
|
|
60029da7a3 | ||
|
|
46a586b2af | ||
|
|
8a86034728 | ||
|
|
ba1abf9319 | ||
|
|
82810cca6b | ||
|
|
964b598ad9 | ||
|
|
16fbfe555f | ||
|
|
16d50100e7 | ||
|
|
2397d6140b | ||
|
|
513276e950 | ||
|
|
2aab1a0c66 | ||
|
|
cfb5d0908b | ||
|
|
5e3eefe5dd | ||
|
|
6ccee3ef68 | ||
|
|
eddf520626 | ||
|
|
3613fb5409 | ||
|
|
97366cdd4c | ||
|
|
ee55cf970e | ||
|
|
ad1ed56a71 | ||
|
|
13ccea2e7c | ||
|
|
02d4ba64d6 | ||
|
|
891ac04155 | ||
|
|
c70c3de205 | ||
|
|
92dc97e2bf | ||
|
|
cdf4313880 | ||
|
|
0e0763221c | ||
|
|
6b515dd59e | ||
|
|
4ee40a954f | ||
|
|
fb96c6e4bc | ||
|
|
c5156fa7e3 | ||
|
|
8b0622f0bf | ||
|
|
1e3eddd3f2 | ||
|
|
1d12a17999 | ||
|
|
db410e1be6 | ||
|
|
9969d03116 | ||
|
|
9d1fecc2f5 | ||
|
|
63df96d251 | ||
|
|
d1266a252d | ||
|
|
6ec6d16dbc | ||
|
|
f940e4647e | ||
|
|
cc39b77b49 | ||
|
|
986065858d | ||
|
|
56475e8f38 | ||
|
|
2e0ff07d1a | ||
|
|
a654e25000 | ||
|
|
a8736a8f70 | ||
|
|
b0d6cee4db | ||
|
|
6bbcdf8ebd | ||
|
|
6fa8289ca6 | ||
|
|
97dbb43caa | ||
|
|
8cda5663ef | ||
|
|
5587c91899 | ||
|
|
4e6d82a334 | ||
|
|
be7302689e | ||
|
|
14d94d6a44 | ||
|
|
8d598f5b82 | ||
|
|
918782908b | ||
|
|
524fe19840 | ||
|
|
18aafb400b | ||
|
|
83ac6b3e34 | ||
|
|
890ebf04df | ||
|
|
6838daf1c3 | ||
|
|
08f4e8532c | ||
|
|
30d25a87da | ||
|
|
af0523df39 | ||
|
|
18a3f8e80c | ||
|
|
ce32c6f3f7 | ||
|
|
6b706bc93c | ||
|
|
6838e25764 | ||
|
|
f6f8b0ee31 | ||
|
|
8e26d0933d | ||
|
|
6f29325a85 | ||
|
|
46e163caa9 | ||
|
|
af19363997 | ||
|
|
c578e210bb | ||
|
|
980f7f04cc | ||
|
|
baeb0ad0d4 | ||
|
|
6c4a69fcfb | ||
|
|
4129fcf8a8 | ||
|
|
b39d60f46c | ||
|
|
8ce3a6b4e3 | ||
|
|
7107ee87d9 | ||
|
|
7ea5d87fa2 | ||
|
|
471a3d3263 | ||
|
|
b95fe30c78 | ||
|
|
cb0cf342c0 | ||
|
|
11db0f49c9 | ||
|
|
017ef1fb88 | ||
|
|
0991fbc9e8 | ||
|
|
e1eedc02ab | ||
|
|
9be32e10f6 | ||
|
|
87996f67a8 | ||
|
|
0822383271 | ||
|
|
0934af1ccd | ||
|
|
b3ad6fb8af | ||
|
|
87f5ebce9b | ||
|
|
a35d7c8951 | ||
|
|
3c8d3edff4 | ||
|
|
c35734bec2 | ||
|
|
e2b634053b | ||
|
|
3e6df0c96d | ||
|
|
7a2ea95e55 | ||
|
|
add3058d24 | ||
|
|
ef888f6b59 | ||
|
|
9b077d6ada | ||
|
|
93d4cee16e | ||
|
|
bc3b654357 | ||
|
|
64b4c92ca0 | ||
|
|
cd66ee4e57 | ||
|
|
f527226757 | ||
|
|
ec0b17a4d8 | ||
|
|
63598d0d42 | ||
|
|
14f6b66135 | ||
|
|
18893c005e | ||
|
|
73b51a0687 | ||
|
|
c4de003fc1 | ||
|
|
45b8ad099e | ||
|
|
8c40ff4852 | ||
|
|
f304c866f1 | ||
|
|
9adf42c308 | ||
|
|
2391db0f53 | ||
|
|
9809e4dfd0 | ||
|
|
b191efea2d | ||
|
|
c5ec801b90 | ||
|
|
95f22bc2a1 | ||
|
|
0098f25bfb | ||
|
|
9395e0835e | ||
|
|
d59d6b7022 | ||
|
|
c21e177ed1 | ||
|
|
d3e1419d0e | ||
|
|
f44d09059b | ||
|
|
185f6d84fb | ||
|
|
3dc6be5d8d | ||
|
|
742e2394a9 | ||
|
|
d9d389b939 | ||
|
|
b0775e13d5 | ||
|
|
0fe98b6c5e | ||
|
|
3a78021f5e | ||
|
|
e096009893 | ||
|
|
b599ee2096 | ||
|
|
bd7cedee48 | ||
|
|
278c07ea56 | ||
|
|
6dc2875057 | ||
|
|
7b24071956 | ||
|
|
6c472aa71d | ||
|
|
ca66490930 | ||
|
|
5317a482d1 | ||
|
|
f21d1d83f6 | ||
|
|
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 | ||
|
|
771f237990 | ||
|
|
4d17ff4fb4 | ||
|
|
7a0ae2d56a | ||
|
|
71a08ca5eb | ||
|
|
4ba5b324a6 | ||
|
|
05ee34c756 | ||
|
|
73adc6f98c | ||
|
|
eb97257c41 | ||
|
|
9d99df6f31 | ||
|
|
62c6543485 | ||
|
|
39cf505d84 | ||
|
|
f55ad46322 | ||
|
|
a91432f6ca | ||
|
|
15cf96aac7 | ||
|
|
813529944b | ||
|
|
eef7d863cb | ||
|
|
255f00dd63 | ||
|
|
f4e289c8df | ||
|
|
017bcfa04d | ||
|
|
da81df06ff | ||
|
|
38c06e2d6f | ||
|
|
e9fe8d4d12 | ||
|
|
bb356cb71c | ||
|
|
45c75cfb0e | ||
|
|
08aad61b61 | ||
|
|
dd1981a086 | ||
|
|
abf42a89c5 | ||
|
|
7dfcf3b730 | ||
|
|
dd0d58fc3b | ||
|
|
15630fe9f9 | ||
|
|
27f6aa5b7b | ||
|
|
a2038a0507 | ||
|
|
1748cd98a4 | ||
|
|
0c3b512fe3 | ||
|
|
113637183a | ||
|
|
595e0ed37e | ||
|
|
6655f4b5e5 | ||
|
|
8798780d22 | ||
|
|
edbd40563f | ||
|
|
96e7aed843 | ||
|
|
96f76b2eb5 | ||
|
|
cc5634851a | ||
|
|
1d1a20f7aa | ||
|
|
32d828fc67 | ||
|
|
927e12791b | ||
|
|
2fbefea52c | ||
|
|
291441c5d7 | ||
|
|
a08c4429d0 | ||
|
|
426597889f | ||
|
|
e757e13987 |
24
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
24
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a bug report on patches
|
||||
title: 'problem: `some-patch`'
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## 🐞 Issue
|
||||
|
||||
<!-- Describe your issue in detail here -->
|
||||
|
||||
## ⚙ Reproduce
|
||||
|
||||
<!-- Include your environment and steps to reproduce the issue as detailed as possible -->
|
||||
|
||||
## 🛠 Solution
|
||||
|
||||
<!-- If applicable, add a possible solution -->
|
||||
|
||||
## ⚠ Additional context
|
||||
|
||||
<!-- Add any other context about the problem here -->
|
||||
24
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
24
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a change to some patch. Do not submit suggestions for patches here.
|
||||
title: 'feat: some feature'
|
||||
labels: feature-request
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## 🐞 Issue
|
||||
|
||||
<!-- Explain here, what the current problem is and why it leads you to request a feature change -->
|
||||
|
||||
## ❗ Solution
|
||||
|
||||
<!-- Explain how your current issue can be solved -->
|
||||
|
||||
## ❓ Motivation
|
||||
|
||||
<!-- Explain why your feature should be considered -->
|
||||
|
||||
## ⚠ Additional context
|
||||
|
||||
<!-- Add any other context or screenshots about the feature request here -->
|
||||
11
.github/workflows/release.yml
vendored
11
.github/workflows/release.yml
vendored
@@ -1,5 +1,6 @@
|
||||
name: Release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
@@ -11,7 +12,7 @@ on:
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
@@ -27,12 +28,14 @@ jobs:
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: "lts/*"
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x gradlew
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v2
|
||||
- name: Build with Gradle
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./gradlew build
|
||||
run: ./gradlew build clean generateReadme
|
||||
- name: Install Android build-tools
|
||||
run: sdkmanager "build-tools;32.0.0"
|
||||
- name: Setup semantic-release
|
||||
run: npm install -g semantic-release @semantic-release/git @semantic-release/changelog gradle-semantic-release-plugin -D
|
||||
- name: Release
|
||||
|
||||
10
.releaserc
10
.releaserc
@@ -7,7 +7,11 @@
|
||||
}
|
||||
],
|
||||
"plugins": [
|
||||
"@semantic-release/commit-analyzer",
|
||||
["@semantic-release/commit-analyzer", {
|
||||
"releaseRules": [
|
||||
{"type": "build", "release": "patch"}
|
||||
]
|
||||
}],
|
||||
"@semantic-release/release-notes-generator",
|
||||
"@semantic-release/changelog",
|
||||
"gradle-semantic-release-plugin",
|
||||
@@ -15,6 +19,7 @@
|
||||
"@semantic-release/git",
|
||||
{
|
||||
"assets": [
|
||||
"README.md",
|
||||
"CHANGELOG.md",
|
||||
"gradle.properties"
|
||||
]
|
||||
@@ -26,6 +31,9 @@
|
||||
"assets": [
|
||||
{
|
||||
"path": "build/libs/*.jar"
|
||||
},
|
||||
{
|
||||
"path": "build/libs/*.dex"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
983
CHANGELOG.md
983
CHANGELOG.md
@@ -1,3 +1,986 @@
|
||||
# [2.24.0](https://github.com/revanced/revanced-patches/compare/v2.23.0...v2.24.0) (2022-07-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `music-microg-support` patch ([#208](https://github.com/revanced/revanced-patches/issues/208)) ([50863e9](https://github.com/revanced/revanced-patches/commit/50863e97cc8eba7e1ad6d11b4821baa45fdd29c4))
|
||||
|
||||
# [2.23.0](https://github.com/revanced/revanced-patches/compare/v2.22.2...v2.23.0) (2022-07-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* bump compatibility of YouTube Music patches to v5.16.51 ([#238](https://github.com/revanced/revanced-patches/issues/238)) ([4fa2a12](https://github.com/revanced/revanced-patches/commit/4fa2a127d715f953a1e4efacaecbc218209a01f3))
|
||||
|
||||
## [2.22.2](https://github.com/revanced/revanced-patches/compare/v2.22.1...v2.22.2) (2022-07-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump youtube version to 17.29.34 ([#236](https://github.com/revanced/revanced-patches/issues/236)) ([be6494a](https://github.com/revanced/revanced-patches/commit/be6494a80989044cba961dc22fc58ffb2e8591f0))
|
||||
|
||||
## [2.22.1](https://github.com/revanced/revanced-patches/compare/v2.22.0...v2.22.1) (2022-07-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove broken video-quality patch ([e8d516a](https://github.com/revanced/revanced-patches/commit/e8d516af896971a09bb9aca8b00e7b7bb57c3dd9))
|
||||
|
||||
# [2.22.0](https://github.com/revanced/revanced-patches/compare/v2.21.3...v2.22.0) (2022-07-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `default-video-quality` patch ([#141](https://github.com/revanced/revanced-patches/issues/141)) ([609ad7d](https://github.com/revanced/revanced-patches/commit/609ad7dee7e29b2ecc4e95a93e9dab1646b4b050))
|
||||
|
||||
# [2.12.0](https://github.com/Canny1913/revanced-patches/compare/v2.11.0...v2.12.0) (2022-07-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `autorepeat-by-default` patch ([#148](https://github.com/Canny1913/revanced-patches/issues/148)) ([fe628ba](https://github.com/Canny1913/revanced-patches/commit/fe628ba909d89ea0bf3d95fe94ca78ef819677da))
|
||||
* `codecs-unlock` patch and update Music patches to `5.14.53` ([2437d30](https://github.com/Canny1913/revanced-patches/commit/2437d3070f6a630d353619f642cefebd47abee20))
|
||||
* `exclusive-audio-playback` patch ([#153](https://github.com/Canny1913/revanced-patches/issues/153)) ([9beff95](https://github.com/Canny1913/revanced-patches/commit/9beff9567f1586e5c58690c1f1d2f7f204025ab7))
|
||||
* `hrd-auto-brightness` ([#152](https://github.com/Canny1913/revanced-patches/issues/152)) ([5f2e9ba](https://github.com/Canny1913/revanced-patches/commit/5f2e9ba30b7432be04bdc9f9f7ec7ac75fdc4b34))
|
||||
* `minimized-playback` patch for YouTube Kids videos ([#201](https://github.com/Canny1913/revanced-patches/issues/201)) ([31e3b42](https://github.com/Canny1913/revanced-patches/commit/31e3b42c6bbce0d00f049b8a69bafc94900bb3b4))
|
||||
* `old-quality-layout` patch ([2497425](https://github.com/Canny1913/revanced-patches/commit/2497425c9f11b8b14c861c2f0f34ff47bdbfac53))
|
||||
* `swipe-controls` with active engagement panel ([#177](https://github.com/Canny1913/revanced-patches/issues/177)) ([000ec6d](https://github.com/Canny1913/revanced-patches/commit/000ec6d8f6ecbb910a06ec852564ee9e5f03dcf8))
|
||||
* add v17.28.34 compatiblity for the `hide-shorts-button` patch ([#224](https://github.com/Canny1913/revanced-patches/issues/224)) ([76166bb](https://github.com/Canny1913/revanced-patches/commit/76166bb35f940ef661e2802f5bf93ed91f2e2913))
|
||||
* autoplay not working. ([586eed5](https://github.com/Canny1913/revanced-patches/commit/586eed515fc7ff8e3b1b150b0d34610b39480bb5))
|
||||
* autoplay still enabled when using patch ([4f96129](https://github.com/Canny1913/revanced-patches/commit/4f961298f6cb6417ee3f3d6f8ac7ce96594ed03b))
|
||||
* bump youtube version for swipe-controls patch ([ff207a5](https://github.com/Canny1913/revanced-patches/commit/ff207a57af7d3c15a8127f4465e97da23878b0d6))
|
||||
* bump youtube version to 17.27.39 ([b93401a](https://github.com/Canny1913/revanced-patches/commit/b93401a391c0ed4887dd1376ac253f74f98a8d7e))
|
||||
* bump youtube version to 17.28.34 ([#225](https://github.com/Canny1913/revanced-patches/issues/225)) ([738cb6a](https://github.com/Canny1913/revanced-patches/commit/738cb6af177e92bbff8c02d6808fe416c0ad2582))
|
||||
* check if node has attributes before accessing them ([2d2ed87](https://github.com/Canny1913/revanced-patches/commit/2d2ed870dacfe092eb6acbcaae5e51775c611322))
|
||||
* compatibility of `force-vp9-codec-parent-fingerprint` fingerprint with version `17.27.39` ([523fd86](https://github.com/Canny1913/revanced-patches/commit/523fd8627bc965a724267f725c28fba5e7a25a04))
|
||||
* constrain `old-quality-layout` to older version ([add7232](https://github.com/Canny1913/revanced-patches/commit/add72326199e90f677b450b553b9d88c0bb4c490))
|
||||
* crash when using force-vp9-codec patch ([7a35e5c](https://github.com/Canny1913/revanced-patches/commit/7a35e5c985b412d5a84083d1416d3207a40b3e97))
|
||||
* disable-fullscreen-panels patch not working ([#213](https://github.com/Canny1913/revanced-patches/issues/213)) ([5372105](https://github.com/Canny1913/revanced-patches/commit/5372105e72607f289b779e4c2a3c13f3458842ce))
|
||||
* display codename for patch names ([10c53f7](https://github.com/Canny1913/revanced-patches/commit/10c53f720df3e70b9d59e8bc3219d56b996f03db))
|
||||
* exclude `swipe-controls` by default due to instability ([bdeb8e0](https://github.com/Canny1913/revanced-patches/commit/bdeb8e04609a0ca94d9e2921bf7d486b9e229cec))
|
||||
* incorrect package name in gradle task ([152b2c9](https://github.com/Canny1913/revanced-patches/commit/152b2c90cf102170648fcc168da10f46743bdc63))
|
||||
* invalid regex ([26bf1d8](https://github.com/Canny1913/revanced-patches/commit/26bf1d818f953abc061126d8b91f17cd9008ba1d))
|
||||
* listing of wrong fingerprint class ([#147](https://github.com/Canny1913/revanced-patches/issues/147)) ([95c2bbd](https://github.com/Canny1913/revanced-patches/commit/95c2bbdd1deb1d76f1177b48286fa6a3bc9f7663))
|
||||
* make all patches toggleable with settings ([#202](https://github.com/Canny1913/revanced-patches/issues/202)) ([7e1d82f](https://github.com/Canny1913/revanced-patches/commit/7e1d82f1161237632c3a57f109db6b8903006b33))
|
||||
* make the patch work w/o settings ([7f0be5c](https://github.com/Canny1913/revanced-patches/commit/7f0be5c08b738d7baeef7ad3e167aab623c2d08e))
|
||||
* references to integrations in `return-youtube-dislike` patch ([5824c2c](https://github.com/Canny1913/revanced-patches/commit/5824c2cdfb1a2d7b8d68044388e5e0746ef2ca09))
|
||||
* remove "dependency" ([b93cb9b](https://github.com/Canny1913/revanced-patches/commit/b93cb9b8dd4b78c53bbf0298db0f532a42d46f7d))
|
||||
* rename autorepeat-by-default patch to always-autorepeat ([3606015](https://github.com/Canny1913/revanced-patches/commit/3606015d715f150cc51fbb29adf3be252b96faab))
|
||||
* stop using manually entered index ([ed0520d](https://github.com/Canny1913/revanced-patches/commit/ed0520d85c74729d7daabbfbd6cb77ad8cd62f15))
|
||||
* update patches to `17.26.35` ([#142](https://github.com/Canny1913/revanced-patches/issues/142)) ([b04112c](https://github.com/Canny1913/revanced-patches/commit/b04112c8562a7b95e7555e894b665913094b33eb))
|
||||
* use dependency in correct patch ([a2a1ee8](https://github.com/Canny1913/revanced-patches/commit/a2a1ee8eb5e059b30fe58c918a80976ef4d7b637))
|
||||
* wording [skip ci] ([ba64d9e](https://github.com/Canny1913/revanced-patches/commit/ba64d9efc3ee606e9bda30ad7f8017af34b1dc3f))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `compact-header` patch ([83753ba](https://github.com/Canny1913/revanced-patches/commit/83753bacf8f56ad16f8abafc02034f1595c12532))
|
||||
* `default-video-quality` patch ([9d30d37](https://github.com/Canny1913/revanced-patches/commit/9d30d372dd13663564286820f3e7685c0a0cee8a))
|
||||
* `force-vp9-codec` patch ([#157](https://github.com/Canny1913/revanced-patches/issues/157)) ([07806a1](https://github.com/Canny1913/revanced-patches/commit/07806a16e5368118949e0e476e901987433ad403))
|
||||
* `hide-get-premium` patch ([#195](https://github.com/Canny1913/revanced-patches/issues/195)) ([639aab4](https://github.com/Canny1913/revanced-patches/commit/639aab411ee514b50840c15c8e9a1a889854403f))
|
||||
* `minimize-playback-music` patch ([#200](https://github.com/Canny1913/revanced-patches/issues/200)) ([d4fd18b](https://github.com/Canny1913/revanced-patches/commit/d4fd18bc74c92e17cdfb21b627b2f6a8919ff2dc))
|
||||
* `music-video-ads` patch ([#172](https://github.com/Canny1913/revanced-patches/issues/172)) ([cbb71b5](https://github.com/Canny1913/revanced-patches/commit/cbb71b5faf1386ed31dd9e0387f6cf0509d92d31))
|
||||
* `return-youtube-dislikes` patch ([#175](https://github.com/Canny1913/revanced-patches/issues/175)) ([18a66d8](https://github.com/Canny1913/revanced-patches/commit/18a66d8454cf6e7cfdd4183631a6870c80d16b90))
|
||||
* `sponsorblock` patch ([#101](https://github.com/Canny1913/revanced-patches/issues/101)) ([36af4cc](https://github.com/Canny1913/revanced-patches/commit/36af4cc14ff8057c10b99019cb23acc6e5aec3f2)), closes [#89](https://github.com/Canny1913/revanced-patches/issues/89) [#90](https://github.com/Canny1913/revanced-patches/issues/90)
|
||||
* `swipe-controls` rewrite ([#131](https://github.com/Canny1913/revanced-patches/issues/131)) ([b7dba09](https://github.com/Canny1913/revanced-patches/commit/b7dba09927ba15a9eacb06dcb4bf1f268560c96e))
|
||||
* 1 line of code ([e2d28bd](https://github.com/Canny1913/revanced-patches/commit/e2d28bd576f74f1792dc959b8ed3064ec6a4cb68))
|
||||
* add version 17.26.35 ([25cd66c](https://github.com/Canny1913/revanced-patches/commit/25cd66cc6d2cd56a4170c5c69a708011fe7eab1d))
|
||||
* complete `default-video-quality` patch ([f7e153b](https://github.com/Canny1913/revanced-patches/commit/f7e153bd08b6dfe07591678195bfa6b06606f6a2))
|
||||
* issue templates ([b82b0aa](https://github.com/Canny1913/revanced-patches/commit/b82b0aad88b7ab9d86f1bcc8e007f6a76a9aa1a5))
|
||||
* twitter `timeline-ads` patch ([#222](https://github.com/Canny1913/revanced-patches/issues/222)) ([f16e67f](https://github.com/Canny1913/revanced-patches/commit/f16e67fc75c9c3505ff875a216ce7e868022075e))
|
||||
|
||||
## [2.21.3](https://github.com/revanced/revanced-patches/compare/v2.21.2...v2.21.3) (2022-07-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* rename autorepeat-by-default patch to always-autorepeat ([3606015](https://github.com/revanced/revanced-patches/commit/3606015d715f150cc51fbb29adf3be252b96faab))
|
||||
|
||||
## [2.21.2](https://github.com/revanced/revanced-patches/compare/v2.21.1...v2.21.2) (2022-07-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump youtube version to 17.28.34 ([#225](https://github.com/revanced/revanced-patches/issues/225)) ([738cb6a](https://github.com/revanced/revanced-patches/commit/738cb6af177e92bbff8c02d6808fe416c0ad2582))
|
||||
|
||||
## [2.21.1](https://github.com/revanced/revanced-patches/compare/v2.21.0...v2.21.1) (2022-07-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add v17.28.34 compatiblity for the `hide-shorts-button` patch ([#224](https://github.com/revanced/revanced-patches/issues/224)) ([76166bb](https://github.com/revanced/revanced-patches/commit/76166bb35f940ef661e2802f5bf93ed91f2e2913))
|
||||
|
||||
# [2.21.0](https://github.com/revanced/revanced-patches/compare/v2.20.5...v2.21.0) (2022-07-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* twitter `timeline-ads` patch ([#222](https://github.com/revanced/revanced-patches/issues/222)) ([f16e67f](https://github.com/revanced/revanced-patches/commit/f16e67fc75c9c3505ff875a216ce7e868022075e))
|
||||
|
||||
## [2.20.5](https://github.com/revanced/revanced-patches/compare/v2.20.4...v2.20.5) (2022-07-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* exclude `swipe-controls` by default due to instability ([bdeb8e0](https://github.com/revanced/revanced-patches/commit/bdeb8e04609a0ca94d9e2921bf7d486b9e229cec))
|
||||
|
||||
## [2.20.4](https://github.com/revanced/revanced-patches/compare/v2.20.3...v2.20.4) (2022-07-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* crash when using force-vp9-codec patch ([7a35e5c](https://github.com/revanced/revanced-patches/commit/7a35e5c985b412d5a84083d1416d3207a40b3e97))
|
||||
* use dependency in correct patch ([a2a1ee8](https://github.com/revanced/revanced-patches/commit/a2a1ee8eb5e059b30fe58c918a80976ef4d7b637))
|
||||
|
||||
## [2.20.4](https://github.com/revanced/revanced-patches/compare/v2.20.3...v2.20.4) (2022-07-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* crash when using force-vp9-codec patch ([7a35e5c](https://github.com/revanced/revanced-patches/commit/7a35e5c985b412d5a84083d1416d3207a40b3e97))
|
||||
* use dependency in correct patch ([a2a1ee8](https://github.com/revanced/revanced-patches/commit/a2a1ee8eb5e059b30fe58c918a80976ef4d7b637))
|
||||
|
||||
## [2.20.4](https://github.com/revanced/revanced-patches/compare/v2.20.3...v2.20.4) (2022-07-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* crash when using force-vp9-codec patch ([7a35e5c](https://github.com/revanced/revanced-patches/commit/7a35e5c985b412d5a84083d1416d3207a40b3e97))
|
||||
* use dependency in correct patch ([a2a1ee8](https://github.com/revanced/revanced-patches/commit/a2a1ee8eb5e059b30fe58c918a80976ef4d7b637))
|
||||
|
||||
## [2.20.4](https://github.com/revanced/revanced-patches/compare/v2.20.3...v2.20.4) (2022-07-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* use dependency in correct patch ([a2a1ee8](https://github.com/revanced/revanced-patches/commit/a2a1ee8eb5e059b30fe58c918a80976ef4d7b637))
|
||||
|
||||
## [2.20.3](https://github.com/revanced/revanced-patches/compare/v2.20.2...v2.20.3) (2022-07-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* disable-fullscreen-panels patch not working ([#213](https://github.com/revanced/revanced-patches/issues/213)) ([5372105](https://github.com/revanced/revanced-patches/commit/5372105e72607f289b779e4c2a3c13f3458842ce))
|
||||
|
||||
## [2.20.2](https://github.com/revanced/revanced-patches/compare/v2.20.1...v2.20.2) (2022-07-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* autoplay not working. ([586eed5](https://github.com/revanced/revanced-patches/commit/586eed515fc7ff8e3b1b150b0d34610b39480bb5))
|
||||
|
||||
## [2.20.1](https://github.com/revanced/revanced-patches/compare/v2.20.0...v2.20.1) (2022-07-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* autoplay still enabled when using patch ([4f96129](https://github.com/revanced/revanced-patches/commit/4f961298f6cb6417ee3f3d6f8ac7ce96594ed03b))
|
||||
|
||||
# [2.20.0](https://github.com/revanced/revanced-patches/compare/v2.19.0...v2.20.0) (2022-07-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `minimize-playback-music` patch ([#200](https://github.com/revanced/revanced-patches/issues/200)) ([d4fd18b](https://github.com/revanced/revanced-patches/commit/d4fd18bc74c92e17cdfb21b627b2f6a8919ff2dc))
|
||||
|
||||
# [2.19.0](https://github.com/revanced/revanced-patches/compare/v2.18.3...v2.19.0) (2022-07-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `compact-header` patch ([83753ba](https://github.com/revanced/revanced-patches/commit/83753bacf8f56ad16f8abafc02034f1595c12532))
|
||||
|
||||
## [2.18.3](https://github.com/revanced/revanced-patches/compare/v2.18.2...v2.18.3) (2022-07-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* compatibility of `force-vp9-codec-parent-fingerprint` fingerprint with version `17.27.39` ([523fd86](https://github.com/revanced/revanced-patches/commit/523fd8627bc965a724267f725c28fba5e7a25a04))
|
||||
|
||||
## [2.18.2](https://github.com/revanced/revanced-patches/compare/v2.18.1...v2.18.2) (2022-07-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* make all patches toggleable with settings ([#202](https://github.com/revanced/revanced-patches/issues/202)) ([7e1d82f](https://github.com/revanced/revanced-patches/commit/7e1d82f1161237632c3a57f109db6b8903006b33))
|
||||
|
||||
## [2.18.1](https://github.com/revanced/revanced-patches/compare/v2.18.0...v2.18.1) (2022-07-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `minimized-playback` patch for YouTube Kids videos ([#201](https://github.com/revanced/revanced-patches/issues/201)) ([31e3b42](https://github.com/revanced/revanced-patches/commit/31e3b42c6bbce0d00f049b8a69bafc94900bb3b4))
|
||||
|
||||
# [2.18.0](https://github.com/revanced/revanced-patches/compare/v2.17.0...v2.18.0) (2022-07-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `hide-get-premium` patch ([#195](https://github.com/revanced/revanced-patches/issues/195)) ([639aab4](https://github.com/revanced/revanced-patches/commit/639aab411ee514b50840c15c8e9a1a889854403f))
|
||||
|
||||
# [2.17.0](https://github.com/revanced/revanced-patches/compare/v2.16.1...v2.17.0) (2022-07-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* check if node has attributes before accessing them ([2d2ed87](https://github.com/revanced/revanced-patches/commit/2d2ed870dacfe092eb6acbcaae5e51775c611322))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `sponsorblock` patch ([#101](https://github.com/revanced/revanced-patches/issues/101)) ([36af4cc](https://github.com/revanced/revanced-patches/commit/36af4cc14ff8057c10b99019cb23acc6e5aec3f2)), closes [#89](https://github.com/revanced/revanced-patches/issues/89) [#90](https://github.com/revanced/revanced-patches/issues/90)
|
||||
|
||||
## [2.16.1](https://github.com/revanced/revanced-patches/compare/v2.16.0...v2.16.1) (2022-07-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump youtube version to 17.27.39 ([b93401a](https://github.com/revanced/revanced-patches/commit/b93401a391c0ed4887dd1376ac253f74f98a8d7e))
|
||||
|
||||
# [2.16.0](https://github.com/revanced/revanced-patches/compare/v2.15.1...v2.16.0) (2022-07-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `force-vp9-codec` patch ([#157](https://github.com/revanced/revanced-patches/issues/157)) ([07806a1](https://github.com/revanced/revanced-patches/commit/07806a16e5368118949e0e476e901987433ad403))
|
||||
|
||||
## [2.15.1](https://github.com/revanced/revanced-patches/compare/v2.15.0...v2.15.1) (2022-07-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `old-quality-layout` patch ([2497425](https://github.com/revanced/revanced-patches/commit/2497425c9f11b8b14c861c2f0f34ff47bdbfac53))
|
||||
* references to integrations in `return-youtube-dislike` patch ([5824c2c](https://github.com/revanced/revanced-patches/commit/5824c2cdfb1a2d7b8d68044388e5e0746ef2ca09))
|
||||
|
||||
# [2.15.0](https://github.com/revanced/revanced-patches/compare/v2.14.1...v2.15.0) (2022-07-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `return-youtube-dislikes` patch ([#175](https://github.com/revanced/revanced-patches/issues/175)) ([18a66d8](https://github.com/revanced/revanced-patches/commit/18a66d8454cf6e7cfdd4183631a6870c80d16b90))
|
||||
|
||||
## [2.14.1](https://github.com/revanced/revanced-patches/compare/v2.14.0...v2.14.1) (2022-07-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `codecs-unlock` patch and update Music patches to `5.14.53` ([2437d30](https://github.com/revanced/revanced-patches/commit/2437d3070f6a630d353619f642cefebd47abee20))
|
||||
|
||||
# [2.14.0](https://github.com/revanced/revanced-patches/compare/v2.13.6...v2.14.0) (2022-07-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `music-video-ads` patch ([#172](https://github.com/revanced/revanced-patches/issues/172)) ([cbb71b5](https://github.com/revanced/revanced-patches/commit/cbb71b5faf1386ed31dd9e0387f6cf0509d92d31))
|
||||
|
||||
## [2.13.6](https://github.com/revanced/revanced-patches/compare/v2.13.5...v2.13.6) (2022-07-14)
|
||||
|
||||
## [2.13.5](https://github.com/revanced/revanced-patches/compare/v2.13.4...v2.13.5) (2022-07-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `swipe-controls` with active engagement panel ([#177](https://github.com/revanced/revanced-patches/issues/177)) ([000ec6d](https://github.com/revanced/revanced-patches/commit/000ec6d8f6ecbb910a06ec852564ee9e5f03dcf8))
|
||||
|
||||
## [2.13.4](https://github.com/revanced/revanced-patches/compare/v2.13.3...v2.13.4) (2022-07-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* constrain `old-quality-layout` to older version ([add7232](https://github.com/revanced/revanced-patches/commit/add72326199e90f677b450b553b9d88c0bb4c490))
|
||||
|
||||
## [2.13.3](https://github.com/revanced/revanced-patches/compare/v2.13.2...v2.13.3) (2022-07-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `exclusive-audio-playback` patch ([#153](https://github.com/revanced/revanced-patches/issues/153)) ([9beff95](https://github.com/revanced/revanced-patches/commit/9beff9567f1586e5c58690c1f1d2f7f204025ab7))
|
||||
|
||||
## [2.13.2](https://github.com/revanced/revanced-patches/compare/v2.13.1...v2.13.2) (2022-07-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `hrd-auto-brightness` ([#152](https://github.com/revanced/revanced-patches/issues/152)) ([5f2e9ba](https://github.com/revanced/revanced-patches/commit/5f2e9ba30b7432be04bdc9f9f7ec7ac75fdc4b34))
|
||||
|
||||
## [2.13.1](https://github.com/revanced/revanced-patches/compare/v2.13.0...v2.13.1) (2022-07-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump youtube version for swipe-controls patch ([ff207a5](https://github.com/revanced/revanced-patches/commit/ff207a57af7d3c15a8127f4465e97da23878b0d6))
|
||||
|
||||
# [2.13.0](https://github.com/revanced/revanced-patches/compare/v2.12.4...v2.13.0) (2022-07-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `swipe-controls` rewrite ([#131](https://github.com/revanced/revanced-patches/issues/131)) ([b7dba09](https://github.com/revanced/revanced-patches/commit/b7dba09927ba15a9eacb06dcb4bf1f268560c96e))
|
||||
|
||||
## [2.12.4](https://github.com/revanced/revanced-patches/compare/v2.12.3...v2.12.4) (2022-07-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `autorepeat-by-default` patch ([#148](https://github.com/revanced/revanced-patches/issues/148)) ([fe628ba](https://github.com/revanced/revanced-patches/commit/fe628ba909d89ea0bf3d95fe94ca78ef819677da))
|
||||
|
||||
## [2.12.3](https://github.com/revanced/revanced-patches/compare/v2.12.2...v2.12.3) (2022-07-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* listing of wrong fingerprint class ([#147](https://github.com/revanced/revanced-patches/issues/147)) ([95c2bbd](https://github.com/revanced/revanced-patches/commit/95c2bbdd1deb1d76f1177b48286fa6a3bc9f7663))
|
||||
|
||||
## [2.12.2](https://github.com/revanced/revanced-patches/compare/v2.12.1...v2.12.2) (2022-07-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* display codename for patch names ([10c53f7](https://github.com/revanced/revanced-patches/commit/10c53f720df3e70b9d59e8bc3219d56b996f03db))
|
||||
* incorrect package name in gradle task ([152b2c9](https://github.com/revanced/revanced-patches/commit/152b2c90cf102170648fcc168da10f46743bdc63))
|
||||
* invalid regex ([26bf1d8](https://github.com/revanced/revanced-patches/commit/26bf1d818f953abc061126d8b91f17cd9008ba1d))
|
||||
|
||||
## [2.12.1](https://github.com/revanced/revanced-patches/compare/v2.12.0...v2.12.1) (2022-07-10)
|
||||
|
||||
# [2.12.0](https://github.com/revanced/revanced-patches/compare/v2.11.0...v2.12.0) (2022-07-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update patches to `17.26.35` ([#142](https://github.com/revanced/revanced-patches/issues/142)) ([b04112c](https://github.com/revanced/revanced-patches/commit/b04112c8562a7b95e7555e894b665913094b33eb))
|
||||
* wording [skip ci] ([ba64d9e](https://github.com/revanced/revanced-patches/commit/ba64d9efc3ee606e9bda30ad7f8017af34b1dc3f))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* issue templates ([b82b0aa](https://github.com/revanced/revanced-patches/commit/b82b0aad88b7ab9d86f1bcc8e007f6a76a9aa1a5))
|
||||
|
||||
# [2.11.0](https://github.com/revanced/revanced-patches/compare/v2.10.2...v2.11.0) (2022-07-09)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `autorepeat-by-default` patch ([#106](https://github.com/revanced/revanced-patches/issues/106)) ([e0ac9f3](https://github.com/revanced/revanced-patches/commit/e0ac9f385fc360f4dd2451e26676633120356c10))
|
||||
|
||||
## [2.10.2](https://github.com/revanced/revanced-patches/compare/v2.10.1...v2.10.2) (2022-07-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* trigger release on `build` commits ([be8bd1b](https://github.com/revanced/revanced-patches/commit/be8bd1b2a4b91f9763448661a802a5dc4a6b1d1d))
|
||||
|
||||
## [2.10.1](https://github.com/revanced/revanced-patches/compare/v2.10.0...v2.10.1) (2022-07-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* patch description consistency ([#134](https://github.com/revanced/revanced-patches/issues/134)) ([da5896d](https://github.com/revanced/revanced-patches/commit/da5896dde0a2b2b9ffe65e486402e4ef92ec1ce9))
|
||||
|
||||
# [2.10.0](https://github.com/revanced/revanced-patches/compare/v2.9.4...v2.10.0) (2022-07-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* implement `wide-searchbar` Patch ([#130](https://github.com/revanced/revanced-patches/issues/130)) ([332f4d1](https://github.com/revanced/revanced-patches/commit/332f4d12d06316d65db252a280fe1f263e65c3a8))
|
||||
|
||||
## [2.9.4](https://github.com/revanced/revanced-patches/compare/v2.9.3...v2.9.4) (2022-07-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add 17.25.34 as supported version for swipe-controls patch ([4d84c19](https://github.com/revanced/revanced-patches/commit/4d84c1914f8ecf51cee25667219bc6cf635a6c1c))
|
||||
|
||||
## [2.9.3](https://github.com/revanced/revanced-patches/compare/v2.9.2...v2.9.3) (2022-07-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Readd `swipe-controls` patch ([#123](https://github.com/revanced/revanced-patches/issues/123)) ([7f2a2b2](https://github.com/revanced/revanced-patches/commit/7f2a2b2ee4e6045d53aba4e7705431b643981107))
|
||||
|
||||
## [2.9.2](https://github.com/revanced/revanced-patches/compare/v2.9.1...v2.9.2) (2022-07-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* revert `swipe-controls` patch ([66e1f33](https://github.com/revanced/revanced-patches/commit/66e1f3384a58361737ba889d946be875b23f3163))
|
||||
|
||||
## [2.9.1](https://github.com/revanced/revanced-patches/compare/v2.9.0...v2.9.1) (2022-07-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* make `minimized-playback-manager-fingerprint` unique ([#120](https://github.com/revanced/revanced-patches/issues/120)) ([cd5e911](https://github.com/revanced/revanced-patches/commit/cd5e911f4ed9ad95b02c13c30cd9466d250e8904))
|
||||
|
||||
# [2.9.0](https://github.com/revanced/revanced-patches/compare/v2.8.2...v2.9.0) (2022-07-05)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `swipe-controls` patch ([#115](https://github.com/revanced/revanced-patches/issues/115)) ([1d0a7dc](https://github.com/revanced/revanced-patches/commit/1d0a7dcc0cc3ea2bcd8ce0221d5e2f53d6eb0ae5))
|
||||
|
||||
## [2.8.2](https://github.com/revanced/revanced-patches/compare/v2.8.1...v2.8.2) (2022-07-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* show minimized playback options in settings ([#118](https://github.com/revanced/revanced-patches/issues/118)) ([6e1a538](https://github.com/revanced/revanced-patches/commit/6e1a538d34291d75f19bf66a188bc69241de3a7a))
|
||||
|
||||
## [2.8.1](https://github.com/revanced/revanced-patches/compare/v2.8.0...v2.8.1) (2022-07-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove unnecessary version constraints ([#117](https://github.com/revanced/revanced-patches/issues/117)) ([1cddf8d](https://github.com/revanced/revanced-patches/commit/1cddf8d9063da3bbdba0fd7080c8c93768b83a4c))
|
||||
|
||||
# [2.8.0](https://github.com/revanced/revanced-patches/compare/v2.7.0...v2.8.0) (2022-07-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `enable-debugging` patch ([#116](https://github.com/revanced/revanced-patches/issues/116)) ([bb355e7](https://github.com/revanced/revanced-patches/commit/bb355e7b7e78e602a10b346fe7e5795463615a81))
|
||||
|
||||
# [2.7.0](https://github.com/revanced/revanced-patches/compare/v2.6.0...v2.7.0) (2022-07-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `hdr-max-brightness` patch ([#105](https://github.com/revanced/revanced-patches/issues/105)) ([1310573](https://github.com/revanced/revanced-patches/commit/131057366a777786d6016d3385584b4e17bc4a8b))
|
||||
* `hide-infocard-suggestions` patch ([#107](https://github.com/revanced/revanced-patches/issues/107)) ([31a767a](https://github.com/revanced/revanced-patches/commit/31a767adbb152906303ab0ae5250769fc38d0625))
|
||||
|
||||
# [2.6.0](https://github.com/revanced/revanced-patches/compare/v2.5.0...v2.6.0) (2022-07-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* freezing panels when watching video in fullscreen ([#89](https://github.com/revanced/revanced-patches/issues/89)) ([f5d4f6c](https://github.com/revanced/revanced-patches/commit/f5d4f6c3419916c6a9cf67babc6be8a64c854d3b))
|
||||
* invalid version in compatibility annotation ([#90](https://github.com/revanced/revanced-patches/issues/90)) ([df43547](https://github.com/revanced/revanced-patches/commit/df435475cdd0494a1e4ea9e2980c2998c9bc7048))
|
||||
* remove refreshing home screen not working ([6c24ebe](https://github.com/revanced/revanced-patches/commit/6c24ebef2fb4f0d58e369ac5bf63e4cab6ca0e80))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* migrate to breaking changes of patcher ([d9147cd](https://github.com/revanced/revanced-patches/commit/d9147cd60c0c25d0c5cc05409b8889dfacd89af9))
|
||||
|
||||
# [2.6.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.6.0-dev.1...v2.6.0-dev.2) (2022-07-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove refreshing home screen not working ([ec7ae90](https://github.com/revanced/revanced-patches/commit/ec7ae900181b6456c692adb3b5bb337e81bc5fea))
|
||||
|
||||
# [2.6.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.5.1-dev.1...v2.6.0-dev.1) (2022-07-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* migrate to breaking changes of patcher ([a116852](https://github.com/revanced/revanced-patches/commit/a11685263fb2274c67684258e73c5247502cb010))
|
||||
|
||||
## [2.5.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.5.0...v2.5.1-dev.1) (2022-06-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* freezing panels when watching video in fullscreen ([#89](https://github.com/revanced/revanced-patches/issues/89)) ([f5d4f6c](https://github.com/revanced/revanced-patches/commit/f5d4f6c3419916c6a9cf67babc6be8a64c854d3b))
|
||||
* invalid version in compatibility annotation ([#90](https://github.com/revanced/revanced-patches/issues/90)) ([df43547](https://github.com/revanced/revanced-patches/commit/df435475cdd0494a1e4ea9e2980c2998c9bc7048))
|
||||
|
||||
# [2.5.0](https://github.com/revanced/revanced-patches/compare/v2.4.0...v2.5.0) (2022-06-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* hide watermark support for 17.25.34 ([#87](https://github.com/revanced/revanced-patches/issues/87)) ([0cdb65b](https://github.com/revanced/revanced-patches/commit/0cdb65bbb3e7b9d75eb393ee87e3718bcd6af4b3))
|
||||
|
||||
# [2.4.0](https://github.com/revanced/revanced-patches/compare/v2.3.1...v2.4.0) (2022-06-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add youtube version 17.25.34 ([#85](https://github.com/revanced/revanced-patches/issues/85)) ([889c9d5](https://github.com/revanced/revanced-patches/commit/889c9d564d16c6e68a52095a4fc8e6d04346c9e9))
|
||||
|
||||
## [2.3.1](https://github.com/revanced/revanced-patches/compare/v2.3.0...v2.3.1) (2022-06-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* change fingerprint to work on latest youtube ([#80](https://github.com/revanced/revanced-patches/issues/80)) ([4dba323](https://github.com/revanced/revanced-patches/commit/4dba323ddf8980cd2b0908a0de41c4b4dea6b0d7))
|
||||
|
||||
# [2.3.0](https://github.com/revanced/revanced-patches/compare/v2.2.0...v2.3.0) (2022-06-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `disable-autoplay-button` patch ([#79](https://github.com/revanced/revanced-patches/issues/79)) ([0d6fb51](https://github.com/revanced/revanced-patches/commit/0d6fb51e025649aae37e230778ea367482fab0d7))
|
||||
|
||||
# [2.2.0](https://github.com/revanced/revanced-patches/compare/v2.1.0...v2.2.0) (2022-06-29)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* make resource mapping patch aware of types ([#77](https://github.com/revanced/revanced-patches/issues/77)) ([188491a](https://github.com/revanced/revanced-patches/commit/188491a707abccc1164413f075d8a66c145a1455))
|
||||
|
||||
# [2.1.0](https://github.com/revanced/revanced-patches/compare/v2.0.3...v2.1.0) (2022-06-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `custom-playback-speed` patch ([#50](https://github.com/revanced/revanced-patches/issues/50)) ([224254b](https://github.com/revanced/revanced-patches/commit/224254bcce2b394bbfd2549089f0204ce4ed4a89))
|
||||
|
||||
## [2.0.3](https://github.com/revanced/revanced-patches/compare/v2.0.2...v2.0.3) (2022-06-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* check if resource files exist ([ba1f3af](https://github.com/revanced/revanced-patches/commit/ba1f3af99be58edc44ed1b8f1875508d5034efd8))
|
||||
|
||||
## [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)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove unused patches ([d12e92a](https://github.com/revanced/revanced-patches/commit/d12e92aead677fefa9dcb48748d783225b65fab1))
|
||||
|
||||
# [1.0.0-dev.14](https://github.com/revanced/revanced-patches/compare/v1.0.0-dev.13...v1.0.0-dev.14) (2022-06-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* spelling mistake ([52f9147](https://github.com/revanced/revanced-patches/commit/52f9147ee8d591f786397d174dc02a141d9250a9))
|
||||
|
||||
|
||||
### 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))
|
||||
|
||||
# [1.0.0-dev.13](https://github.com/revanced/revanced-patches/compare/v1.0.0-dev.12...v1.0.0-dev.13) (2022-05-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 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))
|
||||
|
||||
# [1.0.0-dev.12](https://github.com/revanced/revanced-patches/compare/v1.0.0-dev.11...v1.0.0-dev.12) (2022-05-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* wrong annotation and signature in patches ([a0fdee8](https://github.com/revanced/revanced-patches/commit/a0fdee81a6d6773603520e7c3040ae8637642d58))
|
||||
|
||||
# [1.0.0-dev.11](https://github.com/revanced/revanced-patches/compare/v1.0.0-dev.10...v1.0.0-dev.11) (2022-05-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* breaking changes by `revanced-patcher` dependency ([7e485b4](https://github.com/revanced/revanced-patches/commit/7e485b4ffe204d724809aeb9bd9f693a35ded94d))
|
||||
* breaking patcher changes ([50f9cc5](https://github.com/revanced/revanced-patches/commit/50f9cc52acfd5bc23330ecd23d8d85678a9d3eee))
|
||||
* breaking patcher changes ([cbb9e2c](https://github.com/revanced/revanced-patches/commit/cbb9e2cd1fa829e1d1dd92dbd40131b11ae6a05b))
|
||||
* bugfixes in `microg` ([a43b33b](https://github.com/revanced/revanced-patches/commit/a43b33bdbb2b36e0a8f991fa11dfeeec34de01f9))
|
||||
* write while reading resources and remove checking for "." in resource extensions ([7bc6094](https://github.com/revanced/revanced-patches/commit/7bc60943cb2350e89dac091ec9c98c5effd0b8a9))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* begin `MicroG Patch` ([91474ba](https://github.com/revanced/revanced-patches/commit/91474ba07376c13e7a71685dfd8b6e6913ed5ee9))
|
||||
* update MicroG patch to latest version ([c24f806](https://github.com/revanced/revanced-patches/commit/c24f8063a04f89aea2d2f7087a435738de7dfeae))
|
||||
|
||||
# [1.0.0-dev.11](https://github.com/revanced/revanced-patches/compare/v1.0.0-dev.10...v1.0.0-dev.11) (2022-05-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* breaking changes by `revanced-patcher` dependency ([7e485b4](https://github.com/revanced/revanced-patches/commit/7e485b4ffe204d724809aeb9bd9f693a35ded94d))
|
||||
* breaking patcher changes ([50f9cc5](https://github.com/revanced/revanced-patches/commit/50f9cc52acfd5bc23330ecd23d8d85678a9d3eee))
|
||||
* breaking patcher changes ([cbb9e2c](https://github.com/revanced/revanced-patches/commit/cbb9e2cd1fa829e1d1dd92dbd40131b11ae6a05b))
|
||||
* bugfixes in `microg` ([a43b33b](https://github.com/revanced/revanced-patches/commit/a43b33bdbb2b36e0a8f991fa11dfeeec34de01f9))
|
||||
* write while reading resources and remove checking for "." in resource extensions ([7bc6094](https://github.com/revanced/revanced-patches/commit/7bc60943cb2350e89dac091ec9c98c5effd0b8a9))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* begin `MicroG Patch` ([91474ba](https://github.com/revanced/revanced-patches/commit/91474ba07376c13e7a71685dfd8b6e6913ed5ee9))
|
||||
* update MicroG patch to latest version ([c24f806](https://github.com/revanced/revanced-patches/commit/c24f8063a04f89aea2d2f7087a435738de7dfeae))
|
||||
|
||||
# [1.0.0-dev.10](https://github.com/revanced/revanced-patches/compare/v1.0.0-dev.9...v1.0.0-dev.10) (2022-05-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `create-button-signature` ([a173f6e](https://github.com/revanced/revanced-patches/commit/a173f6e5a7e65943657e2072e8a72a4a680e5277))
|
||||
* breaking changes by `revanced-patcher` dependency ([e12e484](https://github.com/revanced/revanced-patches/commit/e12e484e3796c5c9c8505b677838cdf8432f2e79))
|
||||
* loop in `amoled` patch ([c4c86b6](https://github.com/revanced/revanced-patches/commit/c4c86b65fd8b2463c1d86ad2e46ec9f08e60d47c))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add `amoled` patch ([d61bac4](https://github.com/revanced/revanced-patches/commit/d61bac4f8243d0ef72ca91c7c1d5facd858d515e))
|
||||
* update patches to latest version ([bad25de](https://github.com/revanced/revanced-patches/commit/bad25dec1d73137f8b7a1bf4daaceb2279b4d48c))
|
||||
|
||||
# [1.0.0-dev.9](https://github.com/revanced/revanced-patches/compare/v1.0.0-dev.8...v1.0.0-dev.9) (2022-05-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* clean after building ([a2df3fb](https://github.com/revanced/revanced-patches/commit/a2df3fbc9761b07f3010542fa8684ade00e4dc91))
|
||||
|
||||
# [1.0.0-dev.8](https://github.com/revanced/revanced-patches/compare/v1.0.0-dev.7...v1.0.0-dev.8) (2022-05-13)
|
||||
|
||||
|
||||
|
||||
7
README-template.md
Normal file
7
README-template.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# 🧩 ReVanced Patches
|
||||
|
||||
Official patches by ReVanced
|
||||
|
||||
## 📜 List of available patches
|
||||
|
||||
{{ table }}
|
||||
66
README.md
66
README.md
@@ -1,2 +1,64 @@
|
||||
# revanced-patches
|
||||
Repo for all ReVanced patches
|
||||
# 🧩 ReVanced Patches
|
||||
|
||||
Official patches by ReVanced
|
||||
|
||||
## 📜 List of available patches
|
||||
|
||||
### 📦 `com.twitter.android`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `timeline-ads` | Removes ads from the Twitter timeline. | all |
|
||||
</details>
|
||||
|
||||
### 📦 `com.google.android.apps.youtube.music`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `minimized-playback-music` | Enables minimized playback on Kids music. | 5.16.51 |
|
||||
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the home screen. | 5.16.51 |
|
||||
| `hide-get-premium` | Removes all "Get Premium" evidences from the avatar menu. | 5.16.51 |
|
||||
| `compact-header` | Hides the music category bar at the top of the homepage. | 5.16.51 |
|
||||
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar. | 5.16.51 |
|
||||
| `background-play` | Enables playing music in the background. | 5.16.51 |
|
||||
| `music-microg-support` | Patch to allow YouTube Music ReVanced to run without root and under a different package name. | 5.16.51 |
|
||||
| `music-video-ads` | Removes ads in the music player. | 5.16.51 |
|
||||
| `codecs-unlock` | Adds more audio codec options. The new audio codecs usually result in better audio quality. | 5.16.51 |
|
||||
| `exclusive-audio-playback` | Enables the option to play music without video. | 5.16.51 |
|
||||
</details>
|
||||
|
||||
### 📦 `com.google.android.youtube`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `swipe-controls` | Adds volume and brightness swipe controls. | 17.29.34 |
|
||||
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 17.29.34 |
|
||||
| `minimized-playback` | Enables minimized and background playback. | 17.29.34 |
|
||||
| `amoled` | Enables pure black theme. | 17.29.34 |
|
||||
| `disable-create-button` | Hides the create button in the navigation bar. | 17.29.34 |
|
||||
| `hide-cast-button` | Hides the cast button in the video player. | all |
|
||||
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 17.29.34 |
|
||||
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.29.34 |
|
||||
| `premium-heading` | Shows premium branding on the home screen. | all |
|
||||
| `custom-branding` | Changes the YouTube launcher icon to be ReVanced's. | all |
|
||||
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 17.29.34 |
|
||||
| `old-quality-layout` | Enables the original quality flyout menu. | 17.29.34 |
|
||||
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.29.34 |
|
||||
| `hide-watermark` | Hides creator's watermarks on videos. | 17.29.34 |
|
||||
| `sponsorblock` | Integrate SponsorBlock. | 17.29.34 |
|
||||
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.29.34 |
|
||||
| `force-vp9-codec` | Forces the VP9 codec for videos. | 17.29.34 |
|
||||
| `always-autorepeat` | Always repeats the playing video again. | 17.29.34 |
|
||||
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG | 17.29.34 |
|
||||
| `enable-debugging` | Enables app debugging by patching the manifest file. | all |
|
||||
| `custom-playback-speed` | Adds more video playback speed options. | 17.29.34 |
|
||||
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 17.29.34 |
|
||||
| `video-ads` | Removes ads in the video player. | 17.29.34 |
|
||||
| `general-ads` | Removes general ads. | 17.29.34 |
|
||||
| `hide-infocard-suggestions` | Hides infocards in videos. | 17.29.34 |
|
||||
</details>
|
||||
|
||||
|
||||
|
||||
@@ -1,59 +1,67 @@
|
||||
plugins {
|
||||
kotlin("jvm") version "1.6.20"
|
||||
java
|
||||
`maven-publish`
|
||||
kotlin("jvm") version "1.7.0"
|
||||
}
|
||||
|
||||
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 {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
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 {
|
||||
// DO NOT set these variables in the project's gradle.properties.
|
||||
// Instead, you should set them in:
|
||||
// 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!
|
||||
username = githubUsername
|
||||
password = githubPassword
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib"))
|
||||
testImplementation(kotlin("test"))
|
||||
|
||||
implementation("app.revanced:revanced-patcher:1.+")
|
||||
implementation("app.revanced:revanced-patcher:2.4.0")
|
||||
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
withJavadocJar()
|
||||
}
|
||||
tasks {
|
||||
register<DefaultTask>("generateDex") {
|
||||
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 {
|
||||
repositories {
|
||||
if (isGitHubCI) {
|
||||
maven {
|
||||
name = "GitHubPackages"
|
||||
url = uri("https://maven.pkg.github.com/revanced/revanced-patches") // note the "s"!
|
||||
credentials {
|
||||
username = System.getenv("GITHUB_ACTOR")
|
||||
password = System.getenv("GITHUB_TOKEN")
|
||||
}
|
||||
exec {
|
||||
workingDir = work
|
||||
commandLine = listOf(d8, input)
|
||||
}
|
||||
|
||||
exec {
|
||||
workingDir = work
|
||||
commandLine = listOf("mv", "classes.dex", output)
|
||||
}
|
||||
} else {
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
publications {
|
||||
register<MavenPublication>("gpr") {
|
||||
from(components["java"])
|
||||
}
|
||||
register<JavaExec>("generateReadme") {
|
||||
description = "Generate README.md"
|
||||
dependsOn(build)
|
||||
|
||||
classpath = sourceSets["main"].runtimeClasspath
|
||||
mainClass.set("app.revanced.meta.readme.Generator")
|
||||
}
|
||||
// Dummy task to fix the Gradle semantic-release plugin.
|
||||
// Remove this if you forked it to support building only.
|
||||
// Tracking issue: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
||||
register<DefaultTask>("publish") {
|
||||
group = "publish"
|
||||
description = "Dummy task"
|
||||
dependsOn(named("generateDex"), named("generateReadme"))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
kotlin.code.style = official
|
||||
version = 1.0.0-dev.8
|
||||
version = 2.24.0
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -1,14 +1,187 @@
|
||||
package app.revanced.extensions
|
||||
|
||||
import app.revanced.patcher.smali.toInstruction
|
||||
import app.revanced.patcher.data.impl.ResourceData
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patcher.util.smali.toInstruction
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.builder.MutableMethodImplementation
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction11n
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction11x
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
|
||||
import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
|
||||
import org.w3c.dom.Node
|
||||
import java.io.OutputStream
|
||||
import java.nio.file.Files
|
||||
|
||||
// TODO: this method does not make sense here
|
||||
internal fun MutableMethodImplementation.injectHideCall(
|
||||
index: Int,
|
||||
register: Int
|
||||
) {
|
||||
this.addInstruction(
|
||||
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()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert an event hook at the top of the method. If the hook returns true, the event is consumed and the method will return with true
|
||||
*
|
||||
* the hook method MUST return a boolean and MUST take two parameters, like so:
|
||||
* fun hook(thisRef: Object, eventData: Object): Boolean {}
|
||||
*
|
||||
* The final injected code will resemble the following logic:
|
||||
* if( YouHook(this, event) ) { return true; }
|
||||
* ...
|
||||
*
|
||||
* @param hookRef reference to the hook method
|
||||
*/
|
||||
internal fun MutableMethod.injectConsumableEventHook(hookRef: ImmutableMethodReference) {
|
||||
val isStaticMethod = AccessFlags.STATIC.isSet(this.accessFlags)
|
||||
this.implementation?.let { impl ->
|
||||
// create label to index 0 to continue to the normal program flow
|
||||
val lblContinueNormalFlow = impl.newLabelForIndex(0)
|
||||
|
||||
// define registers
|
||||
/** V0 */
|
||||
val regV0 = 0
|
||||
|
||||
/** this */
|
||||
val regP0 = impl.registerCount - this.parameters.size - (if (isStaticMethod) 0 else 1)
|
||||
|
||||
/** motionEvent */
|
||||
val regP1 = regP0 + 1
|
||||
|
||||
// insert instructions at the start of the method:
|
||||
// if( Hook(this, event) ) { return true; }
|
||||
impl.addInstructions(
|
||||
0, listOf(
|
||||
// invoke-static { p0, p1 } <hook>
|
||||
BuilderInstruction35c(
|
||||
Opcode.INVOKE_STATIC,
|
||||
2,
|
||||
regP0,
|
||||
regP1,
|
||||
0, 0, 0,
|
||||
hookRef
|
||||
),
|
||||
|
||||
// move-result v0
|
||||
BuilderInstruction11x(
|
||||
Opcode.MOVE_RESULT,
|
||||
regV0
|
||||
),
|
||||
|
||||
// if-eqz v0, :continue_normal_flow
|
||||
BuilderInstruction21t(
|
||||
Opcode.IF_EQZ,
|
||||
regV0,
|
||||
lblContinueNormalFlow
|
||||
),
|
||||
|
||||
// const/4 v0, 0x1
|
||||
BuilderInstruction11n(
|
||||
Opcode.CONST_4,
|
||||
regV0,
|
||||
0x1
|
||||
),
|
||||
|
||||
// return v0
|
||||
BuilderInstruction11x(
|
||||
Opcode.RETURN,
|
||||
regV0
|
||||
)
|
||||
|
||||
// :continue_normal_flow
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* inject resources into the patched app
|
||||
*
|
||||
* @param classLoader classloader to use for loading the resources
|
||||
* @param patchDirectoryPath path to the files. this will be the directory you created under the 'resources' source folder
|
||||
* @param resourceType the resource type, for example 'drawable'. this has to match both the source and the target
|
||||
* @param resourceFileNames names of all resources of this type to inject
|
||||
*/
|
||||
fun ResourceData.injectResources(
|
||||
classLoader: ClassLoader,
|
||||
patchDirectoryPath: String,
|
||||
resourceType: String,
|
||||
resourceFileNames: List<String>
|
||||
) {
|
||||
resourceFileNames.forEach { name ->
|
||||
val relativePath = "$resourceType/$name"
|
||||
val sourceRes = classLoader.getResourceAsStream("$patchDirectoryPath/$relativePath")
|
||||
?: throw PatchResultError("could not open resource '$patchDirectoryPath/$relativePath'")
|
||||
|
||||
Files.copy(
|
||||
sourceRes,
|
||||
this["res"].resolve(relativePath).toPath()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* inject strings into the patched app
|
||||
*
|
||||
* @param classLoader classloader to use for loading the resources
|
||||
* @param patchDirectoryPath path to the files. this will be the directory you created under the 'resources' source folder
|
||||
* @param languageIdentifier ISO 639-2 two- letter language code identifier (aka the one android uses for values directory)
|
||||
*/
|
||||
fun ResourceData.injectStrings(
|
||||
classLoader: ClassLoader,
|
||||
patchDirectoryPath: String,
|
||||
languageIdentifier: String? = null,
|
||||
) {
|
||||
val relativePath =
|
||||
if (languageIdentifier.isNullOrBlank()) "values/strings.xml" else "values/strings-$languageIdentifier.xml"
|
||||
|
||||
// open source strings.xml
|
||||
val sourceInputStream = classLoader.getResourceAsStream("$patchDirectoryPath/$relativePath")
|
||||
?: throw PatchResultError("failed to open '$patchDirectoryPath/$relativePath'")
|
||||
xmlEditor[sourceInputStream, OutputStream.nullOutputStream()].use { sourceStringsXml ->
|
||||
val strings = sourceStringsXml.file.getElementsByTagName("resources").item(0).childNodes
|
||||
|
||||
// open target strings.xml
|
||||
xmlEditor["res/$relativePath"].use { targetStringsXml ->
|
||||
val targetFile = targetStringsXml.file
|
||||
val targetRootNode = targetFile.getElementsByTagName("resources").item(0)
|
||||
|
||||
// process all children strings in the source
|
||||
for (i in 0 until strings.length) {
|
||||
// clone the node from source to target
|
||||
val node = strings.item(i).cloneNode(true)
|
||||
targetFile.adoptNode(node)
|
||||
targetRootNode.appendChild(node)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal fun Node.doRecursively(action: (Node) -> Unit) {
|
||||
action(this)
|
||||
for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action)
|
||||
}
|
||||
|
||||
internal fun String.startsWithAny(vararg prefixes: String): Boolean {
|
||||
for (prefix in prefixes)
|
||||
if (this.startsWith(prefix))
|
||||
return true
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
internal fun String.equalsAny(vararg other: String): Boolean {
|
||||
for (_other in other)
|
||||
if (this == _other)
|
||||
return true
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
11
src/main/kotlin/app/revanced/meta/readme/Extensions.kt
Normal file
11
src/main/kotlin/app/revanced/meta/readme/Extensions.kt
Normal file
@@ -0,0 +1,11 @@
|
||||
package app.revanced.meta.readme
|
||||
|
||||
import app.revanced.patcher.data.Data
|
||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
||||
import app.revanced.patcher.patch.Patch
|
||||
|
||||
internal fun Class<out Patch<Data>>.getLatestVersion(): SemanticVersion? =
|
||||
this.compatiblePackages?.first()?.versions?.map { SemanticVersion.fromString(it) }
|
||||
?.maxWithOrNull(
|
||||
SemanticVersionComparator
|
||||
)
|
||||
55
src/main/kotlin/app/revanced/meta/readme/Generator.kt
Normal file
55
src/main/kotlin/app/revanced/meta/readme/Generator.kt
Normal file
@@ -0,0 +1,55 @@
|
||||
package app.revanced.meta.readme
|
||||
|
||||
import app.revanced.patcher.data.Data
|
||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
||||
import app.revanced.patcher.extensions.PatchExtensions.description
|
||||
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
||||
import app.revanced.patcher.patch.Patch
|
||||
import app.revanced.patcher.util.patch.implementation.JarPatchBundle
|
||||
import java.io.File
|
||||
|
||||
object Generator {
|
||||
private const val TABLE_HEADER =
|
||||
"| \uD83D\uDC8A Patch | \uD83D\uDCDC Description | \uD83C\uDFF9 Target Version |\n" +
|
||||
"|:--------:|:--------------:|:-----------------:|"
|
||||
|
||||
@JvmStatic
|
||||
fun main(args: Array<String>) {
|
||||
val buildDir = File("build/libs/")
|
||||
val buildJar =
|
||||
buildDir.listFiles()?.first { it.name.startsWith("revanced-patches-") && it.name.endsWith(".jar") }!!
|
||||
|
||||
val bundle = JarPatchBundle(buildJar.absolutePath).loadPatches()
|
||||
|
||||
val output = StringBuilder()
|
||||
|
||||
val packages = mutableMapOf<String, MutableList<Class<out Patch<Data>>>>()
|
||||
|
||||
bundle.map {
|
||||
val packageName = it.compatiblePackages?.first()?.name!!
|
||||
if (!packages.contains(packageName)) {
|
||||
packages[packageName] = mutableListOf()
|
||||
}
|
||||
|
||||
packages[packageName]?.add(it)
|
||||
}
|
||||
|
||||
for (pkg in packages) {
|
||||
output.appendLine("### \uD83D\uDCE6 `${pkg.key}`")
|
||||
output.appendLine("<details>\n")
|
||||
|
||||
output.appendLine(TABLE_HEADER)
|
||||
pkg.value.forEach { output.appendLine("| `${it.patchName}` | ${it.description} | ${it.getLatestVersion() ?: "all"} |") }
|
||||
|
||||
output.appendLine("</details>\n")
|
||||
}
|
||||
|
||||
val readMeTemplateFile = File("README-template.md")
|
||||
val readmeTemplate = Template(readMeTemplateFile.readText())
|
||||
|
||||
readmeTemplate.replaceVariable("table", output.toString())
|
||||
|
||||
val readme = File("README.md")
|
||||
readme.writeText(readmeTemplate.toString())
|
||||
}
|
||||
}
|
||||
24
src/main/kotlin/app/revanced/meta/readme/SemanticVersion.kt
Normal file
24
src/main/kotlin/app/revanced/meta/readme/SemanticVersion.kt
Normal file
@@ -0,0 +1,24 @@
|
||||
package app.revanced.meta.readme
|
||||
|
||||
data class SemanticVersion(val major: Int, val minor: Int, val patch: Int) {
|
||||
companion object {
|
||||
fun fromString(version: String): SemanticVersion {
|
||||
var parts = version.split(".")
|
||||
|
||||
if (parts.count() != 3) throw IllegalArgumentException("Invalid semantic version")
|
||||
|
||||
val versionNumbers = parts.map { it.toInt() }
|
||||
return SemanticVersion(versionNumbers[0], versionNumbers[1], versionNumbers[2])
|
||||
}
|
||||
}
|
||||
|
||||
override fun toString(): String = "$major.$minor.$patch"
|
||||
}
|
||||
|
||||
object SemanticVersionComparator : Comparator<SemanticVersion> {
|
||||
override fun compare(a: SemanticVersion, b: SemanticVersion): Int = when {
|
||||
a.major != b.major -> a.major - b.major
|
||||
a.minor != b.minor -> a.minor - b.minor
|
||||
else -> a.patch - b.patch
|
||||
}
|
||||
}
|
||||
14
src/main/kotlin/app/revanced/meta/readme/Template.kt
Normal file
14
src/main/kotlin/app/revanced/meta/readme/Template.kt
Normal file
@@ -0,0 +1,14 @@
|
||||
package app.revanced.meta.readme
|
||||
|
||||
class Template(template: String) {
|
||||
val result: StringBuilder = StringBuilder(template)
|
||||
|
||||
fun replaceVariable(name: String, value: String) {
|
||||
val regex = Regex("\\{\\{\\s?$name\\s?}}")
|
||||
val range = regex.find(result)!!.range
|
||||
|
||||
result.replace(range.first, range.last + 1, value)
|
||||
}
|
||||
|
||||
override fun toString(): String = result.toString()
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package app.revanced.patches
|
||||
|
||||
import app.revanced.patcher.data.base.Data
|
||||
import app.revanced.patcher.patch.base.Patch
|
||||
import app.revanced.patches.music.audio.CodecsUnlockPatch
|
||||
import app.revanced.patches.music.audio.EnableAudioOnlyPatch
|
||||
import app.revanced.patches.music.layout.RemoveTasteBuilderPatch
|
||||
import app.revanced.patches.music.layout.RemoveUpgradeTabPatch
|
||||
import app.revanced.patches.music.premium.BackgroundPlayPatch
|
||||
import app.revanced.patches.youtube.ad.HomePromoPatch
|
||||
import app.revanced.patches.youtube.ad.VideoAdsPatch
|
||||
import app.revanced.patches.youtube.interaction.EnableSeekbarTappingPatch
|
||||
import app.revanced.patches.youtube.layout.*
|
||||
import app.revanced.patches.youtube.misc.FixLocaleConfigErrorPatch
|
||||
import app.revanced.patches.youtube.misc.IntegrationsPatch
|
||||
|
||||
/**
|
||||
* Index contains all the patches.
|
||||
*/
|
||||
@Suppress("Unused")
|
||||
object Index {
|
||||
/**
|
||||
* Array of patches.
|
||||
* New patches should be added to the array.
|
||||
*/
|
||||
val patches: List<() -> Patch<Data>> = listOf(
|
||||
::IntegrationsPatch,
|
||||
::FixLocaleConfigErrorPatch,
|
||||
//::HomeAdsPatch,
|
||||
::VideoAdsPatch,
|
||||
::HomePromoPatch,
|
||||
::MinimizedPlaybackPatch,
|
||||
::CreateButtonRemoverPatch,
|
||||
::ShortsButtonRemoverPatch,
|
||||
::HideReelsPatch,
|
||||
::OldQualityLayoutPatch,
|
||||
::EnableSeekbarTappingPatch,
|
||||
::EnableAudioOnlyPatch,
|
||||
::RemoveUpgradeTabPatch,
|
||||
::RemoveTasteBuilderPatch,
|
||||
::BackgroundPlayPatch,
|
||||
::CodecsUnlockPatch
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.music.ad.video.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class MusicVideoAdsCompatibility
|
||||
@@ -0,0 +1,39 @@
|
||||
package app.revanced.patches.music.ad.video.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.music.ad.video.annotations.MusicVideoAdsCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("show-video-ads-constructor-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Laghd;",
|
||||
"<init>",
|
||||
)
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@MusicVideoAdsCompatibility
|
||||
@Version("0.0.1")
|
||||
object ShowMusicVideoAdsConstructorFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L"), listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IPUT_BOOLEAN,
|
||||
Opcode.RETURN_VOID
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,26 @@
|
||||
package app.revanced.patches.music.ad.video.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.music.ad.video.annotations.MusicVideoAdsCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("show-video-ads-method-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Laghd;", "d"
|
||||
)
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@MusicVideoAdsCompatibility
|
||||
@Version("0.0.1")
|
||||
object ShowMusicVideoAdsFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"), listOf(
|
||||
Opcode.IPUT_BOOLEAN,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.RETURN_VOID
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,40 @@
|
||||
package app.revanced.patches.music.ad.video.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.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.impl.BytecodePatch
|
||||
import app.revanced.patches.music.ad.video.annotations.MusicVideoAdsCompatibility
|
||||
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsConstructorFingerprint
|
||||
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsFingerprint
|
||||
|
||||
@Patch
|
||||
@Name("music-video-ads")
|
||||
@Description("Removes ads in the music player.")
|
||||
@MusicVideoAdsCompatibility
|
||||
@Version("0.0.1")
|
||||
class MusicVideoAdsPatch : BytecodePatch(
|
||||
listOf(
|
||||
ShowMusicVideoAdsConstructorFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
ShowMusicVideoAdsFingerprint.resolve(data, ShowMusicVideoAdsConstructorFingerprint.result!!.classDef)
|
||||
|
||||
val result = ShowMusicVideoAdsFingerprint.result!!
|
||||
|
||||
result.mutableMethod.addInstructions(
|
||||
result.patternScanResult!!.startIndex, """
|
||||
const/4 p1, 0x0
|
||||
"""
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
package app.revanced.patches.music.audio
|
||||
|
||||
import app.revanced.patcher.data.implementation.BytecodeData
|
||||
import app.revanced.patcher.data.implementation.toMethodWalker
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
||||
import app.revanced.patcher.patch.implementation.metadata.PackageMetadata
|
||||
import app.revanced.patcher.patch.implementation.metadata.PatchMetadata
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
||||
import app.revanced.patcher.signature.MethodMetadata
|
||||
import app.revanced.patcher.signature.MethodSignature
|
||||
import app.revanced.patcher.signature.MethodSignatureMetadata
|
||||
import app.revanced.patcher.signature.PatternScanMethod
|
||||
import app.revanced.patcher.smali.toInstruction
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
private val packageMetadata = listOf(
|
||||
PackageMetadata(
|
||||
"com.google.android.apps.youtube.music",
|
||||
listOf("5.03.50")
|
||||
)
|
||||
)
|
||||
|
||||
private val patchMetadata = PatchMetadata(
|
||||
"codecs-unlock",
|
||||
"Audio codecs unlock patch",
|
||||
"Enables more audio codecs. Usually results in better audio quality but may depend on song and device.",
|
||||
packageMetadata,
|
||||
"0.0.1"
|
||||
)
|
||||
|
||||
class CodecsUnlockPatch : BytecodePatch(
|
||||
patchMetadata,
|
||||
listOf(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"codec-lock-method",
|
||||
MethodMetadata(
|
||||
"Labwj;",
|
||||
"a",
|
||||
),
|
||||
PatternScanMethod.Fuzzy(2),// FIXME: Test this threshold and find the best value.
|
||||
packageMetadata,
|
||||
"Required signature for ${patchMetadata.name}. Discovered in version 5.03.50.",
|
||||
"0.0.1"
|
||||
),
|
||||
"L",
|
||||
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||
listOf("L", "L", "L", "L"),
|
||||
listOf(
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.RETURN_OBJECT
|
||||
)
|
||||
),
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"all-codecs-reference-method",
|
||||
MethodMetadata(
|
||||
"Laari;",
|
||||
"b",
|
||||
),
|
||||
PatternScanMethod.Fuzzy(2),// FIXME: Test this threshold and find the best value.
|
||||
packageMetadata,
|
||||
"Required signature for ${patchMetadata.name}. Discovered in version 5.03.50.",
|
||||
"0.0.1"
|
||||
),
|
||||
"J",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
listOf("L"),
|
||||
listOf(
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.IPUT_BOOLEAN,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.GOTO,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.IPUT_BOOLEAN,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.GOTO,
|
||||
Opcode.MOVE_EXCEPTION,
|
||||
Opcode.INVOKE_SUPER,
|
||||
Opcode.MOVE_RESULT_WIDE,
|
||||
Opcode.RETURN_WIDE
|
||||
),
|
||||
listOf("itag")
|
||||
)
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
var result = signatures.first().result!!
|
||||
|
||||
val implementation = result.method.implementation!!
|
||||
|
||||
val instructionIndex = result.scanData.startIndex
|
||||
|
||||
result = signatures.last().result!!
|
||||
val codecMethod = data
|
||||
.toMethodWalker(result.immutableMethod)
|
||||
.walk(result.scanData.startIndex)
|
||||
.getMethod()
|
||||
|
||||
implementation.replaceInstruction(
|
||||
instructionIndex,
|
||||
"invoke-static {}, ${codecMethod.definingClass}->${codecMethod.name}()Ljava/util/Set;".toInstruction()
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,133 +0,0 @@
|
||||
package app.revanced.patches.music.audio
|
||||
|
||||
import app.revanced.patcher.data.implementation.BytecodeData
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
||||
import app.revanced.patcher.patch.implementation.metadata.PackageMetadata
|
||||
import app.revanced.patcher.patch.implementation.metadata.PatchMetadata
|
||||
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.MethodMetadata
|
||||
import app.revanced.patcher.signature.MethodSignature
|
||||
import app.revanced.patcher.signature.MethodSignatureMetadata
|
||||
import app.revanced.patcher.signature.PatternScanMethod
|
||||
import app.revanced.patcher.smali.toInstruction
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
private val compatiblePackages = listOf(
|
||||
PackageMetadata(
|
||||
"com.google.android.apps.youtube.music",
|
||||
listOf("5.03.50")
|
||||
)
|
||||
)
|
||||
|
||||
class EnableAudioOnlyPatch : BytecodePatch(
|
||||
PatchMetadata(
|
||||
"audio-only-playback-patch",
|
||||
"Audio Only Mode Patch",
|
||||
"Add the option to play music without video.",
|
||||
compatiblePackages,
|
||||
"0.0.1"
|
||||
),
|
||||
listOf(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"audio-only-method-signature",
|
||||
MethodMetadata("Lgmd;", "c"),
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
"Signature for the method required to be patched.",
|
||||
"0.0.1"
|
||||
),
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
listOf("L", "Z"),
|
||||
listOf(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQ,
|
||||
Opcode.CONST_4,
|
||||
Opcode.GOTO,
|
||||
Opcode.NOP,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.GOTO,
|
||||
Opcode.RETURN_VOID
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
val result = signatures.first().result!!.findParentMethod(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"audio-only-enabler-method",
|
||||
MethodMetadata("Lgmd;", "d"),
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
"Signature for the method required to be patched.",
|
||||
"0.0.1"
|
||||
),
|
||||
"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 method for ${metadata.shortName} not found.")
|
||||
|
||||
val implementation = result.method.implementation!!
|
||||
implementation.replaceInstruction(
|
||||
implementation.instructions.count() - 1,
|
||||
"const/4 v0, 0x1".toInstruction()
|
||||
)
|
||||
implementation.addInstruction(
|
||||
"return v0".toInstruction()
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.revanced.patches.music.audio.codecs.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class CodecsUnlockCompatibility
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package app.revanced.patches.music.audio.codecs.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("all-codecs-reference-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Laari;",
|
||||
"b",
|
||||
)
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@CodecsUnlockCompatibility
|
||||
@Version("0.0.1")
|
||||
object AllCodecsReferenceFingerprint : MethodFingerprint(
|
||||
"J", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.IPUT_BOOLEAN,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.GOTO,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.IPUT_BOOLEAN,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.GOTO,
|
||||
Opcode.MOVE_EXCEPTION,
|
||||
Opcode.INVOKE_SUPER,
|
||||
Opcode.MOVE_RESULT_WIDE,
|
||||
Opcode.RETURN_WIDE
|
||||
), listOf("itag")
|
||||
)
|
||||
@@ -0,0 +1,41 @@
|
||||
package app.revanced.patches.music.audio.codecs.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("codec-lock-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Labwj;",
|
||||
"a",
|
||||
)
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@CodecsUnlockCompatibility
|
||||
@Version("0.0.1")
|
||||
object CodecsLockFingerprint : MethodFingerprint(
|
||||
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L", "L", "L"), listOf(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.RETURN_OBJECT
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,45 @@
|
||||
package app.revanced.patches.music.audio.codecs.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.data.impl.toMethodWalker
|
||||
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.patcher.util.smali.toInstruction
|
||||
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
||||
import app.revanced.patches.music.audio.codecs.fingerprints.AllCodecsReferenceFingerprint
|
||||
import app.revanced.patches.music.audio.codecs.fingerprints.CodecsLockFingerprint
|
||||
|
||||
@Patch
|
||||
@Name("codecs-unlock")
|
||||
@Description("Adds more audio codec options. The new audio codecs usually result in better audio quality.")
|
||||
@CodecsUnlockCompatibility
|
||||
@Version("0.0.1")
|
||||
class CodecsUnlockPatch : BytecodePatch(
|
||||
listOf(
|
||||
CodecsLockFingerprint, AllCodecsReferenceFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
var result = CodecsLockFingerprint.result!!
|
||||
|
||||
val implementation = result.mutableMethod.implementation!!
|
||||
|
||||
val instructionIndex = result.patternScanResult!!.startIndex
|
||||
|
||||
result = AllCodecsReferenceFingerprint.result!!
|
||||
val codecMethod =
|
||||
data.toMethodWalker(result.method).nextMethod(result.patternScanResult!!.startIndex).getMethod()
|
||||
|
||||
implementation.replaceInstruction(
|
||||
instructionIndex,
|
||||
"invoke-static {}, ${codecMethod.definingClass}->${codecMethod.name}()Ljava/util/Set;".toInstruction()
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.revanced.patches.music.audio.exclusiveaudio.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class ExclusiveAudioCompatibility
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package app.revanced.patches.music.audio.exclusiveaudio.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.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
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,60 @@
|
||||
package app.revanced.patches.music.audio.exclusiveaudio.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("exclusive-audio-fingerprints")
|
||||
@MatchingMethod(
|
||||
"Lgmd;", "c"
|
||||
)
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@ExclusiveAudioCompatibility
|
||||
@Version("0.0.1")
|
||||
object ExclusiveAudioFingerprint : MethodFingerprint(
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
listOf("L", "Z"),
|
||||
listOf(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQ,
|
||||
Opcode.CONST_4,
|
||||
Opcode.GOTO,
|
||||
Opcode.NOP,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.GOTO,
|
||||
Opcode.RETURN_VOID
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,35 @@
|
||||
package app.revanced.patches.music.audio.exclusiveaudio.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.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.impl.BytecodePatch
|
||||
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
||||
import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.AudioOnlyEnablerFingerprint
|
||||
import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.ExclusiveAudioFingerprint
|
||||
|
||||
@Patch
|
||||
@Name("exclusive-audio-playback")
|
||||
@Description("Enables the option to play music without video.")
|
||||
@ExclusiveAudioCompatibility
|
||||
@Version("0.0.1")
|
||||
class ExclusiveAudioPatch : BytecodePatch(
|
||||
listOf(
|
||||
AudioOnlyEnablerFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
val method = AudioOnlyEnablerFingerprint.result!!.mutableMethod
|
||||
method.replaceInstruction(method.implementation!!.instructions.count() - 1, "const/4 v0, 0x1")
|
||||
method.addInstruction("return v0")
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
package app.revanced.patches.music.layout
|
||||
|
||||
import app.revanced.patcher.data.implementation.BytecodeData
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
||||
import app.revanced.patcher.patch.implementation.metadata.PackageMetadata
|
||||
import app.revanced.patcher.patch.implementation.metadata.PatchMetadata
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
||||
import app.revanced.patcher.signature.MethodMetadata
|
||||
import app.revanced.patcher.signature.MethodSignature
|
||||
import app.revanced.patcher.signature.MethodSignatureMetadata
|
||||
import app.revanced.patcher.signature.PatternScanMethod
|
||||
import app.revanced.patcher.smali.toInstructions
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
||||
|
||||
private val compatiblePackages = listOf(
|
||||
PackageMetadata(
|
||||
"com.google.android.apps.youtube.music",
|
||||
listOf("5.03.50")
|
||||
)
|
||||
)
|
||||
|
||||
class RemoveTasteBuilderPatch : BytecodePatch(
|
||||
PatchMetadata(
|
||||
"tasteBuilder-remover",
|
||||
"Remove TasteBuilder Patch",
|
||||
"Removes the \"Tell us which artists you like\" card from the Home screen. The same functionality can be triggered from the settings anyway.",
|
||||
compatiblePackages,
|
||||
"0.0.1"
|
||||
),
|
||||
listOf(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"taste-builder-constructor",
|
||||
MethodMetadata("Lkyu;", "<init>"),
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
"Required signature for this patch.",
|
||||
"0.0.1"
|
||||
),
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
listOf("L", "L", "L", "L"),
|
||||
listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST,
|
||||
Opcode.CONST_4,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.CONST,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
val result = signatures.first().result!!
|
||||
val implementation = result.method.implementation!!
|
||||
|
||||
val insertIndex = result.scanData.endIndex - 8
|
||||
|
||||
val register = (implementation.instructions[insertIndex] as Instruction22c).registerA
|
||||
|
||||
val instructionList =
|
||||
"""
|
||||
const/16 v1, 0x8
|
||||
invoke-virtual {v${register}, v1}, Landroid/view/View;->setVisibility(I)V
|
||||
""".trimIndent().toInstructions().toMutableList()
|
||||
|
||||
implementation.addInstructions(
|
||||
insertIndex,
|
||||
instructionList
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,151 +0,0 @@
|
||||
package app.revanced.patches.music.layout
|
||||
|
||||
import app.revanced.patcher.data.implementation.BytecodeData
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
||||
import app.revanced.patcher.patch.implementation.metadata.PackageMetadata
|
||||
import app.revanced.patcher.patch.implementation.metadata.PatchMetadata
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
||||
import app.revanced.patcher.signature.MethodMetadata
|
||||
import app.revanced.patcher.signature.MethodSignature
|
||||
import app.revanced.patcher.signature.MethodSignatureMetadata
|
||||
import app.revanced.patcher.signature.PatternScanMethod
|
||||
import app.revanced.patcher.smali.toInstructions
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction22t
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
|
||||
private val compatiblePackages = listOf(
|
||||
PackageMetadata(
|
||||
"com.google.android.apps.youtube.music",
|
||||
listOf("5.03.50")
|
||||
)
|
||||
)
|
||||
|
||||
class RemoveUpgradeTabPatch : BytecodePatch(
|
||||
PatchMetadata(
|
||||
"upgrade-tab-remover",
|
||||
"Remove Upgrade Tab Patch",
|
||||
"Remove the upgrade tab from t he pivot bar in YouTube music.",
|
||||
compatiblePackages,
|
||||
"0.0.1"
|
||||
),
|
||||
listOf(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"pivot-bar-constructor",
|
||||
MethodMetadata("Lhfu;", "<init2>"), // unknown
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
"Required signature for this patch.",
|
||||
"0.0.1"
|
||||
),
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
listOf("L", "Z"),
|
||||
listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_BOOLEAN,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.GOTO,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IGET,
|
||||
Opcode.CONST,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.GOTO,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IGET,
|
||||
Opcode.CONST,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.GOTO,
|
||||
Opcode.NOP,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.RETURN_VOID
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
val result = signatures.first().result!!
|
||||
val implementation = result.method.implementation!!
|
||||
|
||||
val pivotBarElementFieldRef =
|
||||
(implementation.instructions[result.scanData.endIndex - 1] as Instruction22c).reference
|
||||
|
||||
val register = (implementation.instructions.first() as Instruction35c).registerC
|
||||
// first compile all the needed instructions
|
||||
val instructionList =
|
||||
"""
|
||||
invoke-interface { v0 }, Ljava/util/List;->size()I
|
||||
move-result v1
|
||||
const/4 v2, 0x3
|
||||
invoke-interface {v0, v2}, Ljava/util/List;->remove(I)Ljava/lang/Object;
|
||||
iput-object v0, v$register, $pivotBarElementFieldRef
|
||||
""".trimIndent().toInstructions().toMutableList()
|
||||
|
||||
|
||||
// replace the instruction to retain the label at given index
|
||||
implementation.replaceInstruction(
|
||||
result.scanData.endIndex - 1,
|
||||
instructionList[0] // invoke-interface
|
||||
)
|
||||
// do not forget to remove this instruction since we added it already
|
||||
instructionList.removeFirst()
|
||||
|
||||
val exitInstruction = instructionList.last() // iput-object
|
||||
implementation.addInstruction(
|
||||
result.scanData.endIndex,
|
||||
exitInstruction
|
||||
)
|
||||
// do not forget to remove this instruction since we added it already
|
||||
instructionList.removeLast()
|
||||
|
||||
// add the necessary if statement to remove the upgrade tab button in case it exists
|
||||
instructionList.add(
|
||||
2, // if-le
|
||||
BuilderInstruction22t(
|
||||
Opcode.IF_LE,
|
||||
1, 2,
|
||||
implementation.newLabelForIndex(result.scanData.endIndex)
|
||||
)
|
||||
)
|
||||
|
||||
implementation.addInstructions(
|
||||
result.scanData.endIndex,
|
||||
instructionList
|
||||
)
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.music.layout.compactheader.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class CompactHeaderCompatibility
|
||||
@@ -0,0 +1,33 @@
|
||||
package app.revanced.patches.music.layout.compactheader.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.music.layout.compactheader.annotations.CompactHeaderCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("compact-header-constructor-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Llcz;", "<init>"
|
||||
)
|
||||
@CompactHeaderCompatibility
|
||||
@Version("0.0.1")
|
||||
object CompactHeaderConstructorFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L", "L"), listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.CONST,
|
||||
Opcode.CONST_4,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,41 @@
|
||||
package app.revanced.patches.music.layout.compactheader.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.music.layout.compactheader.annotations.CompactHeaderCompatibility
|
||||
import app.revanced.patches.music.layout.compactheader.fingerprints.CompactHeaderConstructorFingerprint
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction11x
|
||||
|
||||
@Patch(false)
|
||||
@Name("compact-header")
|
||||
@Description("Hides the music category bar at the top of the homepage.")
|
||||
@CompactHeaderCompatibility
|
||||
@Version("0.0.1")
|
||||
class CompactHeaderPatch : BytecodePatch(
|
||||
listOf(
|
||||
CompactHeaderConstructorFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
val result = CompactHeaderConstructorFingerprint.result!!
|
||||
val method = result.mutableMethod
|
||||
|
||||
val insertIndex = result.patternScanResult!!.endIndex
|
||||
val register = (method.implementation!!.instructions[insertIndex - 1] as BuilderInstruction11x).registerA
|
||||
method.addInstructions(
|
||||
insertIndex, """
|
||||
const/16 v0, 0x8
|
||||
invoke-virtual {v${register}, v0}, Landroid/view/View;->setVisibility(I)V
|
||||
"""
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.music.layout.minimizedplayback.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class MinimizedPlaybackCompatibility
|
||||
@@ -0,0 +1,36 @@
|
||||
package app.revanced.patches.music.layout.minimizedplayback.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.music.layout.minimizedplayback.annotations.MinimizedPlaybackCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("minimized-playback-manager-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Llxw;", "c"
|
||||
)
|
||||
@MinimizedPlaybackCompatibility
|
||||
@Version("0.0.1")
|
||||
object MinimizedPlaybackManagerFingerprint : MethodFingerprint(
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
listOf("I", "L", "Z"),
|
||||
listOf(
|
||||
Opcode.IGET,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.IF_EQ,
|
||||
Opcode.GOTO,
|
||||
Opcode.RETURN_VOID,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IPUT_BOOLEAN,
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,38 @@
|
||||
package app.revanced.patches.music.layout.minimizedplayback.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.data.impl.toMethodWalker
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.music.layout.minimizedplayback.annotations.MinimizedPlaybackCompatibility
|
||||
import app.revanced.patches.music.layout.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.reference.MethodReference
|
||||
|
||||
@Patch
|
||||
@Name("minimized-playback-music")
|
||||
@Description("Enables minimized playback on Kids music.")
|
||||
@MinimizedPlaybackCompatibility
|
||||
@Version("0.0.1")
|
||||
class MinimizedPlaybackPatch : BytecodePatch(
|
||||
listOf(
|
||||
MinimizedPlaybackManagerFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstructions(
|
||||
0, """
|
||||
return-void
|
||||
"""
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.revanced.patches.music.layout.premium.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class HideGetPremiumCompatibility
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package app.revanced.patches.music.layout.premium.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.music.layout.premium.annotations.HideGetPremiumCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("hide-get-premium-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Lktn;", "k"
|
||||
)
|
||||
@HideGetPremiumCompatibility
|
||||
@Version("0.0.1")
|
||||
object HideGetPremiumFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.CONST_16,
|
||||
Opcode.GOTO,
|
||||
Opcode.NOP,
|
||||
Opcode.INVOKE_VIRTUAL
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,29 @@
|
||||
package app.revanced.patches.music.layout.premium.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.music.layout.premium.annotations.HideGetPremiumCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("hide-get-premium-parent-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Lktn;", "k"
|
||||
)
|
||||
@HideGetPremiumCompatibility
|
||||
@Version("0.0.1")
|
||||
object HideGetPremiumParentFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_STATIC
|
||||
),
|
||||
listOf("FEmusic_history"),
|
||||
)
|
||||
@@ -0,0 +1,49 @@
|
||||
package app.revanced.patches.music.layout.premium.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.replaceInstruction
|
||||
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
|
||||
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.music.layout.premium.annotations.HideGetPremiumCompatibility
|
||||
import app.revanced.patches.music.layout.premium.fingerprints.HideGetPremiumFingerprint
|
||||
import app.revanced.patches.music.layout.premium.fingerprints.HideGetPremiumParentFingerprint
|
||||
|
||||
@Patch
|
||||
@Name("hide-get-premium")
|
||||
@Description("Removes all \"Get Premium\" evidences from the avatar menu.")
|
||||
@HideGetPremiumCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideGetPremiumPatch : BytecodePatch(
|
||||
listOf(
|
||||
HideGetPremiumParentFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
val parentResult = HideGetPremiumParentFingerprint.result!!
|
||||
HideGetPremiumFingerprint.resolve(data, parentResult.classDef)
|
||||
|
||||
val parentMethod = parentResult.mutableMethod
|
||||
parentMethod.replaceInstruction(
|
||||
parentResult.patternScanResult!!.startIndex, """
|
||||
const/4 v1, 0x0
|
||||
"""
|
||||
)
|
||||
|
||||
val result = HideGetPremiumFingerprint.result!!
|
||||
val method = result.mutableMethod
|
||||
method.addInstructions(
|
||||
result.patternScanResult!!.startIndex, """
|
||||
const/16 v0, 0x8
|
||||
"""
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.revanced.patches.music.layout.tastebuilder.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class RemoveTasteBuilderCompatibility
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package app.revanced.patches.music.layout.tastebuilder.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.music.layout.tastebuilder.annotations.RemoveTasteBuilderCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("taste-builder-constructor-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Lkyu;", "<init>"
|
||||
)
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@RemoveTasteBuilderCompatibility
|
||||
@Version("0.0.1")
|
||||
object TasteBuilderConstructorFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L"), listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST,
|
||||
Opcode.CONST_4,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.CONST,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,41 @@
|
||||
package app.revanced.patches.music.layout.tastebuilder.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.music.layout.tastebuilder.annotations.RemoveTasteBuilderCompatibility
|
||||
import app.revanced.patches.music.layout.tastebuilder.fingerprints.TasteBuilderConstructorFingerprint
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
||||
|
||||
@Patch
|
||||
@Name("tasteBuilder-remover")
|
||||
@Description("Removes the \"Tell us which artists you like\" card from the home screen.")
|
||||
@RemoveTasteBuilderCompatibility
|
||||
@Version("0.0.1")
|
||||
class RemoveTasteBuilderPatch : BytecodePatch(
|
||||
listOf(
|
||||
TasteBuilderConstructorFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
val result = TasteBuilderConstructorFingerprint.result!!
|
||||
val method = result.mutableMethod
|
||||
|
||||
val insertIndex = result.patternScanResult!!.endIndex - 8
|
||||
val register = (method.implementation!!.instructions[insertIndex] as Instruction22c).registerA
|
||||
method.addInstructions(
|
||||
insertIndex, """
|
||||
const/16 v1, 0x8
|
||||
invoke-virtual {v${register}, v1}, Landroid/view/View;->setVisibility(I)V
|
||||
"""
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.revanced.patches.music.layout.upgradebutton.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class RemoveUpgradeButtonCompatibility
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package app.revanced.patches.music.layout.upgradebutton.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.music.layout.upgradebutton.annotations.RemoveUpgradeButtonCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("pivot-bar-constructor-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Lhfu;", "<init2>"
|
||||
)
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@RemoveUpgradeButtonCompatibility
|
||||
@Version("0.0.1")
|
||||
object PivotBarConstructorFingerprint : MethodFingerprint(
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
listOf("L", "Z"),
|
||||
listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_BOOLEAN,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.GOTO,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IGET,
|
||||
Opcode.CONST,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.GOTO,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IGET,
|
||||
Opcode.CONST,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.GOTO,
|
||||
Opcode.NOP,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.RETURN_VOID
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,76 @@
|
||||
package app.revanced.patches.music.layout.upgradebutton.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.patcher.util.smali.toInstructions
|
||||
import app.revanced.patches.music.layout.upgradebutton.annotations.RemoveUpgradeButtonCompatibility
|
||||
import app.revanced.patches.music.layout.upgradebutton.fingerprints.PivotBarConstructorFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction22t
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
|
||||
|
||||
@Patch
|
||||
@Name("upgrade-button-remover")
|
||||
@Description("Removes the upgrade tab from the pivot bar.")
|
||||
@RemoveUpgradeButtonCompatibility
|
||||
@Version("0.0.1")
|
||||
class RemoveUpgradeButtonPatch : BytecodePatch(
|
||||
listOf(
|
||||
PivotBarConstructorFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
val result = PivotBarConstructorFingerprint.result!!
|
||||
val implementation = result.mutableMethod.implementation!!
|
||||
|
||||
val pivotBarElementFieldRef =
|
||||
(implementation.instructions[result.patternScanResult!!.endIndex - 1] as Instruction22c).reference
|
||||
|
||||
val register = (implementation.instructions.first() as Instruction35c).registerC
|
||||
// first compile all the needed instructions
|
||||
val instructionList = """
|
||||
invoke-interface { v0 }, Ljava/util/List;->size()I
|
||||
move-result v1
|
||||
const/4 v2, 0x3
|
||||
invoke-interface {v0, v2}, Ljava/util/List;->remove(I)Ljava/lang/Object;
|
||||
iput-object v0, v$register, $pivotBarElementFieldRef
|
||||
""".toInstructions().toMutableList()
|
||||
|
||||
|
||||
// replace the instruction to retain the label at given index
|
||||
implementation.replaceInstruction(
|
||||
result.patternScanResult!!.endIndex - 1, instructionList[0] // invoke-interface
|
||||
)
|
||||
// do not forget to remove this instruction since we added it already
|
||||
instructionList.removeFirst()
|
||||
|
||||
val exitInstruction = instructionList.last() // iput-object
|
||||
implementation.addInstruction(
|
||||
result.patternScanResult!!.endIndex, exitInstruction
|
||||
)
|
||||
// do not forget to remove this instruction since we added it already
|
||||
instructionList.removeLast()
|
||||
|
||||
// add the necessary if statement to remove the upgrade tab button in case it exists
|
||||
instructionList.add(
|
||||
2, // if-le
|
||||
BuilderInstruction22t(
|
||||
Opcode.IF_LE, 1, 2, implementation.newLabelForIndex(result.patternScanResult!!.endIndex)
|
||||
)
|
||||
)
|
||||
|
||||
implementation.addInstructions(
|
||||
result.patternScanResult!!.endIndex, instructionList
|
||||
)
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.music.misc.microg.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class MusicMicroGPatchCompatibility
|
||||
@@ -0,0 +1,21 @@
|
||||
package app.revanced.patches.music.misc.microg.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
@Name("google-play-utility-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Lnuv;", "b"
|
||||
)
|
||||
@DirectPatternScanMethod
|
||||
@MusicMicroGPatchCompatibility
|
||||
@Version("0.0.1")
|
||||
object GooglePlayUtilityFingerprint : MethodFingerprint(
|
||||
"I", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "I"), null, listOf("This should never happen.", "MetadataValueReader", "GooglePlayServicesUtil", "com.android.vending", "android.hardware.type.embedded")
|
||||
)
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.revanced.patches.music.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.music.misc.microg.annotations.MusicMicroGPatchCompatibility
|
||||
|
||||
@Name("google-play-prime-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Lrwi;", "a"
|
||||
)
|
||||
@DirectPatternScanMethod
|
||||
@MusicMicroGPatchCompatibility
|
||||
@Version("0.0.1")
|
||||
object PrimeFingerprint : MethodFingerprint(
|
||||
null, null, null, null, listOf("com.google.android.GoogleCamera", "com.android.vending")
|
||||
)
|
||||
@@ -0,0 +1,21 @@
|
||||
package app.revanced.patches.music.misc.microg.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
@Name("google-play-service-checker-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Lnuv;", "d"
|
||||
)
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@MusicMicroGPatchCompatibility
|
||||
@Version("0.0.1")
|
||||
object ServiceCheckFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "I"), null, listOf("Google Play Services not available")
|
||||
)
|
||||
@@ -0,0 +1,160 @@
|
||||
package app.revanced.patches.music.misc.microg.patch.bytecode
|
||||
|
||||
import app.revanced.extensions.equalsAny
|
||||
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.replaceInstruction
|
||||
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.patcher.util.proxy.mutableTypes.MutableClass
|
||||
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
|
||||
import app.revanced.patches.music.misc.microg.patch.resource.MusicMicroGResourcePatch
|
||||
import app.revanced.patches.youtube.misc.microg.patch.resource.enum.StringReplaceMode
|
||||
import app.revanced.patches.music.misc.microg.shared.Constants.BASE_MICROG_PACKAGE_NAME
|
||||
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_PACKAGE_NAME
|
||||
import app.revanced.patches.music.misc.microg.fingerprints.*
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.builder.MutableMethodImplementation
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21c
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction21c
|
||||
import org.jf.dexlib2.iface.reference.StringReference
|
||||
import org.jf.dexlib2.immutable.reference.ImmutableStringReference
|
||||
|
||||
@Patch
|
||||
@Dependencies([MusicMicroGResourcePatch::class])
|
||||
@Name("music-microg-support")
|
||||
@Description("Patch to allow YouTube Music ReVanced to run without root and under a different package name.")
|
||||
@MusicMicroGPatchCompatibility
|
||||
@Version("0.0.1")
|
||||
class MusicMicroGBytecodePatch : BytecodePatch(
|
||||
listOf(
|
||||
ServiceCheckFingerprint,
|
||||
GooglePlayUtilityFingerprint,
|
||||
PrimeFingerprint,
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
disablePlayServiceChecks()
|
||||
data.classes.forEach { classDef ->
|
||||
var proxiedClass: MutableClass? = null
|
||||
|
||||
classDef.methods.forEach methodLoop@{ method ->
|
||||
val implementation = method.implementation ?: return@methodLoop
|
||||
|
||||
var proxiedImplementation: MutableMethodImplementation? = null
|
||||
|
||||
implementation.instructions.forEachIndexed { i, instruction ->
|
||||
if (instruction.opcode != Opcode.CONST_STRING) return@forEachIndexed
|
||||
|
||||
val stringValue = ((instruction as Instruction21c).reference as StringReference).string
|
||||
|
||||
val replaceMode = if (stringValue.equalsAny(
|
||||
"com.google.android.gms",
|
||||
"com.google.android.gms.chimera",
|
||||
"com.google.android.c2dm.intent.REGISTER",
|
||||
"com.google.android.c2dm.permission.SEND",
|
||||
"com.google.iid.TOKEN_REQUEST",
|
||||
"com.google",
|
||||
"com.google.android.gms.chimera.GmsIntentOperationService",
|
||||
"com.google.android.gms.phenotype.internal.IPhenotypeCallbacks",
|
||||
"com.google.android.gms.phenotype.internal.IPhenotypeService",
|
||||
"com.google.android.gms.phenotype.service.START",
|
||||
"com.google.android.gms.phenotype.PACKAGE_NAME",
|
||||
"com.google.android.gms.phenotype.UPDATE",
|
||||
"com.google.android.gms.phenotype",
|
||||
"com.google.android.gms.auth.accounts",
|
||||
"com.google.android.c2dm.intent.REGISTRATION",
|
||||
"com.google.android.gsf.action.GET_GLS",
|
||||
"com.google.android.gsf.login",
|
||||
"content://com.google.settings/partner",
|
||||
"content://com.google.android.gms.phenotype/",
|
||||
"content://com.google.android.gsf.gservices",
|
||||
"content://com.google.android.gsf.gservices/prefix",
|
||||
"com.google.android.c2dm.intent.RECEIVE"
|
||||
)
|
||||
) {
|
||||
StringReplaceMode.REPLACE_WITH_MICROG
|
||||
} else if (stringValue.equalsAny(
|
||||
"com.google.android.apps.youtube.music.SuggestionsProvider", "com.google.android.apps.youtube.music.fileprovider"
|
||||
)
|
||||
) {
|
||||
StringReplaceMode.REPLACE_WITH_REVANCED
|
||||
} else {
|
||||
StringReplaceMode.DO_NOT_REPLACE
|
||||
}
|
||||
|
||||
if (replaceMode != StringReplaceMode.DO_NOT_REPLACE) {
|
||||
if (proxiedClass == null) {
|
||||
proxiedClass = data.proxy(classDef).resolve()
|
||||
}
|
||||
|
||||
if (proxiedImplementation == null) {
|
||||
proxiedImplementation = proxiedClass!!.methods.first {
|
||||
it.name == method.name && it.parameterTypes.containsAll(method.parameterTypes)
|
||||
}.implementation!!
|
||||
}
|
||||
|
||||
val newString = if (replaceMode == StringReplaceMode.REPLACE_WITH_REVANCED) stringValue.replace(
|
||||
"com.google.android.apps.youtube.music", REVANCED_MUSIC_PACKAGE_NAME
|
||||
)
|
||||
else stringValue.replace("com.google", BASE_MICROG_PACKAGE_NAME)
|
||||
|
||||
proxiedImplementation!!.replaceInstruction(
|
||||
i, BuilderInstruction21c(
|
||||
Opcode.CONST_STRING, instruction.registerA, ImmutableStringReference(newString)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private fun disablePlayServiceChecks() {
|
||||
listOf(
|
||||
ServiceCheckFingerprint,
|
||||
GooglePlayUtilityFingerprint,
|
||||
).forEach { fingerprint ->
|
||||
val result = fingerprint.result!!
|
||||
val stringInstructions = when (result.method.returnType.first()) {
|
||||
'V' -> "return-void"
|
||||
'I' -> """
|
||||
const/4 v0, 0x0
|
||||
return v0
|
||||
"""
|
||||
|
||||
else -> throw Exception("This case should never happen.")
|
||||
}
|
||||
result.mutableMethod.addInstructions(
|
||||
0, stringInstructions
|
||||
)
|
||||
}
|
||||
|
||||
val primeMethod = PrimeFingerprint.result!!.mutableMethod
|
||||
val implementation = primeMethod.implementation!!
|
||||
|
||||
var register = 2
|
||||
val index = implementation.instructions.indexOfFirst {
|
||||
if (it.opcode != Opcode.CONST_STRING) return@indexOfFirst false
|
||||
|
||||
val instructionString = ((it as Instruction21c).reference as StringReference).string
|
||||
if (instructionString != "com.google.android.apps.youtube.music") return@indexOfFirst false
|
||||
|
||||
register = it.registerA
|
||||
return@indexOfFirst true
|
||||
}
|
||||
|
||||
primeMethod.replaceInstruction(
|
||||
index, "const-string v$register, \"$REVANCED_MUSIC_PACKAGE_NAME\""
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package app.revanced.patches.music.misc.microg.patch.resource
|
||||
|
||||
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.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.impl.ResourcePatch
|
||||
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
|
||||
import app.revanced.patches.music.misc.microg.shared.Constants.BASE_MICROG_PACKAGE_NAME
|
||||
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_APP_NAME
|
||||
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_PACKAGE_NAME
|
||||
|
||||
@Name("music-microg-resource-patch")
|
||||
@Description("Resource patch to allow YouTube Music ReVanced to run without root and under a different package name.")
|
||||
@MusicMicroGPatchCompatibility
|
||||
@Version("0.0.1")
|
||||
class MusicMicroGResourcePatch : ResourcePatch() {
|
||||
override fun execute(data: ResourceData): PatchResult {
|
||||
|
||||
val manifest = data["AndroidManifest.xml"].readText()
|
||||
|
||||
data["AndroidManifest.xml"].writeText(
|
||||
manifest.replace(
|
||||
"package=\"com.google.android.apps.youtube.music", "package=\"$REVANCED_MUSIC_PACKAGE_NAME"
|
||||
).replace(
|
||||
"android:label=\"@string/app_name", "android:label=\"$REVANCED_MUSIC_APP_NAME"
|
||||
).replace(
|
||||
"android:label=\"@string/app_launcher_name", "android:label=\"$REVANCED_MUSIC_APP_NAME"
|
||||
).replace(
|
||||
"android:authorities=\"com.google.android.apps.youtube.music", "android:authorities=\"$REVANCED_MUSIC_PACKAGE_NAME"
|
||||
).replace(
|
||||
"com.google.android.apps.youtube.music.permission.C2D_MESSAGE", "$REVANCED_MUSIC_PACKAGE_NAME.permission.C2D_MESSAGE"
|
||||
).replace(
|
||||
"com.google.android.c2dm", "$BASE_MICROG_PACKAGE_NAME.android.c2dm"
|
||||
).replace(
|
||||
"</queries>", "<package android:name=\"$BASE_MICROG_PACKAGE_NAME.android.gms\"/></queries>"
|
||||
)
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.revanced.patches.music.misc.microg.shared
|
||||
|
||||
object Constants {
|
||||
internal const val BASE_MICROG_PACKAGE_NAME = "com.mgoogle"
|
||||
internal const val REVANCED_MUSIC_APP_NAME = "YouTube Music ReVanced"
|
||||
internal const val REVANCED_MUSIC_PACKAGE_NAME = "app.revanced.android.apps.youtube.music"
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
package app.revanced.patches.music.premium
|
||||
|
||||
import app.revanced.patcher.data.implementation.BytecodeData
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
||||
import app.revanced.patcher.patch.implementation.metadata.PackageMetadata
|
||||
import app.revanced.patcher.patch.implementation.metadata.PatchMetadata
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
||||
import app.revanced.patcher.signature.MethodMetadata
|
||||
import app.revanced.patcher.signature.MethodSignature
|
||||
import app.revanced.patcher.signature.MethodSignatureMetadata
|
||||
import app.revanced.patcher.signature.PatternScanMethod
|
||||
import app.revanced.patcher.smali.toInstructions
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
private val compatiblePackages = listOf(
|
||||
PackageMetadata(
|
||||
"com.google.android.apps.youtube.music",
|
||||
listOf("5.03.50")
|
||||
)
|
||||
)
|
||||
|
||||
class BackgroundPlayPatch : BytecodePatch(
|
||||
PatchMetadata(
|
||||
"background-play",
|
||||
"Enable Background Playback Patch",
|
||||
"Enable playing music in the background.",
|
||||
compatiblePackages,
|
||||
"0.0.1"
|
||||
),
|
||||
listOf(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"background-playback-disabler-method",
|
||||
MethodMetadata("Lafgf;", "e"),
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
"Signature for the method required to be patched.",
|
||||
"0.0.1"
|
||||
),
|
||||
"Z",
|
||||
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||
listOf("L"),
|
||||
listOf(
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET,
|
||||
Opcode.AND_INT_LIT16,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET,
|
||||
Opcode.CONST,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.GOTO,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.GOTO,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.CONST_4,
|
||||
Opcode.RETURN,
|
||||
Opcode.RETURN,
|
||||
Opcode.RETURN
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
signatures.first().result!!.method.implementation!!.addInstructions(
|
||||
0,
|
||||
"""
|
||||
const/4 v0, 0x1
|
||||
return v0
|
||||
""".trimIndent().toInstructions()
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.revanced.patches.music.premium.backgroundplay.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class BackgroundPlayCompatibility
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package app.revanced.patches.music.premium.backgroundplay.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.music.premium.backgroundplay.annotations.BackgroundPlayCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("background-playback-disabler-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Lafgf;", "e"
|
||||
)
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@BackgroundPlayCompatibility
|
||||
@Version("0.0.1")
|
||||
object BackgroundPlaybackDisableFingerprint : MethodFingerprint(
|
||||
"Z", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), listOf(
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET,
|
||||
Opcode.AND_INT_LIT16,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET,
|
||||
Opcode.CONST,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.GOTO,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.GOTO,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.CONST_4,
|
||||
Opcode.RETURN,
|
||||
Opcode.RETURN,
|
||||
Opcode.RETURN
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,36 @@
|
||||
package app.revanced.patches.music.premium.backgroundplay.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.music.premium.backgroundplay.annotations.BackgroundPlayCompatibility
|
||||
import app.revanced.patches.music.premium.backgroundplay.fingerprints.BackgroundPlaybackDisableFingerprint
|
||||
|
||||
@Patch
|
||||
@Name("background-play")
|
||||
@Description("Enables playing music in the background.")
|
||||
@BackgroundPlayCompatibility
|
||||
@Version("0.0.1")
|
||||
class BackgroundPlayPatch : BytecodePatch(
|
||||
listOf(
|
||||
BackgroundPlaybackDisableFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
BackgroundPlaybackDisableFingerprint.result!!.mutableMethod.addInstructions(
|
||||
0,
|
||||
"""
|
||||
const/4 v0, 0x1
|
||||
return v0
|
||||
"""
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.twitter.ad.timeline.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.twitter.android", arrayOf()
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class TimelineAdsCompatibility
|
||||
@@ -0,0 +1,26 @@
|
||||
package app.revanced.patches.twitter.ad.timeline.fingerprints
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.twitter.ad.timeline.annotations.TimelineAdsCompatibility
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("timeline-tweet-json-parser-fingerprint")
|
||||
@MatchingMethod("LJsonTimelineTweet\$\$JsonObjectMapper;", "parseField")
|
||||
@TimelineAdsCompatibility
|
||||
@Version("0.0.1")
|
||||
object TimelineTweetJsonParserFingerprint : MethodFingerprint(
|
||||
null, null, null, listOf(
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.GOTO,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.RETURN_VOID,
|
||||
), listOf("tweetPromotedMetadata", "promotedMetadata", "hasModeratedReplies", "conversationAnnotation"),
|
||||
{ methodDef -> methodDef.name == "parseField" }
|
||||
)
|
||||
@@ -0,0 +1,77 @@
|
||||
package app.revanced.patches.twitter.ad.timeline.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.instruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprintResult
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.twitter.ad.timeline.annotations.TimelineAdsCompatibility
|
||||
import app.revanced.patches.twitter.ad.timeline.fingerprints.TimelineTweetJsonParserFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.builder.BuilderInstruction
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction22c
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.reference.FieldReference
|
||||
import org.jf.dexlib2.iface.reference.StringReference
|
||||
|
||||
@Patch
|
||||
@Name("timeline-ads")
|
||||
@Description("Removes ads from the Twitter timeline.")
|
||||
@TimelineAdsCompatibility
|
||||
@Version("0.0.1")
|
||||
class TimelineAdsPatch : BytecodePatch(
|
||||
listOf(TimelineTweetJsonParserFingerprint)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
if (removePromotedAds())
|
||||
return PatchResultError("The instruction for the tweet id field could not be found")
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private fun removePromotedAds(): Boolean {
|
||||
val (parserFingerprintResult, parserMethod, instructions) = TimelineTweetJsonParserFingerprint.unwrap()
|
||||
|
||||
// Anchor index
|
||||
val tweetIdFieldInstructionIndex = instructions.indexOfFirst { instruction ->
|
||||
if (instruction.opcode.ordinal != Opcode.CONST_STRING.ordinal) return@indexOfFirst false
|
||||
if (((instruction as? ReferenceInstruction)?.reference as StringReference).string != "tweetSocialProof") return@indexOfFirst false
|
||||
|
||||
// Use the above conditions as an anchor to find the index for the instruction with the field we need
|
||||
return@indexOfFirst true
|
||||
} - 2 // This is where the instruction with the field is located
|
||||
|
||||
// Reference to the tweetId field for of the timeline tweet
|
||||
val tweetIdFieldReference =
|
||||
(parserMethod.instruction(tweetIdFieldInstructionIndex) as? BuilderInstruction22c)?.reference as? FieldReference
|
||||
?: return true
|
||||
|
||||
// Set the tweetId field to null
|
||||
// This will cause twitter to not show the promoted ads, because we set it to null, when the tweet is promoted
|
||||
parserFingerprintResult.mutableMethod.addInstructions(
|
||||
parserFingerprintResult.patternScanResult!!.startIndex + 1,
|
||||
"""
|
||||
const/4 v2, 0x0
|
||||
iput-object v2, p0, Lcom/twitter/model/json/timeline/urt/JsonTimelineTweet;->${tweetIdFieldReference.name}:Ljava/lang/String;
|
||||
"""
|
||||
)
|
||||
return false
|
||||
}
|
||||
|
||||
private fun MethodFingerprint.unwrap(): Triple<MethodFingerprintResult, MutableMethod, MutableList<BuilderInstruction>> {
|
||||
val parserFingerprintResult = this.result!!
|
||||
val parserMethod = parserFingerprintResult.mutableMethod
|
||||
val instructions = parserMethod.implementation!!.instructions
|
||||
|
||||
return Triple(parserFingerprintResult, parserMethod, instructions)
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,188 +0,0 @@
|
||||
package app.revanced.patches.youtube.ad
|
||||
|
||||
import app.revanced.extensions.injectHideCall
|
||||
import app.revanced.patcher.data.implementation.BytecodeData
|
||||
import app.revanced.patcher.data.implementation.toMethodWalker
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
||||
import app.revanced.patcher.patch.implementation.metadata.PackageMetadata
|
||||
import app.revanced.patcher.patch.implementation.metadata.PatchMetadata
|
||||
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.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patcher.signature.MethodMetadata
|
||||
import app.revanced.patcher.signature.MethodSignature
|
||||
import app.revanced.patcher.signature.MethodSignatureMetadata
|
||||
import app.revanced.patcher.signature.PatternScanMethod
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction11x
|
||||
|
||||
private val compatiblePackages = listOf(
|
||||
PackageMetadata(
|
||||
"com.google.android.youtube",
|
||||
listOf("17.03.38", "17.14.35", "17.17.34")
|
||||
)
|
||||
)
|
||||
|
||||
private val patchMetadata = PatchMetadata(
|
||||
"home-promo-ads",
|
||||
"Home Promo Ads Patch",
|
||||
"Patch to remove promoted ads in YouTube",
|
||||
compatiblePackages,
|
||||
"0.0.1"
|
||||
)
|
||||
|
||||
private val signatureDescription = "Required signature for ${patchMetadata.name}. Discovered in version 17.03.38."
|
||||
|
||||
class HomePromoPatch : BytecodePatch(
|
||||
patchMetadata,
|
||||
listOf(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"promoted-discovery-app-parent-method",
|
||||
MethodMetadata(
|
||||
"Ljre;",
|
||||
"lP",
|
||||
),
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
signatureDescription,
|
||||
"0.0.1"
|
||||
),
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.BRIDGE or AccessFlags.SYNTHETIC,
|
||||
listOf("L", "L"),
|
||||
listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.NEW_ARRAY,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_GE,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.APUT_OBJECT,
|
||||
Opcode.ADD_INT_LIT8,
|
||||
Opcode.GOTO
|
||||
)
|
||||
),
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"promoted-discovery-action-parent-method",
|
||||
MethodMetadata(
|
||||
"Ljqv;",
|
||||
"lP",
|
||||
),
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
signatureDescription,
|
||||
"0.0.1"
|
||||
),
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.BRIDGE or AccessFlags.SYNTHETIC,
|
||||
listOf("L", "L"),
|
||||
listOf(
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.INVOKE_VIRTUAL_RANGE,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.CONST_4,
|
||||
Opcode.XOR_INT_2ADDR,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
for (signature in signatures) {
|
||||
val result = signature.result!!
|
||||
|
||||
val methodMetadata = MethodMetadata(signature.metadata.methodMetadata!!.definingClass, "d")
|
||||
val requiredMethod = result.findParentMethod(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"promoted-discovery-action-method",
|
||||
methodMetadata,
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
signatureDescription,
|
||||
"0.0.1"
|
||||
),
|
||||
"V",
|
||||
AccessFlags.PRIVATE or AccessFlags.FINAL,
|
||||
listOf("Z", "Z"),
|
||||
null
|
||||
)
|
||||
)
|
||||
?: return PatchResultError("Required parent method ${methodMetadata.name} could not be found in ${methodMetadata.definingClass}")
|
||||
|
||||
val toBePatchedInvokeOffset =
|
||||
requiredMethod.immutableMethod.implementation!!.instructions.indexOfFirst { it.opcode == Opcode.INVOKE_DIRECT }
|
||||
val toBePatchedMethod = data
|
||||
.toMethodWalker(requiredMethod.immutableMethod)
|
||||
.walk(toBePatchedInvokeOffset, true)
|
||||
.getMethod() as MutableMethod
|
||||
|
||||
val implementation = toBePatchedMethod.implementation!!
|
||||
val invokeVirtualOffset = implementation.instructions.indexOfFirst { it.opcode == Opcode.INVOKE_VIRTUAL }
|
||||
|
||||
val moveResultInstruction = implementation.instructions[invokeVirtualOffset + 1]
|
||||
if (moveResultInstruction.opcode != Opcode.MOVE_RESULT_OBJECT)
|
||||
return PatchResultError("The toBePatchedInvokeOffset offset was wrong in ${metadata.name}")
|
||||
|
||||
val register = (moveResultInstruction as Instruction11x).registerA
|
||||
implementation.injectHideCall(invokeVirtualOffset + 2, register)
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
package app.revanced.patches.youtube.ad
|
||||
|
||||
import app.revanced.patcher.data.implementation.BytecodeData
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
||||
import app.revanced.patcher.patch.implementation.metadata.PackageMetadata
|
||||
import app.revanced.patcher.patch.implementation.metadata.PatchMetadata
|
||||
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.MethodMetadata
|
||||
import app.revanced.patcher.signature.MethodSignature
|
||||
import app.revanced.patcher.signature.MethodSignatureMetadata
|
||||
import app.revanced.patcher.signature.PatternScanMethod
|
||||
import app.revanced.patcher.smali.toInstructions
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
private val packageMetadata = listOf(
|
||||
PackageMetadata(
|
||||
"com.google.android.youtube",
|
||||
listOf("17.14.35", "17.17.34")
|
||||
)
|
||||
)
|
||||
|
||||
private val patchMetadata = PatchMetadata(
|
||||
"video-ads",
|
||||
"YouTube Video Ads Patch",
|
||||
"Patch to remove ads in the YouTube video player.",
|
||||
packageMetadata,
|
||||
"0.0.1"
|
||||
)
|
||||
|
||||
class VideoAdsPatch : BytecodePatch(
|
||||
patchMetadata,
|
||||
listOf(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"show-video-ads-constructor",
|
||||
MethodMetadata(
|
||||
"Laadb",
|
||||
"<init>",
|
||||
),
|
||||
PatternScanMethod.Fuzzy(2),// FIXME: Test this threshold and find the best value.
|
||||
packageMetadata,
|
||||
"Required signature for ${patchMetadata.name}. Discovered in version 17.14.35.",
|
||||
"0.0.1"
|
||||
),
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
listOf("L", "L", "L"),
|
||||
listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
null, // either CONST_4 or CONST_16
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IPUT_BOOLEAN,
|
||||
Opcode.RETURN_VOID
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
var result = signatures.first().result!!
|
||||
|
||||
val responsibleMethodSignature = MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"show-video-ads-method",
|
||||
MethodMetadata(
|
||||
"zai",
|
||||
null // unknown
|
||||
),
|
||||
PatternScanMethod.Direct(),
|
||||
packageMetadata,
|
||||
"Signature to find the method, which is responsible for showing the video ads. Discovered in version 17.14.35",
|
||||
"0.0.1"
|
||||
),
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
listOf("Z"),
|
||||
null
|
||||
)
|
||||
|
||||
result = result.findParentMethod(
|
||||
responsibleMethodSignature
|
||||
) ?: return PatchResultError(
|
||||
"Could not find parent method with signature ${responsibleMethodSignature.metadata.name}"
|
||||
)
|
||||
|
||||
// Override the parameter by calling shouldShowAds and setting the parameter to the result
|
||||
result.method.implementation!!.addInstructions(
|
||||
0,
|
||||
"""
|
||||
invoke-static { }, Lfi/vanced/libraries/youtube/whitelisting/Whitelist;->shouldShowAds()Z
|
||||
move-result v1
|
||||
""".trimIndent().toInstructions()
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.revanced.patches.youtube.ad.general.annotation
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"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", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class GeneralAdsCompatibility
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package app.revanced.patches.youtube.ad.general.bytecode.extensions
|
||||
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.softCompareTo
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import org.jf.dexlib2.builder.BuilderInstruction
|
||||
import org.jf.dexlib2.builder.MutableMethodImplementation
|
||||
import org.jf.dexlib2.iface.Method
|
||||
import org.jf.dexlib2.iface.instruction.Instruction
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.reference.FieldReference
|
||||
import org.jf.dexlib2.iface.reference.MethodReference
|
||||
import org.jf.dexlib2.iface.reference.Reference
|
||||
import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
|
||||
|
||||
internal object MethodExtensions {
|
||||
internal fun MutableMethodImplementation.insertBlocks(
|
||||
startIndex: Int,
|
||||
vararg blocks: List<BuilderInstruction>,
|
||||
) {
|
||||
blocks.reversed().forEach {
|
||||
this.addInstructions(
|
||||
startIndex, it
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun MutableClass.addMethod(mutableMethod: MutableMethod) {
|
||||
this.methods.add(mutableMethod)
|
||||
}
|
||||
|
||||
internal fun MutableClass.findMutableMethodOf(
|
||||
method: Method
|
||||
) = this.methods.first {
|
||||
it.softCompareTo(
|
||||
ImmutableMethodReference(
|
||||
method.definingClass, method.name, method.parameters, method.returnType
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
internal inline fun <reified T : Reference> Instruction.toDescriptor(): String {
|
||||
val reference = (this as ReferenceInstruction).reference
|
||||
return when (T::class) {
|
||||
MethodReference::class -> {
|
||||
val methodReference = reference as MethodReference
|
||||
"${methodReference.definingClass}->${methodReference.name}(${
|
||||
methodReference.parameterTypes.joinToString(
|
||||
""
|
||||
) { it }
|
||||
})${methodReference.returnType}"
|
||||
}
|
||||
|
||||
FieldReference::class -> {
|
||||
val fieldReference = reference as FieldReference
|
||||
"${fieldReference.definingClass}->${fieldReference.name}:${fieldReference.type}"
|
||||
}
|
||||
|
||||
else -> throw PatchResultError("Unsupported reference type")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,424 @@
|
||||
package app.revanced.patches.youtube.ad.general.bytecode.patch
|
||||
|
||||
import app.revanced.extensions.injectHideCall
|
||||
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.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.patcher.util.proxy.mutableTypes.MutableClass
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patcher.util.smali.toInstructions
|
||||
import app.revanced.patches.youtube.ad.general.annotation.GeneralAdsCompatibility
|
||||
import app.revanced.patches.youtube.ad.general.bytecode.extensions.MethodExtensions.addMethod
|
||||
import app.revanced.patches.youtube.ad.general.bytecode.extensions.MethodExtensions.findMutableMethodOf
|
||||
import app.revanced.patches.youtube.ad.general.bytecode.extensions.MethodExtensions.insertBlocks
|
||||
import app.revanced.patches.youtube.ad.general.bytecode.extensions.MethodExtensions.toDescriptor
|
||||
import app.revanced.patches.youtube.ad.general.bytecode.utils.MethodUtils.createMutableMethod
|
||||
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.builder.MutableMethodImplementation
|
||||
import org.jf.dexlib2.builder.instruction.*
|
||||
import org.jf.dexlib2.iface.MethodImplementation
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction21c
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction31i
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
import org.jf.dexlib2.iface.reference.FieldReference
|
||||
import org.jf.dexlib2.iface.reference.MethodReference
|
||||
import org.jf.dexlib2.iface.reference.StringReference
|
||||
import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
|
||||
|
||||
@Patch
|
||||
@Dependencies([ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class])
|
||||
@Name("general-ads")
|
||||
@Description("Removes general ads.")
|
||||
@GeneralAdsCompatibility
|
||||
@Version("0.0.1")
|
||||
class GeneralBytecodeAdsPatch : BytecodePatch() {
|
||||
// a constant used by litho
|
||||
private val lithoConstant = 0xaed2868
|
||||
|
||||
// list of resource names to get the id of
|
||||
private val resourceIds = arrayOf(
|
||||
"ad_attribution",
|
||||
"reel_multiple_items_shelf",
|
||||
"info_cards_drawer_header",
|
||||
"endscreen_element_layout_video",
|
||||
"endscreen_element_layout_circle",
|
||||
"endscreen_element_layout_icon",
|
||||
"promoted_video_item_land",
|
||||
"promoted_video_item_full_bleed",
|
||||
).map { name ->
|
||||
ResourceIdMappingProviderResourcePatch.resourceMappings.single { it.name == name }.id
|
||||
}
|
||||
|
||||
private val stringReferences = arrayOf(
|
||||
"Claiming to use more elements than provided",
|
||||
"loadVideo() called on LocalDirector in wrong state",
|
||||
"LoggingProperties are not in proto format"
|
||||
)
|
||||
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
// iterating through all classes is expensive
|
||||
for (classDef in data.classes) {
|
||||
var mutableClass: MutableClass? = null
|
||||
|
||||
method@ for (method in classDef.methods) {
|
||||
var mutableMethod: MutableMethod? = null
|
||||
|
||||
if (method.implementation == null) continue@method
|
||||
|
||||
val instructions = method.implementation!!.instructions
|
||||
instructions.forEachIndexed { index, instruction ->
|
||||
when (instruction.opcode) {
|
||||
Opcode.CONST -> {
|
||||
// TODO: find a way to de-duplicate code.
|
||||
// The issue is we need to save mutableClass and mutableMethod to the existing fields
|
||||
when ((instruction as Instruction31i).wideLiteral) {
|
||||
resourceIds[0] -> { // general ads
|
||||
// and is followed by an instruction with the mnemonic INVOKE_VIRTUAL
|
||||
val insertIndex = index + 1
|
||||
val invokeInstruction = instructions.elementAt(insertIndex)
|
||||
if (invokeInstruction.opcode != Opcode.INVOKE_VIRTUAL) return@forEachIndexed
|
||||
|
||||
// create proxied method, make sure to not re-resolve() the current class
|
||||
if (mutableClass == null) mutableClass = data.proxy(classDef).resolve()
|
||||
if (mutableMethod == null) mutableMethod =
|
||||
mutableClass!!.findMutableMethodOf(method)
|
||||
|
||||
// insert hide call to hide the view corresponding to the resource
|
||||
val viewRegister = (invokeInstruction as Instruction35c).registerC
|
||||
mutableMethod!!.implementation!!.injectHideCall(insertIndex, viewRegister)
|
||||
|
||||
}
|
||||
|
||||
resourceIds[1] -> { // reel ads
|
||||
// and is followed by an instruction at insertIndex with the mnemonic IPUT_OBJECT
|
||||
val insertIndex = index + 4
|
||||
val iPutInstruction = instructions.elementAt(insertIndex)
|
||||
if (iPutInstruction.opcode != Opcode.IPUT_OBJECT) return@forEachIndexed
|
||||
|
||||
// create proxied method, make sure to not re-resolve() the current class
|
||||
if (mutableClass == null) mutableClass = data.proxy(classDef).resolve()
|
||||
if (mutableMethod == null) mutableMethod =
|
||||
mutableClass!!.findMutableMethodOf(method)
|
||||
|
||||
val viewRegister = (iPutInstruction as Instruction22c).registerA
|
||||
mutableMethod!!.implementation!!.injectHideCall(insertIndex, viewRegister)
|
||||
}
|
||||
|
||||
resourceIds[2] -> { // info cards ads
|
||||
// and is followed by an instruction with the mnemonic INVOKE_VIRTUAL
|
||||
val removeIndex = index - 1
|
||||
val invokeInstruction = instructions.elementAt(removeIndex)
|
||||
if (invokeInstruction.opcode != Opcode.INVOKE_VIRTUAL) return@forEachIndexed
|
||||
|
||||
// create proxied method, make sure to not re-resolve() the current class
|
||||
if (mutableClass == null) mutableClass = data.proxy(classDef).resolve()
|
||||
if (mutableMethod == null) mutableMethod =
|
||||
mutableClass!!.findMutableMethodOf(method)
|
||||
|
||||
//ToDo: Add Settings toggle for whatever this is
|
||||
mutableMethod!!.implementation!!.removeInstruction(removeIndex)
|
||||
}
|
||||
|
||||
resourceIds[3], resourceIds[4], resourceIds[5] -> { // end screen ads
|
||||
// and is followed by an instruction with the mnemonic IPUT_OBJECT
|
||||
val insertIndex = index + 7
|
||||
val invokeInstruction = instructions.elementAt(insertIndex)
|
||||
if (invokeInstruction.opcode != Opcode.IPUT_OBJECT) return@forEachIndexed
|
||||
|
||||
// create proxied method, make sure to not re-resolve() the current class
|
||||
if (mutableClass == null) mutableClass = data.proxy(classDef).resolve()
|
||||
if (mutableMethod == null) mutableMethod =
|
||||
mutableClass!!.findMutableMethodOf(method)
|
||||
|
||||
// TODO: dynamically get registers
|
||||
mutableMethod!!.addInstructions(
|
||||
insertIndex, """
|
||||
const/16 v1, 0x8
|
||||
invoke-virtual {v0,v1}, Landroid/widget/FrameLayout;->setVisibility(I)V
|
||||
"""
|
||||
)
|
||||
}
|
||||
|
||||
resourceIds[6] -> {
|
||||
// and is followed by an instruction with the mnemonic INVOKE_DIRECT
|
||||
val insertIndex = index + 3
|
||||
val invokeInstruction = instructions.elementAt(insertIndex)
|
||||
if (invokeInstruction.opcode != Opcode.INVOKE_DIRECT) return@forEachIndexed
|
||||
|
||||
// create proxied method, make sure to not re-resolve() the current class
|
||||
if (mutableClass == null) mutableClass = data.proxy(classDef).resolve()
|
||||
if (mutableMethod == null) mutableMethod =
|
||||
mutableClass!!.findMutableMethodOf(method)
|
||||
|
||||
// insert hide call to hide the view corresponding to the resource
|
||||
val viewRegister = (invokeInstruction as Instruction35c).registerE
|
||||
mutableMethod!!.implementation!!.injectHideCall(insertIndex, viewRegister)
|
||||
}
|
||||
|
||||
resourceIds[7] -> {
|
||||
// TODO, go to class, hide the inflated view
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Opcode.CONST_STRING -> {
|
||||
|
||||
when (((instruction as Instruction21c).reference as StringReference).string) {
|
||||
stringReferences[0] -> {
|
||||
val stringInstruction = instructions.elementAt(3)
|
||||
if (stringInstruction.opcode == Opcode.CONST_STRING) return@forEachIndexed
|
||||
|
||||
// create proxied method, make sure to not re-resolve() the current class
|
||||
if (mutableClass == null) mutableClass = data.proxy(classDef).resolve()
|
||||
if (mutableMethod == null) mutableMethod =
|
||||
mutableClass!!.findMutableMethodOf(method)
|
||||
|
||||
// return the method
|
||||
val insertIndex = 1 // after super constructor
|
||||
//ToDo: Add setting here
|
||||
mutableMethod!!.implementation!!.addInstruction(
|
||||
insertIndex, BuilderInstruction10x(Opcode.RETURN_VOID)
|
||||
)
|
||||
}
|
||||
|
||||
stringReferences[1] -> {
|
||||
// TODO: migrate video ads patch to here if necessary
|
||||
}
|
||||
|
||||
stringReferences[2] -> { // Litho ads
|
||||
// create proxied method.
|
||||
val proxy = data.proxy(classDef)
|
||||
val mutableClass = proxy.resolve()
|
||||
|
||||
// add getIsEmpty method
|
||||
mutableClass.addGetIsEmptyMethod()
|
||||
|
||||
// get required method to patch and get references from
|
||||
val lithoMethod = getLithoMethod(mutableClass)
|
||||
?: return PatchResultError("Could not find required litho method to patch.")
|
||||
val lithoMethodImplementation = lithoMethod.implementation!!
|
||||
|
||||
// create and add getTemplateName method
|
||||
val getTemplateMethod =
|
||||
mutableClass.createGetTemplateNameMethod(lithoMethodImplementation)
|
||||
mutableClass.addMethod(getTemplateMethod)
|
||||
|
||||
val lithoInstructions = lithoMethodImplementation.instructions
|
||||
val thisType = mutableClass.type
|
||||
val templateNameParameterType = getTemplateMethod.parameterTypes.first()
|
||||
|
||||
// get reference descriptors
|
||||
val indexOfReference1 = lithoInstructions.indexOfFirst {
|
||||
it.opcode == Opcode.INVOKE_STATIC_RANGE
|
||||
}
|
||||
val descriptor1 =
|
||||
lithoInstructions.elementAt(indexOfReference1).toDescriptor<MethodReference>()
|
||||
val descriptor2 = lithoInstructions.elementAt(indexOfReference1 + 2)
|
||||
.toDescriptor<FieldReference>()
|
||||
|
||||
// create label
|
||||
val lithoRemoveLabel = lithoMethodImplementation.newLabelForIndex(0)
|
||||
|
||||
// create branch instructions
|
||||
val ifEqzFirstInstruction =
|
||||
BuilderInstruction21t(Opcode.IF_EQZ, 0, lithoRemoveLabel)
|
||||
val ifEqzSecondInstruction =
|
||||
BuilderInstruction21t(Opcode.IF_EQZ, 1, lithoRemoveLabel)
|
||||
|
||||
// create blocks
|
||||
val block1 = """
|
||||
invoke-static/range {p3}, $thisType->getTemplateName($templateNameParameterType)Ljava/lang/String;
|
||||
move-result-object v0
|
||||
""".toInstructions(lithoMethod)
|
||||
val block2 = """
|
||||
move-object/from16 v1, p3
|
||||
iget-object v2, v1, $templateNameParameterType->b:Ljava/nio/ByteBuffer;
|
||||
invoke-static {v0, v2}, Lapp/revanced/integrations/patches/GeneralBytecodeAdsPatch;->containsAd(Ljava/lang/String;Ljava/nio/ByteBuffer;)Z
|
||||
move-result v1
|
||||
""".toInstructions(lithoMethod)
|
||||
val block3 = """
|
||||
move-object/from16 v2, p1
|
||||
invoke-static {v2}, $descriptor1
|
||||
move-result-object v0
|
||||
iget-object v0, v0, $descriptor2
|
||||
return-object v0
|
||||
""".toInstructions(lithoMethod)
|
||||
|
||||
// insert blocks and branch instructions
|
||||
lithoMethodImplementation.insertBlocks(
|
||||
0,
|
||||
block1,
|
||||
listOf(ifEqzFirstInstruction),
|
||||
block2,
|
||||
listOf(ifEqzSecondInstruction),
|
||||
block3,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else -> return@forEachIndexed
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private fun getLithoMethod(mutableClass: MutableClass) = mutableClass.methods.firstOrNull {
|
||||
it.implementation?.instructions?.any { instruction ->
|
||||
instruction.opcode == Opcode.CONST && (instruction as Instruction31i).narrowLiteral == lithoConstant
|
||||
} ?: false
|
||||
}
|
||||
|
||||
private fun MutableClass.addGetIsEmptyMethod() {
|
||||
val getIsEmptyImplementation = MutableMethodImplementation(1)
|
||||
|
||||
// create target instructions
|
||||
val firstTargetInstruction = BuilderInstruction11n(Opcode.CONST_4, 0, 1)
|
||||
val secondTargetInstruction = BuilderInstruction11n(Opcode.CONST_4, 0, 0)
|
||||
|
||||
// add instructions to the instruction list
|
||||
getIsEmptyImplementation.addInstructions(
|
||||
0, listOf(
|
||||
// BuilderInstruction21t(Opcode.IF_EQZ, 0, first),
|
||||
BuilderInstruction35c(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
ImmutableMethodReference("Ljava/lang/String;", "isEmpty", null, "Z")
|
||||
),
|
||||
BuilderInstruction11x(Opcode.MOVE_RESULT, 0),
|
||||
// BuilderInstruction21t(Opcode.IF_EQZ, 0, second),
|
||||
// BuilderInstruction10t(Opcode.GOTO, first),
|
||||
secondTargetInstruction,
|
||||
BuilderInstruction11x(Opcode.RETURN, 0),
|
||||
firstTargetInstruction,
|
||||
BuilderInstruction11x(Opcode.RETURN, 0),
|
||||
)
|
||||
)
|
||||
|
||||
val getIsEmptyInstructions = getIsEmptyImplementation.instructions
|
||||
|
||||
// create labels for the target instructions
|
||||
val firstLabel =
|
||||
getIsEmptyImplementation.newLabelForIndex(getIsEmptyInstructions.indexOf(firstTargetInstruction))
|
||||
val secondLabel =
|
||||
getIsEmptyImplementation.newLabelForIndex(getIsEmptyInstructions.indexOf(secondTargetInstruction))
|
||||
|
||||
// create branch instructions to the labels
|
||||
val ifEqzFirstInstruction = BuilderInstruction21t(Opcode.IF_EQZ, 0, firstLabel)
|
||||
val ifEqzSecondInstruction = BuilderInstruction21t(Opcode.IF_EQZ, 0, secondLabel)
|
||||
val gotoInstruction = BuilderInstruction10t(Opcode.GOTO, firstLabel)
|
||||
|
||||
// insert remaining branch instructions, order of adding those instructions is important
|
||||
getIsEmptyImplementation.addInstructions(
|
||||
2, listOf(
|
||||
ifEqzSecondInstruction, gotoInstruction
|
||||
)
|
||||
)
|
||||
getIsEmptyImplementation.addInstruction(
|
||||
0, ifEqzFirstInstruction
|
||||
)
|
||||
|
||||
this.addMethod(
|
||||
createMutableMethod(
|
||||
this.type, "getIsEmpty", "Z", "Ljava/lang/String;", getIsEmptyImplementation
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private fun MutableClass.createGetTemplateNameMethod(lithoMethodImplementation: MethodImplementation): MutableMethod {
|
||||
var counter = 1
|
||||
val descriptors = buildList {
|
||||
for (instruction in lithoMethodImplementation.instructions) {
|
||||
if (instruction !is ReferenceInstruction) continue
|
||||
if (counter++ > 4) break
|
||||
|
||||
add(instruction.toDescriptor<MethodReference>())
|
||||
}
|
||||
}
|
||||
|
||||
val getTemplateNameImplementation = MutableMethodImplementation(2)
|
||||
|
||||
// create code blocks
|
||||
val block1 = """
|
||||
invoke-virtual {p0}, ${descriptors[0]}
|
||||
move-result-object p0
|
||||
const v0, $lithoConstant
|
||||
invoke-static {p0, v0}, ${descriptors[1]}
|
||||
move-result-object p0
|
||||
""".toInstructions()
|
||||
val block2 = """
|
||||
invoke-static {p0}, ${descriptors[2]}
|
||||
move-result-object p0
|
||||
invoke-virtual {p0}, ${descriptors[3]}
|
||||
move-result-object v0
|
||||
invoke-static {v0}, ${this.type}->getIsEmpty(Ljava/lang/String;)Z
|
||||
move-result v0
|
||||
""".toInstructions()
|
||||
val block3 = """
|
||||
invoke-virtual {p0}, ${descriptors[3]}
|
||||
move-result-object p0
|
||||
return-object p0
|
||||
""".toInstructions()
|
||||
|
||||
// create target instruction
|
||||
val targetInstruction = BuilderInstruction11n(Opcode.CONST_4, 1, 0)
|
||||
// and remaining instruction
|
||||
val returnInstruction = BuilderInstruction11x(Opcode.RETURN_OBJECT, 1)
|
||||
|
||||
// insert blocks and instructions
|
||||
getTemplateNameImplementation.insertBlocks(
|
||||
0,
|
||||
block1,
|
||||
block2,
|
||||
block3,
|
||||
listOf(
|
||||
targetInstruction, returnInstruction
|
||||
),
|
||||
)
|
||||
|
||||
// create label for target instruction
|
||||
val targetInstructionLabel =
|
||||
getTemplateNameImplementation.newLabelForIndex(getTemplateNameImplementation.instructions.size - 2)
|
||||
|
||||
// create branch instructions to the label
|
||||
val ifEqzInstruction = BuilderInstruction21t(Opcode.IF_EQZ, 1, targetInstructionLabel)
|
||||
val ifNezInstruction = BuilderInstruction21t(Opcode.IF_NEZ, 0, targetInstructionLabel)
|
||||
|
||||
// insert branch instructions
|
||||
getTemplateNameImplementation.addInstruction(
|
||||
block1.size, ifEqzInstruction
|
||||
)
|
||||
getTemplateNameImplementation.addInstruction(
|
||||
block1.size + block2.size + 1, ifNezInstruction
|
||||
)
|
||||
|
||||
// create the method
|
||||
return createMutableMethod(
|
||||
this.type,
|
||||
"getTemplateName",
|
||||
"Ljava/lang/String;",
|
||||
descriptors[0].split("->")[0], // a bit weird to get the type this way,
|
||||
getTemplateNameImplementation
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package app.revanced.patches.youtube.ad.general.bytecode.utils
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.iface.MethodImplementation
|
||||
import org.jf.dexlib2.immutable.ImmutableMethod
|
||||
import org.jf.dexlib2.immutable.ImmutableMethodParameter
|
||||
|
||||
internal object MethodUtils {
|
||||
internal fun createMutableMethod(
|
||||
definingClass: String, name: String, returnType: String, parameter: String, implementation: MethodImplementation
|
||||
) = ImmutableMethod(
|
||||
definingClass, name, listOf(
|
||||
ImmutableMethodParameter(
|
||||
parameter, null, null
|
||||
)
|
||||
), returnType, AccessFlags.PRIVATE or AccessFlags.STATIC, null, null, implementation
|
||||
).toMutable()
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.youtube.ad.infocardsuggestions.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class HideInfocardSuggestionsCompatibility
|
||||
@@ -0,0 +1,24 @@
|
||||
package app.revanced.patches.youtube.ad.infocardsuggestions.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.ad.infocardsuggestions.annotations.HideInfocardSuggestionsCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
@Name("hide-infocard-suggestions-fingerprint")
|
||||
@MatchingMethod("Liff;", "i")
|
||||
@FuzzyPatternScanMethod(2)
|
||||
@HideInfocardSuggestionsCompatibility
|
||||
@Version("0.0.1")
|
||||
object HideInfocardSuggestionsFingerprint : MethodFingerprint(
|
||||
"Ljava/lang/Boolean;",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
null,
|
||||
null,
|
||||
listOf("vibrator"),
|
||||
null
|
||||
)
|
||||
@@ -0,0 +1,24 @@
|
||||
package app.revanced.patches.youtube.ad.infocardsuggestions.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.youtube.ad.infocardsuggestions.annotations.HideInfocardSuggestionsCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
@Name("hide-infocard-suggestions-parent-fingerprint")
|
||||
@MatchingMethod("Liff;", "lE")
|
||||
@FuzzyPatternScanMethod(2)
|
||||
@HideInfocardSuggestionsCompatibility
|
||||
@Version("0.0.1")
|
||||
object HideInfocardSuggestionsParentFingerprint : MethodFingerprint(
|
||||
"Ljava/lang/String;",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
listOf(),
|
||||
null,
|
||||
listOf("player_overlay_info_card_teaser"),
|
||||
null
|
||||
)
|
||||
@@ -0,0 +1,54 @@
|
||||
package app.revanced.patches.youtube.ad.infocardsuggestions.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.replaceInstruction
|
||||
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.ad.infocardsuggestions.annotations.HideInfocardSuggestionsCompatibility
|
||||
import app.revanced.patches.youtube.ad.infocardsuggestions.fingerprints.HideInfocardSuggestionsFingerprint
|
||||
import app.revanced.patches.youtube.ad.infocardsuggestions.fingerprints.HideInfocardSuggestionsParentFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction35c
|
||||
|
||||
@Patch
|
||||
@Dependencies([IntegrationsPatch::class])
|
||||
@Name("hide-infocard-suggestions")
|
||||
@Description("Hides infocards in videos.")
|
||||
@HideInfocardSuggestionsCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideInfocardSuggestionsPatch : BytecodePatch(
|
||||
listOf(
|
||||
HideInfocardSuggestionsParentFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
val parentResult = HideInfocardSuggestionsParentFingerprint.result
|
||||
?: return PatchResultError("Parent fingerprint not resolved!")
|
||||
|
||||
|
||||
HideInfocardSuggestionsFingerprint.resolve(data, parentResult.classDef)
|
||||
val result = HideInfocardSuggestionsFingerprint.result
|
||||
?: return PatchResultError("Required parent method could not be found.")
|
||||
|
||||
val method = result.mutableMethod
|
||||
val implementation = method.implementation
|
||||
?: return PatchResultError("Implementation not found.")
|
||||
|
||||
val index = implementation.instructions.indexOfFirst { ((it as? BuilderInstruction35c)?.reference.toString() == "Landroid/view/View;->setVisibility(I)V") }
|
||||
|
||||
method.replaceInstruction(index, """
|
||||
invoke-static {p1}, Lapp/revanced/integrations/patches/HideInfoCardSuggestionsPatch;->hideInfoCardSuggestions(Landroid/view/View;)V
|
||||
""")
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.revanced.patches.youtube.ad.video.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"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", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class VideoAdsCompatibility
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package app.revanced.patches.youtube.ad.video.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("show-video-ads-constructor-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Laair",
|
||||
"<init>",
|
||||
)
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@VideoAdsCompatibility
|
||||
@Version("0.0.1")
|
||||
object ShowVideoAdsConstructorFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L"), listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
null, // either CONST_4 or CONST_16
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IPUT_BOOLEAN,
|
||||
Opcode.RETURN_VOID
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,21 @@
|
||||
package app.revanced.patches.youtube.ad.video.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.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
|
||||
)
|
||||
@@ -0,0 +1,43 @@
|
||||
package app.revanced.patches.youtube.ad.video.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.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.Patch
|
||||
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
||||
import app.revanced.patches.youtube.ad.video.fingerprints.ShowVideoAdsConstructorFingerprint
|
||||
import app.revanced.patches.youtube.ad.video.fingerprints.ShowVideoAdsFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
|
||||
@Patch
|
||||
@Dependencies([IntegrationsPatch::class])
|
||||
@Name("video-ads")
|
||||
@Description("Removes ads in the video player.")
|
||||
@VideoAdsCompatibility
|
||||
@Version("0.0.1")
|
||||
class VideoAdsPatch : BytecodePatch(
|
||||
listOf(
|
||||
ShowVideoAdsConstructorFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
ShowVideoAdsFingerprint.resolve(data, ShowVideoAdsConstructorFingerprint.result!!.classDef)
|
||||
|
||||
// Override the parameter by calling shouldShowAds and setting the parameter to the result
|
||||
ShowVideoAdsFingerprint.result!!.mutableMethod.addInstructions(
|
||||
0, """
|
||||
invoke-static { }, Lapp/revanced/integrations/patches/VideoAdsPatch;->shouldShowAds()Z
|
||||
move-result v1
|
||||
"""
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,186 +0,0 @@
|
||||
package app.revanced.patches.youtube.interaction
|
||||
|
||||
import app.revanced.patcher.data.implementation.BytecodeData
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
||||
import app.revanced.patcher.patch.implementation.metadata.PackageMetadata
|
||||
import app.revanced.patcher.patch.implementation.metadata.PatchMetadata
|
||||
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.MethodMetadata
|
||||
import app.revanced.patcher.signature.MethodSignature
|
||||
import app.revanced.patcher.signature.MethodSignatureMetadata
|
||||
import app.revanced.patcher.signature.PatternScanMethod
|
||||
import app.revanced.patcher.smali.toInstructions
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
||||
import org.jf.dexlib2.iface.Method
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction11n
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
|
||||
private val compatiblePackages = listOf(
|
||||
PackageMetadata(
|
||||
"com.google.android.youtube",
|
||||
listOf("17.17.34")
|
||||
)
|
||||
)
|
||||
|
||||
class EnableSeekbarTappingPatch : BytecodePatch(
|
||||
PatchMetadata(
|
||||
"seekbar-tapping",
|
||||
"Enable seekbar tapping patch",
|
||||
"Enable tapping on the seekbar of the YouTube player.",
|
||||
compatiblePackages,
|
||||
"0.0.1"
|
||||
),
|
||||
listOf(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"enable-seekbar-tapping-parent-signature",
|
||||
MethodMetadata("Lzhj;", "J"), // unknown
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
"Signature for a parent method, which is needed to find the actual method required to be patched.",
|
||||
"0.0.1"
|
||||
),
|
||||
"L",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
listOf(),
|
||||
listOf(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.NEW_ARRAY,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_WIDE,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.APUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_WIDE,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.APUT_OBJECT,
|
||||
Opcode.CONST,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.RETURN_OBJECT
|
||||
)
|
||||
),
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"enable-seekbar-tapping-signature",
|
||||
MethodMetadata("Lfao;", "onTouchEvent"), // unknown
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
"Signature for the method required to be patched.",
|
||||
"0.0.1"
|
||||
),
|
||||
"Z",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
listOf("L"),
|
||||
listOf(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_WIDE,
|
||||
Opcode.IGET,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET,
|
||||
Opcode.DIV_INT_2ADDR,
|
||||
Opcode.ADD_INT,
|
||||
Opcode.SUB_INT_2ADDR,
|
||||
Opcode.INT_TO_FLOAT,
|
||||
Opcode.CMPG_FLOAT,
|
||||
Opcode.IF_GTZ,
|
||||
Opcode.INT_TO_FLOAT,
|
||||
Opcode.CMPG_FLOAT,
|
||||
Opcode.IF_GTZ,
|
||||
Opcode.CONST_4,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
var result = signatures.first().result!!
|
||||
|
||||
val tapSeekMethods = mutableMapOf<String, Method>()
|
||||
|
||||
// find the methods which tap the seekbar
|
||||
for (it in result.definingClassProxy.immutableClass.methods) {
|
||||
if (it.implementation == null) continue
|
||||
|
||||
val instructions = it.implementation!!.instructions
|
||||
// here we make sure we actually find the method because it has more then 7 instructions
|
||||
if (instructions.count() < 7) continue
|
||||
|
||||
// we know that the 7th instruction has the opcode CONST_4
|
||||
val instruction = instructions.elementAt(6)
|
||||
if (instruction.opcode != Opcode.CONST_4) continue
|
||||
|
||||
// the literal for this instruction has to be either 1 or 2
|
||||
val literal = (instruction as Instruction11n).narrowLiteral
|
||||
|
||||
// method founds
|
||||
if (literal == 1) tapSeekMethods["P"] = it
|
||||
if (literal == 2) tapSeekMethods["O"] = it
|
||||
}
|
||||
|
||||
// replace map because we dont need the upper one anymore
|
||||
result = signatures.last().result!!
|
||||
|
||||
val implementation = result.method.implementation!!
|
||||
|
||||
// if tap-seeking is enabled, do not invoke the two methods below
|
||||
val pMethod = tapSeekMethods["P"]!!
|
||||
val oMethod = tapSeekMethods["O"]!!
|
||||
|
||||
// get the required register
|
||||
val instruction = implementation.instructions[result.scanData.endIndex]
|
||||
if (instruction.opcode != Opcode.INVOKE_VIRTUAL)
|
||||
return PatchResultError("Could not find the correct register")
|
||||
val register = (instruction as Instruction35c).registerC
|
||||
|
||||
// the instructions are written in reverse order.
|
||||
implementation.addInstructions(
|
||||
result.scanData.endIndex + 1,
|
||||
"""
|
||||
invoke-virtual { v$register, v2 }, ${oMethod.definingClass}->${oMethod.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
|
||||
val elseLabel = implementation.newLabelForIndex(result.scanData.endIndex + 1)
|
||||
implementation.addInstruction(
|
||||
result.scanData.endIndex + 1,
|
||||
BuilderInstruction21t(Opcode.IF_EQZ, 0, elseLabel)
|
||||
)
|
||||
implementation.addInstructions(
|
||||
result.scanData.endIndex + 1,
|
||||
"""
|
||||
invoke-static { }, Lfi/razerman/youtube/preferences/BooleanPreferences;->isTapSeekingEnabled()Z
|
||||
move-result v0
|
||||
""".trimIndent().toInstructions()
|
||||
)
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.revanced.patches.youtube.interaction.seekbar.annotation
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"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", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class SeekbarTappingCompatibility
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package app.revanced.patches.youtube.interaction.seekbar.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.youtube.interaction.seekbar.annotation.SeekbarTappingCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("enable-seekbar-tapping-fingerprint")
|
||||
@MatchingMethod("Lfbl;", "onTouchEvent")
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@SeekbarTappingCompatibility
|
||||
@Version("0.0.1")
|
||||
object SeekbarTappingFingerprint : MethodFingerprint(
|
||||
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_WIDE,
|
||||
Opcode.IGET,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET,
|
||||
Opcode.DIV_INT_2ADDR,
|
||||
Opcode.ADD_INT,
|
||||
Opcode.SUB_INT_2ADDR,
|
||||
Opcode.INT_TO_FLOAT,
|
||||
Opcode.CMPG_FLOAT,
|
||||
Opcode.IF_GTZ,
|
||||
Opcode.INT_TO_FLOAT,
|
||||
Opcode.CMPG_FLOAT,
|
||||
Opcode.IF_GTZ,
|
||||
Opcode.CONST_4,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,51 @@
|
||||
package app.revanced.patches.youtube.interaction.seekbar.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.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patches.youtube.interaction.seekbar.annotation.SeekbarTappingCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("enable-seekbar-tapping-parent-fingerprint")
|
||||
@MatchingMethod("Lzmx;", "I")
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@SeekbarTappingCompatibility
|
||||
@Version("0.0.1")
|
||||
object SeekbarTappingParentFingerprint : MethodFingerprint(
|
||||
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.NEW_ARRAY,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_WIDE,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.APUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_WIDE,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST_4,
|
||||
Opcode.APUT_OBJECT,
|
||||
Opcode.CONST,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.RETURN_OBJECT
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,95 @@
|
||||
package app.revanced.patches.youtube.interaction.seekbar.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.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.interaction.seekbar.annotation.SeekbarTappingCompatibility
|
||||
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.SeekbarTappingFingerprint
|
||||
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.SeekbarTappingParentFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
||||
import org.jf.dexlib2.iface.Method
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction11n
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
|
||||
@Patch
|
||||
@Dependencies([IntegrationsPatch::class])
|
||||
@Name("seekbar-tapping")
|
||||
@Description("Enables tap-to-seek on the seekbar of the video player.")
|
||||
@SeekbarTappingCompatibility
|
||||
@Version("0.0.1")
|
||||
class EnableSeekbarTappingPatch : BytecodePatch(
|
||||
listOf(
|
||||
SeekbarTappingParentFingerprint, SeekbarTappingFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
var result = SeekbarTappingParentFingerprint.result!!
|
||||
|
||||
val tapSeekMethods = mutableMapOf<String, Method>()
|
||||
|
||||
// find the methods which tap the seekbar
|
||||
for (it in result.classDef.methods) {
|
||||
if (it.implementation == null) continue
|
||||
|
||||
val instructions = it.implementation!!.instructions
|
||||
// here we make sure we actually find the method because it has more then 7 instructions
|
||||
if (instructions.count() < 7) continue
|
||||
|
||||
// we know that the 7th instruction has the opcode CONST_4
|
||||
val instruction = instructions.elementAt(6)
|
||||
if (instruction.opcode != Opcode.CONST_4) continue
|
||||
|
||||
// the literal for this instruction has to be either 1 or 2
|
||||
val literal = (instruction as Instruction11n).narrowLiteral
|
||||
|
||||
// method founds
|
||||
if (literal == 1) tapSeekMethods["P"] = it
|
||||
if (literal == 2) tapSeekMethods["O"] = it
|
||||
}
|
||||
|
||||
// replace map because we don't need the upper one anymore
|
||||
result = SeekbarTappingFingerprint.result!!
|
||||
|
||||
val implementation = result.mutableMethod.implementation!!
|
||||
|
||||
// if tap-seeking is enabled, do not invoke the two methods below
|
||||
val pMethod = tapSeekMethods["P"]!!
|
||||
val oMethod = tapSeekMethods["O"]!!
|
||||
|
||||
// get the required register
|
||||
val instruction = implementation.instructions[result.patternScanResult!!.endIndex]
|
||||
if (instruction.opcode != Opcode.INVOKE_VIRTUAL) return PatchResultError("Could not find the correct register")
|
||||
val register = (instruction as Instruction35c).registerC
|
||||
|
||||
// the instructions are written in reverse order.
|
||||
result.mutableMethod.addInstructions(
|
||||
result.patternScanResult!!.endIndex + 1, """
|
||||
invoke-virtual { v$register, v2 }, ${oMethod.definingClass}->${oMethod.name}(I)V
|
||||
invoke-virtual { v$register, v2 }, ${pMethod.definingClass}->${pMethod.name}(I)V
|
||||
"""
|
||||
)
|
||||
|
||||
// if tap-seeking is disabled, do not invoke the two methods above by jumping to the else label
|
||||
val elseLabel = implementation.newLabelForIndex(result.patternScanResult!!.endIndex + 1)
|
||||
implementation.addInstruction(
|
||||
result.patternScanResult!!.endIndex + 1, BuilderInstruction21t(Opcode.IF_EQZ, 0, elseLabel)
|
||||
)
|
||||
result.mutableMethod.addInstructions(
|
||||
result.patternScanResult!!.endIndex + 1, """
|
||||
invoke-static { }, Lapp/revanced/integrations/patches/SeekbarTappingPatch;->isTapSeekingEnabled()Z
|
||||
move-result v0
|
||||
"""
|
||||
)
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.youtube.interaction.swipecontrols.annotation
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.24.34", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class SwipeControlsCompatibility
|
||||
@@ -0,0 +1,21 @@
|
||||
package app.revanced.patches.youtube.interaction.swipecontrols.fingerprints
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
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.interaction.swipecontrols.annotation.SwipeControlsCompatibility
|
||||
|
||||
@Name("watch-while-onStart-fingerprint")
|
||||
@MatchingMethod(
|
||||
"LWatchWhileActivity;", "onCreate"
|
||||
)
|
||||
@DirectPatternScanMethod
|
||||
@SwipeControlsCompatibility
|
||||
@Version("0.0.1")
|
||||
object WatchWhileOnStartFingerprint : MethodFingerprint(
|
||||
null, null, null, null, null, { methodDef ->
|
||||
methodDef.definingClass.endsWith("WatchWhileActivity;") && methodDef.name == "onStart"
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,45 @@
|
||||
package app.revanced.patches.youtube.interaction.swipecontrols.patch.bytecode
|
||||
|
||||
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.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.Patch
|
||||
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||
import app.revanced.patches.youtube.interaction.swipecontrols.annotation.SwipeControlsCompatibility
|
||||
import app.revanced.patches.youtube.interaction.swipecontrols.fingerprints.WatchWhileOnStartFingerprint
|
||||
import app.revanced.patches.youtube.interaction.swipecontrols.patch.resource.SwipeControlsResourcePatch
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.playeroverlay.patch.PlayerOverlaysHookPatch
|
||||
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
|
||||
|
||||
@Patch(include = false)
|
||||
@Name("swipe-controls")
|
||||
@Description("Adds volume and brightness swipe controls.")
|
||||
@SwipeControlsCompatibility
|
||||
@Version("0.0.2")
|
||||
@Dependencies(
|
||||
[
|
||||
IntegrationsPatch::class,
|
||||
PlayerTypeHookPatch::class,
|
||||
PlayerOverlaysHookPatch::class,
|
||||
SwipeControlsResourcePatch::class
|
||||
]
|
||||
)
|
||||
class SwipeControlsBytecodePatch : BytecodePatch(
|
||||
listOf(
|
||||
WatchWhileOnStartFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
WatchWhileOnStartFingerprint.result!!.mutableMethod.addInstruction(
|
||||
0,
|
||||
"invoke-static { p0 }, Lapp/revanced/integrations/patches/SwipeControlsPatch;->WatchWhileActivity_onStartHookEX(Ljava/lang/Object;)V"
|
||||
)
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package app.revanced.patches.youtube.interaction.swipecontrols.patch.resource
|
||||
|
||||
import app.revanced.extensions.injectResources
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.impl.ResourceData
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.impl.ResourcePatch
|
||||
import app.revanced.patches.youtube.interaction.swipecontrols.annotation.SwipeControlsCompatibility
|
||||
|
||||
@Name("swipe-controls-resource-patch")
|
||||
@SwipeControlsCompatibility
|
||||
@Version("0.0.1")
|
||||
class SwipeControlsResourcePatch : ResourcePatch() {
|
||||
override fun execute(data: ResourceData): PatchResult {
|
||||
val resourcesDir = "swipecontrols"
|
||||
|
||||
data.injectResources(
|
||||
this.javaClass.classLoader,
|
||||
resourcesDir,
|
||||
"drawable",
|
||||
listOf(
|
||||
"ic_sc_brightness_auto",
|
||||
"ic_sc_brightness_manual",
|
||||
"ic_sc_volume_mute",
|
||||
"ic_sc_volume_normal"
|
||||
).map { "$it.xml" }
|
||||
)
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout
|
||||
|
||||
import app.revanced.patcher.data.implementation.BytecodeData
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
||||
import app.revanced.patcher.patch.implementation.metadata.PackageMetadata
|
||||
import app.revanced.patcher.patch.implementation.metadata.PatchMetadata
|
||||
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.MethodMetadata
|
||||
import app.revanced.patcher.signature.MethodSignature
|
||||
import app.revanced.patcher.signature.MethodSignatureMetadata
|
||||
import app.revanced.patcher.signature.PatternScanMethod
|
||||
import app.revanced.patcher.smali.toInstruction
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
|
||||
private val compatiblePackages = listOf(
|
||||
PackageMetadata(
|
||||
"com.google.android.youtube",
|
||||
listOf("17.14.35", "17.17.34")
|
||||
)
|
||||
)
|
||||
|
||||
class CreateButtonRemoverPatch : BytecodePatch(
|
||||
PatchMetadata(
|
||||
"create-button",
|
||||
"Create button patch",
|
||||
"Disable the create button.",
|
||||
compatiblePackages,
|
||||
"0.0.1"
|
||||
),
|
||||
listOf(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"create-button-method",
|
||||
MethodMetadata("Lkne", "z"), // unknown
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
"Signature for the method required to be patched.",
|
||||
"0.0.1"
|
||||
),
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
listOf("Z"),
|
||||
listOf(
|
||||
Opcode.IGET,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.CONST,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.INVOKE_DIRECT_RANGE,
|
||||
Opcode.CONST_4,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
val result = signatures.first().result!!
|
||||
|
||||
// Get the required register which holds the view object we need to pass to the method hideCreateButton
|
||||
val implementation = result.method.implementation!!
|
||||
val instruction = implementation.instructions[result.scanData.endIndex + 1]
|
||||
if (instruction.opcode != Opcode.INVOKE_STATIC)
|
||||
return PatchResultError("Could not find the correct register")
|
||||
val register = (instruction as Instruction35c).registerC
|
||||
|
||||
// Hide the button view via proxy by passing it to the hideCreateButton method
|
||||
implementation.addInstruction(
|
||||
result.scanData.endIndex + 1,
|
||||
"invoke-static { v$register }, Lfi/razerman/youtube/XAdRemover;->hideCreateButton(Landroid/view/View;)V".toInstruction()
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout
|
||||
|
||||
import app.revanced.patcher.data.implementation.BytecodeData
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
||||
import app.revanced.patcher.patch.implementation.metadata.PackageMetadata
|
||||
import app.revanced.patcher.patch.implementation.metadata.PatchMetadata
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
||||
import app.revanced.patcher.signature.MethodMetadata
|
||||
import app.revanced.patcher.signature.MethodSignature
|
||||
import app.revanced.patcher.signature.MethodSignatureMetadata
|
||||
import app.revanced.patcher.signature.PatternScanMethod
|
||||
import app.revanced.patcher.smali.toInstruction
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
private val compatiblePackages = listOf(
|
||||
PackageMetadata(
|
||||
"com.google.android.youtube",
|
||||
listOf("17.17.34")
|
||||
)
|
||||
)
|
||||
|
||||
class HideReelsPatch : BytecodePatch(
|
||||
PatchMetadata(
|
||||
"hide-reels",
|
||||
"Hide reels patch",
|
||||
"Hide reels on the page.",
|
||||
compatiblePackages,
|
||||
"0.0.1"
|
||||
),
|
||||
listOf(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"hide-reels-signature",
|
||||
MethodMetadata("Ljvy", "<init>"), // unknown
|
||||
PatternScanMethod.Fuzzy(3), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
"Signature for the method required to be patched.",
|
||||
"0.0.1"
|
||||
),
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
listOf(
|
||||
"L",
|
||||
"L",
|
||||
"L",
|
||||
"L",
|
||||
"L",
|
||||
"L",
|
||||
"L",
|
||||
"L",
|
||||
"L",
|
||||
"L",
|
||||
"L",
|
||||
"[B",
|
||||
"[B",
|
||||
"[B",
|
||||
"[B",
|
||||
"[B",
|
||||
"[B"
|
||||
),
|
||||
listOf(
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.MOVE_OBJECT_FROM16,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST,
|
||||
Opcode.CONST_4,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IPUT_OBJECT
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
val result = signatures.first().result!!
|
||||
val implementation = result.method.implementation!!
|
||||
|
||||
// HideReel will hide the reel view before it is being used,
|
||||
// so we pass the view to the HideReel method
|
||||
implementation.addInstruction(
|
||||
result.scanData.endIndex,
|
||||
"invoke-static { v2 }, Lfi/razerman/youtube/XAdRemover;->HideReel(Landroid/view/View;)V".toInstruction()
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout
|
||||
|
||||
import app.revanced.patcher.data.implementation.BytecodeData
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
||||
import app.revanced.patcher.patch.implementation.metadata.PackageMetadata
|
||||
import app.revanced.patcher.patch.implementation.metadata.PatchMetadata
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
||||
import app.revanced.patcher.signature.MethodMetadata
|
||||
import app.revanced.patcher.signature.MethodSignature
|
||||
import app.revanced.patcher.signature.MethodSignatureMetadata
|
||||
import app.revanced.patcher.signature.PatternScanMethod
|
||||
import app.revanced.patcher.smali.toInstructions
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
private val compatiblePackages = listOf(
|
||||
PackageMetadata(
|
||||
"com.google.android.youtube",
|
||||
listOf("17.14.35", "17.17.34")
|
||||
)
|
||||
)
|
||||
|
||||
class MinimizedPlaybackPatch : BytecodePatch(
|
||||
PatchMetadata(
|
||||
"minimized-playback",
|
||||
"Minimized Playback Patch",
|
||||
"Enable minimized and background playback.",
|
||||
compatiblePackages,
|
||||
"0.0.1"
|
||||
),
|
||||
listOf(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"minimized-playback-manager",
|
||||
MethodMetadata("Lype", "j"), // unknown
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
"Signature for the method required to be patched.",
|
||||
"0.0.1"
|
||||
),
|
||||
"Z",
|
||||
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||
listOf("L"),
|
||||
listOf(
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET,
|
||||
Opcode.AND_INT_LIT16,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET,
|
||||
Opcode.CONST,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET,
|
||||
Opcode.IF_NE,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.GOTO,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.GOTO,
|
||||
Opcode.CONST_4,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.IF_EQZ
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
// Instead of removing all instructions like Vanced,
|
||||
// we return the method at the beginning instead
|
||||
signatures.first().result!!.method.implementation!!.addInstructions(
|
||||
0,
|
||||
"""
|
||||
const/4 v0, 0x1
|
||||
return v0
|
||||
""".trimIndent().toInstructions()
|
||||
)
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout
|
||||
|
||||
import app.revanced.patcher.data.implementation.BytecodeData
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
||||
import app.revanced.patcher.patch.implementation.metadata.PackageMetadata
|
||||
import app.revanced.patcher.patch.implementation.metadata.PatchMetadata
|
||||
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.MethodMetadata
|
||||
import app.revanced.patcher.signature.MethodSignature
|
||||
import app.revanced.patcher.signature.MethodSignatureMetadata
|
||||
import app.revanced.patcher.signature.PatternScanMethod
|
||||
import app.revanced.patcher.smali.toInstructions
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
||||
|
||||
private val compatiblePackages = listOf(
|
||||
PackageMetadata(
|
||||
"com.google.android.youtube",
|
||||
listOf("17.17.34")
|
||||
)
|
||||
)
|
||||
|
||||
class OldQualityLayoutPatch : BytecodePatch(
|
||||
PatchMetadata(
|
||||
"old-quality-layout",
|
||||
"Old Quality Layout Patch",
|
||||
"Enable the original quality flyout menu",
|
||||
compatiblePackages,
|
||||
"0.0.1"
|
||||
),
|
||||
listOf(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"old-quality-parent-method-signature",
|
||||
MethodMetadata("Libh", "<init>"), // unknown
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
"Signature to find a parent method required by the Old Quality Layout patch.",
|
||||
"0.0.1"
|
||||
),
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
listOf("L", "L", "L", "L", "L", "L", "L"),
|
||||
listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.CONST_4,
|
||||
Opcode.CONST_4,
|
||||
Opcode.CONST_4,
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
var result = signatures.first().result!!
|
||||
|
||||
result = result.findParentMethod(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"old-quality-method-signature",
|
||||
MethodMetadata("Libh", null), // unknown
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
"Signature to find the method required by the Old Quality Layout patch",
|
||||
"0.0.1"
|
||||
),
|
||||
"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("Method old-quality-patch-method has not been found")
|
||||
|
||||
val implementation = result.method.implementation!!
|
||||
|
||||
// if useOldStyleQualitySettings == true, jump over all instructions
|
||||
val jmpInstruction =
|
||||
BuilderInstruction21t(
|
||||
Opcode.IF_NEZ,
|
||||
0,
|
||||
implementation.instructions[result.scanData.endIndex].location.labels.first()
|
||||
)
|
||||
implementation.addInstruction(5, jmpInstruction)
|
||||
implementation.addInstructions(
|
||||
0,
|
||||
"""
|
||||
invoke-static { }, Lfi/razerman/youtube/XGlobals;->useOldStyleQualitySettings()Z
|
||||
move-result v0
|
||||
""".trimIndent().toInstructions()
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout
|
||||
|
||||
import app.revanced.patcher.data.implementation.BytecodeData
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.patch.implementation.BytecodePatch
|
||||
import app.revanced.patcher.patch.implementation.metadata.PackageMetadata
|
||||
import app.revanced.patcher.patch.implementation.metadata.PatchMetadata
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResult
|
||||
import app.revanced.patcher.patch.implementation.misc.PatchResultSuccess
|
||||
import app.revanced.patcher.signature.MethodMetadata
|
||||
import app.revanced.patcher.signature.MethodSignature
|
||||
import app.revanced.patcher.signature.MethodSignatureMetadata
|
||||
import app.revanced.patcher.signature.PatternScanMethod
|
||||
import app.revanced.patcher.smali.toInstruction
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction11x
|
||||
|
||||
private val compatiblePackages = listOf(
|
||||
PackageMetadata(
|
||||
"com.google.android.youtube",
|
||||
listOf("17.14.35", "17.17.34")
|
||||
)
|
||||
)
|
||||
|
||||
class ShortsButtonRemoverPatch : BytecodePatch(
|
||||
PatchMetadata(
|
||||
"shorts-button",
|
||||
"Shorts button patch",
|
||||
"Hide the shorts button.",
|
||||
compatiblePackages,
|
||||
"0.0.1"
|
||||
),
|
||||
listOf(
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"pivotbar-buttons-method-tabenum",
|
||||
MethodMetadata("Lkne", "z"), // unknown
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
"Signature for the pivotbar method that creates all button views.",
|
||||
"0.0.1"
|
||||
),
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
listOf("Z"),
|
||||
listOf(
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET,
|
||||
Opcode.INVOKE_STATIC, // SomeEnum.fromValue(tabOrdinal)
|
||||
Opcode.MOVE_RESULT_OBJECT
|
||||
)
|
||||
),
|
||||
MethodSignature(
|
||||
MethodSignatureMetadata(
|
||||
"pivotbar-buttons-method-view",
|
||||
MethodMetadata("Lkne", "z"), // unknown
|
||||
PatternScanMethod.Fuzzy(2), // FIXME: Test this threshold and find the best value.
|
||||
compatiblePackages,
|
||||
"Signature for the pivotbar method that creates all button views.",
|
||||
"0.0.1"
|
||||
),
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
listOf("Z"),
|
||||
listOf(
|
||||
Opcode.NEW_INSTANCE, // new StateListDrawable()
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.NEW_ARRAY,
|
||||
Opcode.CONST,
|
||||
Opcode.CONST_16,
|
||||
Opcode.APUT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.MOVE,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL_RANGE, // pivotBar.getView(drawable, tabName, z, i, map, akebVar, optional)
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
)
|
||||
),
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
val result1 = signatures.first().result!!
|
||||
val implementation1 = result1.method.implementation!!
|
||||
val moveEnumInstruction = implementation1.instructions[result1.scanData.endIndex]
|
||||
val enumRegister = (moveEnumInstruction as Instruction11x).registerA
|
||||
|
||||
val result2 = signatures.last().result!!
|
||||
val implementation2 = result2.method.implementation!!
|
||||
val moveViewInstruction = implementation2.instructions[result2.scanData.endIndex]
|
||||
val viewRegister = (moveViewInstruction as Instruction11x).registerA
|
||||
|
||||
// Save the tab enum in XGlobals to avoid smali/register workarounds
|
||||
implementation1.addInstruction(
|
||||
result1.scanData.endIndex + 1,
|
||||
"sput-object v$enumRegister, Lfi/razerman/youtube/XGlobals;->lastPivotTab:Ljava/lang/Enum;".toInstruction()
|
||||
)
|
||||
|
||||
// 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"
|
||||
implementation2.addInstruction(
|
||||
result2.scanData.endIndex + 2,
|
||||
"invoke-static { v$viewRegister }, Lfi/razerman/youtube/XAdRemover;->hideShortsButton(Landroid/view/View;)V".toInstruction()
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.youtube.layout.amoled.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"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", "17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class AmoledCompatibility
|
||||
@@ -0,0 +1,43 @@
|
||||
package app.revanced.patches.youtube.layout.amoled.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.PatchResult
|
||||
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.ResourcePatch
|
||||
import app.revanced.patches.youtube.layout.amoled.annotations.AmoledCompatibility
|
||||
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||
import org.w3c.dom.Element
|
||||
import java.io.File
|
||||
|
||||
@Patch
|
||||
@Dependencies([FixLocaleConfigErrorPatch::class])
|
||||
@Name("amoled")
|
||||
@Description("Enables pure black theme.")
|
||||
@AmoledCompatibility
|
||||
@Version("0.0.1")
|
||||
class AmoledPatch : ResourcePatch() {
|
||||
override fun execute(data: ResourceData): PatchResult {
|
||||
data.xmlEditor["res${File.separator}values${File.separator}colors.xml"].use { editor ->
|
||||
val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element
|
||||
|
||||
for (i in 0 until resourcesNode.childNodes.length) {
|
||||
val node = resourcesNode.childNodes.item(i)
|
||||
if (node !is Element) continue
|
||||
|
||||
val element = resourcesNode.childNodes.item(i) as Element
|
||||
element.textContent = when (element.getAttribute("name")) {
|
||||
"yt_black1", "yt_black1_opacity95", "yt_black2", "yt_black3", "yt_black4", "yt_status_bar_background_dark" -> "@android:color/black"
|
||||
"yt_selected_nav_label_dark" -> "#ffdf0000"
|
||||
else -> continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.patches.youtube.layout.autoplaybutton.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.25.34", "17.26.35", "17.27.39", "17.28.34", "17.29.34")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class AutoplayButtonCompatibility
|
||||
@@ -0,0 +1,34 @@
|
||||
package app.revanced.patches.youtube.layout.autoplaybutton.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.autoplaybutton.annotations.AutoplayButtonCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("autonav-informer-fingerprint")
|
||||
@MatchingMethod(
|
||||
"LWillAutonavInformer;", "k"
|
||||
)
|
||||
@FuzzyPatternScanMethod(2)
|
||||
@AutoplayButtonCompatibility
|
||||
@Version("0.0.1")
|
||||
object AutonavInformerFingerprint : MethodFingerprint(
|
||||
"Z",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
null,
|
||||
listOf(
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
),
|
||||
null,
|
||||
{ it.definingClass.endsWith("WillAutonavInformer;") }
|
||||
)
|
||||
@@ -0,0 +1,32 @@
|
||||
package app.revanced.patches.youtube.layout.autoplaybutton.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.autoplaybutton.annotations.AutoplayButtonCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("layout-constructor-fingerprint")
|
||||
@MatchingMethod(
|
||||
"LYouTubeControlsOverlay;", "F"
|
||||
)
|
||||
@FuzzyPatternScanMethod(2)
|
||||
@AutoplayButtonCompatibility
|
||||
@Version("0.0.1")
|
||||
object LayoutConstructorFingerprint : MethodFingerprint(
|
||||
"V",
|
||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
null,
|
||||
listOf(
|
||||
Opcode.CONST,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
),
|
||||
listOf("1.0x")
|
||||
)
|
||||
@@ -0,0 +1,88 @@
|
||||
package app.revanced.patches.youtube.layout.autoplaybutton.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.patch.PatchResult
|
||||
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.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.youtube.layout.autoplaybutton.annotations.AutoplayButtonCompatibility
|
||||
import app.revanced.patches.youtube.layout.autoplaybutton.fingerprints.AutonavInformerFingerprint
|
||||
import app.revanced.patches.youtube.layout.autoplaybutton.fingerprints.LayoutConstructorFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.mapping.patch.ResourceIdMappingProviderResourcePatch
|
||||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
|
||||
@Patch
|
||||
@Dependencies([ResourceIdMappingProviderResourcePatch::class, IntegrationsPatch::class])
|
||||
@Name("hide-autoplay-button")
|
||||
@Description("Hides the autoplay button in the video player.")
|
||||
@AutoplayButtonCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideAutoplayButton : BytecodePatch(
|
||||
listOf(
|
||||
LayoutConstructorFingerprint, AutonavInformerFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
val layoutGenMethod = LayoutConstructorFingerprint.result!!.mutableMethod
|
||||
|
||||
val autonavToggle =
|
||||
ResourceIdMappingProviderResourcePatch.resourceMappings.single { it.type == "id" && it.name == "autonav_toggle" }
|
||||
val autonavPreviewStub =
|
||||
ResourceIdMappingProviderResourcePatch.resourceMappings.single { it.type == "id" && it.name == "autonav_preview_stub" }
|
||||
|
||||
val instructions = layoutGenMethod.implementation!!.instructions
|
||||
|
||||
val autonavToggleConstIndex =
|
||||
instructions.indexOfFirst { (it as? WideLiteralInstruction)?.wideLiteral == autonavToggle.id } + 4
|
||||
val autonavPreviewStubConstIndex =
|
||||
instructions.indexOfFirst { (it as? WideLiteralInstruction)?.wideLiteral == autonavPreviewStub.id } + 4
|
||||
|
||||
injectIfBranch(layoutGenMethod, autonavToggleConstIndex)
|
||||
injectIfBranch(layoutGenMethod, autonavPreviewStubConstIndex)
|
||||
|
||||
val autonavInformerMethod = AutonavInformerFingerprint.result!!.mutableMethod
|
||||
|
||||
//force disable autoplay since it's hard to do without the button
|
||||
autonavInformerMethod.addInstructions(
|
||||
0, """
|
||||
invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonShown()Z
|
||||
move-result v0
|
||||
if-nez v0, :hidden
|
||||
const/4 v0, 0x0
|
||||
return v0
|
||||
:hidden
|
||||
nop
|
||||
"""
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private fun injectIfBranch(method: MutableMethod, index: Int) {
|
||||
val instructions = method.implementation!!.instructions
|
||||
val insn = (instructions.get(index) as? Instruction35c)!!
|
||||
val methodToCall = insn.reference.toString()
|
||||
|
||||
//remove the invoke-virtual because we want to put it in an if-statement
|
||||
method.removeInstruction(index)
|
||||
method.addInstructions(
|
||||
index, """
|
||||
invoke-static {}, Lapp/revanced/integrations/patches/HideAutoplayButtonPatch;->isButtonShown()Z
|
||||
move-result v11
|
||||
if-eqz v11, :hidebutton
|
||||
invoke-virtual {v${insn.registerC}, v${insn.registerD}, v${insn.registerE}}, $methodToCall
|
||||
:hidebutton
|
||||
nop
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -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,51 @@
|
||||
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.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.ResourcePatch
|
||||
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
|
||||
import kotlin.io.path.exists
|
||||
|
||||
@Patch
|
||||
@Dependencies([FixLocaleConfigErrorPatch::class])
|
||||
@Name("premium-heading")
|
||||
@Description("Shows premium branding on the home screen.")
|
||||
@PremiumHeadingCompatibility
|
||||
@Version("0.0.1")
|
||||
class PremiumHeadingPatch : ResourcePatch() {
|
||||
override fun execute(data: ResourceData): PatchResult {
|
||||
val resDirectory = data["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 ->
|
||||
val fromPath = headingDirectory.resolve("${original}_$mode.png").toPath()
|
||||
val toPath = headingDirectory.resolve("${replacement}_$mode.png").toPath()
|
||||
|
||||
if (!fromPath.exists())
|
||||
return PatchResultError("The file $fromPath does not exist in the resources. Therefore, this patch can not succeed.")
|
||||
Files.copy(
|
||||
fromPath,
|
||||
toPath,
|
||||
StandardCopyOption.REPLACE_EXISTING
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user