mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-08 02:13:55 +01:00
Compare commits
468 Commits
v2.140.1-d
...
v2.139.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
817a6a9f87 | ||
|
|
18b39a448e | ||
|
|
13e74c9946 | ||
|
|
d77c9fec15 | ||
|
|
27c66f7d12 | ||
|
|
ad3041635f | ||
|
|
8ff56f557c | ||
|
|
6369b24f64 | ||
|
|
f1960310b6 | ||
|
|
0aaa2a40ec | ||
|
|
9d6c99930b | ||
|
|
d50a58900c | ||
|
|
139f9a88eb | ||
|
|
f057ba8eab | ||
|
|
7bd544e171 | ||
|
|
796d4dc407 | ||
|
|
99f6363606 | ||
|
|
f63cfb52b0 | ||
|
|
583ec5d8e3 | ||
|
|
b675adef30 | ||
|
|
a08fe535b1 | ||
|
|
7e5c963e36 | ||
|
|
05ea840b8f | ||
|
|
da4b80c5dd | ||
|
|
4ca19b7fd2 | ||
|
|
260b395426 | ||
|
|
b4d8dbcc3d | ||
|
|
7180914df1 | ||
|
|
748b14d547 | ||
|
|
d9d4d1f38c | ||
|
|
0f73a9dd5e | ||
|
|
fafcd751b2 | ||
|
|
ea7b3f5529 | ||
|
|
4935c00aa5 | ||
|
|
06098713bb | ||
|
|
eb505d802a | ||
|
|
e8b7cdfa35 | ||
|
|
986951dc8a | ||
|
|
b88fda959c | ||
|
|
96c36dca74 | ||
|
|
4ce3fd4ff7 | ||
|
|
81c5c3870c | ||
|
|
30aeaf70d8 | ||
|
|
712423789e | ||
|
|
1ad2db1ca4 | ||
|
|
16b4e78d79 | ||
|
|
f57c555395 | ||
|
|
53f1f6fc96 | ||
|
|
b4b8f62c7b | ||
|
|
8b2703273a | ||
|
|
9e2a6eead1 | ||
|
|
5afd49a111 | ||
|
|
e79ad750d4 | ||
|
|
97ea238520 | ||
|
|
700ca5b543 | ||
|
|
b792be5b78 | ||
|
|
025b480175 | ||
|
|
e1b53b214f | ||
|
|
30939e5efe | ||
|
|
4d9c41488d | ||
|
|
2fffcde357 | ||
|
|
7af08e0ba7 | ||
|
|
228834fda8 | ||
|
|
7466aecc5b | ||
|
|
8ee36541b4 | ||
|
|
a4fd6603fe | ||
|
|
510cb8f590 | ||
|
|
c02ebd752c | ||
|
|
b4d7eca5fa | ||
|
|
c6125c071b | ||
|
|
478de297f9 | ||
|
|
ebc4a12cd7 | ||
|
|
b3c0291e70 | ||
|
|
c43588ee40 | ||
|
|
c74b5d4e47 | ||
|
|
91ae954210 | ||
|
|
65172cad4f | ||
|
|
c2122494bc | ||
|
|
6ed94935ca | ||
|
|
a934821fa7 | ||
|
|
f3785c4e47 | ||
|
|
67e0db5ac9 | ||
|
|
aaa820430b | ||
|
|
cf5ed1baea | ||
|
|
206341cec4 | ||
|
|
e8f4890edd | ||
|
|
9463f11dbf | ||
|
|
2b3e153b60 | ||
|
|
4b6bf69366 | ||
|
|
38e8e7898b | ||
|
|
3175e864af | ||
|
|
d320dd4e58 | ||
|
|
f5ae96defb | ||
|
|
bfe3876cea | ||
|
|
3ad2c42a53 | ||
|
|
0d22fc2d2f | ||
|
|
6e6dbd0c1a | ||
|
|
4272fade4f | ||
|
|
2095e34db8 | ||
|
|
1483a9d8bb | ||
|
|
ea113f01a3 | ||
|
|
d4658c7056 | ||
|
|
a615717580 | ||
|
|
04db353154 | ||
|
|
7cb0312a9d | ||
|
|
5357ff2e48 | ||
|
|
62083ead98 | ||
|
|
6f04169117 | ||
|
|
cc1b283cb7 | ||
|
|
4597a74e32 | ||
|
|
3734545ca6 | ||
|
|
60ef90c745 | ||
|
|
ece4ac1a9e | ||
|
|
d6e17f948d | ||
|
|
9ab3bd0313 | ||
|
|
0f10888aa3 | ||
|
|
63c0e5dc84 | ||
|
|
41bc0222b9 | ||
|
|
71e4cc964b | ||
|
|
afc9886ebd | ||
|
|
de06d96ea0 | ||
|
|
1139f77cb9 | ||
|
|
5a801b1562 | ||
|
|
7f301090b9 | ||
|
|
28a687c605 | ||
|
|
9b74a08ae1 | ||
|
|
1177c41373 | ||
|
|
be4de62c8f | ||
|
|
528156aec9 | ||
|
|
e377ecf208 | ||
|
|
fa147bd6cc | ||
|
|
88211e28ca | ||
|
|
a4e3a97937 | ||
|
|
02bd807a27 | ||
|
|
a06e81ae39 | ||
|
|
a87d0bc440 | ||
|
|
a2b64f63e0 | ||
|
|
80ab1592c3 | ||
|
|
e17f476c46 | ||
|
|
bfa9abe4cf | ||
|
|
0e0118eaa6 | ||
|
|
7b6439b200 | ||
|
|
65e3b21d64 | ||
|
|
d90bcc3135 | ||
|
|
eee47ee37c | ||
|
|
d340dd0e0d | ||
|
|
2193a0307e | ||
|
|
58dcd172f9 | ||
|
|
f818396243 | ||
|
|
3d124af58c | ||
|
|
df18d4a15a | ||
|
|
f08a2b6a90 | ||
|
|
fce8df8284 | ||
|
|
6ec99045d7 | ||
|
|
757784b038 | ||
|
|
7e06f23e29 | ||
|
|
26a43b1753 | ||
|
|
c8023f0b66 | ||
|
|
25f65c7c02 | ||
|
|
07d39f2b81 | ||
|
|
01e226d0c9 | ||
|
|
c98e10adf7 | ||
|
|
858b8a6fa8 | ||
|
|
53a66f64ab | ||
|
|
e2b9baed25 | ||
|
|
6bc24755d5 | ||
|
|
e871d655d2 | ||
|
|
1fa0d5da0e | ||
|
|
461e4bef09 | ||
|
|
9b1df03087 | ||
|
|
541a1a0e0a | ||
|
|
ce2f7042da | ||
|
|
ca3438b640 | ||
|
|
5121c3d45b | ||
|
|
666b241a53 | ||
|
|
b961bdf9d3 | ||
|
|
8aa1d58b76 | ||
|
|
570723bb59 | ||
|
|
7027929e30 | ||
|
|
f11f269c2f | ||
|
|
b0cd520b1a | ||
|
|
5c0fd8a6da | ||
|
|
e34d67f01e | ||
|
|
72703d6a56 | ||
|
|
b8c473796a | ||
|
|
25e86c5545 | ||
|
|
f1bf2c589b | ||
|
|
8b54559953 | ||
|
|
3761dbd7b2 | ||
|
|
8cf0343f29 | ||
|
|
f3753a22da | ||
|
|
c90312a925 | ||
|
|
c1d6aa3e49 | ||
|
|
c097370960 | ||
|
|
8ffa3b4746 | ||
|
|
1e6d0f7f62 | ||
|
|
e73c5dfebd | ||
|
|
32309ac007 | ||
|
|
079800aa1a | ||
|
|
06f0d05d19 | ||
|
|
c618a18851 | ||
|
|
1aac521af3 | ||
|
|
68fe1cc792 | ||
|
|
ba519d4b10 | ||
|
|
0351c8a50d | ||
|
|
d0c4ac5d8a | ||
|
|
daa55c59e2 | ||
|
|
4ad057b748 | ||
|
|
3eaefc7979 | ||
|
|
d81ce614a8 | ||
|
|
dcd711b341 | ||
|
|
96d500bc70 | ||
|
|
031b517245 | ||
|
|
79a0ea78cf | ||
|
|
2a54e624a0 | ||
|
|
e8cc0de11c | ||
|
|
d2209569e0 | ||
|
|
492cce9452 | ||
|
|
a17232da24 | ||
|
|
3ae7858adf | ||
|
|
1a6bb30789 | ||
|
|
2b10b834c7 | ||
|
|
35c86c6ff5 | ||
|
|
f4897e41a9 | ||
|
|
1eadafb098 | ||
|
|
7eb2a0b1bc | ||
|
|
a13e294978 | ||
|
|
a3548ed524 | ||
|
|
37cbbccec5 | ||
|
|
4e83400de4 | ||
|
|
e9e5f7b018 | ||
|
|
01be9fd79e | ||
|
|
e8faa5d944 | ||
|
|
9ac84ae720 | ||
|
|
52424bd6ab | ||
|
|
4c2d6466cc | ||
|
|
6bcae6ddeb | ||
|
|
65cee57493 | ||
|
|
5058fd3c43 | ||
|
|
b2affc5493 | ||
|
|
01a4349a3f | ||
|
|
3a25dc4fa2 | ||
|
|
7f1a918649 | ||
|
|
c26de68a27 | ||
|
|
9381508678 | ||
|
|
6d9c743618 | ||
|
|
6c9986290b | ||
|
|
adc7f670d1 | ||
|
|
fdc34023fc | ||
|
|
1e54bc457f | ||
|
|
9552100878 | ||
|
|
9166024b01 | ||
|
|
acc0f5018c | ||
|
|
05c043ada3 | ||
|
|
e30967bedd | ||
|
|
40d56f6e59 | ||
|
|
8bdfe8b74f | ||
|
|
c7c9440a60 | ||
|
|
4dcd487275 | ||
|
|
68eff6fd76 | ||
|
|
9b58c642f3 | ||
|
|
f9c16396d6 | ||
|
|
7c528856e1 | ||
|
|
29c18ad537 | ||
|
|
1654d4121b | ||
|
|
05c6c9e683 | ||
|
|
facb808e37 | ||
|
|
fe1427b88a | ||
|
|
634c6c3344 | ||
|
|
d438d9b866 | ||
|
|
e4139a112e | ||
|
|
559d7ad50c | ||
|
|
e1bbe59b40 | ||
|
|
2f932d697b | ||
|
|
237129d327 | ||
|
|
e4d7dc0aa9 | ||
|
|
fed9e4aafa | ||
|
|
85aa45d3f2 | ||
|
|
16df8d5ebc | ||
|
|
e89c3dad39 | ||
|
|
0f78f621c7 | ||
|
|
fe30cea22d | ||
|
|
5a30d8564c | ||
|
|
34222d9f2c | ||
|
|
f765af0929 | ||
|
|
298c33deb6 | ||
|
|
111db2a499 | ||
|
|
fa536957cc | ||
|
|
980deec6af | ||
|
|
658638bfad | ||
|
|
d5ee3b006d | ||
|
|
36ab007924 | ||
|
|
c46705f21a | ||
|
|
31ae362d18 | ||
|
|
b64f7bb400 | ||
|
|
64244ec476 | ||
|
|
f005314358 | ||
|
|
ae1aeffc62 | ||
|
|
56768caa4c | ||
|
|
19484ca2bc | ||
|
|
a8a98646e7 | ||
|
|
4927bc7451 | ||
|
|
66a5ca3fa8 | ||
|
|
6c0b9213fe | ||
|
|
70e21500cc | ||
|
|
784e97591a | ||
|
|
26ff3b338e | ||
|
|
28c864ae95 | ||
|
|
deb829c791 | ||
|
|
3c0f3ac968 | ||
|
|
2f6da4ed27 | ||
|
|
1b653c77c4 | ||
|
|
82ea2d3498 | ||
|
|
07dee5b87a | ||
|
|
7713516ed8 | ||
|
|
22fa09dc27 | ||
|
|
24d03387de | ||
|
|
04310901b7 | ||
|
|
3011c1fa45 | ||
|
|
6b83fe572a | ||
|
|
32d303f4b7 | ||
|
|
837c381e19 | ||
|
|
09ae60bb28 | ||
|
|
f9d180aad4 | ||
|
|
c40181140d | ||
|
|
c5e190a4d5 | ||
|
|
24e3f8b24e | ||
|
|
53b0485642 | ||
|
|
b362b560b6 | ||
|
|
b285bf96bd | ||
|
|
bfb47eb1c4 | ||
|
|
4e2d30228a | ||
|
|
dce28760f5 | ||
|
|
68ec6d2258 | ||
|
|
83498fd29c | ||
|
|
1ab35a1cfa | ||
|
|
e0b45237bb | ||
|
|
161a1b0af1 | ||
|
|
7618376388 | ||
|
|
2bdb857a9f | ||
|
|
be02acecfc | ||
|
|
9e873329c6 | ||
|
|
8a2b79ec16 | ||
|
|
9842f7ca0d | ||
|
|
8a913c6a2a | ||
|
|
84676ef33d | ||
|
|
eb985942f0 | ||
|
|
886018d6fb | ||
|
|
e7a17ccbc6 | ||
|
|
c707dc8769 | ||
|
|
1bb93e3598 | ||
|
|
e8848171ac | ||
|
|
249288c8a5 | ||
|
|
1791525b54 | ||
|
|
47fbe3cb25 | ||
|
|
89235ca7fa | ||
|
|
f63abb8eb3 | ||
|
|
b701f86fa1 | ||
|
|
3117ee7ba4 | ||
|
|
b8e084b9e1 | ||
|
|
bafeff84c2 | ||
|
|
8d193786cb | ||
|
|
d78d271967 | ||
|
|
59ea2bc636 | ||
|
|
e8b550f5aa | ||
|
|
e73c0e0a00 | ||
|
|
8c132be096 | ||
|
|
cb10ea1797 | ||
|
|
6d6a0375c8 | ||
|
|
8541ee0066 | ||
|
|
f7e0b46bc7 | ||
|
|
59af825d0a | ||
|
|
04ffffbdf2 | ||
|
|
ecc131fa4f | ||
|
|
a4f1d3558e | ||
|
|
4cbd58721d | ||
|
|
7cfe43e666 | ||
|
|
c93d7bc212 | ||
|
|
c28fd5cf20 | ||
|
|
069f754d51 | ||
|
|
cba04cf5a6 | ||
|
|
5e358c7319 | ||
|
|
ce69471684 | ||
|
|
a0981dda9d | ||
|
|
6073181ee1 | ||
|
|
522587321c | ||
|
|
b16748794e | ||
|
|
01e9a396d6 | ||
|
|
86fcd4d475 | ||
|
|
8bbc744114 | ||
|
|
d7a4ad76ea | ||
|
|
7e6ee73908 | ||
|
|
87954a1aaf | ||
|
|
e5a2ed0f70 | ||
|
|
2295aaebf4 | ||
|
|
a72bf150c2 | ||
|
|
0290cd3d36 | ||
|
|
e8d61e0c0e | ||
|
|
19769d80eb | ||
|
|
12c16d4644 | ||
|
|
75f4653c16 | ||
|
|
3286d26996 | ||
|
|
edbc36e90f | ||
|
|
7ad2be7f27 | ||
|
|
1702322671 | ||
|
|
9c9bfbd593 | ||
|
|
3df662a39c | ||
|
|
572c110a6e | ||
|
|
0be9f00915 | ||
|
|
0b6f643ff3 | ||
|
|
1989d53938 | ||
|
|
ac1acf10e6 | ||
|
|
0ad686da21 | ||
|
|
e734b2231a | ||
|
|
efe06d1cdc | ||
|
|
a0f9013fab | ||
|
|
93dcd542d5 | ||
|
|
3bac23f577 | ||
|
|
febcf60efb | ||
|
|
0d74a2dfa6 | ||
|
|
5b04fbb748 | ||
|
|
fbfa0ea3be | ||
|
|
4a30afe1e2 | ||
|
|
dd1df32036 | ||
|
|
a52d674cde | ||
|
|
67f6041bab | ||
|
|
6b3f8e46fd | ||
|
|
b95058f20a | ||
|
|
5b80ac1216 | ||
|
|
6fe1bfb856 | ||
|
|
589a7c01d1 | ||
|
|
4cd6d4459a | ||
|
|
89a92b2057 | ||
|
|
9f265a46cf | ||
|
|
a740690a08 | ||
|
|
d722a64d3c | ||
|
|
abe2674290 | ||
|
|
e5ec40f6fa | ||
|
|
96c43fc6f5 | ||
|
|
4e36d72c5c | ||
|
|
6197246e8e | ||
|
|
15a044cae1 | ||
|
|
ede60b994c | ||
|
|
c15cc431d6 | ||
|
|
fb006f87ab | ||
|
|
28206fd804 | ||
|
|
e425e75152 | ||
|
|
69d6c55942 | ||
|
|
f2b29351b4 | ||
|
|
db0b468e71 | ||
|
|
b75e759348 | ||
|
|
83b41322c4 | ||
|
|
8d8878aa08 | ||
|
|
d628674cdd | ||
|
|
23b182ccbb | ||
|
|
4a784ecd6e | ||
|
|
0165b53c6d | ||
|
|
17a0e16087 | ||
|
|
8cf91f39a5 | ||
|
|
9ef93f6618 | ||
|
|
8c3866f5e3 | ||
|
|
d115d649f4 | ||
|
|
ddc789395e | ||
|
|
e1200d4e3f | ||
|
|
8276340d2b | ||
|
|
8f32af4de1 | ||
|
|
a2bc9f0722 | ||
|
|
f94bb06996 |
12
.github/ISSUE_TEMPLATE/bug-issue.yml
vendored
12
.github/ISSUE_TEMPLATE/bug-issue.yml
vendored
@@ -59,3 +59,15 @@ body:
|
|||||||
description: Add additional context here.
|
description: Add additional context here.
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
|
- type: checkboxes
|
||||||
|
id: acknowledgements
|
||||||
|
attributes:
|
||||||
|
label: Acknowledgements
|
||||||
|
description: Your issue will be closed if you haven't done these steps.
|
||||||
|
options:
|
||||||
|
- label: I have searched the existing issues and this is a new and no duplicate or related to another open issue.
|
||||||
|
required: true
|
||||||
|
- label: I have written a short but informative title.
|
||||||
|
required: true
|
||||||
|
- label: I filled out all of the requested information in this issue properly.
|
||||||
|
required: true
|
||||||
46
.github/ISSUE_TEMPLATE/feature-issue.yml
vendored
46
.github/ISSUE_TEMPLATE/feature-issue.yml
vendored
@@ -1,46 +0,0 @@
|
|||||||
name: ⭐ Feature request
|
|
||||||
description: Create a detailed feature request.
|
|
||||||
title: 'feat: <title>'
|
|
||||||
labels: [feature-request]
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
# ReVanced feature request
|
|
||||||
|
|
||||||
Do not submit requests for patches here. Please submit them [here](https://github.com/orgs/revanced/discussions/categories/patches) instead.
|
|
||||||
Important to note that your feature request may have already been made before. Please check for existing feature requests [here](https://github.com/revanced/revanced-patches/labels/feature-request).
|
|
||||||
|
|
||||||
- type: dropdown
|
|
||||||
attributes:
|
|
||||||
label: Type
|
|
||||||
options:
|
|
||||||
- Functionality
|
|
||||||
- Cosmetic
|
|
||||||
- Other
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Issue
|
|
||||||
description: What is the current problem. Why does it require a feature request?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Feature
|
|
||||||
description: Describe your feature in detail. How does it solve the issue?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Motivation
|
|
||||||
description: Why should your feature should be considered?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Additional context
|
|
||||||
description: Add additional context here.
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
41
.github/ISSUE_TEMPLATE/patch-request.yml
vendored
Normal file
41
.github/ISSUE_TEMPLATE/patch-request.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
name: ⭐ Patch Request
|
||||||
|
description: Create a detailed patch request.
|
||||||
|
title: 'feat(patch): '
|
||||||
|
labels: [patch-request]
|
||||||
|
body:
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Application
|
||||||
|
description: Which application is this patch for?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Issue
|
||||||
|
description: What is the issue this patch should solve?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Patch
|
||||||
|
description: "Describe the patch you'd like to see in detail."
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Motivation
|
||||||
|
description: Why should your patch request should be considered? What makes it valuable to the community?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
id: acknowledgements
|
||||||
|
attributes:
|
||||||
|
label: Acknowledgements
|
||||||
|
description: Your issue will be closed if you haven't done these steps.
|
||||||
|
options:
|
||||||
|
- label: I have searched the existing issues and this is a new and no duplicate or related to another open issue.
|
||||||
|
required: true
|
||||||
|
- label: I have written a short but informative title.
|
||||||
|
required: true
|
||||||
|
- label: I filled out all of the requested information in this issue properly.
|
||||||
|
required: true
|
||||||
12
.github/workflows/release.yml
vendored
12
.github/workflows/release.yml
vendored
@@ -15,25 +15,21 @@ jobs:
|
|||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup JDK
|
- name: Setup JDK
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
distribution: 'adopt'
|
distribution: 'temurin'
|
||||||
cache: gradle
|
cache: gradle
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: "lts/*"
|
|
||||||
- name: Setup Android SDK
|
- name: Setup Android SDK
|
||||||
uses: android-actions/setup-android@v2
|
uses: android-actions/setup-android@v2
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: ./gradlew build clean generateReadme
|
run: ./gradlew build clean generateMeta
|
||||||
- name: Install Android build-tools
|
- name: Install Android build-tools
|
||||||
run: sdkmanager "build-tools;32.0.0"
|
run: sdkmanager "build-tools;32.0.0"
|
||||||
- name: Setup semantic-release
|
- name: Setup semantic-release
|
||||||
|
|||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -114,4 +114,7 @@ gradle-app.setting
|
|||||||
# gradle/wrapper/gradle-wrapper.properties
|
# gradle/wrapper/gradle-wrapper.properties
|
||||||
|
|
||||||
# Potentially copyrighted test APK
|
# Potentially copyrighted test APK
|
||||||
*.apk
|
*.apk
|
||||||
|
|
||||||
|
# Ignore vscode config
|
||||||
|
.vscode/
|
||||||
|
|||||||
1
.idea/.gitignore
generated
vendored
1
.idea/.gitignore
generated
vendored
@@ -6,3 +6,4 @@
|
|||||||
/dataSources.local.xml
|
/dataSources.local.xml
|
||||||
# Editor-based HTTP Client requests
|
# Editor-based HTTP Client requests
|
||||||
/httpRequests/
|
/httpRequests/
|
||||||
|
/kotlinc.xml
|
||||||
|
|||||||
@@ -21,7 +21,8 @@
|
|||||||
"assets": [
|
"assets": [
|
||||||
"README.md",
|
"README.md",
|
||||||
"CHANGELOG.md",
|
"CHANGELOG.md",
|
||||||
"gradle.properties"
|
"gradle.properties",
|
||||||
|
"patches.json"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -33,7 +34,7 @@
|
|||||||
"path": "build/libs/*.jar"
|
"path": "build/libs/*.jar"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "build/libs/*.dex"
|
"path": "patches.json"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
1370
CHANGELOG.md
1370
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,122 @@
|
|||||||
# 🧩 ReVanced Patches
|
## 🧩 Patches
|
||||||
|
|
||||||
Official patches by ReVanced
|
The official Patch bundle provided by ReVanced and the community.
|
||||||
|
|
||||||
## 📜 List of available patches
|
> Looking for the JSON variant of this? [Click here](patches.json).
|
||||||
|
|
||||||
{{ table }}
|
{{ table }}
|
||||||
|
|
||||||
|
## 📝 JSON Format
|
||||||
|
|
||||||
|
This section explains the JSON format for the [patches.json](patches.json) file.
|
||||||
|
|
||||||
|
The file contains an array of objects, each object representing a patch. The object contains the following properties:
|
||||||
|
|
||||||
|
| key | description |
|
||||||
|
|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `name` | The name of the patch. |
|
||||||
|
| `description` | The description of the patch. |
|
||||||
|
| `version` | The version of the patch. |
|
||||||
|
| `excluded` | Whether the patch is excluded by default. If `true`, the patch must never be included by default. |
|
||||||
|
| `options` | An array of options for this patch. |
|
||||||
|
| `options.key` | The key of the option. |
|
||||||
|
| `options.title` | The title of the option. |
|
||||||
|
| `options.description` | The description of the option. |
|
||||||
|
| `options.required` | Whether the option is required. |
|
||||||
|
| `options.choices?` | An array of choices of the option. This may be `null` if this option has no choices. The element type of this array may be any type. It can be a `String`, `Int` or something else. |
|
||||||
|
| `dependencies` | An array of dependencies, which are patch names. |
|
||||||
|
| `compatiblePackages` | An array of packages compatible with this patch. |
|
||||||
|
| `compatiblePackages.name` | The name of the package. |
|
||||||
|
| `compatiblePackages.versions` | An array of versions of the package compatible with this patch. If empty, all versions are seemingly compatible. |
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "remember-video-quality",
|
||||||
|
"description": "Adds the ability to remember the video quality you chose in the video quality flyout.",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"excluded": false,
|
||||||
|
"options": [],
|
||||||
|
"dependencies": [
|
||||||
|
"integrations",
|
||||||
|
"video-id-hook"
|
||||||
|
],
|
||||||
|
"compatiblePackages": [
|
||||||
|
{
|
||||||
|
"name": "com.google.android.youtube",
|
||||||
|
"versions": [
|
||||||
|
"17.22.36",
|
||||||
|
"17.24.35",
|
||||||
|
"17.26.35",
|
||||||
|
"17.27.39",
|
||||||
|
"17.28.34",
|
||||||
|
"17.29.34",
|
||||||
|
"17.32.35",
|
||||||
|
"17.33.42"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "theme",
|
||||||
|
"description": "Enables a custom theme.",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"excluded": false,
|
||||||
|
"deprecated": false,
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"key": "theme",
|
||||||
|
"title": "Theme",
|
||||||
|
"description": "Select a theme.",
|
||||||
|
"required": true,
|
||||||
|
"choices": [
|
||||||
|
"Amoled"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": [
|
||||||
|
"locale-config-fix"
|
||||||
|
],
|
||||||
|
"compatiblePackages": [
|
||||||
|
{
|
||||||
|
"name": "com.google.android.youtube",
|
||||||
|
"versions": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "custom-branding",
|
||||||
|
"description": "Changes the YouTube launcher icon and name to your choice (defaults to ReVanced).",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"excluded": false,
|
||||||
|
"deprecated": false,
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"key": "appName",
|
||||||
|
"title": "Application Name",
|
||||||
|
"description": "The name of the application it will show on your home screen.",
|
||||||
|
"required": true,
|
||||||
|
"choices": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "appIconPath",
|
||||||
|
"title": "Application Icon Path",
|
||||||
|
"description": "A path to the icon of the application.",
|
||||||
|
"required": false,
|
||||||
|
"choices": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": [
|
||||||
|
"locale-config-fix"
|
||||||
|
],
|
||||||
|
"compatiblePackages": [
|
||||||
|
{
|
||||||
|
"name": "com.google.android.youtube",
|
||||||
|
"versions": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
385
README.md
385
README.md
@@ -1,14 +1,141 @@
|
|||||||
# 🧩 ReVanced Patches
|
## 🧩 Patches
|
||||||
|
|
||||||
Official patches by ReVanced
|
The official Patch bundle provided by ReVanced and the community.
|
||||||
|
|
||||||
## 📜 List of available patches
|
> Looking for the JSON variant of this? [Click here](patches.json).
|
||||||
|
|
||||||
|
### 📦 `com.google.android.youtube`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `always-autorepeat` | Always repeats the playing video again. | 17.45.36 |
|
||||||
|
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
|
||||||
|
| `comments` | Hides components related to comments. | 17.45.36 |
|
||||||
|
| `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all |
|
||||||
|
| `custom-video-buffer` | Lets you change the buffers of videos. | 17.45.36 |
|
||||||
|
| `custom-video-speed` | Adds more video speed options. | 17.45.36 |
|
||||||
|
| `debugging` | Adds debugging options. | all |
|
||||||
|
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 17.45.36 |
|
||||||
|
| `disable-auto-player-popup-panels` | Disable automatic popup panels (playlist or live chat) on video player. | 17.45.36 |
|
||||||
|
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 17.45.36 |
|
||||||
|
| `disable-startup-shorts-player` | Disables playing YouTube Shorts when launching YouTube. | 17.45.36 |
|
||||||
|
| `disable-zoom-haptics` | Disables haptics when zooming. | all |
|
||||||
|
| `downloads` | Enables downloading music and videos from YouTube. | 17.45.36 |
|
||||||
|
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.45.36 |
|
||||||
|
| `general-ads` | Removes general ads. | 17.45.36 |
|
||||||
|
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 17.45.36 |
|
||||||
|
| `hide-album-cards` | Hides the album cards below the artist description. | 17.45.36 |
|
||||||
|
| `hide-artist-card` | Hides the artist card below the searchbar. | 17.45.36 |
|
||||||
|
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.45.36 |
|
||||||
|
| `hide-captions-button` | Hides the captions button on video player. | 17.45.36 |
|
||||||
|
| `hide-cast-button` | Hides the cast button in the video player. | all |
|
||||||
|
| `hide-create-button` | Hides the create button in the navigation bar. | 17.45.36 |
|
||||||
|
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 17.45.36 |
|
||||||
|
| `hide-email-address` | Hides the email address in the account switcher. | 17.45.36 |
|
||||||
|
| `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 17.45.36 |
|
||||||
|
| `hide-info-cards` | Hides info-cards in videos. | 17.45.36 |
|
||||||
|
| `hide-my-mix` | Hides mix playlists. | 17.45.36 |
|
||||||
|
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.45.36 |
|
||||||
|
| `hide-time-and-seekbar` | Hides progress bar and time counter on videos. | 17.45.36 |
|
||||||
|
| `hide-video-buttons` | Adds options to hide action buttons under a video. | 17.45.36 |
|
||||||
|
| `hide-watch-in-vr` | Hides the Watch in VR option from the player settings flyout panel. | 17.45.36 |
|
||||||
|
| `hide-watermark` | Hides creator's watermarks on videos. | 17.45.36 |
|
||||||
|
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 17.45.36 |
|
||||||
|
| `minimized-playback` | Enables minimized and background playback. | 17.45.36 |
|
||||||
|
| `old-quality-layout` | Enables the original quality flyout menu. | 17.45.36 |
|
||||||
|
| `open-links-directly` | Bypasses redirect links and allows opening links directly. | 17.45.36 |
|
||||||
|
| `premium-heading` | Shows premium branding on the home screen. | all |
|
||||||
|
| `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 17.45.36 |
|
||||||
|
| `remove-player-button-background` | Removes the background from the video player buttons. | 17.45.36 |
|
||||||
|
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 17.45.36 |
|
||||||
|
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 17.45.36 |
|
||||||
|
| `settings` | Adds settings for ReVanced to YouTube. | all |
|
||||||
|
| `sponsorblock` | Integrate SponsorBlock. | 17.45.36 |
|
||||||
|
| `swipe-controls` | Adds volume and brightness swipe controls. | 17.45.36 |
|
||||||
|
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.45.36 |
|
||||||
|
| `theme` | Applies a custom theme. | all |
|
||||||
|
| `video-ads` | Removes ads in the video player. | 17.45.36 |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 📦 `com.google.android.apps.youtube.music`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `background-play` | Enables playing music in the background. | 5.31.50 |
|
||||||
|
| `codecs-unlock` | Adds more audio codec options. The new audio codecs usually result in better audio quality. | 5.31.50 |
|
||||||
|
| `compact-header` | Hides the music category bar at the top of the homepage. | 5.31.50 |
|
||||||
|
| `exclusive-audio-playback` | Enables the option to play music without video. | 5.31.50 |
|
||||||
|
| `hide-get-premium` | Removes all "Get Premium" evidences from the avatar menu. | 5.31.50 |
|
||||||
|
| `minimized-playback-music` | Enables minimized playback on Kids music. | 5.31.50 |
|
||||||
|
| `music-microg-support` | Allows YouTube Music ReVanced to run without root and under a different package name. | 5.31.50 |
|
||||||
|
| `music-video-ads` | Removes ads in the music player. | 5.31.50 |
|
||||||
|
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the home screen. | 5.31.50 |
|
||||||
|
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar. | 5.31.50 |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 📦 `com.ss.android.ugc.trill`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `disable-login-requirement` | Do not force login. | all |
|
||||||
|
| `downloads` | Removes download restrictions and changes the default path to download to. | all |
|
||||||
|
| `feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | all |
|
||||||
|
| `fix-google-login` | Allows logging in with a Google account. | all |
|
||||||
|
| `hide-ads` | Removes ads from TikTok. | all |
|
||||||
|
| `playback-speed` | Enables the playback speed option for all videos. | all |
|
||||||
|
| `settings` | Adds settings for ReVanced to TikTok. | all |
|
||||||
|
| `show-seekbar` | Shows progress bar for all video. | all |
|
||||||
|
| `sim-spoof` | Spoofs the information which is retrieved from the sim-card. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 📦 `com.zhiliaoapp.musically`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `disable-login-requirement` | Do not force login. | all |
|
||||||
|
| `downloads` | Removes download restrictions and changes the default path to download to. | all |
|
||||||
|
| `feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | all |
|
||||||
|
| `fix-google-login` | Allows logging in with a Google account. | all |
|
||||||
|
| `hide-ads` | Removes ads from TikTok. | all |
|
||||||
|
| `playback-speed` | Enables the playback speed option for all videos. | all |
|
||||||
|
| `settings` | Adds settings for ReVanced to TikTok. | all |
|
||||||
|
| `show-seekbar` | Shows progress bar for all video. | all |
|
||||||
|
| `sim-spoof` | Spoofs the information which is retrieved from the sim-card. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 📦 `tv.twitch.android.app`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `block-audio-ads` | Blocks audio ads in streams and VODs. | all |
|
||||||
|
| `block-video-ads` | Blocks video ads in streams and VODs. | all |
|
||||||
|
| `debug-mode` | Enables Twitch's internal debugging mode. | all |
|
||||||
|
| `settings` | Adds settings menu to Twitch. | all |
|
||||||
|
| `show-deleted-messages` | Shows deleted chat messages behind a clickable spoiler. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 📦 `com.spotify.music`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `disable-capture-restriction` | Allows capturing Spotify's audio output while screen sharing or screen recording. | all |
|
||||||
|
| `hide-premium-navbar` | Removes the premium tab from the navbar. | all |
|
||||||
|
| `spotify-theme` | Applies a custom theme. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
### 📦 `com.twitter.android`
|
### 📦 `com.twitter.android`
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `dynamic-color` | Replaces the default Twitter Blue with the users Material You palette. | all |
|
||||||
|
| `monochrome-icon` | Adds a monochrome icon. | all |
|
||||||
| `timeline-ads` | Removes ads from the Twitter timeline. | all |
|
| `timeline-ads` | Removes ads from the Twitter timeline. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@@ -18,23 +145,55 @@ Official patches by ReVanced
|
|||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|:--------:|:--------------:|:-----------------:|
|
||||||
| `general-reddit-ads` | Removes general ads from the Reddit frontpage and subreddits. | all |
|
| `general-reddit-ads` | Removes general ads from the Reddit frontpage and subreddits. | all |
|
||||||
|
| `premium-icon-reddit` | Unlocks premium Reddit app icons. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 📦 `com.google.android.apps.youtube.music`
|
### 📦 `com.vanced.android.youtube`
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|:--------:|:--------------:|:-----------------:|
|
||||||
| `minimized-playback-music` | Enables minimized playback on Kids music. | 5.17.51 |
|
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
|
||||||
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the home screen. | 5.16.51 |
|
</details>
|
||||||
| `hide-get-premium` | Removes all "Get Premium" evidences from the avatar menu. | 5.17.51 |
|
|
||||||
| `compact-header` | Hides the music category bar at the top of the homepage. | 5.16.51 |
|
### 📦 `com.myprog.hexedit`
|
||||||
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar. | 5.17.51 |
|
<details>
|
||||||
| `background-play` | Enables playing music in the background. | 5.17.51 |
|
|
||||||
| `music-microg-support` | Allows YouTube Music ReVanced to run without root and under a different package name. | 5.17.51 |
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
| `music-video-ads` | Removes ads in the music player. | 5.17.51 |
|
|:--------:|:--------------:|:-----------------:|
|
||||||
| `codecs-unlock` | Adds more audio codec options. The new audio codecs usually result in better audio quality. | 5.17.51 |
|
| `disable-ads` | Disables ads in HexEditor. | all |
|
||||||
| `exclusive-audio-playback` | Enables the option to play music without video. | 5.17.51 |
|
</details>
|
||||||
|
|
||||||
|
### 📦 `com.crunchyroll.crunchyroid`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `enable-downloads` | Enables downloads for Crunchyroll. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 📦 `com.garzotto.pflotsh.ecmwf_a`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `pflotsh-ecmwf-subscription-unlock` | Unlocks all subscription features. | 3.5.4 |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 📦 `org.citra.citra_emu`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `premium-unlock` | Unlocks premium functions. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 📦 `com.backdrops.wallpapers`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `pro-unlock` | Unlocks pro-only functions. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 📦 `de.dwd.warnapp`
|
### 📦 `de.dwd.warnapp`
|
||||||
@@ -45,47 +204,183 @@ Official patches by ReVanced
|
|||||||
| `promo-code-unlock` | Disables the validation of promo code. Any code will work to unlock all features. | all |
|
| `promo-code-unlock` | Disables the validation of promo code. Any code will work to unlock all features. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 📦 `com.ss.android.ugc.trill`
|
### 📦 `com.urbandroid.sleep`
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|:--------:|:--------------:|:-----------------:|
|
||||||
| `tiktok-ads` | Removes ads from TikTok. | all |
|
| `unlock-premium` | Unlocks all premium features. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 📦 `com.google.android.youtube`
|
### 📦 `com.shervinkoushan.anyTracker`
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|:--------:|:--------------:|:-----------------:|
|
||||||
| `swipe-controls` | Adds volume and brightness swipe controls. | 17.29.34 |
|
| `unlock-premium` | Unlocks all premium features. | all |
|
||||||
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 17.29.34 |
|
</details>
|
||||||
| `minimized-playback` | Enables minimized and background playback. | 17.29.34 |
|
|
||||||
| `amoled` | Enables pure black theme. | 17.29.34 |
|
### 📦 `ginlemon.iconpackstudio`
|
||||||
| `disable-create-button` | Hides the create button in the navigation bar. | 17.29.34 |
|
<details>
|
||||||
| `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 |
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.29.34 |
|
|:--------:|:--------------:|:-----------------:|
|
||||||
| `premium-heading` | Shows premium branding on the home screen. | all |
|
| `unlock-pro` | Unlocks all pro features. | all |
|
||||||
| `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all |
|
</details>
|
||||||
| `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 |
|
### 📦 `com.ithebk.expensemanager`
|
||||||
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.29.34 |
|
<details>
|
||||||
| `hide-watermark` | Hides creator's watermarks on videos. | 17.29.34 |
|
|
||||||
| `sponsorblock` | Integrate SponsorBlock. | 17.29.34 |
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.29.34 |
|
|:--------:|:--------------:|:-----------------:|
|
||||||
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.29.34 |
|
| `unlock-pro` | Unlocks pro features. | all |
|
||||||
| `custom-video-buffer` | Lets you change the buffers of videos. | 17.29.34 |
|
</details>
|
||||||
| `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 |
|
### 📦 `org.totschnig.myexpenses`
|
||||||
| `settings` | Adds settings for ReVanced to YouTube. | all |
|
<details>
|
||||||
| `enable-debugging` | Enables app debugging by patching the manifest file. | all |
|
|
||||||
| `custom-playback-speed` | Adds more video playback speed options. | 17.29.34 |
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 17.29.34 |
|
|:--------:|:--------------:|:-----------------:|
|
||||||
| `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 17.29.34 |
|
| `unlock-pro` | Unlocks all professional features. | all |
|
||||||
| `video-ads` | Removes ads in the video player. | 17.29.34 |
|
</details>
|
||||||
| `general-ads` | Removes general ads. | 17.29.34 |
|
|
||||||
| `hide-infocard-suggestions` | Hides infocards in videos. | 17.29.34 |
|
### 📦 `co.windyapp.android`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `unlock-pro` | Unlocks all pro features. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 📦 `com.awedea.nyx`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `unlock-pro` | Unlocks all pro features. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### 📦 `com.ticktick.task`
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `unlock-themes` | Unlocks all themes. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 📝 JSON Format
|
||||||
|
|
||||||
|
This section explains the JSON format for the [patches.json](patches.json) file.
|
||||||
|
|
||||||
|
The file contains an array of objects, each object representing a patch. The object contains the following properties:
|
||||||
|
|
||||||
|
| key | description |
|
||||||
|
|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `name` | The name of the patch. |
|
||||||
|
| `description` | The description of the patch. |
|
||||||
|
| `version` | The version of the patch. |
|
||||||
|
| `excluded` | Whether the patch is excluded by default. If `true`, the patch must never be included by default. |
|
||||||
|
| `options` | An array of options for this patch. |
|
||||||
|
| `options.key` | The key of the option. |
|
||||||
|
| `options.title` | The title of the option. |
|
||||||
|
| `options.description` | The description of the option. |
|
||||||
|
| `options.required` | Whether the option is required. |
|
||||||
|
| `options.choices?` | An array of choices of the option. This may be `null` if this option has no choices. The element type of this array may be any type. It can be a `String`, `Int` or something else. |
|
||||||
|
| `dependencies` | An array of dependencies, which are patch names. |
|
||||||
|
| `compatiblePackages` | An array of packages compatible with this patch. |
|
||||||
|
| `compatiblePackages.name` | The name of the package. |
|
||||||
|
| `compatiblePackages.versions` | An array of versions of the package compatible with this patch. If empty, all versions are seemingly compatible. |
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "remember-video-quality",
|
||||||
|
"description": "Adds the ability to remember the video quality you chose in the video quality flyout.",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"excluded": false,
|
||||||
|
"options": [],
|
||||||
|
"dependencies": [
|
||||||
|
"integrations",
|
||||||
|
"video-id-hook"
|
||||||
|
],
|
||||||
|
"compatiblePackages": [
|
||||||
|
{
|
||||||
|
"name": "com.google.android.youtube",
|
||||||
|
"versions": [
|
||||||
|
"17.22.36",
|
||||||
|
"17.24.35",
|
||||||
|
"17.26.35",
|
||||||
|
"17.27.39",
|
||||||
|
"17.28.34",
|
||||||
|
"17.29.34",
|
||||||
|
"17.32.35",
|
||||||
|
"17.33.42"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "theme",
|
||||||
|
"description": "Enables a custom theme.",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"excluded": false,
|
||||||
|
"deprecated": false,
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"key": "theme",
|
||||||
|
"title": "Theme",
|
||||||
|
"description": "Select a theme.",
|
||||||
|
"required": true,
|
||||||
|
"choices": [
|
||||||
|
"Amoled"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": [
|
||||||
|
"locale-config-fix"
|
||||||
|
],
|
||||||
|
"compatiblePackages": [
|
||||||
|
{
|
||||||
|
"name": "com.google.android.youtube",
|
||||||
|
"versions": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "custom-branding",
|
||||||
|
"description": "Changes the YouTube launcher icon and name to your choice (defaults to ReVanced).",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"excluded": false,
|
||||||
|
"deprecated": false,
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"key": "appName",
|
||||||
|
"title": "Application Name",
|
||||||
|
"description": "The name of the application it will show on your home screen.",
|
||||||
|
"required": true,
|
||||||
|
"choices": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "appIconPath",
|
||||||
|
"title": "Application Icon Path",
|
||||||
|
"description": "A path to the icon of the application.",
|
||||||
|
"required": false,
|
||||||
|
"choices": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": [
|
||||||
|
"locale-config-fix"
|
||||||
|
],
|
||||||
|
"compatiblePackages": [
|
||||||
|
{
|
||||||
|
"name": "com.google.android.youtube",
|
||||||
|
"versions": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
@@ -20,22 +20,21 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib"))
|
implementation("app.revanced:revanced-patcher:6.3.0")
|
||||||
|
|
||||||
implementation("app.revanced:revanced-patcher:3.3.3")
|
|
||||||
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
||||||
|
// Required for meta
|
||||||
|
implementation("com.google.code.gson:gson:2.10")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
register<DefaultTask>("generateDex") {
|
register<DefaultTask>("generateBundle") {
|
||||||
description = "Generate dex files from build"
|
description = "Generate dex files from build and bundle them in the jar file"
|
||||||
dependsOn(build)
|
dependsOn(build)
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
val androidHome = System.getenv("ANDROID_HOME") ?: throw GradleException("ANDROID_HOME not found")
|
val androidHome = System.getenv("ANDROID_HOME") ?: throw GradleException("ANDROID_HOME not found")
|
||||||
val d8 = "${androidHome}/build-tools/32.0.0/d8"
|
val d8 = "${androidHome}/build-tools/32.0.0/d8"
|
||||||
val input = configurations.archives.get().allArtifacts.files.files.first().absolutePath
|
val input = configurations.archives.get().allArtifacts.files.files.first().absolutePath
|
||||||
val output = input.replace(".jar", ".dex")
|
|
||||||
val work = File("${buildDir}/libs")
|
val work = File("${buildDir}/libs")
|
||||||
|
|
||||||
exec {
|
exec {
|
||||||
@@ -45,16 +44,16 @@ tasks {
|
|||||||
|
|
||||||
exec {
|
exec {
|
||||||
workingDir = work
|
workingDir = work
|
||||||
commandLine = listOf("mv", "classes.dex", output)
|
commandLine = listOf("zip", "-u", input, "classes.dex")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
register<JavaExec>("generateReadme") {
|
register<JavaExec>("generateMeta") {
|
||||||
description = "Generate README.md"
|
description = "Generate metadata for this bundle"
|
||||||
dependsOn(build)
|
dependsOn(build)
|
||||||
|
|
||||||
classpath = sourceSets["main"].runtimeClasspath
|
classpath = sourceSets["main"].runtimeClasspath
|
||||||
mainClass.set("app.revanced.meta.readme.Generator")
|
mainClass.set("app.revanced.meta.Meta")
|
||||||
}
|
}
|
||||||
// Dummy task to fix the Gradle semantic-release plugin.
|
// Dummy task to fix the Gradle semantic-release plugin.
|
||||||
// Remove this if you forked it to support building only.
|
// Remove this if you forked it to support building only.
|
||||||
@@ -62,6 +61,6 @@ tasks {
|
|||||||
register<DefaultTask>("publish") {
|
register<DefaultTask>("publish") {
|
||||||
group = "publish"
|
group = "publish"
|
||||||
description = "Dummy task"
|
description = "Dummy task"
|
||||||
dependsOn(named("generateDex"), named("generateReadme"))
|
dependsOn(named("generateBundle"), named("generateMeta"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.36.2
|
version = 2.139.0
|
||||||
|
|||||||
1
patches.json
Normal file
1
patches.json
Normal file
File diff suppressed because one or more lines are too long
@@ -1,32 +1,31 @@
|
|||||||
package app.revanced.extensions
|
package app.revanced.extensions
|
||||||
|
|
||||||
import app.revanced.patcher.data.impl.BytecodeData
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.data.impl.ResourceData
|
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import app.revanced.patcher.util.smali.toInstruction
|
import org.jf.dexlib2.iface.Method
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.util.MethodUtil
|
||||||
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 org.w3c.dom.Node
|
||||||
import java.nio.file.Files
|
|
||||||
|
|
||||||
// TODO: this method does not make sense here
|
// TODO: populate this to all patches
|
||||||
internal fun MutableMethodImplementation.injectHideCall(
|
/**
|
||||||
index: Int,
|
* Convert a [MethodFingerprint] to a [PatchResultError].
|
||||||
register: Int
|
*
|
||||||
) {
|
* @return A [PatchResultError] for the [MethodFingerprint].
|
||||||
this.addInstruction(
|
*/
|
||||||
index,
|
fun MethodFingerprint.toErrorResult() = PatchResultError("Failed to resolve $name")
|
||||||
"invoke-static { v$register }, Lapp/revanced/integrations/patches/HideHomeAdsPatch;->HideHomeAds(Landroid/view/View;)V".toInstruction()
|
|
||||||
)
|
/**
|
||||||
|
* Find the [MutableMethod] from a given [Method] in a [MutableClass].
|
||||||
|
*
|
||||||
|
* @param method The [Method] to find.
|
||||||
|
* @return The [MutableMethod].
|
||||||
|
*/
|
||||||
|
fun MutableClass.findMutableMethodOf(method: Method) = this.methods.first {
|
||||||
|
MethodUtil.methodSignaturesMatch(it, method)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,9 +34,9 @@ internal fun MutableMethodImplementation.injectHideCall(
|
|||||||
* @param targetClass the class to start traversing the class hierarchy from
|
* @param targetClass the class to start traversing the class hierarchy from
|
||||||
* @param callback function that is called for every class in the hierarchy
|
* @param callback function that is called for every class in the hierarchy
|
||||||
*/
|
*/
|
||||||
fun BytecodeData.traverseClassHierarchy(targetClass: MutableClass, callback: MutableClass.() -> Unit) {
|
fun BytecodeContext.traverseClassHierarchy(targetClass: MutableClass, callback: MutableClass.() -> Unit) {
|
||||||
callback(targetClass)
|
callback(targetClass)
|
||||||
this.findClass(targetClass.superclass ?: return)?.resolve()?.let {
|
this.findClass(targetClass.superclass ?: return)?.mutableClass?.let {
|
||||||
traverseClassHierarchy(it, callback)
|
traverseClassHierarchy(it, callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,160 +52,7 @@ fun MutableClass.transformMethods(transform: MutableMethod.() -> MutableMethod)
|
|||||||
methods.addAll(transformedMethods)
|
methods.addAll(transformedMethods)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 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].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) {
|
internal fun Node.doRecursively(action: (Node) -> Unit) {
|
||||||
action(this)
|
action(this)
|
||||||
for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action)
|
for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun String.startsWithAny(vararg 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
|
|
||||||
}
|
|
||||||
27
src/main/kotlin/app/revanced/meta/Meta.kt
Normal file
27
src/main/kotlin/app/revanced/meta/Meta.kt
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package app.revanced.meta
|
||||||
|
|
||||||
|
import app.revanced.meta.json.generateJson
|
||||||
|
import app.revanced.meta.readme.generateText
|
||||||
|
import app.revanced.patcher.data.Context
|
||||||
|
import app.revanced.patcher.patch.Patch
|
||||||
|
import app.revanced.patcher.util.patch.PatchBundle
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
typealias Bundle = List<Class<out Patch<Context>>>
|
||||||
|
|
||||||
|
object Meta {
|
||||||
|
@JvmStatic
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
val patches = accumulatePatches()
|
||||||
|
if (patches.isEmpty()) throw IllegalStateException("No patches found")
|
||||||
|
|
||||||
|
generateText(patches)
|
||||||
|
generateJson(patches)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun accumulatePatches() = PatchBundle.Jar(
|
||||||
|
File("build/libs/").listFiles()!!.first {
|
||||||
|
it.name.startsWith("revanced-patches-") && it.name.endsWith(".jar")
|
||||||
|
}.absolutePath
|
||||||
|
).loadPatches()
|
||||||
48
src/main/kotlin/app/revanced/meta/json/Generator.kt
Normal file
48
src/main/kotlin/app/revanced/meta/json/Generator.kt
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
package app.revanced.meta.json
|
||||||
|
|
||||||
|
import app.revanced.meta.Bundle
|
||||||
|
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
||||||
|
import app.revanced.patcher.extensions.PatchExtensions.dependencies
|
||||||
|
import app.revanced.patcher.extensions.PatchExtensions.description
|
||||||
|
import app.revanced.patcher.extensions.PatchExtensions.include
|
||||||
|
import app.revanced.patcher.extensions.PatchExtensions.options
|
||||||
|
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
||||||
|
import app.revanced.patcher.extensions.PatchExtensions.version
|
||||||
|
import app.revanced.patcher.patch.PatchOption
|
||||||
|
import com.google.gson.GsonBuilder
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
private val gson = GsonBuilder().serializeNulls().create()
|
||||||
|
|
||||||
|
fun generateJson(bundle: Bundle) {
|
||||||
|
val patches = bundle.map {
|
||||||
|
JsonPatch(
|
||||||
|
it.patchName,
|
||||||
|
it.description ?: "This patch has no description.",
|
||||||
|
it.version ?: "0.0.0",
|
||||||
|
!it.include,
|
||||||
|
it.options?.map { option ->
|
||||||
|
Option(
|
||||||
|
option.key,
|
||||||
|
option.title,
|
||||||
|
option.description,
|
||||||
|
option.required,
|
||||||
|
option.let { lo ->
|
||||||
|
if (lo is PatchOption.ListOption<*>) {
|
||||||
|
lo.options.toMutableList().toTypedArray()
|
||||||
|
} else null
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}?.toTypedArray() ?: emptyArray(),
|
||||||
|
it.dependencies?.map { dep ->
|
||||||
|
dep.java.patchName
|
||||||
|
}?.toTypedArray() ?: emptyArray(),
|
||||||
|
it.compatiblePackages?.map { pkg ->
|
||||||
|
CompatiblePackage(pkg.name, pkg.versions)
|
||||||
|
}?.toTypedArray() ?: emptyArray()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
val json = File("patches.json")
|
||||||
|
json.writeText(gson.toJson(patches))
|
||||||
|
}
|
||||||
26
src/main/kotlin/app/revanced/meta/json/JsonPatch.kt
Normal file
26
src/main/kotlin/app/revanced/meta/json/JsonPatch.kt
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
@file:Suppress("ArrayInDataClass") // We don't need it here.
|
||||||
|
|
||||||
|
package app.revanced.meta.json
|
||||||
|
|
||||||
|
data class JsonPatch(
|
||||||
|
val name: String,
|
||||||
|
val description: String,
|
||||||
|
val version: String,
|
||||||
|
val excluded: Boolean,
|
||||||
|
val options: Array<Option>,
|
||||||
|
val dependencies: Array<String>,
|
||||||
|
val compatiblePackages: Array<CompatiblePackage>,
|
||||||
|
)
|
||||||
|
|
||||||
|
data class CompatiblePackage(
|
||||||
|
val name: String,
|
||||||
|
val versions: Array<String>,
|
||||||
|
)
|
||||||
|
|
||||||
|
data class Option(
|
||||||
|
val key: String,
|
||||||
|
val title: String,
|
||||||
|
val description: String,
|
||||||
|
val required: Boolean,
|
||||||
|
val choices: Array<*>?,
|
||||||
|
)
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
package app.revanced.meta.readme
|
package app.revanced.meta.readme
|
||||||
|
|
||||||
import app.revanced.patcher.data.Data
|
import app.revanced.patcher.data.Context
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
||||||
import app.revanced.patcher.patch.Patch
|
import app.revanced.patcher.patch.Patch
|
||||||
|
|
||||||
internal fun Class<out Patch<Data>>.getLatestVersion(): SemanticVersion? =
|
internal fun Class<out Patch<Context>>.getLatestVersion() =
|
||||||
this.compatiblePackages?.first()?.versions?.map { SemanticVersion.fromString(it) }
|
this.compatiblePackages?.first()?.versions?.map {
|
||||||
?.maxWithOrNull(
|
SemanticVersion.fromString(it)
|
||||||
SemanticVersionComparator
|
}?.maxWithOrNull(SemanticVersionComparator)
|
||||||
)
|
|
||||||
|
|||||||
@@ -1,55 +1,42 @@
|
|||||||
package app.revanced.meta.readme
|
package app.revanced.meta.readme
|
||||||
|
|
||||||
import app.revanced.patcher.data.Data
|
import app.revanced.meta.Bundle
|
||||||
|
import app.revanced.patcher.data.Context
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.description
|
import app.revanced.patcher.extensions.PatchExtensions.description
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
||||||
import app.revanced.patcher.patch.Patch
|
import app.revanced.patcher.patch.Patch
|
||||||
import app.revanced.patcher.util.patch.impl.JarPatchBundle
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
object Generator {
|
private const val TABLE_HEADER =
|
||||||
private const val TABLE_HEADER =
|
"| \uD83D\uDC8A Patch | \uD83D\uDCDC Description | \uD83C\uDFF9 Target Version |\n" + "|:--------:|:--------------:|:-----------------:|"
|
||||||
"| \uD83D\uDC8A Patch | \uD83D\uDCDC Description | \uD83C\uDFF9 Target Version |\n" +
|
|
||||||
"|:--------:|:--------------:|:-----------------:|"
|
|
||||||
|
|
||||||
@JvmStatic
|
private val TABLE_REGEX = Regex("\\{\\{\\s?table\\s?}}")
|
||||||
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()
|
fun generateText(bundle: Bundle) {
|
||||||
|
val output = StringBuilder()
|
||||||
|
val packages = mutableMapOf<String, MutableList<Class<out Patch<Context>>>>()
|
||||||
|
|
||||||
val output = StringBuilder()
|
for (patch in bundle) {
|
||||||
|
patch.compatiblePackages?.forEach { pkg ->
|
||||||
val packages = mutableMapOf<String, MutableList<Class<out Patch<Data>>>>()
|
if (!packages.contains(pkg.name)) packages[pkg.name] = mutableListOf()
|
||||||
|
packages[pkg.name]!!.add(patch)
|
||||||
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())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (pkg in packages.entries.sortedByDescending { it.value.size }) {
|
||||||
|
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 readmeTemplate = Template(File("README-template.md").readText())
|
||||||
|
readmeTemplate.replaceVariable(TABLE_REGEX, output.toString())
|
||||||
|
|
||||||
|
val readme = File("README.md")
|
||||||
|
readme.writeText(readmeTemplate.toString())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ package app.revanced.meta.readme
|
|||||||
data class SemanticVersion(val major: Int, val minor: Int, val patch: Int) {
|
data class SemanticVersion(val major: Int, val minor: Int, val patch: Int) {
|
||||||
companion object {
|
companion object {
|
||||||
fun fromString(version: String): SemanticVersion {
|
fun fromString(version: String): SemanticVersion {
|
||||||
var parts = version.split(".")
|
val parts = version.split(".")
|
||||||
|
|
||||||
if (parts.count() != 3) throw IllegalArgumentException("Invalid semantic version")
|
if (parts.count() != 3) throw IllegalArgumentException("Invalid semantic version")
|
||||||
|
|
||||||
val versionNumbers = parts.map { it.toInt() }
|
val versionNumbers = parts.map { it.toInt() }
|
||||||
return SemanticVersion(versionNumbers[0], versionNumbers[1], versionNumbers[2])
|
return SemanticVersion(versionNumbers[0], versionNumbers[1], versionNumbers[2])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
package app.revanced.meta.readme
|
package app.revanced.meta.readme
|
||||||
|
|
||||||
class Template(template: String) {
|
class Template(template: String) {
|
||||||
val result: StringBuilder = StringBuilder(template)
|
val result = StringBuilder(template)
|
||||||
|
|
||||||
fun replaceVariable(name: String, value: String) {
|
fun replaceVariable(regex: Regex, value: String) {
|
||||||
val regex = Regex("\\{\\{\\s?$name\\s?}}")
|
|
||||||
val range = regex.find(result)!!.range
|
val range = regex.find(result)!!.range
|
||||||
|
|
||||||
result.replace(range.first, range.last + 1, value)
|
result.replace(range.first, range.last + 1, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package app.revanced.patches.backdrops.misc.pro.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility([Package("com.backdrops.wallpapers")])
|
||||||
|
internal annotation class ProUnlockCompatibility
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package app.revanced.patches.backdrops.misc.pro.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
object ProUnlockFingerprint : MethodFingerprint(
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.INVOKE_VIRTUAL,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.INVOKE_INTERFACE,
|
||||||
|
Opcode.MOVE_RESULT,
|
||||||
|
Opcode.IF_EQZ
|
||||||
|
),
|
||||||
|
customFingerprint = { it.definingClass == "Lcom/backdrops/wallpapers/data/local/DatabaseHandlerIAB;" && it.name == "lambda\$existPurchase\$0" }
|
||||||
|
)
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package app.revanced.patches.backdrops.misc.pro.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.extensions.instruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
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.patches.backdrops.misc.pro.annotations.ProUnlockCompatibility
|
||||||
|
import app.revanced.patches.backdrops.misc.pro.fingerprints.ProUnlockFingerprint
|
||||||
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("pro-unlock")
|
||||||
|
@Description("Unlocks pro-only functions.")
|
||||||
|
@ProUnlockCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class ProUnlockPatch : BytecodePatch(
|
||||||
|
listOf(ProUnlockFingerprint)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
val result = ProUnlockFingerprint.result ?: return PatchResultError("${ProUnlockFingerprint.name} not found")
|
||||||
|
|
||||||
|
val moveRegisterInstruction = result.mutableMethod.instruction(result.scanResult.patternScanResult!!.endIndex - 1)
|
||||||
|
val register = (moveRegisterInstruction as OneRegisterInstruction).registerA
|
||||||
|
|
||||||
|
result.mutableMethod.addInstructions(
|
||||||
|
result.scanResult.patternScanResult!!.endIndex,
|
||||||
|
"""
|
||||||
|
const/4 v$register, 0x1
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package app.revanced.patches.citra.misc.premium.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility([Package("org.citra.citra_emu")])
|
||||||
|
internal annotation class PremiumUnlockCompatbility
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package app.revanced.patches.citra.misc.premium.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object PremiumUnlockFingerprint : MethodFingerprint(
|
||||||
|
customFingerprint = { it.definingClass == "Lorg/citra/citra_emu/ui/main/MainActivity;" && it.name == "isPremiumActive" }
|
||||||
|
)
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package app.revanced.patches.citra.misc.premium.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
||||||
|
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.patches.citra.misc.premium.annotations.PremiumUnlockCompatbility
|
||||||
|
import app.revanced.patches.citra.misc.premium.fingerprints.PremiumUnlockFingerprint
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("premium-unlock")
|
||||||
|
@Description("Unlocks premium functions.")
|
||||||
|
@PremiumUnlockCompatbility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class PremiumUnlockPatch : BytecodePatch(
|
||||||
|
listOf(PremiumUnlockFingerprint)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
val result = PremiumUnlockFingerprint.result ?: return PatchResultError("${PremiumUnlockFingerprint.name} not found")
|
||||||
|
|
||||||
|
result.mutableMethod.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const v0, 0x1
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.crunchyroll.downloads.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility(
|
||||||
|
[
|
||||||
|
Package("com.crunchyroll.crunchyroid")
|
||||||
|
]
|
||||||
|
)
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class DownloadsCompatibility
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package app.revanced.patches.crunchyroll.downloads.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.patches.crunchyroll.downloads.annotations.DownloadsCompatibility
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
@Name("downloads-fingerprint")
|
||||||
|
@DownloadsCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
object DownloadsFingerprint : MethodFingerprint(
|
||||||
|
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, null,
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.CONST_STRING,
|
||||||
|
Opcode.INVOKE_VIRTUAL,
|
||||||
|
Opcode.MOVE_RESULT,
|
||||||
|
Opcode.RETURN
|
||||||
|
),
|
||||||
|
strings = listOf("offline_viewing"),
|
||||||
|
)
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package app.revanced.patches.crunchyroll.downloads.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.replaceInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.crunchyroll.downloads.annotations.DownloadsCompatibility
|
||||||
|
import app.revanced.patches.crunchyroll.downloads.fingerprints.DownloadsFingerprint
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("enable-downloads")
|
||||||
|
@Description("Enables downloads for Crunchyroll.")
|
||||||
|
@DownloadsCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class DownloadsPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
DownloadsFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
with(DownloadsFingerprint.result!!.mutableMethod) {
|
||||||
|
val index = implementation!!.instructions.lastIndex
|
||||||
|
replaceInstruction(
|
||||||
|
index - 1,
|
||||||
|
"""
|
||||||
|
const/4 v0, 0x1
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.hexeditor.ad.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility(
|
||||||
|
[
|
||||||
|
Package("com.myprog.hexedit")
|
||||||
|
]
|
||||||
|
)
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class HexEditorAdsCompatibility
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package app.revanced.patches.hexeditor.ad.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object PrimaryAdsFingerprint : MethodFingerprint(
|
||||||
|
customFingerprint = { methodDef ->
|
||||||
|
methodDef.definingClass.endsWith("PreferencesHelper;") && methodDef.name == "isAdsDisabled"
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package app.revanced.patches.hexeditor.ad.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.removeInstruction
|
||||||
|
import app.revanced.patcher.extensions.replaceInstructions
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.hexeditor.ad.annotations.HexEditorAdsCompatibility
|
||||||
|
import app.revanced.patches.hexeditor.ad.fingerprints.PrimaryAdsFingerprint
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("disable-ads")
|
||||||
|
@Description("Disables ads in HexEditor.")
|
||||||
|
@HexEditorAdsCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class HexEditorAdsPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
PrimaryAdsFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
val method = PrimaryAdsFingerprint.result!!.mutableMethod
|
||||||
|
|
||||||
|
method.replaceInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const/4 v0, 0x1
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package app.revanced.patches.iconpackstudio.misc.pro.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility([Package("ginlemon.iconpackstudio")])
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class UnlockProCompatibility
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package app.revanced.patches.iconpackstudio.misc.pro.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object CheckProFingerprint : MethodFingerprint(
|
||||||
|
"Z",
|
||||||
|
customFingerprint = { it.definingClass.endsWith("IPSPurchaseRepository;")}
|
||||||
|
)
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package app.revanced.patches.iconpackstudio.misc.pro.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.extensions.removeInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.iconpackstudio.misc.pro.annotations.UnlockProCompatibility
|
||||||
|
import app.revanced.patches.iconpackstudio.misc.pro.fingerprints.CheckProFingerprint
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("unlock-pro")
|
||||||
|
@Description("Unlocks all pro features.")
|
||||||
|
@UnlockProCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class UnlockProPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
CheckProFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
val method = CheckProFingerprint.result!!.mutableMethod
|
||||||
|
method.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const/4 v0, 0x1
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package app.revanced.patches.moneymanager.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility([Package("com.ithebk.expensemanager")])
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class UnlockProCompatibility
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package app.revanced.patches.moneymanager.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
object UnlockProFingerprint : MethodFingerprint(
|
||||||
|
"Z",
|
||||||
|
AccessFlags.STATIC or AccessFlags.SYNTHETIC,
|
||||||
|
parameters = listOf("L"),
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.IGET_BOOLEAN,
|
||||||
|
Opcode.RETURN
|
||||||
|
),
|
||||||
|
customFingerprint = { methodDef ->
|
||||||
|
methodDef.definingClass.endsWith("MainActivity;")
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package app.revanced.patches.moneymanager.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.moneymanager.annotations.UnlockProCompatibility
|
||||||
|
import app.revanced.patches.moneymanager.fingerprints.UnlockProFingerprint
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("unlock-pro")
|
||||||
|
@Description("Unlocks pro features.")
|
||||||
|
@UnlockProCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class UnlockProPatch : BytecodePatch(
|
||||||
|
listOf(UnlockProFingerprint)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
UnlockProFingerprint.result!!.mutableMethod.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const/4 v0, 0x1
|
||||||
|
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52", "5.31.50")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,23 +1,11 @@
|
|||||||
package app.revanced.patches.music.ad.video.fingerprints
|
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.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.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.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
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.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@MusicVideoAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object ShowMusicVideoAdsConstructorFingerprint : MethodFingerprint(
|
object ShowMusicVideoAdsConstructorFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L"), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L"), listOf(
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
|
|||||||
@@ -1,22 +1,10 @@
|
|||||||
package app.revanced.patches.music.ad.video.fingerprints
|
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.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.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.ad.video.annotations.MusicVideoAdsCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
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(
|
object ShowMusicVideoAdsFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"), listOf(
|
||||||
Opcode.IPUT_BOOLEAN,
|
Opcode.IPUT_BOOLEAN,
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ package app.revanced.patches.music.ad.video.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.impl.BytecodeData
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.impl.BytecodePatch
|
|
||||||
import app.revanced.patches.music.ad.video.annotations.MusicVideoAdsCompatibility
|
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.ShowMusicVideoAdsConstructorFingerprint
|
||||||
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsFingerprint
|
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsFingerprint
|
||||||
@@ -24,13 +24,13 @@ class MusicVideoAdsPatch : BytecodePatch(
|
|||||||
ShowMusicVideoAdsConstructorFingerprint
|
ShowMusicVideoAdsConstructorFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
ShowMusicVideoAdsFingerprint.resolve(data, ShowMusicVideoAdsConstructorFingerprint.result!!.classDef)
|
ShowMusicVideoAdsFingerprint.resolve(context, ShowMusicVideoAdsConstructorFingerprint.result!!.classDef)
|
||||||
|
|
||||||
val result = ShowMusicVideoAdsFingerprint.result!!
|
val result = ShowMusicVideoAdsFingerprint.result!!
|
||||||
|
|
||||||
result.mutableMethod.addInstructions(
|
result.mutableMethod.addInstructions(
|
||||||
result.patternScanResult!!.startIndex, """
|
result.scanResult.patternScanResult!!.startIndex, """
|
||||||
const/4 p1, 0x0
|
const/4 p1, 0x0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52", "5.31.50")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,23 +1,13 @@
|
|||||||
package app.revanced.patches.music.audio.codecs.fingerprints
|
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.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.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("all-codecs-reference-fingerprint")
|
|
||||||
@MatchingMethod(
|
|
||||||
"Laari;",
|
|
||||||
"b",
|
|
||||||
)
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@CodecsUnlockCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object AllCodecsReferenceFingerprint : MethodFingerprint(
|
object AllCodecsReferenceFingerprint : MethodFingerprint(
|
||||||
"J", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
|
"J", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
|
||||||
Opcode.INVOKE_STATIC,
|
Opcode.INVOKE_STATIC,
|
||||||
|
|||||||
@@ -1,25 +1,15 @@
|
|||||||
package app.revanced.patches.music.audio.codecs.fingerprints
|
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.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.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("codec-lock-fingerprint")
|
|
||||||
@MatchingMethod(
|
|
||||||
"Lacfr;",
|
|
||||||
"a",
|
|
||||||
)
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@CodecsUnlockCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object CodecsLockFingerprint : MethodFingerprint(
|
object CodecsLockFingerprint : MethodFingerprint(
|
||||||
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, null, listOf(
|
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, opcodes = listOf(
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.MOVE_RESULT,
|
Opcode.MOVE_RESULT,
|
||||||
@@ -35,5 +25,5 @@ object CodecsLockFingerprint : MethodFingerprint(
|
|||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
Opcode.RETURN_OBJECT
|
Opcode.RETURN_OBJECT
|
||||||
),
|
),
|
||||||
listOf("eac3_supported")
|
strings = listOf("eac3_supported")
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ package app.revanced.patches.music.audio.codecs.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.impl.BytecodeData
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.data.impl.toMethodWalker
|
import app.revanced.patcher.data.toMethodWalker
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.impl.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.util.smali.toInstruction
|
import app.revanced.patcher.util.smali.toInstruction
|
||||||
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
||||||
import app.revanced.patches.music.audio.codecs.fingerprints.AllCodecsReferenceFingerprint
|
import app.revanced.patches.music.audio.codecs.fingerprints.AllCodecsReferenceFingerprint
|
||||||
@@ -25,12 +25,12 @@ class CodecsUnlockPatch : BytecodePatch(
|
|||||||
CodecsLockFingerprint, AllCodecsReferenceFingerprint
|
CodecsLockFingerprint, AllCodecsReferenceFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
val codecsLockResult = CodecsLockFingerprint.result!!
|
val codecsLockResult = CodecsLockFingerprint.result!!
|
||||||
|
|
||||||
val implementation = codecsLockResult.mutableMethod.implementation!!
|
val implementation = codecsLockResult.mutableMethod.implementation!!
|
||||||
|
|
||||||
val scanResultStartIndex = codecsLockResult.patternScanResult!!.startIndex
|
val scanResultStartIndex = codecsLockResult.scanResult.patternScanResult!!.startIndex
|
||||||
val instructionIndex = scanResultStartIndex +
|
val instructionIndex = scanResultStartIndex +
|
||||||
if (implementation.instructions[scanResultStartIndex - 1].opcode == Opcode.CHECK_CAST) {
|
if (implementation.instructions[scanResultStartIndex - 1].opcode == Opcode.CHECK_CAST) {
|
||||||
// for 5.16.xx and lower
|
// for 5.16.xx and lower
|
||||||
@@ -42,8 +42,8 @@ class CodecsUnlockPatch : BytecodePatch(
|
|||||||
|
|
||||||
val allCodecsResult = AllCodecsReferenceFingerprint.result!!
|
val allCodecsResult = AllCodecsReferenceFingerprint.result!!
|
||||||
val allCodecsMethod =
|
val allCodecsMethod =
|
||||||
data.toMethodWalker(allCodecsResult.method)
|
context.toMethodWalker(allCodecsResult.method)
|
||||||
.nextMethod(allCodecsResult.patternScanResult!!.startIndex)
|
.nextMethod(allCodecsResult.scanResult.patternScanResult!!.startIndex)
|
||||||
.getMethod()
|
.getMethod()
|
||||||
|
|
||||||
implementation.replaceInstruction(
|
implementation.replaceInstruction(
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52", "5.31.50")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,25 +1,10 @@
|
|||||||
package app.revanced.patches.music.audio.exclusiveaudio.fingerprints
|
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.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.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("audio-only-enabler-fingerprint")
|
|
||||||
@MatchingMethod(
|
|
||||||
"Lgmd;",
|
|
||||||
"d"
|
|
||||||
)
|
|
||||||
@DirectPatternScanMethod
|
|
||||||
@ExclusiveAudioCompatibility
|
|
||||||
@Version(
|
|
||||||
"0.0.1"
|
|
||||||
)
|
|
||||||
object AudioOnlyEnablerFingerprint: MethodFingerprint(
|
object AudioOnlyEnablerFingerprint: MethodFingerprint(
|
||||||
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
||||||
Opcode.IGET_OBJECT,
|
Opcode.IGET_OBJECT,
|
||||||
|
|||||||
@@ -1,22 +1,13 @@
|
|||||||
package app.revanced.patches.music.audio.exclusiveaudio.fingerprints
|
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.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.FuzzyPatternScanMethod
|
||||||
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.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("exclusive-audio-fingerprints")
|
|
||||||
@MatchingMethod(
|
|
||||||
"Lgmd;", "c"
|
|
||||||
)
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@ExclusiveAudioCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object ExclusiveAudioFingerprint : MethodFingerprint(
|
object ExclusiveAudioFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
|||||||
@@ -3,17 +3,15 @@ package app.revanced.patches.music.audio.exclusiveaudio.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.impl.BytecodeData
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
import app.revanced.patcher.extensions.replaceInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.impl.BytecodePatch
|
|
||||||
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
||||||
import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.AudioOnlyEnablerFingerprint
|
import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.AudioOnlyEnablerFingerprint
|
||||||
import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.ExclusiveAudioFingerprint
|
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("exclusive-audio-playback")
|
@Name("exclusive-audio-playback")
|
||||||
@@ -25,7 +23,7 @@ class ExclusiveAudioPatch : BytecodePatch(
|
|||||||
AudioOnlyEnablerFingerprint
|
AudioOnlyEnablerFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
val method = AudioOnlyEnablerFingerprint.result!!.mutableMethod
|
val method = AudioOnlyEnablerFingerprint.result!!.mutableMethod
|
||||||
method.replaceInstruction(method.implementation!!.instructions.count() - 1, "const/4 v0, 0x1")
|
method.replaceInstruction(method.implementation!!.instructions.count() - 1, "const/4 v0, 0x1")
|
||||||
method.addInstruction("return v0")
|
method.addInstruction("return v0")
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52", "5.31.50")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,20 +1,10 @@
|
|||||||
package app.revanced.patches.music.layout.compactheader.fingerprints
|
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.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
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.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("compact-header-constructor-fingerprint")
|
|
||||||
@MatchingMethod(
|
|
||||||
"Llcz;", "<init>"
|
|
||||||
)
|
|
||||||
@CompactHeaderCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object CompactHeaderConstructorFingerprint : MethodFingerprint(
|
object CompactHeaderConstructorFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L", "L"), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L", "L"), listOf(
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ package app.revanced.patches.music.layout.compactheader.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.impl.BytecodeData
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.impl.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.music.layout.compactheader.annotations.CompactHeaderCompatibility
|
import app.revanced.patches.music.layout.compactheader.annotations.CompactHeaderCompatibility
|
||||||
import app.revanced.patches.music.layout.compactheader.fingerprints.CompactHeaderConstructorFingerprint
|
import app.revanced.patches.music.layout.compactheader.fingerprints.CompactHeaderConstructorFingerprint
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction11x
|
import org.jf.dexlib2.builder.instruction.BuilderInstruction11x
|
||||||
@@ -23,16 +23,16 @@ class CompactHeaderPatch : BytecodePatch(
|
|||||||
CompactHeaderConstructorFingerprint
|
CompactHeaderConstructorFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
val result = CompactHeaderConstructorFingerprint.result!!
|
val result = CompactHeaderConstructorFingerprint.result!!
|
||||||
val method = result.mutableMethod
|
val method = result.mutableMethod
|
||||||
|
|
||||||
val insertIndex = result.patternScanResult!!.endIndex
|
val insertIndex = result.scanResult.patternScanResult!!.endIndex
|
||||||
val register = (method.implementation!!.instructions[insertIndex - 1] as BuilderInstruction11x).registerA
|
val register = (method.implementation!!.instructions[insertIndex - 1] as BuilderInstruction11x).registerA
|
||||||
method.addInstructions(
|
method.addInstructions(
|
||||||
insertIndex, """
|
insertIndex, """
|
||||||
const/16 v0, 0x8
|
const/16 v2, 0x8
|
||||||
invoke-virtual {v${register}, v0}, Landroid/view/View;->setVisibility(I)V
|
invoke-virtual {v${register}, v2}, Landroid/view/View;->setVisibility(I)V
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52", "5.31.50")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,20 +1,10 @@
|
|||||||
package app.revanced.patches.music.layout.minimizedplayback.fingerprints
|
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.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
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.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("minimized-playback-manager-fingerprint")
|
|
||||||
@MatchingMethod(
|
|
||||||
"Llxw;", "c"
|
|
||||||
)
|
|
||||||
@MinimizedPlaybackCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object MinimizedPlaybackManagerFingerprint : MethodFingerprint(
|
object MinimizedPlaybackManagerFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
|||||||
@@ -3,18 +3,14 @@ package app.revanced.patches.music.layout.minimizedplayback.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.impl.BytecodeData
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.data.impl.toMethodWalker
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.patch.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.annotations.MinimizedPlaybackCompatibility
|
||||||
import app.revanced.patches.music.layout.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint
|
import app.revanced.patches.music.layout.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint
|
||||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
|
||||||
import org.jf.dexlib2.iface.reference.MethodReference
|
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("minimized-playback-music")
|
@Name("minimized-playback-music")
|
||||||
@@ -26,7 +22,7 @@ class MinimizedPlaybackPatch : BytecodePatch(
|
|||||||
MinimizedPlaybackManagerFingerprint
|
MinimizedPlaybackManagerFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstructions(
|
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstructions(
|
||||||
0, """
|
0, """
|
||||||
return-void
|
return-void
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52", "5.31.50")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,20 +1,10 @@
|
|||||||
package app.revanced.patches.music.layout.premium.fingerprints
|
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.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
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.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("hide-get-premium-fingerprint")
|
|
||||||
@MatchingMethod(
|
|
||||||
"Lktn;", "k"
|
|
||||||
)
|
|
||||||
@HideGetPremiumCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object HideGetPremiumFingerprint : MethodFingerprint(
|
object HideGetPremiumFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
||||||
Opcode.IF_NEZ,
|
Opcode.IF_NEZ,
|
||||||
|
|||||||
@@ -1,20 +1,10 @@
|
|||||||
package app.revanced.patches.music.layout.premium.fingerprints
|
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.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
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.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("hide-get-premium-parent-fingerprint")
|
|
||||||
@MatchingMethod(
|
|
||||||
"Lktn;", "k"
|
|
||||||
)
|
|
||||||
@HideGetPremiumCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object HideGetPremiumParentFingerprint : MethodFingerprint(
|
object HideGetPremiumParentFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
||||||
Opcode.IGET_BOOLEAN,
|
Opcode.IGET_BOOLEAN,
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ package app.revanced.patches.music.layout.premium.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.impl.BytecodeData
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
import app.revanced.patcher.extensions.replaceInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.impl.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.music.layout.premium.annotations.HideGetPremiumCompatibility
|
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.HideGetPremiumFingerprint
|
||||||
import app.revanced.patches.music.layout.premium.fingerprints.HideGetPremiumParentFingerprint
|
import app.revanced.patches.music.layout.premium.fingerprints.HideGetPremiumParentFingerprint
|
||||||
@@ -25,13 +25,15 @@ class HideGetPremiumPatch : BytecodePatch(
|
|||||||
HideGetPremiumParentFingerprint
|
HideGetPremiumParentFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
val parentResult = HideGetPremiumParentFingerprint.result!!
|
val parentResult = HideGetPremiumParentFingerprint.result!!
|
||||||
HideGetPremiumFingerprint.resolve(data, parentResult.classDef)
|
HideGetPremiumFingerprint.resolve(context, parentResult.classDef)
|
||||||
|
|
||||||
|
val startIndex = parentResult.scanResult.patternScanResult!!.startIndex
|
||||||
|
|
||||||
val parentMethod = parentResult.mutableMethod
|
val parentMethod = parentResult.mutableMethod
|
||||||
parentMethod.replaceInstruction(
|
parentMethod.replaceInstruction(
|
||||||
parentResult.patternScanResult!!.startIndex, """
|
startIndex, """
|
||||||
const/4 v1, 0x0
|
const/4 v1, 0x0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
@@ -39,7 +41,7 @@ class HideGetPremiumPatch : BytecodePatch(
|
|||||||
val result = HideGetPremiumFingerprint.result!!
|
val result = HideGetPremiumFingerprint.result!!
|
||||||
val method = result.mutableMethod
|
val method = result.mutableMethod
|
||||||
method.addInstructions(
|
method.addInstructions(
|
||||||
result.patternScanResult!!.startIndex, """
|
startIndex, """
|
||||||
const/16 v0, 0x8
|
const/16 v0, 0x8
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
*/
|
*/
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
"com.google.android.apps.youtube.music", arrayOf("5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52", "5.31.50")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,24 +1,15 @@
|
|||||||
package app.revanced.patches.music.layout.tastebuilder.fingerprints
|
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.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.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.layout.tastebuilder.annotations.RemoveTasteBuilderCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("taste-builder-constructor-fingerprint")
|
|
||||||
@MatchingMethod(
|
|
||||||
"Lkyu;", "<init>"
|
|
||||||
)
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@RemoveTasteBuilderCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object TasteBuilderConstructorFingerprint : MethodFingerprint(
|
object TasteBuilderConstructorFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L"), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L"), listOf(
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.NEW_INSTANCE,
|
Opcode.NEW_INSTANCE,
|
||||||
@@ -35,9 +26,9 @@ object TasteBuilderConstructorFingerprint : MethodFingerprint(
|
|||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
Opcode.CHECK_CAST,
|
Opcode.CHECK_CAST,
|
||||||
Opcode.IPUT_OBJECT,
|
|
||||||
Opcode.NEW_INSTANCE,
|
Opcode.NEW_INSTANCE,
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
Opcode.IPUT_OBJECT
|
Opcode.IPUT_OBJECT,
|
||||||
|
Opcode.CONST
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -3,12 +3,12 @@ package app.revanced.patches.music.layout.tastebuilder.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.impl.BytecodeData
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.impl.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.music.layout.tastebuilder.annotations.RemoveTasteBuilderCompatibility
|
import app.revanced.patches.music.layout.tastebuilder.annotations.RemoveTasteBuilderCompatibility
|
||||||
import app.revanced.patches.music.layout.tastebuilder.fingerprints.TasteBuilderConstructorFingerprint
|
import app.revanced.patches.music.layout.tastebuilder.fingerprints.TasteBuilderConstructorFingerprint
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
||||||
@@ -23,11 +23,11 @@ class RemoveTasteBuilderPatch : BytecodePatch(
|
|||||||
TasteBuilderConstructorFingerprint
|
TasteBuilderConstructorFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
val result = TasteBuilderConstructorFingerprint.result!!
|
val result = TasteBuilderConstructorFingerprint.result!!
|
||||||
val method = result.mutableMethod
|
val method = result.mutableMethod
|
||||||
|
|
||||||
val insertIndex = result.patternScanResult!!.endIndex - 8
|
val insertIndex = result.scanResult.patternScanResult!!.endIndex - 8
|
||||||
val register = (method.implementation!!.instructions[insertIndex] as Instruction22c).registerA
|
val register = (method.implementation!!.instructions[insertIndex] as Instruction22c).registerA
|
||||||
method.addInstructions(
|
method.addInstructions(
|
||||||
insertIndex, """
|
insertIndex, """
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52", "5.31.50")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,22 +1,13 @@
|
|||||||
package app.revanced.patches.music.layout.upgradebutton.fingerprints
|
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.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.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.layout.upgradebutton.annotations.RemoveUpgradeButtonCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("pivot-bar-constructor-fingerprint")
|
|
||||||
@MatchingMethod(
|
|
||||||
"Lhfu;", "<init2>"
|
|
||||||
)
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@RemoveUpgradeButtonCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object PivotBarConstructorFingerprint : MethodFingerprint(
|
object PivotBarConstructorFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ package app.revanced.patches.music.layout.upgradebutton.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.impl.BytecodeData
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.impl.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.util.smali.toInstructions
|
import app.revanced.patcher.util.smali.toInstructions
|
||||||
import app.revanced.patches.music.layout.upgradebutton.annotations.RemoveUpgradeButtonCompatibility
|
import app.revanced.patches.music.layout.upgradebutton.annotations.RemoveUpgradeButtonCompatibility
|
||||||
import app.revanced.patches.music.layout.upgradebutton.fingerprints.PivotBarConstructorFingerprint
|
import app.revanced.patches.music.layout.upgradebutton.fingerprints.PivotBarConstructorFingerprint
|
||||||
@@ -28,12 +28,12 @@ class RemoveUpgradeButtonPatch : BytecodePatch(
|
|||||||
PivotBarConstructorFingerprint
|
PivotBarConstructorFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
val result = PivotBarConstructorFingerprint.result!!
|
val result = PivotBarConstructorFingerprint.result!!
|
||||||
val implementation = result.mutableMethod.implementation!!
|
val implementation = result.mutableMethod.implementation!!
|
||||||
|
|
||||||
val pivotBarElementFieldRef =
|
val pivotBarElementFieldRef =
|
||||||
(implementation.instructions[result.patternScanResult!!.endIndex - 1] as Instruction22c).reference
|
(implementation.instructions[result.scanResult.patternScanResult!!.endIndex - 1] as Instruction22c).reference
|
||||||
|
|
||||||
val register = (implementation.instructions.first() as Instruction35c).registerC
|
val register = (implementation.instructions.first() as Instruction35c).registerC
|
||||||
// first compile all the needed instructions
|
// first compile all the needed instructions
|
||||||
@@ -46,16 +46,18 @@ class RemoveUpgradeButtonPatch : BytecodePatch(
|
|||||||
""".toInstructions().toMutableList()
|
""".toInstructions().toMutableList()
|
||||||
|
|
||||||
|
|
||||||
|
val endIndex = result.scanResult.patternScanResult!!.endIndex
|
||||||
|
|
||||||
// replace the instruction to retain the label at given index
|
// replace the instruction to retain the label at given index
|
||||||
implementation.replaceInstruction(
|
implementation.replaceInstruction(
|
||||||
result.patternScanResult!!.endIndex - 1, instructionList[0] // invoke-interface
|
endIndex - 1, instructionList[0] // invoke-interface
|
||||||
)
|
)
|
||||||
// do not forget to remove this instruction since we added it already
|
// do not forget to remove this instruction since we added it already
|
||||||
instructionList.removeFirst()
|
instructionList.removeFirst()
|
||||||
|
|
||||||
val exitInstruction = instructionList.last() // iput-object
|
val exitInstruction = instructionList.last() // iput-object
|
||||||
implementation.addInstruction(
|
implementation.addInstruction(
|
||||||
result.patternScanResult!!.endIndex, exitInstruction
|
endIndex, exitInstruction
|
||||||
)
|
)
|
||||||
// do not forget to remove this instruction since we added it already
|
// do not forget to remove this instruction since we added it already
|
||||||
instructionList.removeLast()
|
instructionList.removeLast()
|
||||||
@@ -64,12 +66,12 @@ class RemoveUpgradeButtonPatch : BytecodePatch(
|
|||||||
instructionList.add(
|
instructionList.add(
|
||||||
2, // if-le
|
2, // if-le
|
||||||
BuilderInstruction22t(
|
BuilderInstruction22t(
|
||||||
Opcode.IF_LE, 1, 2, implementation.newLabelForIndex(result.patternScanResult!!.endIndex)
|
Opcode.IF_LE, 1, 2, implementation.newLabelForIndex(endIndex)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
implementation.addInstructions(
|
implementation.addInstructions(
|
||||||
result.patternScanResult!!.endIndex, instructionList
|
endIndex, instructionList
|
||||||
)
|
)
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52", "5.31.50")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,20 +1,8 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
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.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
|
||||||
|
|
||||||
@Name("cast-context-fetch-fingerprint")
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
@MatchingMethod(
|
|
||||||
"Lvvz;", "a"
|
|
||||||
)
|
|
||||||
@DirectPatternScanMethod
|
|
||||||
@MicroGPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object CastContextFetchFingerprint : MethodFingerprint(
|
object CastContextFetchFingerprint : MethodFingerprint(
|
||||||
null, null, null, null,
|
strings = listOf("Error fetching CastContext.")
|
||||||
listOf("Error fetching CastContext.")
|
|
||||||
)
|
)
|
||||||
@@ -1,20 +1,8 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
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.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
|
||||||
|
|
||||||
@Name("cast-module-fingerprint")
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
@MatchingMethod(
|
|
||||||
"Llqh;", "c"
|
|
||||||
)
|
|
||||||
@DirectPatternScanMethod
|
|
||||||
@MicroGPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object CastDynamiteModuleFingerprint : MethodFingerprint(
|
object CastDynamiteModuleFingerprint : MethodFingerprint(
|
||||||
null, null, null, null,
|
strings = listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
|
||||||
listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
|
|
||||||
)
|
)
|
||||||
@@ -1,20 +1,8 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
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.youtube.misc.microg.annotations.MicroGPatchCompatibility
|
|
||||||
|
|
||||||
@Name("cast-context-fetch-fingerprint")
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
@MatchingMethod(
|
|
||||||
"Lmcf;", "c"
|
|
||||||
)
|
|
||||||
@DirectPatternScanMethod
|
|
||||||
@MicroGPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object CastDynamiteModuleV2Fingerprint : MethodFingerprint(
|
object CastDynamiteModuleV2Fingerprint : MethodFingerprint(
|
||||||
null, null, null, null,
|
strings = listOf("Failed to load module via V2: ")
|
||||||
listOf("Failed to load module via V2: ")
|
|
||||||
)
|
)
|
||||||
@@ -1,21 +1,18 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
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.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
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
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
@Name("google-play-utility-fingerprint")
|
|
||||||
@MatchingMethod(
|
|
||||||
"Lnuv;", "b"
|
|
||||||
)
|
|
||||||
@DirectPatternScanMethod
|
|
||||||
@MusicMicroGPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object GooglePlayUtilityFingerprint : MethodFingerprint(
|
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")
|
"I",
|
||||||
|
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||||
|
listOf("L", "I"),
|
||||||
|
strings = listOf(
|
||||||
|
"This should never happen.",
|
||||||
|
"MetadataValueReader",
|
||||||
|
"GooglePlayServicesUtil",
|
||||||
|
"com.android.vending",
|
||||||
|
"android.hardware.type.embedded"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
@@ -1,19 +1,8 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
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")
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
@MatchingMethod(
|
|
||||||
"Lrwi;", "a"
|
|
||||||
)
|
|
||||||
@DirectPatternScanMethod
|
|
||||||
@MusicMicroGPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object PrimeFingerprint : MethodFingerprint(
|
object PrimeFingerprint : MethodFingerprint(
|
||||||
null, null, null, null, listOf("com.google.android.GoogleCamera", "com.android.vending")
|
strings = listOf("com.google.android.GoogleCamera", "com.android.vending")
|
||||||
)
|
)
|
||||||
@@ -1,21 +1,15 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
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.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.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
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.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@MusicMicroGPatchCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object ServiceCheckFingerprint : MethodFingerprint(
|
object ServiceCheckFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "I"), null, listOf("Google Play Services not available")
|
"V",
|
||||||
|
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||||
|
listOf("L", "I"),
|
||||||
|
strings = listOf("Google Play Services not available")
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,37 +1,27 @@
|
|||||||
package app.revanced.patches.music.misc.microg.patch.bytecode
|
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.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.impl.BytecodeData
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
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.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 app.revanced.patches.music.misc.microg.fingerprints.*
|
||||||
import org.jf.dexlib2.Opcode
|
import app.revanced.patches.music.misc.microg.patch.resource.MusicMicroGResourcePatch
|
||||||
import org.jf.dexlib2.builder.MutableMethodImplementation
|
import app.revanced.patches.music.misc.microg.shared.Constants.MUSIC_PACKAGE_NAME
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21c
|
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_PACKAGE_NAME
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction21c
|
import app.revanced.patches.youtube.misc.microg.shared.Constants
|
||||||
import org.jf.dexlib2.iface.reference.StringReference
|
import app.revanced.util.microg.MicroGBytecodeHelper
|
||||||
import org.jf.dexlib2.immutable.reference.ImmutableStringReference
|
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@DependsOn([MusicMicroGResourcePatch::class])
|
@DependsOn([MusicMicroGResourcePatch::class])
|
||||||
@Name("music-microg-support")
|
@Name("music-microg-support")
|
||||||
@Description("Allows YouTube Music ReVanced to run without root and under a different package name.")
|
@Description("Allows YouTube Music ReVanced to run without root and under a different package name.")
|
||||||
@MusicMicroGPatchCompatibility
|
@MusicMicroGPatchCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.2")
|
||||||
class MusicMicroGBytecodePatch : BytecodePatch(
|
class MusicMicroGBytecodePatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
ServiceCheckFingerprint,
|
ServiceCheckFingerprint,
|
||||||
@@ -42,130 +32,34 @@ class MusicMicroGBytecodePatch : BytecodePatch(
|
|||||||
PrimeFingerprint,
|
PrimeFingerprint,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
// NOTE: the previous patch also replaced the following strings, but it seems like they are not needed:
|
||||||
disablePlayServiceChecks()
|
// - "com.google.android.gms.chimera.GmsIntentOperationService",
|
||||||
data.classes.forEach { classDef ->
|
// - "com.google.android.gms.phenotype.internal.IPhenotypeCallbacks",
|
||||||
var proxiedClass: MutableClass? = null
|
// - "com.google.android.gms.phenotype.internal.IPhenotypeService",
|
||||||
|
// - "com.google.android.gms.phenotype.PACKAGE_NAME",
|
||||||
classDef.methods.forEach methodLoop@{ method ->
|
// - "com.google.android.gms.phenotype.UPDATE",
|
||||||
val implementation = method.implementation ?: return@methodLoop
|
// - "com.google.android.gms.phenotype",
|
||||||
|
override fun execute(context: BytecodeContext) =
|
||||||
var proxiedImplementation: MutableMethodImplementation? = null
|
// apply common microG patch
|
||||||
|
MicroGBytecodeHelper.patchBytecode(
|
||||||
implementation.instructions.forEachIndexed { i, instruction ->
|
context,
|
||||||
if (instruction.opcode != Opcode.CONST_STRING) return@forEachIndexed
|
arrayOf(
|
||||||
|
MicroGBytecodeHelper.packageNameTransform(
|
||||||
val stringValue = ((instruction as Instruction21c).reference as StringReference).string
|
Constants.PACKAGE_NAME,
|
||||||
|
Constants.REVANCED_PACKAGE_NAME
|
||||||
val replaceMode = if (stringValue.equalsAny(
|
)
|
||||||
"com.google.android.gms",
|
),
|
||||||
"com.google.android.gms.chimera",
|
MicroGBytecodeHelper.PrimeMethodTransformationData(
|
||||||
"com.google.android.c2dm.intent.REGISTER",
|
PrimeFingerprint,
|
||||||
"com.google.android.c2dm.permission.SEND",
|
MUSIC_PACKAGE_NAME,
|
||||||
"com.google.iid.TOKEN_REQUEST",
|
REVANCED_MUSIC_PACKAGE_NAME
|
||||||
"com.google",
|
),
|
||||||
"com.google.android.gms.chimera.GmsIntentOperationService",
|
listOf(
|
||||||
"com.google.android.gms.phenotype.internal.IPhenotypeCallbacks",
|
ServiceCheckFingerprint,
|
||||||
"com.google.android.gms.phenotype.internal.IPhenotypeService",
|
GooglePlayUtilityFingerprint,
|
||||||
"com.google.android.gms.phenotype.service.START",
|
CastDynamiteModuleFingerprint,
|
||||||
"com.google.android.gms.phenotype.PACKAGE_NAME",
|
CastDynamiteModuleV2Fingerprint,
|
||||||
"com.google.android.gms.phenotype.UPDATE",
|
CastContextFetchFingerprint
|
||||||
"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,
|
|
||||||
CastDynamiteModuleFingerprint,
|
|
||||||
CastDynamiteModuleV2Fingerprint,
|
|
||||||
CastContextFetchFingerprint,
|
|
||||||
).forEach { fingerprint ->
|
|
||||||
val result = fingerprint.result!!
|
|
||||||
val stringInstructions = when (result.method.returnType.first()) {
|
|
||||||
'L' -> """
|
|
||||||
const/4 v0, 0x0
|
|
||||||
return-object v0
|
|
||||||
"""
|
|
||||||
|
|
||||||
'V' -> "return-void"
|
|
||||||
'I' -> """
|
|
||||||
const/4 v0, 0x0
|
|
||||||
return v0
|
|
||||||
"""
|
|
||||||
|
|
||||||
else -> throw Exception("This case should never happen.")
|
|
||||||
}
|
|
||||||
result.mutableMethod.addInstructions(
|
|
||||||
0, stringInstructions
|
|
||||||
)
|
)
|
||||||
}
|
).let { PatchResultSuccess() }
|
||||||
|
|
||||||
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\""
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,44 +1,41 @@
|
|||||||
package app.revanced.patches.music.misc.microg.patch.resource
|
package app.revanced.patches.music.misc.microg.patch.resource
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.impl.ResourceData
|
import app.revanced.patcher.data.ResourceContext
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.impl.ResourcePatch
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
|
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.MUSIC_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_APP_NAME
|
||||||
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_PACKAGE_NAME
|
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_PACKAGE_NAME
|
||||||
|
import app.revanced.patches.music.misc.microg.shared.Constants.SPOOFED_PACKAGE_NAME
|
||||||
@Name("music-microg-resource-patch")
|
import app.revanced.patches.music.misc.microg.shared.Constants.SPOOFED_PACKAGE_SIGNATURE
|
||||||
@Description("Resource patch to allow YouTube Music ReVanced to run without root and under a different package name.")
|
import app.revanced.util.microg.MicroGManifestHelper
|
||||||
@MusicMicroGPatchCompatibility
|
import app.revanced.util.microg.MicroGResourceHelper
|
||||||
@Version("0.0.1")
|
|
||||||
class MusicMicroGResourcePatch : ResourcePatch() {
|
@Name("music-microg-resource-patch")
|
||||||
override fun execute(data: ResourceData): PatchResult {
|
@Description("Resource patch to allow YouTube Music ReVanced to run without root and under a different package name.")
|
||||||
|
@MusicMicroGPatchCompatibility
|
||||||
val manifest = data["AndroidManifest.xml"].readText()
|
@Version("0.0.2")
|
||||||
|
class MusicMicroGResourcePatch : ResourcePatch {
|
||||||
data["AndroidManifest.xml"].writeText(
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
manifest.replace(
|
// update manifest
|
||||||
"package=\"com.google.android.apps.youtube.music", "package=\"$REVANCED_MUSIC_PACKAGE_NAME"
|
MicroGResourceHelper.patchManifest(
|
||||||
).replace(
|
context,
|
||||||
"android:label=\"@string/app_name", "android:label=\"$REVANCED_MUSIC_APP_NAME"
|
MUSIC_PACKAGE_NAME,
|
||||||
).replace(
|
REVANCED_MUSIC_PACKAGE_NAME,
|
||||||
"android:label=\"@string/app_launcher_name", "android:label=\"$REVANCED_MUSIC_APP_NAME"
|
REVANCED_MUSIC_APP_NAME
|
||||||
).replace(
|
)
|
||||||
"android:authorities=\"com.google.android.apps.youtube.music", "android:authorities=\"$REVANCED_MUSIC_PACKAGE_NAME"
|
|
||||||
).replace(
|
// add metadata to the manifest
|
||||||
"com.google.android.apps.youtube.music.permission.C2D_MESSAGE", "$REVANCED_MUSIC_PACKAGE_NAME.permission.C2D_MESSAGE"
|
MicroGManifestHelper.addSpoofingMetadata(
|
||||||
).replace(
|
context,
|
||||||
"com.google.android.c2dm", "$BASE_MICROG_PACKAGE_NAME.android.c2dm"
|
SPOOFED_PACKAGE_NAME,
|
||||||
).replace(
|
SPOOFED_PACKAGE_SIGNATURE
|
||||||
"</queries>", "<package android:name=\"$BASE_MICROG_PACKAGE_NAME.android.gms\"/></queries>"
|
)
|
||||||
)
|
return PatchResultSuccess()
|
||||||
)
|
}
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
package app.revanced.patches.music.misc.microg.shared
|
package app.revanced.patches.music.misc.microg.shared
|
||||||
|
|
||||||
object Constants {
|
object Constants {
|
||||||
internal const val BASE_MICROG_PACKAGE_NAME = "com.mgoogle"
|
internal const val REVANCED_MUSIC_APP_NAME = "YT Music ReVanced"
|
||||||
internal const val REVANCED_MUSIC_APP_NAME = "YouTube Music ReVanced"
|
|
||||||
internal const val REVANCED_MUSIC_PACKAGE_NAME = "app.revanced.android.apps.youtube.music"
|
internal const val REVANCED_MUSIC_PACKAGE_NAME = "app.revanced.android.apps.youtube.music"
|
||||||
}
|
internal const val MUSIC_PACKAGE_NAME = "com.google.android.apps.youtube.music"
|
||||||
|
internal const val SPOOFED_PACKAGE_NAME = MUSIC_PACKAGE_NAME
|
||||||
|
internal const val SPOOFED_PACKAGE_SIGNATURE = "afb0fed5eeaebdd86f56a97742f4b6b33ef59875"
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51", "5.21.52", "5.22.54", "5.23.50", "5.25.51", "5.25.52", "5.26.52", "5.27.51", "5.28.52", "5.29.52", "5.31.50")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
@@ -1,22 +1,13 @@
|
|||||||
package app.revanced.patches.music.premium.backgroundplay.fingerprints
|
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.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.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patches.music.premium.backgroundplay.annotations.BackgroundPlayCompatibility
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
@Name("background-playback-disabler-fingerprint")
|
|
||||||
@MatchingMethod(
|
|
||||||
"Lafgf;", "e"
|
|
||||||
)
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
@BackgroundPlayCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
object BackgroundPlaybackDisableFingerprint : MethodFingerprint(
|
object BackgroundPlaybackDisableFingerprint : MethodFingerprint(
|
||||||
"Z", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), listOf(
|
"Z", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), listOf(
|
||||||
Opcode.CONST_4,
|
Opcode.CONST_4,
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ package app.revanced.patches.music.premium.backgroundplay.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.impl.BytecodeData
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.impl.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.music.premium.backgroundplay.annotations.BackgroundPlayCompatibility
|
import app.revanced.patches.music.premium.backgroundplay.annotations.BackgroundPlayCompatibility
|
||||||
import app.revanced.patches.music.premium.backgroundplay.fingerprints.BackgroundPlaybackDisableFingerprint
|
import app.revanced.patches.music.premium.backgroundplay.fingerprints.BackgroundPlaybackDisableFingerprint
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ class BackgroundPlayPatch : BytecodePatch(
|
|||||||
BackgroundPlaybackDisableFingerprint
|
BackgroundPlaybackDisableFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
BackgroundPlaybackDisableFingerprint.result!!.mutableMethod.addInstructions(
|
BackgroundPlaybackDisableFingerprint.result!!.mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package app.revanced.patches.myexpenses.misc.pro.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility([Package("org.totschnig.myexpenses")])
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class UnlockProCompatibility
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package app.revanced.patches.myexpenses.misc.pro.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object IsEnabledFingerprint : MethodFingerprint(
|
||||||
|
"Z",
|
||||||
|
strings = listOf("feature", "feature.licenceStatus")
|
||||||
|
)
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package app.revanced.patches.myexpenses.misc.pro.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.extensions.removeInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.myexpenses.misc.pro.annotations.UnlockProCompatibility
|
||||||
|
import app.revanced.patches.myexpenses.misc.pro.fingerprints.IsEnabledFingerprint
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("unlock-pro")
|
||||||
|
@Description("Unlocks all professional features.")
|
||||||
|
@UnlockProCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class UnlockProPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
IsEnabledFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
val method = IsEnabledFingerprint.result!!.mutableMethod
|
||||||
|
method.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const/4 v0, 0x1
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package app.revanced.patches.nyx.misc.pro.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility([Package("com.awedea.nyx")])
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class UnlockProCompatibility
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package app.revanced.patches.nyx.misc.pro.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object CheckProFingerprint : MethodFingerprint(
|
||||||
|
customFingerprint = { methodDef ->
|
||||||
|
methodDef.definingClass.endsWith("BillingManager;") && methodDef.name == "isProVersion"
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package app.revanced.patches.nyx.misc.pro.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.extensions.removeInstruction
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.nyx.misc.pro.annotations.UnlockProCompatibility
|
||||||
|
import app.revanced.patches.nyx.misc.pro.fingerprints.CheckProFingerprint
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("unlock-pro")
|
||||||
|
@Description("Unlocks all pro features.")
|
||||||
|
@UnlockProCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class UnlockProPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
CheckProFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
val method = CheckProFingerprint.result!!.mutableMethod
|
||||||
|
method.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const/4 v0, 0x1
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,11 +3,7 @@ package app.revanced.patches.reddit.ad.general.annotations
|
|||||||
import app.revanced.patcher.annotation.Compatibility
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
import app.revanced.patcher.annotation.Package
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
@Compatibility(
|
@Compatibility([Package("com.reddit.frontpage")])
|
||||||
[Package(
|
|
||||||
"com.reddit.frontpage", arrayOf()
|
|
||||||
)]
|
|
||||||
)
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
internal annotation class GeneralAdsCompatibility
|
internal annotation class GeneralAdsCompatibility
|
||||||
|
|||||||
@@ -3,12 +3,11 @@ package app.revanced.patches.reddit.ad.general.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.impl.BytecodeData
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
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.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.reddit.ad.general.annotations.GeneralAdsCompatibility
|
import app.revanced.patches.reddit.ad.general.annotations.GeneralAdsCompatibility
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21c
|
import org.jf.dexlib2.builder.instruction.BuilderInstruction21c
|
||||||
@@ -22,8 +21,8 @@ import org.jf.dexlib2.immutable.reference.ImmutableStringReference
|
|||||||
@GeneralAdsCompatibility
|
@GeneralAdsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class GeneralAdsPatch : BytecodePatch() {
|
class GeneralAdsPatch : BytecodePatch() {
|
||||||
override fun execute(data: BytecodeData): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
data.classes.forEach { classDef ->
|
context.classes.forEach { classDef ->
|
||||||
classDef.methods.forEach methodLoop@{ method ->
|
classDef.methods.forEach methodLoop@{ method ->
|
||||||
val implementation = method.implementation ?: return@methodLoop
|
val implementation = method.implementation ?: return@methodLoop
|
||||||
|
|
||||||
@@ -31,7 +30,7 @@ class GeneralAdsPatch : BytecodePatch() {
|
|||||||
if (instruction.opcode != Opcode.CONST_STRING) return@forEachIndexed
|
if (instruction.opcode != Opcode.CONST_STRING) return@forEachIndexed
|
||||||
if (((instruction as ReferenceInstruction).reference as StringReference).string != "AdPost") return@forEachIndexed
|
if (((instruction as ReferenceInstruction).reference as StringReference).string != "AdPost") return@forEachIndexed
|
||||||
|
|
||||||
val proxiedClass = data.proxy(classDef).resolve()
|
val proxiedClass = context.proxy(classDef).mutableClass
|
||||||
|
|
||||||
val proxiedImplementation = proxiedClass.methods.first {
|
val proxiedImplementation = proxiedClass.methods.first {
|
||||||
it.name == method.name && it.parameterTypes.containsAll(method.parameterTypes)
|
it.name == method.name && it.parameterTypes.containsAll(method.parameterTypes)
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package app.revanced.patches.reddit.layout.premiumicon.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility([Package("com.reddit.frontpage")])
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class PremiumIconCompatibility
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package app.revanced.patches.reddit.layout.premiumicon.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object PremiumIconFingerprint : MethodFingerprint(
|
||||||
|
"Z",
|
||||||
|
customFingerprint = { methodDef ->
|
||||||
|
methodDef.definingClass.endsWith("MyAccount;") && methodDef.name == "isPremiumSubscriber"
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package app.revanced.patches.reddit.layout.premiumicon.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.reddit.layout.premiumicon.annotations.PremiumIconCompatibility
|
||||||
|
import app.revanced.patches.reddit.layout.premiumicon.fingerprints.PremiumIconFingerprint
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("premium-icon-reddit")
|
||||||
|
@Description("Unlocks premium Reddit app icons.")
|
||||||
|
@PremiumIconCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class PremiumIconPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
PremiumIconFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
val method = PremiumIconFingerprint.result!!.mutableMethod
|
||||||
|
method.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const/4 v0, 0x1
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package app.revanced.patches.shared.fingerprints
|
||||||
|
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object WatchWhileActivityFingerprint : MethodFingerprint(
|
||||||
|
customFingerprint = { methodDef ->
|
||||||
|
methodDef.definingClass.endsWith("WatchWhileActivity;") && methodDef.name == "<init>"
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package app.revanced.patches.shared.integrations.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.addInstruction
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultError
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import org.jf.dexlib2.iface.Method
|
||||||
|
|
||||||
|
@Description("Applies mandatory patches to implement the ReVanced integrations into the application.")
|
||||||
|
@Version("0.0.1")
|
||||||
|
abstract class AbstractIntegrationsPatch(
|
||||||
|
private val integrationsDescriptor: String,
|
||||||
|
private val hooks: Iterable<IntegrationsFingerprint>
|
||||||
|
) : BytecodePatch(hooks) {
|
||||||
|
/**
|
||||||
|
* [MethodFingerprint] for integrations.
|
||||||
|
*
|
||||||
|
* @param contextRegisterResolver A [RegisterResolver] to get the register.
|
||||||
|
* @see MethodFingerprint
|
||||||
|
*/
|
||||||
|
abstract class IntegrationsFingerprint(
|
||||||
|
strings: Iterable<String>? = null,
|
||||||
|
customFingerprint: ((methodDef: Method) -> Boolean)? = null,
|
||||||
|
private val contextRegisterResolver: (Method) -> Int = object : RegisterResolver {}
|
||||||
|
) : MethodFingerprint(strings = strings, customFingerprint = customFingerprint) {
|
||||||
|
fun invoke(integrationsDescriptor: String): PatchResult {
|
||||||
|
result?.mutableMethod?.let { method ->
|
||||||
|
val contextRegister = contextRegisterResolver(method)
|
||||||
|
|
||||||
|
method.addInstruction(
|
||||||
|
0,
|
||||||
|
"sput-object v$contextRegister, " +
|
||||||
|
"$integrationsDescriptor->context:Landroid/content/Context;"
|
||||||
|
)
|
||||||
|
} ?: return PatchResultError("Could not find hook target fingerprint.")
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RegisterResolver : (Method) -> Int {
|
||||||
|
override operator fun invoke(method: Method) = method.implementation!!.registerCount - 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
if (context.findClass(integrationsDescriptor) == null) return MISSING_INTEGRATIONS
|
||||||
|
|
||||||
|
for (hook in hooks) hook.invoke(integrationsDescriptor).let {
|
||||||
|
if (it is PatchResultError) return it
|
||||||
|
}
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
val MISSING_INTEGRATIONS = PatchResultError(
|
||||||
|
"Integrations have not been merged yet. " +
|
||||||
|
"This patch can not succeed without merging the integrations."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package app.revanced.patches.shared.mapping.misc.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.ResourceContext
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
import java.util.*
|
||||||
|
import java.util.concurrent.Executors
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
|
|
||||||
|
@Name("resource-mapping")
|
||||||
|
@Description("Creates a map of public resources.")
|
||||||
|
@Version("0.0.1")
|
||||||
|
class ResourceMappingPatch : ResourcePatch {
|
||||||
|
companion object {
|
||||||
|
internal lateinit var resourceMappings: List<ResourceElement>
|
||||||
|
private set
|
||||||
|
|
||||||
|
private val THREAD_COUNT = Runtime.getRuntime().availableProcessors()
|
||||||
|
private val threadPoolExecutor = Executors.newFixedThreadPool(THREAD_COUNT)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
|
// save the file in memory to concurrently read from
|
||||||
|
val resourceXmlFile = context["res/values/public.xml"].readBytes()
|
||||||
|
|
||||||
|
// create a synchronized list to store the resource mappings
|
||||||
|
val mappings = Collections.synchronizedList(mutableListOf<ResourceElement>())
|
||||||
|
|
||||||
|
for (threadIndex in 0 until THREAD_COUNT) {
|
||||||
|
threadPoolExecutor.execute thread@{
|
||||||
|
context.xmlEditor[resourceXmlFile.inputStream()].use { editor ->
|
||||||
|
val resources = editor.file.documentElement.childNodes
|
||||||
|
val resourcesLength = resources.length
|
||||||
|
val jobSize = resourcesLength / THREAD_COUNT
|
||||||
|
|
||||||
|
val batchStart = jobSize * threadIndex
|
||||||
|
val batchEnd = jobSize * (threadIndex + 1)
|
||||||
|
element@ for (i in batchStart until batchEnd) {
|
||||||
|
// make sure to not to go out of bounds when rounding errors occur at calculating the jobSize
|
||||||
|
if (i >= resourcesLength) return@thread
|
||||||
|
|
||||||
|
val node = resources.item(i)
|
||||||
|
if (node !is Element) continue
|
||||||
|
|
||||||
|
val nameAttribute = node.getAttribute("name")
|
||||||
|
val typeAttribute = node.getAttribute("type")
|
||||||
|
|
||||||
|
if (node.nodeName != "public" || nameAttribute.startsWith("APKTOOL")) continue
|
||||||
|
|
||||||
|
val id = node.getAttribute("id").substring(2).toLong(16)
|
||||||
|
mappings.add(ResourceElement(typeAttribute, nameAttribute, id))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
threadPoolExecutor
|
||||||
|
.also { it.shutdown() }
|
||||||
|
.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS)
|
||||||
|
|
||||||
|
resourceMappings = mappings
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data class ResourceElement(val type: String, val name: String, val id: Long)
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package app.revanced.patches.shared.settings.preference
|
||||||
|
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||||
|
import org.w3c.dom.Document
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base preference class for all preferences.
|
||||||
|
*
|
||||||
|
* @param key The key of the preference.
|
||||||
|
* @param title The title of the preference.
|
||||||
|
*/
|
||||||
|
internal abstract class BasePreference(
|
||||||
|
override val key: String,
|
||||||
|
override val title: StringResource,
|
||||||
|
) : IPreference {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serialize preference element to XML.
|
||||||
|
* Overriding methods should invoke super and operate on its return value.
|
||||||
|
* @param ownerDocument Target document to create elements from.
|
||||||
|
* @param resourceCallback Called when a resource has been processed.
|
||||||
|
*/
|
||||||
|
open fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)? = null): Element {
|
||||||
|
return ownerDocument.createElement(tag).apply {
|
||||||
|
if(key.isNotEmpty())
|
||||||
|
setAttribute("android:key", key)
|
||||||
|
setAttribute("android:title", "@string/${title.also { resourceCallback?.invoke(it) }.name}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package app.revanced.patches.shared.settings.preference
|
||||||
|
|
||||||
|
import org.w3c.dom.Document
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base resource class for all resources.
|
||||||
|
*
|
||||||
|
* @param name The name of the resource.
|
||||||
|
*/
|
||||||
|
internal abstract class BaseResource(
|
||||||
|
override val name: String
|
||||||
|
) : IResource {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serialize resource element to XML.
|
||||||
|
* Overriding methods should invoke super and operate on its return value.
|
||||||
|
* @param ownerDocument Target document to create elements from.
|
||||||
|
* @param resourceCallback Called when a resource has been processed.
|
||||||
|
*/
|
||||||
|
open fun serialize(ownerDocument: Document, resourceCallback: ((IResource) -> Unit)? = null): Element {
|
||||||
|
return ownerDocument.createElement(tag).apply {
|
||||||
|
setAttribute("name", name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package app.revanced.patches.shared.settings.preference
|
||||||
|
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
import org.w3c.dom.Node
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a resource node child
|
||||||
|
*
|
||||||
|
* @param resource The resource to add.
|
||||||
|
* @param resourceCallback Called when a resource has been processed.
|
||||||
|
*/
|
||||||
|
internal fun Node.addResource(resource: BaseResource, resourceCallback: ((IResource) -> Unit)? = null) {
|
||||||
|
appendChild(resource.serialize(ownerDocument, resourceCallback))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a preference node child to the settings.
|
||||||
|
*
|
||||||
|
* @param preference The preference to add.
|
||||||
|
* @param resourceCallback Called when a resource has been processed.
|
||||||
|
*/
|
||||||
|
internal fun Node.addPreference(preference: BasePreference, resourceCallback: ((IResource) -> Unit)? = null) {
|
||||||
|
appendChild(preference.serialize(ownerDocument, resourceCallback))
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun Element.addSummary(summaryResource: StringResource?, summaryType: SummaryType = SummaryType.DEFAULT) =
|
||||||
|
summaryResource?.let { summary ->
|
||||||
|
setAttribute("android:${summaryType.type}", "@string/${summary.name}")
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun <T> Element.addDefault(default: T) {
|
||||||
|
default?.let {
|
||||||
|
setAttribute(
|
||||||
|
"android:defaultValue", when (it) {
|
||||||
|
is Boolean -> if (it) "true" else "false"
|
||||||
|
is String -> it
|
||||||
|
else -> throw IllegalArgumentException("Unsupported default value type: ${it::class.java.name}")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package app.revanced.patches.shared.settings.preference
|
||||||
|
|
||||||
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Preference
|
||||||
|
*/
|
||||||
|
internal interface IPreference {
|
||||||
|
/**
|
||||||
|
* Key of the preference.
|
||||||
|
*/
|
||||||
|
val key: String
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Title of the preference.
|
||||||
|
*/
|
||||||
|
val title: StringResource
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tag name of the preference.
|
||||||
|
*/
|
||||||
|
val tag: String
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package app.revanced.patches.shared.settings.preference
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resource
|
||||||
|
*/
|
||||||
|
internal interface IResource {
|
||||||
|
/**
|
||||||
|
* Name of the resource.
|
||||||
|
*/
|
||||||
|
val name: String
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tag name of the resource.
|
||||||
|
*/
|
||||||
|
val tag: String
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package app.revanced.patches.shared.settings.preference
|
||||||
|
|
||||||
|
enum class SummaryType(val type: String) {
|
||||||
|
DEFAULT("summary"), ON("summaryOn"), OFF("summaryOff")
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user