Compare commits

...

51 Commits

Author SHA1 Message Date
semantic-release-bot
920bfea952 chore(release): 2.178.0-dev.4 [skip ci]
# [2.178.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.3...v2.178.0-dev.4) (2023-06-18)

### Features

* **boostforreddit:** add `change-oauth-client-id` patch ([1c95e0f](1c95e0fcad))
2023-06-18 00:21:44 +00:00
oSumAtrIX
1c95e0fcad feat(boostforreddit): add change-oauth-client-id patch 2023-06-18 02:19:08 +02:00
semantic-release-bot
7f1b70e625 chore(release): 2.178.0-dev.3 [skip ci]
# [2.178.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.2...v2.178.0-dev.3) (2023-06-17)

### Bug Fixes

* **youtube/comments:** add missing filter ([#2423](https://github.com/revanced/revanced-patches/issues/2423)) ([d30797f](d30797f9b8))
2023-06-17 23:50:15 +00:00
johnconner122
d30797f9b8 fix(youtube/comments): add missing filter (#2423) 2023-06-18 01:47:31 +02:00
semantic-release-bot
d5609f65ca chore(release): 2.178.0-dev.2 [skip ci]
# [2.178.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.1...v2.178.0-dev.2) (2023-06-16)

### Bug Fixes

* **googlerecorder/remove-device-restrictions:** add missing app constraint ([#2438](https://github.com/revanced/revanced-patches/issues/2438)) ([7d85d2a](7d85d2ad91))
2023-06-16 19:31:02 +00:00
LisoUseInAIKyrios
88e6ab2d07 chore: fixing build 2023-06-16 23:28:22 +04:00
johnconner122
7d85d2ad91 fix(googlerecorder/remove-device-restrictions): add missing app constraint (#2438) 2023-06-16 13:09:40 +02:00
semantic-release-bot
21adab5ef3 chore(release): 2.178.0-dev.1 [skip ci]
# [2.178.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.177.1-dev.2...v2.178.0-dev.1) (2023-06-16)

### Features

* **google-recorder:** add `remove-device-restrictions` patch ([2e7e231](2e7e231e7d))
2023-06-16 02:09:45 +00:00
oSumAtrIX
2e7e231e7d feat(google-recorder): add remove-device-restrictions patch 2023-06-16 04:06:53 +02:00
semantic-release-bot
ae67a762ff chore(release): 2.177.1-dev.2 [skip ci]
## [2.177.1-dev.2](https://github.com/revanced/revanced-patches/compare/v2.177.1-dev.1...v2.177.1-dev.2) (2023-06-14)

### Bug Fixes

* **youtube:** separate `hide-ads` to `hide-layout-components` patch ([6611882](66118829b3))
2023-06-14 01:33:36 +00:00
oSumAtrIX
66118829b3 fix(youtube): separate hide-ads to hide-layout-components patch 2023-06-14 03:30:29 +02:00
semantic-release-bot
22a18467de chore(release): 2.177.1-dev.1 [skip ci]
## [2.177.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.177.0...v2.177.1-dev.1) (2023-06-14)

### Bug Fixes

* don't include all Litho patches, when not included ([ccc369a](ccc369a2a8))
2023-06-14 00:49:42 +00:00
oSumAtrIX
ccc369a2a8 fix: don't include all Litho patches, when not included 2023-06-14 02:45:29 +02:00
semantic-release-bot
c3d898ae0d chore(release): 2.177.0 [skip ci]
# [2.177.0](https://github.com/revanced/revanced-patches/compare/v2.176.1...v2.177.0) (2023-06-12)

### Bug Fixes

* **reddit/hide-ads:** search for correct reference class descriptor ([fa49810](fa49810907))
* **syncforreddit/change-oauth-client-id:** trim whitespace from OAuth string ([#2402](https://github.com/revanced/revanced-patches/issues/2402)) ([228e8b7](228e8b7d48))
* **syncforreddit/change-oauth-client-id:** use downloads directory ([28abefe](28abefeab0))

### Features

* **syncforreddit/change-oauth-client-id:** support pro version ([7b01617](7b01617cd4))
2023-06-12 22:59:54 +00:00
oSumAtrIX
96add7b8fa chore: merge branch dev to main (#2400) 2023-06-13 00:56:40 +02:00
semantic-release-bot
2ee28e0081 chore(release): 2.177.0-dev.2 [skip ci]
# [2.177.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.177.0-dev.1...v2.177.0-dev.2) (2023-06-12)

### Bug Fixes

* **reddit/hide-ads:** search for correct reference class descriptor ([fa49810](fa49810907))
2023-06-12 22:53:44 +00:00
oSumAtrIX
fa49810907 fix(reddit/hide-ads): search for correct reference class descriptor 2023-06-13 00:51:04 +02:00
oSumAtrIX
2814328bfd chore(syncforreddit/change-oauth-client-id): revert using downloads directory 2023-06-12 23:21:40 +02:00
semantic-release-bot
055bc2e072 chore(release): 2.177.0-dev.1 [skip ci]
# [2.177.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.176.2-dev.2...v2.177.0-dev.1) (2023-06-12)

### Features

* **syncforreddit/change-oauth-client-id:** support pro version ([7b01617](7b01617cd4))
2023-06-12 17:49:26 +00:00
oSumAtrIX
7b01617cd4 feat(syncforreddit/change-oauth-client-id): support pro version 2023-06-12 19:46:25 +02:00
semantic-release-bot
3cec0b59c1 chore(release): 2.176.2-dev.2 [skip ci]
## [2.176.2-dev.2](https://github.com/revanced/revanced-patches/compare/v2.176.2-dev.1...v2.176.2-dev.2) (2023-06-12)

### Bug Fixes

* **syncforreddit/change-oauth-client-id:** trim whitespace from OAuth string ([#2402](https://github.com/revanced/revanced-patches/issues/2402)) ([228e8b7](228e8b7d48))
2023-06-12 04:53:24 +00:00
Palm
228e8b7d48 fix(syncforreddit/change-oauth-client-id): trim whitespace from OAuth string (#2402)
This solves patching errors, when the string includes whitespace
2023-06-12 06:49:33 +02:00
semantic-release-bot
70e893a5d3 chore(release): 2.176.2-dev.1 [skip ci]
## [2.176.2-dev.1](https://github.com/revanced/revanced-patches/compare/v2.176.1...v2.176.2-dev.1) (2023-06-12)

### Bug Fixes

* **syncforreddit/change-oauth-client-id:** use downloads directory ([28abefe](28abefeab0))
2023-06-12 02:40:50 +00:00
oSumAtrIX
28abefeab0 fix(syncforreddit/change-oauth-client-id): use downloads directory
This fixes permission errors on Android
2023-06-12 04:38:07 +02:00
semantic-release-bot
b2c7a6a54f chore(release): 2.176.1 [skip ci]
## [2.176.1](https://github.com/revanced/revanced-patches/compare/v2.176.0...v2.176.1) (2023-06-12)

### Bug Fixes

* **syncforreddit/change-oauth-client-id:** use correct signature for Android API ([3cd52cb](3cd52cbffa))
2023-06-12 02:00:51 +00:00
oSumAtrIX
4570b273a7 chore: merge branch dev to main (#2399) 2023-06-12 03:58:08 +02:00
semantic-release-bot
45d5f708af chore(release): 2.176.1-dev.1 [skip ci]
## [2.176.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.176.0...v2.176.1-dev.1) (2023-06-12)

### Bug Fixes

* **syncforreddit/change-oauth-client-id:** use correct signature for Android API ([3cd52cb](3cd52cbffa))
2023-06-12 01:57:20 +00:00
oSumAtrIX
3cd52cbffa fix(syncforreddit/change-oauth-client-id): use correct signature for Android API 2023-06-12 03:54:21 +02:00
semantic-release-bot
35803524f4 chore(release): 2.176.0 [skip ci]
# [2.176.0](https://github.com/revanced/revanced-patches/compare/v2.175.0...v2.176.0) (2023-06-12)

### Bug Fixes

* **instagram/hide-timeline-ads:** constrain to version `275.0.0.27.98` ([#2377](https://github.com/revanced/revanced-patches/issues/2377)) ([9e3f21f](9e3f21fa0e))
* **songpal:** make patches more resilient ([#2386](https://github.com/revanced/revanced-patches/issues/2386)) ([6a40265](6a40265e9b))
* use correct import ([d17b7c2](d17b7c260a))
* **youtube/hide-get-premium:** shorten descriptions ([59fbe2a](59fbe2a1ef))
* **youtube/theme:** use custom light/dark colors for launch splash screen ([#2337](https://github.com/revanced/revanced-patches/issues/2337)) ([0e03303](0e033038cb))

### Features

* **citra:** remove patches ([#2384](https://github.com/revanced/revanced-patches/issues/2384)) ([b455120](b4551200a3))
* **finanzonline:** support any version ([#2347](https://github.com/revanced/revanced-patches/issues/2347)) ([ab794f7](ab794f74fd))
* **reddit:** add `hide-promoted` patch ([#2350](https://github.com/revanced/revanced-patches/issues/2350)) ([7138447](7138447a1f))
* **songpal:** add `remove-badge-tab` patch ([147827f](147827f9be))
* **songpal:** add `remove-notification-badge` patch ([a2d4869](a2d4869909))
* **syncforreddit/change-oauth-client-id:** improve error message ([c508efd](c508efd0b0))
* **syncforreddit:** add `change-oauth-client-id` patch ([#2393](https://github.com/revanced/revanced-patches/issues/2393)) ([c282abf](c282abf677))
* **youtube/hide-ads:** hide mix playlists ([35fb46b](35fb46b6bc))
* **youtube/swipe-controls:** add option to save and restore brightness ([c6d02f5](c6d02f5928))
2023-06-12 01:47:15 +00:00
oSumAtrIX
b4312c0945 chore: merge branch dev to main (#2335) 2023-06-12 03:43:21 +02:00
semantic-release-bot
6bbe1a1433 chore(release): 2.176.0-dev.7 [skip ci]
# [2.176.0-dev.7](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.6...v2.176.0-dev.7) (2023-06-12)

### Features

* **syncforreddit/change-oauth-client-id:** improve error message ([c508efd](c508efd0b0))
2023-06-12 01:25:29 +00:00
oSumAtrIX
c508efd0b0 feat(syncforreddit/change-oauth-client-id): improve error message 2023-06-12 03:22:23 +02:00
oSumAtrIX
d3d89c9d27 ci: add cache step 2023-06-12 02:55:10 +02:00
semantic-release-bot
9192987b55 chore(release): 2.176.0-dev.6 [skip ci]
# [2.176.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.5...v2.176.0-dev.6) (2023-06-12)

### Features

* **reddit:** add `hide-promoted` patch ([#2350](https://github.com/revanced/revanced-patches/issues/2350)) ([7138447](7138447a1f))
2023-06-12 00:01:26 +00:00
oSumAtrIX
5e3865cb36 ci: remove unnecessary steps 2023-06-12 01:57:58 +02:00
LagradOst
7138447a1f feat(reddit): add hide-promoted patch (#2350)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-06-12 01:57:58 +02:00
semantic-release-bot
f96ce4063b chore(release): 2.176.0-dev.5 [skip ci]
# [2.176.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.4...v2.176.0-dev.5) (2023-06-11)

### Features

* **syncforreddit:** add `change-oauth-client-id` patch ([#2393](https://github.com/revanced/revanced-patches/issues/2393)) ([c282abf](c282abf677))
2023-06-11 23:18:15 +00:00
oSumAtrIX
c282abf677 feat(syncforreddit): add change-oauth-client-id patch (#2393) 2023-06-12 01:15:16 +02:00
semantic-release-bot
7cf1e35fad chore(release): 2.176.0-dev.4 [skip ci]
# [2.176.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.3...v2.176.0-dev.4) (2023-06-11)

### Bug Fixes

* **songpal:** make patches more resilient ([#2386](https://github.com/revanced/revanced-patches/issues/2386)) ([6a40265](6a40265e9b))
2023-06-11 13:55:31 +00:00
fe
6a40265e9b fix(songpal): make patches more resilient (#2386)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-06-11 15:53:33 +02:00
semantic-release-bot
b0a97080cd chore(release): 2.176.0-dev.3 [skip ci]
# [2.176.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.2...v2.176.0-dev.3) (2023-06-10)

### Bug Fixes

* **instagram/hide-timeline-ads:** constrain to version `275.0.0.27.98` ([#2377](https://github.com/revanced/revanced-patches/issues/2377)) ([9e3f21f](9e3f21fa0e))
* use correct import ([d17b7c2](d17b7c260a))
* **youtube/hide-get-premium:** shorten descriptions ([59fbe2a](59fbe2a1ef))

### Features

* **citra:** remove patches ([#2384](https://github.com/revanced/revanced-patches/issues/2384)) ([b455120](b4551200a3))
* **finanzonline:** support any version ([#2347](https://github.com/revanced/revanced-patches/issues/2347)) ([ab794f7](ab794f74fd))
* **songpal:** add `remove-badge-tab` patch ([147827f](147827f9be))
* **songpal:** add `remove-notification-badge` patch ([a2d4869](a2d4869909))
2023-06-10 23:19:03 +00:00
oSumAtrIX
d17b7c260a fix: use correct import 2023-06-11 01:15:10 +02:00
oSumAtrIX
a2d4869909 feat(songpal): add remove-notification-badge patch 2023-06-10 18:41:28 +02:00
Your Name
147827f9be feat(songpal): add remove-badge-tab patch 2023-06-10 18:41:28 +02:00
fe
ab794f74fd feat(finanzonline): support any version (#2347) 2023-06-10 18:05:47 +02:00
Aunali321
b4551200a3 feat(citra): remove patches (#2384)
Citra is an open-source project and is available at https://github.com/citra-emu/citra therefore does not need any patches
2023-06-10 01:15:42 +02:00
Sharun
9e3f21fa0e fix(instagram/hide-timeline-ads): constrain to version 275.0.0.27.98 (#2377) 2023-06-08 09:33:12 +02:00
oSumAtrIX
73d3f3a6ac build(revanced-patcher): bump version 2023-06-07 03:46:58 +02:00
oSumAtrIX
59fbe2a1ef fix(youtube/hide-get-premium): shorten descriptions 2023-06-07 03:46:58 +02:00
semantic-release-bot
6ba64e2124 chore(release): 2.176.0-dev.2 [skip ci]
# [2.176.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.1...v2.176.0-dev.2) (2023-06-07)
2023-06-07 01:05:07 +00:00
LisoUseInAIKyrios
ae40f70785 build(revanced-patcher): bump version (#2324)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2023-06-07 03:02:07 +02:00
179 changed files with 1848 additions and 1082 deletions

View File

@@ -23,23 +23,16 @@ jobs:
# https://github.com/cycjimmy/semantic-release-action#private-packages
persist-credentials: false
fetch-depth: 0
- name: Setup JDK
uses: actions/setup-java@v3
- name: Cache
uses: actions/cache@v3
with:
java-version: '17'
distribution: 'zulu'
cache: gradle
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Setup Android SDK
uses: amyu/setup-android@v2
with:
cache-disabled: false
sdk-version: '33'
build-tools-version: '33.0.1'
path: |
${{ runner.home }}/.gradle/caches
${{ runner.home }}/.gradle/wrapper
.gradle
build
node_modules
key: ${{ runner.os }}-gradle-npm-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'package-lock.json') }}
- name: Build with Gradle
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,3 +1,172 @@
# [2.178.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.3...v2.178.0-dev.4) (2023-06-18)
### Features
* **boostforreddit:** add `change-oauth-client-id` patch ([3dbc4bd](https://github.com/revanced/revanced-patches/commit/3dbc4bd49df1656893ef69c68550a2deb6a92cb7))
# [2.178.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.2...v2.178.0-dev.3) (2023-06-17)
### Bug Fixes
* **youtube/comments:** add missing filter ([#2423](https://github.com/revanced/revanced-patches/issues/2423)) ([cab04b3](https://github.com/revanced/revanced-patches/commit/cab04b3a56cfc5bf00b7c6fcf6f86ab75aa5d4fd))
# [2.178.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.178.0-dev.1...v2.178.0-dev.2) (2023-06-16)
### Bug Fixes
* **googlerecorder/remove-device-restrictions:** add missing app constraint ([#2438](https://github.com/revanced/revanced-patches/issues/2438)) ([d5efe26](https://github.com/revanced/revanced-patches/commit/d5efe26f8959cde75dd3865ec3c2df4b05210e4a))
# [2.178.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.177.1-dev.2...v2.178.0-dev.1) (2023-06-16)
### Features
* **google-recorder:** add `remove-device-restrictions` patch ([ef96ed1](https://github.com/revanced/revanced-patches/commit/ef96ed124e12091dde34124eabd8be9f2bb9280c))
## [2.177.1-dev.2](https://github.com/revanced/revanced-patches/compare/v2.177.1-dev.1...v2.177.1-dev.2) (2023-06-14)
### Bug Fixes
* **youtube:** separate `hide-ads` to `hide-layout-components` patch ([7e0417f](https://github.com/revanced/revanced-patches/commit/7e0417f6728fa7b79a9d8cbcfd3ccba484a5567d))
## [2.177.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.177.0...v2.177.1-dev.1) (2023-06-14)
### Bug Fixes
* don't include all Litho patches, when not included ([fc69491](https://github.com/revanced/revanced-patches/commit/fc69491dfe4b119d46dd3da27b556e55fe0cecfb))
# [2.177.0](https://github.com/revanced/revanced-patches/compare/v2.176.1...v2.177.0) (2023-06-12)
### Bug Fixes
* **reddit/hide-ads:** search for correct reference class descriptor ([ad2a858](https://github.com/revanced/revanced-patches/commit/ad2a8585b2a5ecbc5eb92dd23b0ab124aa8a2541))
* **syncforreddit/change-oauth-client-id:** trim whitespace from OAuth string ([#2402](https://github.com/revanced/revanced-patches/issues/2402)) ([2afea71](https://github.com/revanced/revanced-patches/commit/2afea71557cfe4eb64d7c7ebf5a07dfd24a11824))
* **syncforreddit/change-oauth-client-id:** use downloads directory ([9b5af77](https://github.com/revanced/revanced-patches/commit/9b5af77a229a22466cfe8ed41a21d081beeae960))
### Features
* **syncforreddit/change-oauth-client-id:** support pro version ([d34288b](https://github.com/revanced/revanced-patches/commit/d34288b6e8c7f5bb944622a3c741fcc693868033))
# [2.177.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.177.0-dev.1...v2.177.0-dev.2) (2023-06-12)
### Bug Fixes
* **reddit/hide-ads:** search for correct reference class descriptor ([ad2a858](https://github.com/revanced/revanced-patches/commit/ad2a8585b2a5ecbc5eb92dd23b0ab124aa8a2541))
# [2.177.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.176.2-dev.2...v2.177.0-dev.1) (2023-06-12)
### Features
* **syncforreddit/change-oauth-client-id:** support pro version ([d34288b](https://github.com/revanced/revanced-patches/commit/d34288b6e8c7f5bb944622a3c741fcc693868033))
## [2.176.2-dev.2](https://github.com/revanced/revanced-patches/compare/v2.176.2-dev.1...v2.176.2-dev.2) (2023-06-12)
### Bug Fixes
* **syncforreddit/change-oauth-client-id:** trim whitespace from OAuth string ([#2402](https://github.com/revanced/revanced-patches/issues/2402)) ([2afea71](https://github.com/revanced/revanced-patches/commit/2afea71557cfe4eb64d7c7ebf5a07dfd24a11824))
## [2.176.2-dev.1](https://github.com/revanced/revanced-patches/compare/v2.176.1...v2.176.2-dev.1) (2023-06-12)
### Bug Fixes
* **syncforreddit/change-oauth-client-id:** use downloads directory ([9b5af77](https://github.com/revanced/revanced-patches/commit/9b5af77a229a22466cfe8ed41a21d081beeae960))
## [2.176.1](https://github.com/revanced/revanced-patches/compare/v2.176.0...v2.176.1) (2023-06-12)
### Bug Fixes
* **syncforreddit/change-oauth-client-id:** use correct signature for Android API ([4db2eba](https://github.com/revanced/revanced-patches/commit/4db2eba6d66f094f1d2400bfa8b9c15a175f796e))
## [2.176.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.176.0...v2.176.1-dev.1) (2023-06-12)
### Bug Fixes
* **syncforreddit/change-oauth-client-id:** use correct signature for Android API ([4db2eba](https://github.com/revanced/revanced-patches/commit/4db2eba6d66f094f1d2400bfa8b9c15a175f796e))
# [2.176.0](https://github.com/revanced/revanced-patches/compare/v2.175.0...v2.176.0) (2023-06-12)
### Bug Fixes
* **instagram/hide-timeline-ads:** constrain to version `275.0.0.27.98` ([#2377](https://github.com/revanced/revanced-patches/issues/2377)) ([6ee836c](https://github.com/revanced/revanced-patches/commit/6ee836c587676ba53c2e4748ec1828e193f1c071))
* **songpal:** make patches more resilient ([#2386](https://github.com/revanced/revanced-patches/issues/2386)) ([947bf42](https://github.com/revanced/revanced-patches/commit/947bf42b7c8d029b8a26a5c306869e02a69b62fd))
* use correct import ([9b6e730](https://github.com/revanced/revanced-patches/commit/9b6e730395e56e60cf08372dbbc3a10e92ba8e95))
* **youtube/hide-get-premium:** shorten descriptions ([f5224c4](https://github.com/revanced/revanced-patches/commit/f5224c4980285ef1e29d17887f02b5b397785245))
* **youtube/theme:** use custom light/dark colors for launch splash screen ([#2337](https://github.com/revanced/revanced-patches/issues/2337)) ([8adc05a](https://github.com/revanced/revanced-patches/commit/8adc05a17445dede5f35ee27426d20b750a2a1d3))
### Features
* **citra:** remove patches ([#2384](https://github.com/revanced/revanced-patches/issues/2384)) ([d182329](https://github.com/revanced/revanced-patches/commit/d1823297ce27fc6f3246123c91d9463080afb7ee))
* **finanzonline:** support any version ([#2347](https://github.com/revanced/revanced-patches/issues/2347)) ([cc66b1f](https://github.com/revanced/revanced-patches/commit/cc66b1fc6200bbdcc2697ddd7085d46447775be2))
* **reddit:** add `hide-promoted` patch ([#2350](https://github.com/revanced/revanced-patches/issues/2350)) ([c3fd36c](https://github.com/revanced/revanced-patches/commit/c3fd36cfba7fb8246f8b3a29d9310bd88f01c3e7))
* **songpal:** add `remove-badge-tab` patch ([bde9053](https://github.com/revanced/revanced-patches/commit/bde9053f04e202a7b394a1dad335470d5495e5fc))
* **songpal:** add `remove-notification-badge` patch ([1b77f96](https://github.com/revanced/revanced-patches/commit/1b77f9633cf7e72d653f1d37483b7399e1ad797d))
* **syncforreddit/change-oauth-client-id:** improve error message ([a39b2fd](https://github.com/revanced/revanced-patches/commit/a39b2fd9828b514670135918e69ee736cb4615e5))
* **syncforreddit:** add `change-oauth-client-id` patch ([#2393](https://github.com/revanced/revanced-patches/issues/2393)) ([c93f0c6](https://github.com/revanced/revanced-patches/commit/c93f0c6a99fb2365747371f0f38eff8e0b77aee1))
* **youtube/hide-ads:** hide mix playlists ([dbb38ed](https://github.com/revanced/revanced-patches/commit/dbb38eddfd33db685b8e8be2f2a641a1199e7361))
* **youtube/swipe-controls:** add option to save and restore brightness ([3d03471](https://github.com/revanced/revanced-patches/commit/3d03471b1c2f18d22f17167db78764520064353a))
# [2.176.0-dev.7](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.6...v2.176.0-dev.7) (2023-06-12)
### Features
* **syncforreddit/change-oauth-client-id:** improve error message ([a39b2fd](https://github.com/revanced/revanced-patches/commit/a39b2fd9828b514670135918e69ee736cb4615e5))
# [2.176.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.5...v2.176.0-dev.6) (2023-06-12)
### Features
* **reddit:** add `hide-promoted` patch ([#2350](https://github.com/revanced/revanced-patches/issues/2350)) ([c3fd36c](https://github.com/revanced/revanced-patches/commit/c3fd36cfba7fb8246f8b3a29d9310bd88f01c3e7))
# [2.176.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.4...v2.176.0-dev.5) (2023-06-11)
### Features
* **syncforreddit:** add `change-oauth-client-id` patch ([#2393](https://github.com/revanced/revanced-patches/issues/2393)) ([c93f0c6](https://github.com/revanced/revanced-patches/commit/c93f0c6a99fb2365747371f0f38eff8e0b77aee1))
# [2.176.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.3...v2.176.0-dev.4) (2023-06-11)
### Bug Fixes
* **songpal:** make patches more resilient ([#2386](https://github.com/revanced/revanced-patches/issues/2386)) ([947bf42](https://github.com/revanced/revanced-patches/commit/947bf42b7c8d029b8a26a5c306869e02a69b62fd))
# [2.176.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.2...v2.176.0-dev.3) (2023-06-10)
### Bug Fixes
* **instagram/hide-timeline-ads:** constrain to version `275.0.0.27.98` ([#2377](https://github.com/revanced/revanced-patches/issues/2377)) ([6ee836c](https://github.com/revanced/revanced-patches/commit/6ee836c587676ba53c2e4748ec1828e193f1c071))
* use correct import ([9b6e730](https://github.com/revanced/revanced-patches/commit/9b6e730395e56e60cf08372dbbc3a10e92ba8e95))
* **youtube/hide-get-premium:** shorten descriptions ([f5224c4](https://github.com/revanced/revanced-patches/commit/f5224c4980285ef1e29d17887f02b5b397785245))
### Features
* **citra:** remove patches ([#2384](https://github.com/revanced/revanced-patches/issues/2384)) ([d182329](https://github.com/revanced/revanced-patches/commit/d1823297ce27fc6f3246123c91d9463080afb7ee))
* **finanzonline:** support any version ([#2347](https://github.com/revanced/revanced-patches/issues/2347)) ([cc66b1f](https://github.com/revanced/revanced-patches/commit/cc66b1fc6200bbdcc2697ddd7085d46447775be2))
* **songpal:** add `remove-badge-tab` patch ([bde9053](https://github.com/revanced/revanced-patches/commit/bde9053f04e202a7b394a1dad335470d5495e5fc))
* **songpal:** add `remove-notification-badge` patch ([1b77f96](https://github.com/revanced/revanced-patches/commit/1b77f9633cf7e72d653f1d37483b7399e1ad797d))
# [2.176.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.176.0-dev.1...v2.176.0-dev.2) (2023-06-07)
# [2.176.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.175.0...v2.176.0-dev.1) (2023-06-02)

175
README.md
View File

@@ -25,7 +25,6 @@ The official ReVanced Patches.
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 18.19.35 |
| `hide-ads` | Removes general ads. | 18.19.35 |
| `hide-album-cards` | Hides the album cards below the artist description. | 18.19.35 |
| `hide-artist-card` | Hides the artist card below the searchbar. | 18.19.35 |
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 18.19.35 |
| `hide-breaking-news-shelf` | Hides the breaking news shelf on the homepage tab. | 18.19.35 |
| `hide-captions-button` | Hides the captions button on video player. | 18.19.35 |
@@ -36,6 +35,7 @@ The official ReVanced Patches.
| `hide-filter-bar` | Hides the filter bar in video feeds. | 18.19.35 |
| `hide-floating-microphone-button` | Hides the floating microphone button which appears in search. | 18.19.35 |
| `hide-info-cards` | Hides info cards in videos. | 18.19.35 |
| `hide-layout-components` | Hides general layout components. | 18.19.35 |
| `hide-load-more-button` | Hides the button under videos that loads similar videos. | 18.19.35 |
| `hide-player-buttons` | Adds the option to hide video player previous and next buttons. | 18.19.35 |
| `hide-player-overlay` | Hides the dark background overlay from the player when player controls are visible. | all |
@@ -140,17 +140,6 @@ The official ReVanced Patches.
| `hide-views-stats` | Hides the view stats under tweets. | 9.71.0-release.0 |
</details>
### [📦 `com.reddit.frontpage`](https://play.google.com/store/apps/details?id=com.reddit.frontpage)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `hide-ads` | Removes general ads from the Reddit frontpage and subreddits. | all |
| `hide-subreddit-banner` | Hides banner ads from comments on subreddits. | all |
| `premium-icon-reddit` | Unlocks premium Reddit app icons. | all |
| `sanitize-sharing-links` | Removes (tracking) query parameters from the URLs when sharing links. | all |
</details>
### [📦 `com.facebook.orca`](https://play.google.com/store/apps/details?id=com.facebook.orca)
<details>
@@ -161,6 +150,25 @@ The official ReVanced Patches.
| `hide-inbox-ads` | Hides ads in inbox. | all |
</details>
### [📦 `com.reddit.frontpage`](https://play.google.com/store/apps/details?id=com.reddit.frontpage)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `hide-ads` | Removes ads from the Reddit. | all |
| `premium-icon-reddit` | Unlocks premium Reddit app icons. | all |
| `sanitize-sharing-links` | Removes (tracking) query parameters from the URLs when sharing links. | all |
</details>
### [📦 `com.laurencedawson.reddit_sync`](https://play.google.com/store/apps/details?id=com.laurencedawson.reddit_sync)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `change-oauth-client-id` | Changes the OAuth client ID. | all |
| `disable-ads` | Disables ads. | all |
</details>
### [📦 `com.spotify.music`](https://play.google.com/store/apps/details?id=com.spotify.music)
<details>
@@ -170,13 +178,22 @@ The official ReVanced Patches.
| `spotify-theme` | Applies a custom theme. | all |
</details>
### [📦 `com.sony.songpal.mdr`](https://play.google.com/store/apps/details?id=com.sony.songpal.mdr)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `remove-badge-tab` | Removes the badge tab from the activity tab. | all |
| `remove-notification-badge` | Removes the red notification badge from the activity tab. | all |
</details>
### [📦 `at.gv.bmf.bmf2go`](https://play.google.com/store/apps/details?id=at.gv.bmf.bmf2go)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `remove-bootloader-detection` | Removes the check for an unlocked bootloader. | 2.2.0 |
| `remove-root-detection` | Removes the check for root permissions. | 2.2.0 |
| `remove-bootloader-detection` | Removes the check for an unlocked bootloader. | all |
| `remove-root-detection` | Removes the check for root permissions. | all |
</details>
### [📦 `at.gv.oe.app`](https://play.google.com/store/apps/details?id=at.gv.oe.app)
@@ -188,6 +205,22 @@ The official ReVanced Patches.
| `spoof-signature` | Spoofs the signature of the app. | all |
</details>
### [📦 `com.rubenmayayo.reddit`](https://play.google.com/store/apps/details?id=com.rubenmayayo.reddit)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `change-oauth-client-id` | Changes the OAuth client ID in Boost for Reddit. | all |
</details>
### [📦 `com.laurencedawson.reddit_sync.pro`](https://play.google.com/store/apps/details?id=com.laurencedawson.reddit_sync.pro)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `change-oauth-client-id` | Changes the OAuth client ID. | all |
</details>
### [📦 `com.myprog.hexedit`](https://play.google.com/store/apps/details?id=com.myprog.hexedit)
<details>
@@ -196,14 +229,6 @@ The official ReVanced Patches.
| `disable-ads` | Disables ads in HexEditor. | all |
</details>
### [📦 `com.laurencedawson.reddit_sync`](https://play.google.com/store/apps/details?id=com.laurencedawson.reddit_sync)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `disable-ads` | Disables ads. | all |
</details>
### [📦 `com.spotify.lite`](https://play.google.com/store/apps/details?id=com.spotify.lite)
<details>
@@ -233,23 +258,7 @@ The official ReVanced Patches.
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `hide-timeline-ads` | Removes ads from the timeline. | all |
</details>
### [📦 `org.citra.citra_emu`](https://play.google.com/store/apps/details?id=org.citra.citra_emu)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `premium-unlock` | Unlocks premium functions. | all |
</details>
### [📦 `org.citra.citra_emu.canary`](https://play.google.com/store/apps/details?id=org.citra.citra_emu.canary)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `premium-unlock` | Unlocks premium functions. | all |
| `hide-timeline-ads` | Removes ads from the timeline. | 275.0.0.27.98 |
</details>
### [📦 `com.backdrops.wallpapers`](https://play.google.com/store/apps/details?id=com.backdrops.wallpapers)
@@ -292,6 +301,14 @@ The official ReVanced Patches.
| `remove-debugging-detection` | Removes the USB and wireless debugging checks. | all |
</details>
### [📦 `com.google.android.apps.recorder`](https://play.google.com/store/apps/details?id=com.google.android.apps.recorder)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `remove-device-restrictions` | Removes restrictions from using the app on any device. | all |
</details>
### [📦 `com.dci.dev.androidtwelvewidgets`](https://play.google.com/store/apps/details?id=com.dci.dev.androidtwelvewidgets)
<details>
@@ -324,6 +341,30 @@ The official ReVanced Patches.
| `unlock-prime` | Unlocks Nova Prime and all functions of the app. | all |
</details>
### [📦 `tv.trakt.trakt`](https://play.google.com/store/apps/details?id=tv.trakt.trakt)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks pro features. | all |
</details>
### [📦 `com.zombodroid.MemeGenerator`](https://play.google.com/store/apps/details?id=com.zombodroid.MemeGenerator)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks pro features. | 4.6377 |
</details>
### [📦 `com.ithebk.expensemanager`](https://play.google.com/store/apps/details?id=com.ithebk.expensemanager)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks pro features. | all |
</details>
### [📦 `com.vsco.cam`](https://play.google.com/store/apps/details?id=com.vsco.cam)
<details>
@@ -340,22 +381,6 @@ The official ReVanced Patches.
| `unlock-pro` | Unlocks all pro features. | all |
</details>
### [📦 `com.candylink.openvpn`](https://play.google.com/store/apps/details?id=com.candylink.openvpn)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks premium features. | all |
</details>
### [📦 `com.ithebk.expensemanager`](https://play.google.com/store/apps/details?id=com.ithebk.expensemanager)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks pro features. | all |
</details>
### [📦 `ginlemon.iconpackstudio`](https://play.google.com/store/apps/details?id=ginlemon.iconpackstudio)
<details>
@@ -364,22 +389,6 @@ The official ReVanced Patches.
| `unlock-pro` | Unlocks all pro features. | all |
</details>
### [📦 `com.zombodroid.MemeGenerator`](https://play.google.com/store/apps/details?id=com.zombodroid.MemeGenerator)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks pro features. | 4.6377 |
</details>
### [📦 `co.windyapp.android`](https://play.google.com/store/apps/details?id=co.windyapp.android)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks all pro features. | all |
</details>
### [📦 `org.totschnig.myexpenses`](https://play.google.com/store/apps/details?id=org.totschnig.myexpenses)
<details>
@@ -388,14 +397,6 @@ The official ReVanced Patches.
| `unlock-pro` | Unlocks all professional features. | 3.4.9 |
</details>
### [📦 `tv.trakt.trakt`](https://play.google.com/store/apps/details?id=tv.trakt.trakt)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks pro features. | all |
</details>
### [📦 `com.wakdev.apps.nfctools.se`](https://play.google.com/store/apps/details?id=com.wakdev.apps.nfctools.se)
<details>
@@ -404,6 +405,22 @@ The official ReVanced Patches.
| `unlock-pro` | Unlocks all pro features. | all |
</details>
### [📦 `co.windyapp.android`](https://play.google.com/store/apps/details?id=co.windyapp.android)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks all pro features. | all |
</details>
### [📦 `com.candylink.openvpn`](https://play.google.com/store/apps/details?id=com.candylink.openvpn)
<details>
| 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:|
| `unlock-pro` | Unlocks premium features. | all |
</details>
### [📦 `com.ticktick.task`](https://play.google.com/store/apps/details?id=com.ticktick.task)
<details>

View File

@@ -27,12 +27,16 @@ repositories {
}
dependencies {
implementation("app.revanced:revanced-patcher:9.0.0")
implementation("app.revanced:revanced-patcher:11.0.0")
implementation("app.revanced:multidexlib2:2.5.3-a3836654")
// Required for meta
implementation("com.google.code.gson:gson:2.10.1")
// Required for FlexVer-Java
implementation("com.unascribed:flexver-java:1.0.2")
// A dependency to the Android library unfortunately fails the build,
// which is why this is required for the patch change-oauth-client-id
compileOnly(project("dummy"))
}
kotlin {

9
dummy/build.gradle.kts Normal file
View File

@@ -0,0 +1,9 @@
plugins {
id("java")
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}

View File

@@ -0,0 +1,9 @@
package android.os;
import java.io.File;
public final class Environment {
public static File getExternalStorageDirectory() {
throw new UnsupportedOperationException("Stub");
}
}

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official
version = 2.176.0-dev.1
version = 2.178.0-dev.4

File diff suppressed because one or more lines are too long

View File

@@ -1 +1,3 @@
include("dummy")
rootProject.name = "revanced-patches"

View File

@@ -1,7 +1,7 @@
package app.revanced.extensions
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass

View File

@@ -5,8 +5,8 @@ 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.instruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -28,8 +28,8 @@ class ProUnlockPatch : BytecodePatch(
val registerIndex = result.scanResult.patternScanResult!!.endIndex - 1
result.mutableMethod.apply {
val register = instruction<OneRegisterInstruction>(registerIndex).registerA
addInstructions(
val register = getInstruction<OneRegisterInstruction>(registerIndex).registerA
addInstruction(
result.scanResult.patternScanResult!!.endIndex,
"""
const/4 v$register, 0x1

View File

@@ -5,7 +5,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -22,15 +22,13 @@ class UnlockProPatch : BytecodePatch(
listOf(IsPremiumPurchasedFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
IsPremiumPurchasedFingerprint.result?.let {
it.mutableMethod.addInstructions(
0,
"""
const/4 v0, 0x1
return v0
"""
)
} ?: return IsPremiumPurchasedFingerprint.toErrorResult()
IsPremiumPurchasedFingerprint.result?.mutableMethod?.addInstructions(
0,
"""
const/4 v0, 0x1
return v0
"""
) ?: return IsPremiumPurchasedFingerprint.toErrorResult()
return PatchResultSuccess()
}

View File

@@ -1,7 +0,0 @@
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"), Package("org.citra.citra_emu.canary")])
internal annotation class PremiumUnlockCompatbility

View File

@@ -1,9 +0,0 @@
package app.revanced.patches.citra.misc.premium.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object PremiumUnlockFingerprint : MethodFingerprint(
customFingerprint = { methodDef, _ ->
methodDef.definingClass == "Lorg/citra/citra_emu/ui/main/MainActivity;" && methodDef.name == "isPremiumActive"
}
)

View File

@@ -1,37 +0,0 @@
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()
}
}

View File

@@ -2,12 +2,29 @@ package app.revanced.patches.finanzonline.detection.bootloader.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
// Located @ at.gv.bmf.bmf2go.taxequalization.tools.utils.AttestationHelper#isBootStateOk (3.0.1)
object BootStateFingerprint : MethodFingerprint(
"Z",
accessFlags = AccessFlags.PUBLIC.value,
strings = listOf("Boot state of device: %s"),
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/AttestationHelper;")
}
opcodes = listOf(
Opcode.INVOKE_DIRECT,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CONST_4,
Opcode.NEW_ARRAY,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT,
Opcode.CONST_4,
Opcode.APUT_OBJECT,
Opcode.CONST_STRING,
Opcode.INVOKE_STATIC,
Opcode.SGET_OBJECT,
Opcode.IF_EQ,
Opcode.SGET_OBJECT,
Opcode.IF_NE,
Opcode.GOTO,
Opcode.MOVE,
Opcode.RETURN
)
)

View File

@@ -1,13 +0,0 @@
package app.revanced.patches.finanzonline.detection.bootloader.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
object BootloaderDetectionFingerprint : MethodFingerprint(
"Z",
accessFlags = AccessFlags.PUBLIC.value,
strings = listOf("Creation of attestation key succeeded", "Creation of attestation key failed"),
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/AttestationHelper;")
}
)

View File

@@ -0,0 +1,11 @@
package app.revanced.patches.finanzonline.detection.bootloader.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
// Located @ at.gv.bmf.bmf2go.taxequalization.tools.utils.AttestationHelper#createKey (3.0.1)
object CreateKeyFingerprint : MethodFingerprint(
"Z",
accessFlags = AccessFlags.PUBLIC.value,
strings = listOf("attestation", "SHA-256", "random", "EC", "AndroidKeyStore")
)

View File

@@ -5,13 +5,13 @@ 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.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.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.finanzonline.detection.bootloader.fingerprints.BootStateFingerprint
import app.revanced.patches.finanzonline.detection.bootloader.fingerprints.BootloaderDetectionFingerprint
import app.revanced.patches.finanzonline.detection.bootloader.fingerprints.CreateKeyFingerprint
import app.revanced.patches.finanzonline.detection.shared.annotations.DetectionCompatibility
@@ -21,11 +21,11 @@ import app.revanced.patches.finanzonline.detection.shared.annotations.DetectionC
@DetectionCompatibility
@Version("0.0.1")
class BootloaderDetectionPatch : BytecodePatch(
listOf(BootloaderDetectionFingerprint, BootStateFingerprint)
listOf(CreateKeyFingerprint, BootStateFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
arrayOf(BootloaderDetectionFingerprint, BootStateFingerprint).forEach { fingerprint ->
fingerprint.result?.mutableMethod?.addInstruction(
arrayOf(CreateKeyFingerprint, BootStateFingerprint).forEach { fingerprint ->
fingerprint.result?.mutableMethod?.addInstructions(
0,
"""
const/4 v0, 0x1
@@ -33,6 +33,7 @@ class BootloaderDetectionPatch : BytecodePatch(
"""
) ?: return fingerprint.toErrorResult()
}
return PatchResultSuccess()
}
}

View File

@@ -1,10 +1,22 @@
package app.revanced.patches.finanzonline.detection.root.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
// Located @ at.gv.bmf.bmf2go.taxequalization.tools.utils.RootDetection#isRooted (3.0.1)
object RootDetectionFingerprint : MethodFingerprint(
"L",
customFingerprint = { methodDef, _ ->
methodDef.definingClass == "Lat/gv/bmf/bmf2go/tools/utils/z;"
}
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
parameters = listOf("L"),
opcodes = listOf(
Opcode.NEW_INSTANCE,
Opcode.INVOKE_DIRECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.RETURN_OBJECT
)
)

View File

@@ -5,7 +5,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -29,6 +29,7 @@ class RootDetectionPatch : BytecodePatch(
return-object v0
"""
) ?: return RootDetectionFingerprint.toErrorResult()
return PatchResultSuccess()
}
}

View File

@@ -3,6 +3,6 @@ package app.revanced.patches.finanzonline.detection.shared.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("at.gv.bmf.bmf2go", arrayOf("2.2.0"))])
@Compatibility([Package("at.gv.bmf.bmf2go")])
@Target(AnnotationTarget.CLASS)
internal annotation class DetectionCompatibility

View File

@@ -0,0 +1,12 @@
package app.revanced.patches.googlerecorder.restrictions.fingereprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object OnApplicationCreateFingerprint : MethodFingerprint(
strings = listOf("com.google.android.feature.PIXEL_2017_EXPERIENCE"),
customFingerprint = custom@{ methodDef, classDef ->
if (methodDef.name != "onCreate") return@custom false
classDef.type.endsWith("RecorderApplication;")
}
)

View File

@@ -0,0 +1,45 @@
package app.revanced.patches.googlerecorder.restrictions.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Package
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
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.googlerecorder.restrictions.fingereprints.OnApplicationCreateFingerprint
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch
@Name("remove-device-restrictions")
@Description("Removes restrictions from using the app on any device.")
@Compatibility([Package("com.google.android.apps.recorder")])
@Version("0.0.1")
class RemoveDeviceRestrictions : BytecodePatch(
listOf(OnApplicationCreateFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
OnApplicationCreateFingerprint.result?.let {
val featureStringIndex = it.scanResult.stringsScanResult!!.matches.first().index
it.mutableMethod.apply {
// Remove check for device restrictions.
removeInstructions(featureStringIndex - 2, 5)
val featureAvailableRegister = getInstruction<OneRegisterInstruction>(featureStringIndex).registerA
// Override "isPixelDevice()" to return true.
addInstruction(featureStringIndex, "const/4 v$featureAvailableRegister, 0x1")
}
} ?: return OnApplicationCreateFingerprint.toErrorResult()
return PatchResultSuccess()
}
}

View File

@@ -4,8 +4,8 @@ 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.extensions.InstructionExtensions.removeInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -4,8 +4,7 @@ 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.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -1,8 +1,10 @@
package app.revanced.patches.idaustria.detection.root.patch
import app.revanced.patcher.annotation.*
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.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -19,7 +21,7 @@ class RootDetectionPatch : BytecodePatch(
listOf(RootDetectionFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
RootDetectionFingerprint.result!!.mutableMethod.addInstructions(0, "return-void")
RootDetectionFingerprint.result!!.mutableMethod.addInstruction(0, "return-void")
return PatchResultSuccess()
}
}

View File

@@ -1,8 +1,10 @@
package app.revanced.patches.idaustria.detection.signature.patch
import app.revanced.patcher.annotation.*
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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -3,9 +3,9 @@ package app.revanced.patches.instagram.patches.ads.timeline.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.*
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.instruction
import app.revanced.patcher.extensions.removeInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
@@ -24,7 +24,7 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch
@Name("hide-timeline-ads")
@Description("Removes ads from the timeline.")
@Compatibility([Package("com.instagram.android")])
@Compatibility([Package("com.instagram.android", arrayOf("275.0.0.27.98"))])
@Version("0.0.1")
class HideTimelineAdsPatch : BytecodePatch(
listOf(
@@ -55,8 +55,8 @@ class HideTimelineAdsPatch : BytecodePatch(
val scanStart = scanResult.patternScanResult!!.startIndex
val jumpIndex = scanStart - 1
val mediaInstanceRegister = mutableMethod.instruction<FiveRegisterInstruction>(scanStart).registerC
val freeRegister = mutableMethod.instruction<OneRegisterInstruction>(jumpIndex).registerA
val mediaInstanceRegister = mutableMethod.getInstruction<FiveRegisterInstruction>(scanStart).registerC
val freeRegister = mutableMethod.getInstruction<OneRegisterInstruction>(jumpIndex).registerA
val returnFalseLabel = "an_ad"
@@ -77,14 +77,12 @@ class HideTimelineAdsPatch : BytecodePatch(
val insertIndex = scanStart + 3
mutableMethod.addInstructions(
mutableMethod.addInstructionsWithLabels(
insertIndex,
checkForAdInstructions,
listOf(
ExternalLabel(
returnFalseLabel,
mutableMethod.instruction(mutableMethod.implementation!!.instructions.size - 2 /* return false = ad */)
)
ExternalLabel(
returnFalseLabel,
mutableMethod.getInstruction(mutableMethod.implementation!!.instructions.size - 2 /* return false = ad */)
)
)
@@ -93,10 +91,10 @@ class HideTimelineAdsPatch : BytecodePatch(
// region Jump to checks for ads from previous patch.
mutableMethod.apply {
addInstructions(
addInstructionsWithLabels(
jumpIndex + 1,
"if-nez v$freeRegister, :start_check",
listOf(ExternalLabel("start_check", instruction(insertIndex)))
ExternalLabel("start_check", getInstruction(insertIndex))
)
}.removeInstruction(jumpIndex)

View File

@@ -4,7 +4,7 @@ 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.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -4,7 +4,7 @@ import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.replaceInstructions
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -4,7 +4,7 @@ import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.replaceInstructions
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -5,7 +5,7 @@ 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.replaceInstructions
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -3,7 +3,7 @@ package app.revanced.patches.messenger.ads.inbox.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.*
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -3,8 +3,8 @@ package app.revanced.patches.messenger.inputfield.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.*
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.instruction
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -23,7 +23,7 @@ class DisableSwitchingEmojiToStickerInMessageInputField : BytecodePatch(listOf(S
val setStringIndex = it.scanResult.patternScanResult!!.startIndex + 2
it.mutableMethod.apply {
val targetRegister = instruction<OneRegisterInstruction>(setStringIndex).registerA
val targetRegister = getInstruction<OneRegisterInstruction>(setStringIndex).registerA
replaceInstruction(
setStringIndex,

View File

@@ -7,7 +7,7 @@ import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Package
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -4,7 +4,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -24,10 +24,9 @@ class UnlockProPatch : BytecodePatch(
UnlockProFingerprint.result!!.mutableMethod.addInstructions(
0,
"""
const/4 v0, 0x1
return v0
"""
const/4 v0, 0x1
return v0
"""
)
return PatchResultSuccess()
}

View File

@@ -4,7 +4,7 @@ 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.InstructionExtensions.addInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
@@ -29,8 +29,9 @@ class MusicVideoAdsPatch : BytecodePatch(
val result = ShowMusicVideoAdsFingerprint.result!!
result.mutableMethod.addInstructions(
result.scanResult.patternScanResult!!.startIndex, """
result.mutableMethod.addInstruction(
result.scanResult.patternScanResult!!.startIndex,
"""
const/4 p1, 0x0
"""
)

View File

@@ -4,8 +4,8 @@ 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.addInstruction
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -4,7 +4,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -4,7 +4,7 @@ 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.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -23,10 +23,11 @@ class MinimizedPlaybackPatch : BytecodePatch(
)
) {
override fun execute(context: BytecodeContext): PatchResult {
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstructions(
0, """
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstruction(
0,
"""
return-void
"""
"""
)
return PatchResultSuccess()

View File

@@ -4,8 +4,8 @@ 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.replaceInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
@@ -40,10 +40,11 @@ class HideGetPremiumPatch : BytecodePatch(
val result = HideGetPremiumFingerprint.result!!
val method = result.mutableMethod
method.addInstructions(
startIndex, """
const/16 v0, 0x8
"""
method.addInstruction(
startIndex,
"""
const/16 v0, 0x8
"""
)
return PatchResultSuccess()

View File

@@ -4,7 +4,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -30,7 +30,8 @@ class RemoveTasteBuilderPatch : BytecodePatch(
val insertIndex = result.scanResult.patternScanResult!!.endIndex - 8
val register = (method.implementation!!.instructions[insertIndex] as Instruction22c).registerA
method.addInstructions(
insertIndex, """
insertIndex,
"""
const/16 v1, 0x8
invoke-virtual {v${register}, v1}, Landroid/view/View;->setVisibility(I)V
"""

View File

@@ -4,7 +4,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -5,8 +5,8 @@ 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.addInstruction
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -4,7 +4,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -4,8 +4,7 @@ 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.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -5,7 +5,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -5,7 +5,7 @@ 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.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -43,7 +43,7 @@ class UnlockPrimePatch : BytecodePatch(
const/16 v$primeStatusRegister, $PRIME_STATUS
"""
)
} ?: UnlockPrimeFingerprint.toErrorResult()
} ?: return UnlockPrimeFingerprint.toErrorResult()
return PatchResultSuccess()
}

View File

@@ -4,8 +4,7 @@ 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.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -4,8 +4,8 @@ import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.instruction
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -21,7 +21,7 @@ class SignatureDetectionPatch : BytecodePatch(
) {
override fun execute(context: BytecodeContext): PatchResult {
CheckSignatureFingerprint.result?.apply {
val signatureCheckInstruction = mutableMethod.instruction(scanResult.patternScanResult!!.endIndex)
val signatureCheckInstruction = mutableMethod.getInstruction(scanResult.patternScanResult!!.endIndex)
val checkRegister = (signatureCheckInstruction as OneRegisterInstruction).registerA
mutableMethod.replaceInstruction(signatureCheckInstruction.location.index, "const/4 v$checkRegister, 0x1")

View File

@@ -5,7 +5,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -31,9 +31,9 @@ class UnlockPlusPatch : BytecodePatch(
addInstructions(
0,
"""
const/4 v0, 0x1
return v0
"""
const/4 v0, 0x1
return v0
"""
)
} ?: return IsPlusUnlockedFingerprint.toErrorResult()

View File

@@ -1,12 +0,0 @@
package app.revanced.patches.reddit.ad.banner.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.reddit.frontpage"
)]
)
@Target(AnnotationTarget.CLASS)
internal annotation class HideBannerCompatibility

View File

@@ -7,17 +7,12 @@ 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 app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.reddit.ad.banner.annotations.HideBannerCompatibility
@Patch
@Name("hide-subreddit-banner")
@Description("Hides banner ads from comments on subreddits.")
@HideBannerCompatibility
@Version("0.0.1")
class HideBannerPatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult {
context.xmlEditor[RESOURCE_FILE_PATH].use {
it.file.getElementsByTagName("merge").item(0).childNodes.apply {
val attributes = arrayOf("height", "width")

View File

@@ -0,0 +1,14 @@
package app.revanced.patches.reddit.ad.comments.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object HideCommentAdsFingerprint : MethodFingerprint(
strings = listOf(
"link",
// CommentPageRepository is not returning a link object
"is not returning a link object"
),
customFingerprint = { _, classDef ->
classDef.sourceFile == "PostDetailPresenter.kt"
},
)

View File

@@ -0,0 +1,34 @@
package app.revanced.patches.reddit.ad.comments.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.InstructionExtensions.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.RequiresIntegrations
import app.revanced.patches.reddit.ad.comments.fingerprints.HideCommentAdsFingerprint
@Name("hide-comment-ads")
@Description("Removes all comment ads.")
@RequiresIntegrations
@Version("0.0.1")
class HideCommentAdsPatch : BytecodePatch(
listOf(HideCommentAdsFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
val method = HideCommentAdsFingerprint.result!!.mutableMethod
// Returns a blank object instead of the comment ad.
method.addInstructions(
0,
"""
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
return-object v0
"""
)
return PatchResultSuccess()
}
}

View File

@@ -3,10 +3,6 @@ package app.revanced.patches.reddit.ad.general.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility(
[Package(
"com.reddit.frontpage"
)]
)
@Compatibility([Package("com.reddit.frontpage")])
@Target(AnnotationTarget.CLASS)
internal annotation class HideAdsCompatibility

View File

@@ -0,0 +1,10 @@
package app.revanced.patches.reddit.ad.general.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object AdPostFingerprint : MethodFingerprint(
"V",
// "children" are present throughout multiple versions
strings = listOf("children"),
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("Listing;") },
)

View File

@@ -0,0 +1,10 @@
package app.revanced.patches.reddit.ad.general.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.Opcode
object NewAdPostFingerprint : MethodFingerprint(
opcodes = listOf(Opcode.INVOKE_VIRTUAL),
strings = listOf("chain", "feedElement"),
customFingerprint = { _, classDef -> classDef.sourceFile == "AdElementConverter.kt" },
)

View File

@@ -4,51 +4,89 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.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.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.annotations.RequiresIntegrations
import app.revanced.patches.reddit.ad.banner.patch.HideBannerPatch
import app.revanced.patches.reddit.ad.comments.patch.HideCommentAdsPatch
import app.revanced.patches.reddit.ad.general.annotations.HideAdsCompatibility
import app.revanced.patches.reddit.ad.general.fingerprints.AdPostFingerprint
import app.revanced.patches.reddit.ad.general.fingerprints.NewAdPostFingerprint
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.builder.instruction.BuilderInstruction21c
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.StringReference
import org.jf.dexlib2.immutable.reference.ImmutableStringReference
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
import org.jf.dexlib2.iface.reference.FieldReference
import org.jf.dexlib2.iface.reference.MethodReference
@Patch
@Name("hide-ads")
@Description("Removes general ads from the Reddit frontpage and subreddits.")
@Description("Removes ads from the Reddit.")
@DependsOn([HideBannerPatch::class, HideCommentAdsPatch::class])
@HideAdsCompatibility
@Version("0.0.1")
class HideAdsPatch : BytecodePatch() {
@RequiresIntegrations
@Version("0.0.2")
class HideAdsPatch : BytecodePatch(
listOf(AdPostFingerprint, NewAdPostFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
context.classes.forEach { classDef ->
classDef.methods.forEach methodLoop@{ method ->
val implementation = method.implementation ?: return@methodLoop
// region Filter promoted ads (does not work in popular or latest feed)
implementation.instructions.forEachIndexed { i, instruction ->
if (instruction.opcode != Opcode.CONST_STRING) return@forEachIndexed
if (((instruction as ReferenceInstruction).reference as StringReference).string != "AdPost") return@forEachIndexed
AdPostFingerprint.result?.mutableMethod?.apply {
val setPostsListChildren = implementation!!.instructions.first { instruction ->
if (instruction.opcode != Opcode.IPUT_OBJECT) return@first false
val proxiedClass = context.proxy(classDef).mutableClass
val proxiedImplementation = proxiedClass.methods.first {
it.name == method.name && it.parameterTypes.containsAll(method.parameterTypes)
}.implementation!!
var newString = "AdPost1"
if (proxiedImplementation.instructions[i - 1].opcode == Opcode.CONST_STRING) {
newString = "SubredditPost"
}
proxiedImplementation.replaceInstruction(
i, BuilderInstruction21c(
Opcode.CONST_STRING, (proxiedImplementation.instructions[i] as BuilderInstruction21c).registerA, ImmutableStringReference(newString)
)
)
}
val reference = (instruction as ReferenceInstruction).reference as FieldReference
reference.name == "children"
}
val castedInstruction = setPostsListChildren as Instruction22c
val itemsRegister = castedInstruction.registerA
val listInstanceRegister = castedInstruction.registerB
// postsList.children = filterChildren(postListItems)
removeInstruction(setPostsListChildren.location.index)
addInstructions(
setPostsListChildren.location.index,
"""
invoke-static {v$itemsRegister}, $FILTER_METHOD_DESCRIPTOR
move-result-object v0
iput-object v0, v$listInstanceRegister, ${castedInstruction.reference}
"""
)
}
// endregion
// region Remove ads from popular and latest feed
NewAdPostFingerprint.result?.let { result ->
// The new feeds work by inserting posts into lists.
// AdElementConverter is conveniently responsible for inserting all feed ads.
// By removing the appending instruction no ad posts gets appended to the feed.
val index = result.method.implementation!!.instructions.indexOfFirst {
if (it.opcode != Opcode.INVOKE_VIRTUAL) return@indexOfFirst false
val reference = (it as ReferenceInstruction).reference as MethodReference
reference.name == "add" && reference.definingClass == "Ljava/util/ArrayList;"
}
result.mutableMethod.removeInstruction(index)
}
// endregion
return PatchResultSuccess()
}
private companion object {
private const val FILTER_METHOD_DESCRIPTOR =
"Lapp/revanced/reddit/patches/FilterPromotedLinksPatch;" +
"->filterChildren(Ljava/lang/Iterable;)Ljava/util/List;"
}
}

View File

@@ -0,0 +1,57 @@
package app.revanced.patches.reddit.customclients
import android.os.Environment
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.patch.*
import app.revanced.patches.reddit.customclients.boostforreddit.api.patch.ChangeOAuthClientIdPatch
import app.revanced.patches.reddit.customclients.syncforreddit.api.patch.ChangeOAuthClientIdPatch.Companion.clientId
import java.io.File
abstract class AbstractChangeOAuthClientIdPatch(
private val redirectUri: String,
private val fingerprint: MethodFingerprint,
) : BytecodePatch(listOf(fingerprint)) {
override fun execute(context: BytecodeContext): PatchResult {
if (ChangeOAuthClientIdPatch.clientId == null) {
// Test if on Android
try {
Class.forName("android.os.Environment")
} catch (e: ClassNotFoundException) {
return PatchResultError("No client ID provided")
}
File(Environment.getExternalStorageDirectory(), "reddit_client_id_revanced.txt").also {
if (it.exists()) return@also
val error = """
In order to use this patch, you need to provide a client ID.
You can do this by creating a file at ${it.absolutePath} with the client ID as its content.
Alternatively, you can provide the client ID using patch options.
You can get your client ID from https://www.reddit.com/prefs/apps.
The application type has to be "installed app" and the redirect URI has to be set to "$redirectUri"
""".trimIndent()
return PatchResultError(error)
}.let { clientId = it.readText().trim() }
}
return fingerprint.patch(context)
}
abstract fun MethodFingerprint.patch(context: BytecodeContext): PatchResult
companion object Options {
open class ChangeOAuthClientIdOptionsContainer : OptionsContainer() {
var clientId by option(
PatchOption.StringOption(
"client-id",
null,
"OAuth client ID",
"The Reddit OAuth client ID."
)
)
}
}
}

View File

@@ -0,0 +1,11 @@
package app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object GetClientIdFingerprint : MethodFingerprint(
customFingerprint = custom@{ methodDef, classDef ->
if (!classDef.type.endsWith("Credentials;")) return@custom false
methodDef.name == "getClientId"
}
)

View File

@@ -0,0 +1,36 @@
package app.revanced.patches.reddit.customclients.boostforreddit.api.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.*
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch
import app.revanced.patches.reddit.customclients.boostforreddit.api.fingerprints.GetClientIdFingerprint
@Patch
@Name("change-oauth-client-id")
@Description("Changes the OAuth client ID in Boost for Reddit.")
@Compatibility([Package("com.rubenmayayo.reddit")])
@Version("0.0.1")
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
"http://rubenmayayo.com",
GetClientIdFingerprint
) {
override fun MethodFingerprint.patch(context: BytecodeContext): PatchResult {
result?.mutableMethod?.addInstructions(
0,
"""
const-string v0, "$clientId"
return-object v0
"""
) ?: return toErrorResult()
return PatchResultSuccess()
}
companion object : Options.ChangeOAuthClientIdOptionsContainer()
}

View File

@@ -1,4 +1,4 @@
package app.revanced.patches.syncforreddit.ads.fingerprints
package app.revanced.patches.reddit.customclients.syncforreddit.ads.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint

View File

@@ -1,26 +1,23 @@
package app.revanced.patches.syncforreddit.ads.patch
package app.revanced.patches.reddit.customclients.syncforreddit.ads.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.annotation.*
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.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.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.syncforreddit.ads.annotations.DisableAdsCompatibility
import app.revanced.patches.syncforreddit.ads.fingerprints.IsAdsEnabledFingerprint
import app.revanced.patches.syncforreddit.detection.piracy.patch.DisablePiracyDetectionPatch
import app.revanced.patches.reddit.customclients.syncforreddit.ads.fingerprints.IsAdsEnabledFingerprint
import app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.patch.DisablePiracyDetectionPatch
@Patch
@Name("disable-ads")
@DependsOn([DisablePiracyDetectionPatch::class])
@Description("Disables ads.")
@Compatibility([Package("com.laurencedawson.reddit_sync")])
@Version("0.0.1")
@DisableAdsCompatibility
class DisableAdsPatch : BytecodePatch(listOf(IsAdsEnabledFingerprint)) {
override fun execute(context: BytecodeContext): PatchResult {
IsAdsEnabledFingerprint.result?.mutableMethod?.apply {

View File

@@ -0,0 +1,7 @@
package app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object GetAuthorizationStringFingerprint : MethodFingerprint(
strings = listOf("authorize.compact?client_id")
)

View File

@@ -0,0 +1,7 @@
package app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
object GetBearerTokenFingerprint : MethodFingerprint(
strings = listOf("Basic")
)

View File

@@ -0,0 +1,68 @@
package app.revanced.patches.reddit.customclients.syncforreddit.api.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.*
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.reddit.customclients.AbstractChangeOAuthClientIdPatch
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.GetAuthorizationStringFingerprint
import app.revanced.patches.reddit.customclients.syncforreddit.api.fingerprints.GetBearerTokenFingerprint
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.StringReference
import java.util.*
@Patch
@Name("change-oauth-client-id")
@Description("Changes the OAuth client ID.")
@Compatibility([Package("com.laurencedawson.reddit_sync"), Package("com.laurencedawson.reddit_sync.pro")])
@Version("0.0.1")
class ChangeOAuthClientIdPatch : AbstractChangeOAuthClientIdPatch(
"http://redditsync/auth",
GetAuthorizationStringFingerprint,
) {
override fun MethodFingerprint.patch(context: BytecodeContext): PatchResult {
result?.also { result ->
GetBearerTokenFingerprint.also { it.resolve(context, result.classDef) }.result?.mutableMethod?.apply {
val auth = Base64.getEncoder().encodeToString("$clientId:".toByteArray(Charsets.UTF_8))
addInstructions(
0,
"""
const-string v0, "Basic $auth"
return-object v0
"""
)
} ?: return GetBearerTokenFingerprint.toErrorResult()
}?.let {
val occurrenceIndex = it.scanResult.stringsScanResult!!.matches.first().index
it.mutableMethod.apply {
val authorizationStringInstruction = getInstruction<ReferenceInstruction>(occurrenceIndex)
val targetRegister = (authorizationStringInstruction as OneRegisterInstruction).registerA
val reference = authorizationStringInstruction.reference as StringReference
val newAuthorizationUrl = reference.string.replace(
"client_id=.*?&".toRegex(),
"client_id=${clientId!!}&"
)
replaceInstruction(
occurrenceIndex,
"const-string v$targetRegister, \"$newAuthorizationUrl\""
)
}
} ?: return toErrorResult()
return PatchResultSuccess()
}
companion object : Options.ChangeOAuthClientIdOptionsContainer()
}

View File

@@ -1,10 +1,10 @@
package app.revanced.patches.syncforreddit.detection.piracy.patch
package app.revanced.patches.reddit.customclients.syncforreddit.detection.piracy.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -15,11 +15,11 @@ import app.revanced.patches.syncforreddit.detection.piracy.fingerprints.PiracyDe
class DisablePiracyDetectionPatch : BytecodePatch(listOf(PiracyDetectionFingerprint)) {
override fun execute(context: BytecodeContext): PatchResult {
PiracyDetectionFingerprint.result?.mutableMethod?.apply {
addInstructions(
addInstruction(
0,
"""
return-void
"""
return-void
"""
)
} ?: return PiracyDetectionFingerprint.toErrorResult()

View File

@@ -4,7 +4,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -5,8 +5,8 @@ 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.instruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -29,7 +29,7 @@ class SanitizeUrlQueryPatch : BytecodePatch(
ShareLinkFactoryFingerprint.result?.let { result ->
result.mutableMethod.apply {
val insertIndex = result.scanResult.patternScanResult!!.endIndex + 1
val urlRegister = instruction<OneRegisterInstruction>(insertIndex - 1).registerA
val urlRegister = getInstruction<OneRegisterInstruction>(insertIndex - 1).registerA
addInstructions(
insertIndex,

View File

@@ -1,8 +1,10 @@
package app.revanced.patches.scbeasy.detection.debugging.patch
import app.revanced.patcher.annotation.*
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.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -19,7 +21,7 @@ class RemoveDebuggingDetectionPatch : BytecodePatch(
listOf(DebuggingDetectionFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
DebuggingDetectionFingerprint.result!!.mutableMethod.addInstructions(
DebuggingDetectionFingerprint.result!!.mutableMethod.addInstructionsWithLabels(
0,
"""
const/4 v0, 0x0

View File

@@ -3,7 +3,7 @@ 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.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult

View File

@@ -4,8 +4,8 @@ import app.revanced.extensions.toErrorResult
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.extensions.instruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -23,7 +23,7 @@ class VerticalScrollPatch : BytecodePatch(
CanScrollVerticallyFingerprint.result?.let {
it.mutableMethod.apply {
val moveResultIndex = it.scanResult.patternScanResult!!.endIndex
val moveResultRegister = instruction<OneRegisterInstruction>(moveResultIndex).registerA
val moveResultRegister = getInstruction<OneRegisterInstruction>(moveResultIndex).registerA
val insertIndex = moveResultIndex + 1
addInstruction(

View File

@@ -0,0 +1,8 @@
package app.revanced.patches.songpal.badge.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("com.sony.songpal.mdr")])
@Target(AnnotationTarget.CLASS)
internal annotation class BadgeCompatibility

View File

@@ -0,0 +1,26 @@
package app.revanced.patches.songpal.badge.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.songpal.badge.patch.BadgeTabPatch
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.MethodReference
// Located @ ub.i0.h#p (9.5.0)
object CreateTabsFingerprint : MethodFingerprint(
"Ljava/util/List",
accessFlags = AccessFlags.PRIVATE.value,
customFingerprint = { methodDef, _ ->
methodDef.implementation?.instructions?.any { instruction ->
if (instruction.opcode != Opcode.INVOKE_STATIC) return@any false
val reference = (instruction as ReferenceInstruction).reference as MethodReference
if (reference.parameterTypes.isNotEmpty()) return@any false
if (reference.definingClass != BadgeTabPatch.ACTIVITY_TAB_DESCRIPTOR) return@any false
if (reference.returnType != "[${BadgeTabPatch.ACTIVITY_TAB_DESCRIPTOR}") return@any false
true
} ?: false
}
)

View File

@@ -0,0 +1,37 @@
package app.revanced.patches.songpal.badge.fingerprints
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.songpal.badge.fingerprints.ShowNotificationFingerprint.expectedReference
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
import org.jf.dexlib2.iface.reference.MethodReference
import org.jf.dexlib2.immutable.reference.ImmutableMethodReference
// Located @ com.sony.songpal.mdr.vim.activity.MdrRemoteBaseActivity.e#run (9.5.0)
object ShowNotificationFingerprint : MethodFingerprint(
"V",
accessFlags = AccessFlags.PUBLIC.value,
customFingerprint = custom@{ methodDef, _ ->
methodDef.implementation?.instructions?.any { instruction ->
if (instruction.opcode != Opcode.INVOKE_VIRTUAL) return@any false
with(expectedReference) {
val currentReference = (instruction as ReferenceInstruction).reference as MethodReference
currentReference.let {
if (it.definingClass != definingClass) return@any false
if (it.parameterTypes != parameterTypes) return@any false
if (it.returnType != returnType) return@any false
}
}
true
} ?: false
}
) {
val expectedReference = ImmutableMethodReference(
"Lcom/google/android/material/bottomnavigation/BottomNavigationView;",
"getOrCreateBadge", // Non-obfuscated placeholder method name.
listOf("I"),
"Lcom/google/android/material/badge/BadgeDrawable;",
)
}

View File

@@ -0,0 +1,66 @@
package app.revanced.patches.songpal.badge.patch
import app.revanced.extensions.toErrorResult
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.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
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.songpal.badge.annotations.BadgeCompatibility
import app.revanced.patches.songpal.badge.fingerprints.CreateTabsFingerprint
@Patch
@Name("remove-badge-tab")
@Description("Removes the badge tab from the activity tab.")
@BadgeCompatibility
@Version("0.0.1")
class BadgeTabPatch : BytecodePatch(
listOf(CreateTabsFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
CreateTabsFingerprint.result?.mutableMethod?.apply {
removeInstructions(0, 2)
val arrayRegister = 0
val indexRegister = 1
val arrayItemRegister = 2
// First insert the array of tabs...
arrayTabs.withIndex().forEach { (index, tab) ->
addInstructions(
0,
"""
const/4 v$indexRegister, $index
sget-object v$arrayItemRegister, $ACTIVITY_TAB_DESCRIPTOR->$tab:$ACTIVITY_TAB_DESCRIPTOR
aput-object v$arrayItemRegister, v$arrayRegister, v$indexRegister
"""
)
}
// Then add the instructions to initialize the array.
// This is done so that the order of instructions is correct.
addInstructions(
0,
"""
const/4 v$arrayRegister, ${arrayTabs.size}
new-array v$arrayRegister, v$arrayRegister, [$ACTIVITY_TAB_DESCRIPTOR
"""
)
} ?: return CreateTabsFingerprint.toErrorResult()
return PatchResultSuccess()
}
companion object {
const val ACTIVITY_TAB_DESCRIPTOR = "Ljp/co/sony/vim/framework/ui/yourheadphones/YhContract\$Tab;"
val arrayTabs = listOf("Log", "HealthCare")
}
}

View File

@@ -0,0 +1,31 @@
package app.revanced.patches.songpal.badge.patch
import app.revanced.extensions.toErrorResult
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.InstructionExtensions.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.songpal.badge.annotations.BadgeCompatibility
import app.revanced.patches.songpal.badge.fingerprints.ShowNotificationFingerprint
@Patch
@Name("remove-notification-badge")
@Description("Removes the red notification badge from the activity tab.")
@BadgeCompatibility
@Version("0.0.1")
class RemoveNotificationBadgePatch : BytecodePatch(
listOf(ShowNotificationFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
ShowNotificationFingerprint.result?.mutableMethod?.apply {
addInstructions(0, "return-void")
} ?: return ShowNotificationFingerprint.toErrorResult()
return PatchResultSuccess()
}
}

View File

@@ -5,7 +5,7 @@ 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.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -4,7 +4,7 @@ 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.InstructionExtensions.removeInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult

View File

@@ -1,8 +0,0 @@
package app.revanced.patches.syncforreddit.ads.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("com.laurencedawson.reddit_sync")])
@Target(AnnotationTarget.CLASS)
internal annotation class DisableAdsCompatibility

View File

@@ -5,7 +5,7 @@ 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.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch

View File

@@ -4,8 +4,8 @@ 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.removeInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -4,7 +4,7 @@ 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.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError

View File

@@ -4,7 +4,7 @@ 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.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -5,10 +5,11 @@ import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.data.toMethodWalker
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.extensions.replaceInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
@@ -63,7 +64,7 @@ class DownloadsPatch : BytecodePatch(
)
//Download videos without watermark.
val method3 = ACLCommonShareFingerprint3.result!!.mutableMethod
method3.addInstructions(
method3.addInstructionsWithLabels(
0,
"""
invoke-static {}, Lapp/revanced/tiktok/download/DownloadsPatch;->shouldRemoveWatermark()Z

View File

@@ -5,7 +5,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.data.toMethodWalker
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -4,7 +4,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -4,7 +4,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess

View File

@@ -5,9 +5,9 @@ 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.instruction
import app.revanced.patcher.extensions.replaceInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
@@ -45,7 +45,7 @@ class SettingsPatch : BytecodePatch(
// Find the indices that need to be patched.
val copyrightPolicyLabelId = AboutPageFingerprint.result?.let {
val startIndex = it.scanResult.patternScanResult!!.startIndex
it.mutableMethod.instruction<WideLiteralInstruction>(startIndex).wideLiteral
it.mutableMethod.getInstruction<WideLiteralInstruction>(startIndex).wideLiteral
} ?: return AboutPageFingerprint.toErrorResult()
val copyrightIndex = instructions.indexOfFirst {
@@ -62,7 +62,7 @@ class SettingsPatch : BytecodePatch(
copyrightIndex,
copyrightPolicyIndex
).forEach { index ->
val instruction = instruction(index)
val instruction = getInstruction(index)
if (instruction.opcode != Opcode.MOVE_RESULT_OBJECT)
return PatchResultError("Hardcoded offset changed.")
@@ -77,7 +77,7 @@ class SettingsPatch : BytecodePatch(
)
// Replace the OnClickListener class with a custom one.
val onClickListener = instruction<ReferenceInstruction>(index + 4).reference.toString()
val onClickListener = getInstruction<ReferenceInstruction>(index + 4).reference.toString()
context.findClass(onClickListener)?.mutableClass?.methods?.first {
it.name == "onClick"
@@ -98,7 +98,7 @@ class SettingsPatch : BytecodePatch(
it.opcode == Opcode.INVOKE_SUPER
} + 1
val thisRegister = instruction<FiveRegisterInstruction>(initializeSettingsIndex - 1).registerC
val thisRegister = getInstruction<FiveRegisterInstruction>(initializeSettingsIndex - 1).registerC
addInstructions(
initializeSettingsIndex,

View File

@@ -5,9 +5,9 @@ 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.addInstruction
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.instruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -97,14 +97,14 @@ class SpoofSimPatch : BytecodePatch() {
// Patch Android API and return fake sim information
private fun MutableMethod.replaceReference(index: Int, replacement: String) {
val resultReg = instruction<OneRegisterInstruction>(index + 1).registerA
val resultReg = getInstruction<OneRegisterInstruction>(index + 1).registerA
addInstructions(
index + 2,
"""
invoke-static {v$resultReg}, Lapp/revanced/tiktok/spoof/sim/SpoofSimPatch;->$replacement(Ljava/lang/String;)Ljava/lang/String;
move-result-object v$resultReg
"""
"""
invoke-static {v$resultReg}, Lapp/revanced/tiktok/spoof/sim/SpoofSimPatch;->$replacement(Ljava/lang/String;)Ljava/lang/String;
move-result-object v$resultReg
"""
)
}
}

View File

@@ -5,7 +5,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult

View File

@@ -3,8 +3,8 @@ package app.revanced.patches.twelvewidgets.unlock.patch
import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.*
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.removeInstructions
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -40,11 +40,12 @@ class UnlockPaidWidgetsPatch : BytecodePatch(
method.apply {
removeInstructions(4, 3)
addInstructions(
implementation?.instructions?.size!!, """
const/4 v1, 0x0
invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V
return-object v0
"""
implementation?.instructions?.size!!,
"""
const/4 v1, 0x0
invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V
return-object v0
"""
)
}
}

View File

@@ -4,8 +4,8 @@ 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.instruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
@@ -31,7 +31,7 @@ class AudioAdsPatch : BytecodePatch(
override fun execute(context: BytecodeContext): PatchResult {
// Block playAds call
with(AudioAdsPresenterPlayFingerprint.result!!) {
mutableMethod.addInstructions(
mutableMethod.addInstructionsWithLabels(
0,
"""
invoke-static { }, Lapp/revanced/twitch/patches/AudioAdsPatch;->shouldBlockAudioAds()Z
@@ -39,7 +39,7 @@ class AudioAdsPatch : BytecodePatch(
if-eqz v0, :show_audio_ads
return-void
""",
listOf(ExternalLabel("show_audio_ads", mutableMethod.instruction(0)))
ExternalLabel("show_audio_ads", mutableMethod.getInstruction(0))
)
}

View File

@@ -5,7 +5,7 @@ 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.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError

View File

@@ -1,8 +1,8 @@
package app.revanced.patches.twitch.ad.shared.util
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.instruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.util.smali.ExternalLabel
@@ -27,7 +27,7 @@ abstract class AbstractAdPatch(
this ?: return false
this.methods.filter { methodNames.contains(it.name) }.forEach {
val retIntructions = when(returnMethod.returnType) {
val retInstruction = when (returnMethod.returnType) {
'V' -> "return-void"
'Z' -> """
const/4 v0, ${returnMethod.value}
@@ -35,13 +35,13 @@ abstract class AbstractAdPatch(
"""
else -> throw NotImplementedError()
}
it.addInstructions(
it.addInstructionsWithLabels(
0,
"""
${createConditionInstructions("v0")}
$retIntructions
$retInstruction
""",
listOf(ExternalLabel(skipLabelName, it.instruction(0)))
ExternalLabel(skipLabelName, it.getInstruction(0))
)
}
true

Some files were not shown because too many files have changed in this diff Show More