mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-09 10:53:55 +01:00
Compare commits
3 Commits
v2.157.0-d
...
v2.6.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3de6790e9f | ||
|
|
c95c241887 | ||
|
|
0f05fbfad9 |
73
.github/ISSUE_TEMPLATE/bug-issue.yml
vendored
73
.github/ISSUE_TEMPLATE/bug-issue.yml
vendored
@@ -1,73 +0,0 @@
|
|||||||
name: 🐞 Bug report
|
|
||||||
description: Report a very clearly broken issue.
|
|
||||||
title: 'bug: <title>'
|
|
||||||
labels: [bug]
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
# ReVanced bug report
|
|
||||||
|
|
||||||
Important to note that your issue may have already been reported before. Please check for existing issues [here](https://github.com/revanced/revanced-patches/labels/bug).
|
|
||||||
|
|
||||||
- type: dropdown
|
|
||||||
attributes:
|
|
||||||
label: Type
|
|
||||||
options:
|
|
||||||
- Error while patching
|
|
||||||
- Error at runtime
|
|
||||||
- Cosmetic
|
|
||||||
- Other
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Bug description
|
|
||||||
description: How did you find the bug? Any additional details that might help?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Steps to reproduce
|
|
||||||
description: Add the steps to reproduce this bug including your environment.
|
|
||||||
placeholder: Step 1. Download some files. Step 2. ...
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Relevant log output
|
|
||||||
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. Capture crash logs by running `logcat | grep AndroidRuntime`.
|
|
||||||
render: shell
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Screenshots or videos
|
|
||||||
description: Add screenshots or videos that show the bug here.
|
|
||||||
placeholder: Drag and drop the screenshots/videos into this box.
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Solution
|
|
||||||
description: If applicable, add a possible solution.
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Additional context
|
|
||||||
description: Add additional context here.
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: checkboxes
|
|
||||||
id: acknowledgements
|
|
||||||
attributes:
|
|
||||||
label: Acknowledgements
|
|
||||||
description: Your issue will be closed if you haven't done these steps.
|
|
||||||
options:
|
|
||||||
- label: I have searched the existing issues and this is a new and no duplicate or related to another open issue.
|
|
||||||
required: true
|
|
||||||
- label: I have written a short but informative title.
|
|
||||||
required: true
|
|
||||||
- label: I filled out all of the requested information in this issue properly.
|
|
||||||
required: true
|
|
||||||
8
.github/ISSUE_TEMPLATE/config.yml
vendored
8
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,8 +0,0 @@
|
|||||||
blank_issues_enabled: false
|
|
||||||
contact_links:
|
|
||||||
- name: 📃 Documentation
|
|
||||||
url: https://github.com/revanced/revanced-documentation/
|
|
||||||
about: Don't know how or where to start? Check out our documentation!
|
|
||||||
- name: 🗨 Discussions
|
|
||||||
url: https://github.com/revanced/revanced-suggestions/discussions
|
|
||||||
about: Got something you think should change or be added? Search for or start a new discussion!
|
|
||||||
41
.github/ISSUE_TEMPLATE/patch-request.yml
vendored
41
.github/ISSUE_TEMPLATE/patch-request.yml
vendored
@@ -1,41 +0,0 @@
|
|||||||
name: ⭐ Patch Request
|
|
||||||
description: Create a detailed patch request.
|
|
||||||
title: 'feat(patch): '
|
|
||||||
labels: [patch-request]
|
|
||||||
body:
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Application
|
|
||||||
description: Which application is this patch for?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Issue
|
|
||||||
description: What is the issue this patch should solve?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Patch
|
|
||||||
description: "Describe the patch you'd like to see in detail."
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Motivation
|
|
||||||
description: Why should your patch request should be considered? What makes it valuable to the community?
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: checkboxes
|
|
||||||
id: acknowledgements
|
|
||||||
attributes:
|
|
||||||
label: Acknowledgements
|
|
||||||
description: Your issue will be closed if you haven't done these steps.
|
|
||||||
options:
|
|
||||||
- label: I have searched the existing issues and this is a new and no duplicate or related to another open issue.
|
|
||||||
required: true
|
|
||||||
- label: I have written a short but informative title.
|
|
||||||
required: true
|
|
||||||
- label: I filled out all of the requested information in this issue properly.
|
|
||||||
required: true
|
|
||||||
25
.github/workflows/pull_request.yml
vendored
25
.github/workflows/pull_request.yml
vendored
@@ -1,25 +0,0 @@
|
|||||||
name: PR to main
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- dev
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
env:
|
|
||||||
MESSAGE: merge branch `${{ github.head_ref || github.ref_name }}` to `main`
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pull-request:
|
|
||||||
name: Open pull request
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Open pull request
|
|
||||||
uses: repo-sync/pull-request@v2
|
|
||||||
with:
|
|
||||||
destination_branch: 'main'
|
|
||||||
pr_title: 'chore: ${{ env.MESSAGE }}'
|
|
||||||
pr_body: 'This pull request will ${{ env.MESSAGE }}.'
|
|
||||||
pr_draft: true
|
|
||||||
32
.github/workflows/release.yml
vendored
32
.github/workflows/release.yml
vendored
@@ -1,5 +1,4 @@
|
|||||||
name: Release
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
@@ -10,43 +9,36 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- dev
|
- dev
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
# Make sure the release step uses its own credentials:
|
|
||||||
# https://github.com/cycjimmy/semantic-release-action#private-packages
|
|
||||||
persist-credentials: false
|
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup JDK
|
- name: Setup JDK
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
distribution: 'zulu'
|
distribution: 'adopt'
|
||||||
cache: gradle
|
cache: gradle
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 'latest'
|
node-version: "lts/*"
|
||||||
cache: 'npm'
|
|
||||||
- name: Setup Android SDK
|
- name: Setup Android SDK
|
||||||
uses: amyu/setup-android@v2
|
uses: android-actions/setup-android@v2
|
||||||
with:
|
|
||||||
cache-disabled: false
|
|
||||||
sdk-version: '33'
|
|
||||||
build-tools-version: '33.0.1'
|
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: ./gradlew generateMeta clean --no-daemon
|
run: ./gradlew build clean
|
||||||
|
- name: Install Android build-tools
|
||||||
|
run: sdkmanager "build-tools;32.0.0"
|
||||||
- name: Setup semantic-release
|
- name: Setup semantic-release
|
||||||
run: npm install semantic-release@19.0.5 @saithodev/semantic-release-backmerge @semantic-release/git @semantic-release/changelog gradle-semantic-release-plugin@1.7.4 -D
|
run: npm install -g semantic-release @semantic-release/git @semantic-release/changelog gradle-semantic-release-plugin -D
|
||||||
- name: Release
|
- name: Release
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: npx semantic-release
|
run: npx semantic-release
|
||||||
|
|||||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -114,10 +114,4 @@ gradle-app.setting
|
|||||||
# gradle/wrapper/gradle-wrapper.properties
|
# gradle/wrapper/gradle-wrapper.properties
|
||||||
|
|
||||||
# Potentially copyrighted test APK
|
# Potentially copyrighted test APK
|
||||||
*.apk
|
*.apk
|
||||||
|
|
||||||
# Ignore vscode config
|
|
||||||
.vscode/
|
|
||||||
|
|
||||||
# Dependency directories
|
|
||||||
node_modules/
|
|
||||||
1
.idea/.gitignore
generated
vendored
1
.idea/.gitignore
generated
vendored
@@ -6,4 +6,3 @@
|
|||||||
/dataSources.local.xml
|
/dataSources.local.xml
|
||||||
# Editor-based HTTP Client requests
|
# Editor-based HTTP Client requests
|
||||||
/httpRequests/
|
/httpRequests/
|
||||||
/kotlinc.xml
|
|
||||||
|
|||||||
16
.releaserc
16
.releaserc
@@ -15,10 +15,8 @@
|
|||||||
"@semantic-release/git",
|
"@semantic-release/git",
|
||||||
{
|
{
|
||||||
"assets": [
|
"assets": [
|
||||||
"README.md",
|
|
||||||
"CHANGELOG.md",
|
"CHANGELOG.md",
|
||||||
"gradle.properties",
|
"gradle.properties"
|
||||||
"patches.json"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -30,17 +28,9 @@
|
|||||||
"path": "build/libs/*.jar"
|
"path": "build/libs/*.jar"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "patches.json"
|
"path": "build/libs/*.dex"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
successComment: false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"@saithodev/semantic-release-backmerge",
|
|
||||||
{
|
|
||||||
branches: [{from: "main", to: "dev"}],
|
|
||||||
clearWorkspace: true
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
2441
CHANGELOG.md
2441
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@@ -1,122 +0,0 @@
|
|||||||
## 🧩 Patches
|
|
||||||
|
|
||||||
The official Patch bundle provided by ReVanced and the community.
|
|
||||||
|
|
||||||
> Looking for the JSON variant of this? [Click here](patches.json).
|
|
||||||
|
|
||||||
{{ table }}
|
|
||||||
|
|
||||||
## 📝 JSON Format
|
|
||||||
|
|
||||||
This section explains the JSON format for the [patches.json](patches.json) file.
|
|
||||||
|
|
||||||
The file contains an array of objects, each object representing a patch. The object contains the following properties:
|
|
||||||
|
|
||||||
| key | description |
|
|
||||||
|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| `name` | The name of the patch. |
|
|
||||||
| `description` | The description of the patch. |
|
|
||||||
| `version` | The version of the patch. |
|
|
||||||
| `excluded` | Whether the patch is excluded by default. If `true`, the patch must never be included by default. |
|
|
||||||
| `options` | An array of options for this patch. |
|
|
||||||
| `options.key` | The key of the option. |
|
|
||||||
| `options.title` | The title of the option. |
|
|
||||||
| `options.description` | The description of the option. |
|
|
||||||
| `options.required` | Whether the option is required. |
|
|
||||||
| `options.choices?` | An array of choices of the option. This may be `null` if this option has no choices. The element type of this array may be any type. It can be a `String`, `Int` or something else. |
|
|
||||||
| `dependencies` | An array of dependencies, which are patch names. |
|
|
||||||
| `compatiblePackages` | An array of packages compatible with this patch. |
|
|
||||||
| `compatiblePackages.name` | The name of the package. |
|
|
||||||
| `compatiblePackages.versions` | An array of versions of the package compatible with this patch. If empty, all versions are seemingly compatible. |
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```json
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"name": "remember-video-quality",
|
|
||||||
"description": "Adds the ability to remember the video quality you chose in the video quality flyout.",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"excluded": false,
|
|
||||||
"options": [],
|
|
||||||
"dependencies": [
|
|
||||||
"integrations",
|
|
||||||
"video-id-hook"
|
|
||||||
],
|
|
||||||
"compatiblePackages": [
|
|
||||||
{
|
|
||||||
"name": "com.google.android.youtube",
|
|
||||||
"versions": [
|
|
||||||
"17.22.36",
|
|
||||||
"17.24.35",
|
|
||||||
"17.26.35",
|
|
||||||
"17.27.39",
|
|
||||||
"17.28.34",
|
|
||||||
"17.29.34",
|
|
||||||
"17.32.35",
|
|
||||||
"17.33.42"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "theme",
|
|
||||||
"description": "Enables a custom theme.",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"excluded": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"key": "theme",
|
|
||||||
"title": "Theme",
|
|
||||||
"description": "Select a theme.",
|
|
||||||
"required": true,
|
|
||||||
"choices": [
|
|
||||||
"Amoled"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dependencies": [
|
|
||||||
"locale-config-fix"
|
|
||||||
],
|
|
||||||
"compatiblePackages": [
|
|
||||||
{
|
|
||||||
"name": "com.google.android.youtube",
|
|
||||||
"versions": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "custom-branding",
|
|
||||||
"description": "Changes the YouTube launcher icon and name to your choice (defaults to ReVanced).",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"excluded": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"key": "appName",
|
|
||||||
"title": "Application Name",
|
|
||||||
"description": "The name of the application it will show on your home screen.",
|
|
||||||
"required": true,
|
|
||||||
"choices": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "appIconPath",
|
|
||||||
"title": "Application Icon Path",
|
|
||||||
"description": "A path to the icon of the application.",
|
|
||||||
"required": false,
|
|
||||||
"choices": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dependencies": [
|
|
||||||
"locale-config-fix"
|
|
||||||
],
|
|
||||||
"compatiblePackages": [
|
|
||||||
{
|
|
||||||
"name": "com.google.android.youtube",
|
|
||||||
"versions": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
```
|
|
||||||
404
README.md
404
README.md
@@ -1,403 +1 @@
|
|||||||
## 🧩 Patches
|
Repo for all ReVanced patches
|
||||||
|
|
||||||
The official Patch bundle provided by ReVanced and the community.
|
|
||||||
|
|
||||||
> Looking for the JSON variant of this? [Click here](patches.json).
|
|
||||||
|
|
||||||
### [📦 `com.google.android.youtube`](https://play.google.com/store/apps/details?id=com.google.android.youtube)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `always-autorepeat` | Always repeats the playing video again. | 17.49.37 |
|
|
||||||
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
|
|
||||||
| `comments` | Hides components related to comments. | 17.49.37 |
|
|
||||||
| `copy-video-url` | Adds buttons in player to copy video links. | 17.49.37 |
|
|
||||||
| `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all |
|
|
||||||
| `custom-video-buffer` | Lets you change the buffers of videos. | 17.49.37 |
|
|
||||||
| `custom-video-speed` | Adds more video speed options. | 17.49.37 |
|
|
||||||
| `debugging` | Adds debugging options. | all |
|
|
||||||
| `disable-auto-captions` | Disable forced captions from being automatically enabled. | 17.49.37 |
|
|
||||||
| `disable-auto-player-popup-panels` | Disable automatic popup panels (playlist or live chat) on video player. | 17.49.37 |
|
|
||||||
| `disable-fullscreen-panels` | Disables video description and comments panel in fullscreen view. | 17.49.37 |
|
|
||||||
| `disable-startup-shorts-player` | Disables playing YouTube Shorts when launching YouTube. | 17.49.37 |
|
|
||||||
| `disable-zoom-haptics` | Disables haptics when zooming. | all |
|
|
||||||
| `downloads` | Enables downloading music and videos from YouTube. | 17.49.37 |
|
|
||||||
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.49.37 |
|
|
||||||
| `general-ads` | Removes general ads. | 17.49.37 |
|
|
||||||
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 17.49.37 |
|
|
||||||
| `hide-album-cards` | Hides the album cards below the artist description. | 17.49.37 |
|
|
||||||
| `hide-artist-card` | Hides the artist card below the searchbar. | 17.49.37 |
|
|
||||||
| `hide-autoplay-button` | Hides the autoplay button in the video player. | 17.49.37 |
|
|
||||||
| `hide-breaking-news-shelf` | Hides the breaking news shelf on the homepage tab. | 17.49.37 |
|
|
||||||
| `hide-captions-button` | Hides the captions button on video player. | 17.49.37 |
|
|
||||||
| `hide-cast-button` | Hides the cast button in the video player. | all |
|
|
||||||
| `hide-create-button` | Hides the create button in the navigation bar. | 17.49.37 |
|
|
||||||
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 17.49.37 |
|
|
||||||
| `hide-email-address` | Hides the email address in the account switcher. | 17.49.37 |
|
|
||||||
| `hide-endscreen-cards` | Hides the suggested video cards at the end of a video in fullscreen. | 17.49.37 |
|
|
||||||
| `hide-info-cards` | Hides info-cards in videos. | 17.49.37 |
|
|
||||||
| `hide-my-mix` | Hides mix playlists. | 17.49.37 |
|
|
||||||
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.49.37 |
|
|
||||||
| `hide-time-and-seekbar` | Hides progress bar and time counter on videos. | 17.49.37 |
|
|
||||||
| `hide-video-buttons` | Adds options to hide action buttons under a video. | 17.49.37 |
|
|
||||||
| `hide-watch-in-vr` | Hides the Watch in VR option in the player settings flyout panel. | 17.49.37 |
|
|
||||||
| `hide-watermark` | Hides creator's watermarks on videos. | 17.49.37 |
|
|
||||||
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name with Vanced MicroG. | 17.49.37 |
|
|
||||||
| `minimized-playback` | Enables minimized and background playback. | 17.49.37 |
|
|
||||||
| `old-quality-layout` | Enables the original video quality flyout in the video player settings | 17.49.37 |
|
|
||||||
| `open-links-directly` | Bypasses https://youtube.com/redirect URLs. | 17.49.37 |
|
|
||||||
| `open-links-externally` | Open links outside of the app directly in your browser. | 17.49.37 |
|
|
||||||
| `premium-heading` | Shows premium branding on the home screen. | all |
|
|
||||||
| `remember-playback-rate` | Adds the ability to remember the playback rate you chose in the video playback rate flyout. | 17.49.37 |
|
|
||||||
| `remember-video-quality` | Adds the ability to remember the video quality you chose in the video quality flyout. | 17.49.37 |
|
|
||||||
| `remove-player-button-background` | Removes the background from the video player buttons. | 17.49.37 |
|
|
||||||
| `return-youtube-dislike` | Shows the dislike count of videos using the Return YouTube Dislike API. | 17.49.37 |
|
|
||||||
| `seekbar-tapping` | Enables tap-to-seek on the seekbar of the video player. | 17.49.37 |
|
|
||||||
| `settings` | Adds settings for ReVanced to YouTube. | all |
|
|
||||||
| `sponsorblock` | Integrate SponsorBlock. | 17.49.37 |
|
|
||||||
| `spoof-app-version` | Tricks YouTube into thinking, you are running an older version of the app. One of the side effects also includes restoring the old UI. | 17.49.37 |
|
|
||||||
| `swipe-controls` | Adds volume and brightness swipe controls. | 17.49.37 |
|
|
||||||
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.49.37 |
|
|
||||||
| `theme` | Applies a custom theme. | all |
|
|
||||||
| `video-ads` | Removes ads in the video player. | 17.49.37 |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `com.google.android.apps.youtube.music`](https://play.google.com/store/apps/details?id=com.google.android.apps.youtube.music)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `background-play` | Enables playing music in the background. | 5.39.52 |
|
|
||||||
| `codecs-unlock` | Adds more audio codec options. The new audio codecs usually result in better audio quality. | 5.39.52 |
|
|
||||||
| `compact-header` | Hides the music category bar at the top of the homepage. | 5.39.52 |
|
|
||||||
| `exclusive-audio-playback` | Enables the option to play music without video. | 5.39.52 |
|
|
||||||
| `hide-get-premium` | Removes all "Get Premium" evidences from the avatar menu. | 5.39.52 |
|
|
||||||
| `minimized-playback-music` | Enables minimized playback on Kids music. | 5.39.52 |
|
|
||||||
| `music-microg-support` | Allows YouTube Music ReVanced to run without root and under a different package name. | 5.39.52 |
|
|
||||||
| `music-video-ads` | Removes ads in the music player. | 5.39.52 |
|
|
||||||
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the home screen. | 5.39.52 |
|
|
||||||
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar. | 5.39.52 |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `com.ss.android.ugc.trill`](https://play.google.com/store/apps/details?id=com.ss.android.ugc.trill)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `disable-login-requirement` | Do not force login. | all |
|
|
||||||
| `downloads` | Removes download restrictions and changes the default path to download to. | 27.8.3 |
|
|
||||||
| `feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | 27.8.3 |
|
|
||||||
| `fix-google-login` | Allows logging in with a Google account. | all |
|
|
||||||
| `hide-ads` | Removes ads from TikTok. | all |
|
|
||||||
| `playback-speed` | Enables the playback speed option for all videos. | all |
|
|
||||||
| `settings` | Adds ReVanced settings to TikTok. | 27.8.3 |
|
|
||||||
| `show-seekbar` | Shows progress bar for all video. | all |
|
|
||||||
| `sim-spoof` | Spoofs the information which is retrieved from the sim-card. | 27.8.3 |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `com.zhiliaoapp.musically`](https://play.google.com/store/apps/details?id=com.zhiliaoapp.musically)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `disable-login-requirement` | Do not force login. | all |
|
|
||||||
| `downloads` | Removes download restrictions and changes the default path to download to. | 27.8.3 |
|
|
||||||
| `feed-filter` | Filters tiktok videos: removing ads, removing livestreams. | 27.8.3 |
|
|
||||||
| `fix-google-login` | Allows logging in with a Google account. | all |
|
|
||||||
| `hide-ads` | Removes ads from TikTok. | all |
|
|
||||||
| `playback-speed` | Enables the playback speed option for all videos. | all |
|
|
||||||
| `settings` | Adds ReVanced settings to TikTok. | 27.8.3 |
|
|
||||||
| `show-seekbar` | Shows progress bar for all video. | all |
|
|
||||||
| `sim-spoof` | Spoofs the information which is retrieved from the sim-card. | 27.8.3 |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `tv.twitch.android.app`](https://play.google.com/store/apps/details?id=tv.twitch.android.app)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `block-audio-ads` | Blocks audio ads in streams and VODs. | all |
|
|
||||||
| `block-embedded-ads` | Blocks embedded steam ads using services like TTV.lol or PurpleAdBlocker. | all |
|
|
||||||
| `block-video-ads` | Blocks video ads in streams and VODs. | all |
|
|
||||||
| `debug-mode` | Enables Twitch's internal debugging mode. | all |
|
|
||||||
| `settings` | Adds settings menu to Twitch. | all |
|
|
||||||
| `show-deleted-messages` | Shows deleted chat messages behind a clickable spoiler. | all |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `com.twitter.android`](https://play.google.com/store/apps/details?id=com.twitter.android)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `dynamic-color` | Replaces the default Twitter Blue with the users Material You palette. | all |
|
|
||||||
| `hide-views-stats` | Hides the view stats under tweets. | 9.69.1-release.0 |
|
|
||||||
| `monochrome-icon` | Adds a monochrome icon. | all |
|
|
||||||
| `timeline-ads` | Removes ads from the Twitter timeline. Might require clearing app data to remove already cached ads. | all |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `com.spotify.music`](https://play.google.com/store/apps/details?id=com.spotify.music)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `disable-capture-restriction` | Allows capturing Spotify's audio output while screen sharing or screen recording. | all |
|
|
||||||
| `hide-premium-navbar` | Removes the premium tab from the navbar. | all |
|
|
||||||
| `spotify-theme` | Applies a custom theme. | all |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `com.reddit.frontpage`](https://play.google.com/store/apps/details?id=com.reddit.frontpage)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `general-reddit-ads` | Removes general ads from the Reddit frontpage and subreddits. | 2022.43.0 |
|
|
||||||
| `premium-icon-reddit` | Unlocks premium Reddit app icons. | 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 |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `at.gv.oe.app`](https://play.google.com/store/apps/details?id=at.gv.oe.app)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `remove-root-detection` | Removes the check for root permissions and unlocked bootloader. | 2.5.2 |
|
|
||||||
| `spoof-signature` | Spoofs the signature of the app. | 2.5.2 |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `com.vanced.android.youtube`](https://play.google.com/store/apps/details?id=com.vanced.android.youtube)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `com.myprog.hexedit`](https://play.google.com/store/apps/details?id=com.myprog.hexedit)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `disable-ads` | Disables ads in HexEditor. | 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 |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `com.backdrops.wallpapers`](https://play.google.com/store/apps/details?id=com.backdrops.wallpapers)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `pro-unlock` | Unlocks pro-only functions. | all |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `de.dwd.warnapp`](https://play.google.com/store/apps/details?id=de.dwd.warnapp)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `promo-code-unlock` | Disables the validation of promo code. Any code will work to unlock all features. | all |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `com.teslacoilsw.launcher`](https://play.google.com/store/apps/details?id=com.teslacoilsw.launcher)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `unlock-prime` | Unlocks Nova Prime and all functions of the app. | 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.awedea.nyx`](https://play.google.com/store/apps/details?id=com.awedea.nyx)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `unlock-pro` | Unlocks all pro features. | all |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `ginlemon.iconpackstudio`](https://play.google.com/store/apps/details?id=ginlemon.iconpackstudio)
|
|
||||||
<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>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `unlock-pro` | Unlocks all professional 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>
|
|
||||||
|
|
||||||
### [📦 `com.ticktick.task`](https://play.google.com/store/apps/details?id=com.ticktick.task)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `unlock-themes` | Unlocks all themes. | all |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `net.dinglisch.android.taskerm`](https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `unlock-trial` | Unlocks the trial version. | all |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 📝 JSON Format
|
|
||||||
|
|
||||||
This section explains the JSON format for the [patches.json](patches.json) file.
|
|
||||||
|
|
||||||
The file contains an array of objects, each object representing a patch. The object contains the following properties:
|
|
||||||
|
|
||||||
| key | description |
|
|
||||||
|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| `name` | The name of the patch. |
|
|
||||||
| `description` | The description of the patch. |
|
|
||||||
| `version` | The version of the patch. |
|
|
||||||
| `excluded` | Whether the patch is excluded by default. If `true`, the patch must never be included by default. |
|
|
||||||
| `options` | An array of options for this patch. |
|
|
||||||
| `options.key` | The key of the option. |
|
|
||||||
| `options.title` | The title of the option. |
|
|
||||||
| `options.description` | The description of the option. |
|
|
||||||
| `options.required` | Whether the option is required. |
|
|
||||||
| `options.choices?` | An array of choices of the option. This may be `null` if this option has no choices. The element type of this array may be any type. It can be a `String`, `Int` or something else. |
|
|
||||||
| `dependencies` | An array of dependencies, which are patch names. |
|
|
||||||
| `compatiblePackages` | An array of packages compatible with this patch. |
|
|
||||||
| `compatiblePackages.name` | The name of the package. |
|
|
||||||
| `compatiblePackages.versions` | An array of versions of the package compatible with this patch. If empty, all versions are seemingly compatible. |
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
```json
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"name": "remember-video-quality",
|
|
||||||
"description": "Adds the ability to remember the video quality you chose in the video quality flyout.",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"excluded": false,
|
|
||||||
"options": [],
|
|
||||||
"dependencies": [
|
|
||||||
"integrations",
|
|
||||||
"video-id-hook"
|
|
||||||
],
|
|
||||||
"compatiblePackages": [
|
|
||||||
{
|
|
||||||
"name": "com.google.android.youtube",
|
|
||||||
"versions": [
|
|
||||||
"17.22.36",
|
|
||||||
"17.24.35",
|
|
||||||
"17.26.35",
|
|
||||||
"17.27.39",
|
|
||||||
"17.28.34",
|
|
||||||
"17.29.34",
|
|
||||||
"17.32.35",
|
|
||||||
"17.33.42"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "theme",
|
|
||||||
"description": "Enables a custom theme.",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"excluded": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"key": "theme",
|
|
||||||
"title": "Theme",
|
|
||||||
"description": "Select a theme.",
|
|
||||||
"required": true,
|
|
||||||
"choices": [
|
|
||||||
"Amoled"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dependencies": [
|
|
||||||
"locale-config-fix"
|
|
||||||
],
|
|
||||||
"compatiblePackages": [
|
|
||||||
{
|
|
||||||
"name": "com.google.android.youtube",
|
|
||||||
"versions": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "custom-branding",
|
|
||||||
"description": "Changes the YouTube launcher icon and name to your choice (defaults to ReVanced).",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"excluded": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"options": [
|
|
||||||
{
|
|
||||||
"key": "appName",
|
|
||||||
"title": "Application Name",
|
|
||||||
"description": "The name of the application it will show on your home screen.",
|
|
||||||
"required": true,
|
|
||||||
"choices": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "appIconPath",
|
|
||||||
"title": "Application Icon Path",
|
|
||||||
"description": "A path to the icon of the application.",
|
|
||||||
"required": false,
|
|
||||||
"choices": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dependencies": [
|
|
||||||
"locale-config-fix"
|
|
||||||
],
|
|
||||||
"compatiblePackages": [
|
|
||||||
{
|
|
||||||
"name": "com.google.android.youtube",
|
|
||||||
"versions": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -20,21 +20,22 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("app.revanced:revanced-patcher:6.4.2")
|
implementation(kotlin("stdlib"))
|
||||||
implementation("app.revanced:multidexlib2:2.5.3-a3836654")
|
|
||||||
// Required for meta
|
implementation("app.revanced:revanced-patcher:2.1.2")
|
||||||
implementation("com.google.code.gson:gson:2.10.1")
|
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
register<DefaultTask>("generateBundle") {
|
register<DefaultTask>("generateDex") {
|
||||||
description = "Generate dex files from build and bundle them in the jar file"
|
description = "Generate dex files from build"
|
||||||
dependsOn(build)
|
dependsOn(build)
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
val androidHome = System.getenv("ANDROID_HOME") ?: throw GradleException("ANDROID_HOME not found")
|
val androidHome = System.getenv("ANDROID_HOME") ?: throw GradleException("ANDROID_HOME not found")
|
||||||
val d8 = "${androidHome}/build-tools/33.0.1/d8"
|
val d8 = "${androidHome}/build-tools/32.0.0/d8"
|
||||||
val input = configurations.archives.get().allArtifacts.files.files.first().absolutePath
|
val input = configurations.archives.get().allArtifacts.files.files.first().absolutePath
|
||||||
|
val output = input.replace(".jar", ".dex")
|
||||||
val work = File("${buildDir}/libs")
|
val work = File("${buildDir}/libs")
|
||||||
|
|
||||||
exec {
|
exec {
|
||||||
@@ -44,23 +45,16 @@ tasks {
|
|||||||
|
|
||||||
exec {
|
exec {
|
||||||
workingDir = work
|
workingDir = work
|
||||||
commandLine = listOf("zip", "-u", input, "classes.dex")
|
commandLine = listOf("mv", "classes.dex", output)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
register<JavaExec>("generateMeta") {
|
|
||||||
description = "Generate metadata for this bundle"
|
|
||||||
dependsOn(build)
|
|
||||||
|
|
||||||
classpath = sourceSets["main"].runtimeClasspath
|
|
||||||
mainClass.set("app.revanced.meta.PatchesFileGenerator")
|
|
||||||
}
|
|
||||||
// Dummy task to fix the Gradle semantic-release plugin.
|
// Dummy task to fix the Gradle semantic-release plugin.
|
||||||
// Remove this if you forked it to support building only.
|
// Remove this if you forked it to support building only.
|
||||||
// Tracking issue: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
// Tracking issue: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
||||||
register<DefaultTask>("publish") {
|
register<DefaultTask>("publish") {
|
||||||
group = "publish"
|
group = "publish"
|
||||||
description = "Dummy task"
|
description = "Dummy task"
|
||||||
dependsOn(named("generateBundle"), named("generateMeta"))
|
dependsOn(named("generateDex"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.157.0-dev.2
|
version = 2.6.0-dev.1
|
||||||
|
|||||||
6107
package-lock.json
generated
6107
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"devDependencies": {
|
|
||||||
"@semantic-release/changelog": "^6.0.2",
|
|
||||||
"@semantic-release/git": "^10.0.1",
|
|
||||||
"gradle-semantic-release-plugin": "^1.7.4",
|
|
||||||
"semantic-release": "^19.0.5"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,44 +1,36 @@
|
|||||||
package app.revanced.extensions
|
package app.revanced.extensions
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
import app.revanced.patcher.util.smali.toInstruction
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import org.jf.dexlib2.builder.MutableMethodImplementation
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
|
||||||
import org.jf.dexlib2.iface.Method
|
|
||||||
import org.jf.dexlib2.util.MethodUtil
|
|
||||||
import org.w3c.dom.Node
|
import org.w3c.dom.Node
|
||||||
|
|
||||||
// TODO: populate this to all patches
|
internal fun MutableMethodImplementation.injectHideCall(
|
||||||
/**
|
index: Int,
|
||||||
* Convert a [MethodFingerprint] to a [PatchResultError].
|
register: Int
|
||||||
*
|
) {
|
||||||
* @return A [PatchResultError] for the [MethodFingerprint].
|
this.addInstruction(
|
||||||
*/
|
index,
|
||||||
fun MethodFingerprint.toErrorResult() = PatchResultError("Failed to resolve $name")
|
"invoke-static { v$register }, Lapp/revanced/integrations/patches/HideHomeAdsPatch;->HideHomeAds(Landroid/view/View;)V".toInstruction()
|
||||||
|
)
|
||||||
/**
|
|
||||||
* Find the [MutableMethod] from a given [Method] in a [MutableClass].
|
|
||||||
*
|
|
||||||
* @param method The [Method] to find.
|
|
||||||
* @return The [MutableMethod].
|
|
||||||
*/
|
|
||||||
fun MutableClass.findMutableMethodOf(method: Method) = this.methods.first {
|
|
||||||
MethodUtil.methodSignaturesMatch(it, method)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* apply a transform to all methods of the class
|
|
||||||
*
|
|
||||||
* @param transform the transformation function. original method goes in, transformed method goes out
|
|
||||||
*/
|
|
||||||
fun MutableClass.transformMethods(transform: MutableMethod.() -> MutableMethod) {
|
|
||||||
val transformedMethods = methods.map { it.transform() }
|
|
||||||
methods.clear()
|
|
||||||
methods.addAll(transformedMethods)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun Node.doRecursively(action: (Node) -> Unit) {
|
internal fun Node.doRecursively(action: (Node) -> Unit) {
|
||||||
action(this)
|
action(this)
|
||||||
for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action)
|
for (i in 0 until this.childNodes.length) this.childNodes.item(i).doRecursively(action)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal fun String.startsWithAny(vararg prefixes: String): Boolean {
|
||||||
|
for (prefix in prefixes)
|
||||||
|
if (this.startsWith(prefix))
|
||||||
|
return true
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
internal fun String.equalsAny(vararg other: String): Boolean {
|
||||||
|
for (_other in other)
|
||||||
|
if (this == _other)
|
||||||
|
return true
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,70 +0,0 @@
|
|||||||
package app.revanced.meta
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.dependencies
|
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.description
|
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.include
|
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.options
|
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.version
|
|
||||||
import app.revanced.patcher.patch.PatchOption
|
|
||||||
import com.google.gson.GsonBuilder
|
|
||||||
import java.io.File
|
|
||||||
|
|
||||||
internal class JsonGenerator : PatchesFileGenerator {
|
|
||||||
override fun generate(bundle: PatchBundlePatches) {
|
|
||||||
val patches = bundle.map {
|
|
||||||
JsonPatch(
|
|
||||||
it.patchName,
|
|
||||||
it.description ?: "This patch has no description.",
|
|
||||||
it.version ?: "0.0.0",
|
|
||||||
!it.include,
|
|
||||||
it.options?.map { option ->
|
|
||||||
JsonPatch.Option(
|
|
||||||
option.key,
|
|
||||||
option.title,
|
|
||||||
option.description,
|
|
||||||
option.required,
|
|
||||||
option.let { listOption ->
|
|
||||||
if (listOption is PatchOption.ListOption<*>) {
|
|
||||||
listOption.options.toMutableList().toTypedArray()
|
|
||||||
} else null
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}?.toTypedArray() ?: emptyArray(),
|
|
||||||
it.dependencies?.map { dep ->
|
|
||||||
dep.java.patchName
|
|
||||||
}?.toTypedArray() ?: emptyArray(),
|
|
||||||
it.compatiblePackages?.map { pkg ->
|
|
||||||
JsonPatch.CompatiblePackage(pkg.name, pkg.versions)
|
|
||||||
}?.toTypedArray() ?: emptyArray()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
val json = File("patches.json")
|
|
||||||
json.writeText(GsonBuilder().serializeNulls().create().toJson(patches))
|
|
||||||
}
|
|
||||||
|
|
||||||
private class JsonPatch(
|
|
||||||
val name: String,
|
|
||||||
val description: String,
|
|
||||||
val version: String,
|
|
||||||
val excluded: Boolean,
|
|
||||||
val options: Array<Option>,
|
|
||||||
val dependencies: Array<String>,
|
|
||||||
val compatiblePackages: Array<CompatiblePackage>,
|
|
||||||
) {
|
|
||||||
class CompatiblePackage(
|
|
||||||
val name: String,
|
|
||||||
val versions: Array<String>,
|
|
||||||
)
|
|
||||||
|
|
||||||
class Option(
|
|
||||||
val key: String,
|
|
||||||
val title: String,
|
|
||||||
val description: String,
|
|
||||||
val required: Boolean,
|
|
||||||
val choices: Array<*>?,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package app.revanced.meta
|
|
||||||
|
|
||||||
import app.revanced.patcher.data.Context
|
|
||||||
import app.revanced.patcher.patch.Patch
|
|
||||||
import app.revanced.patcher.util.patch.PatchBundle
|
|
||||||
import java.io.File
|
|
||||||
|
|
||||||
typealias PatchBundlePatches = List<Class<out Patch<Context>>>
|
|
||||||
|
|
||||||
internal interface PatchesFileGenerator {
|
|
||||||
fun generate(bundle: PatchBundlePatches)
|
|
||||||
|
|
||||||
private companion object {
|
|
||||||
@JvmStatic
|
|
||||||
fun main(args: Array<String>) = PatchBundle.Jar(
|
|
||||||
File("build/libs/").listFiles()!!.first {
|
|
||||||
it.name.startsWith("revanced-patches-") && it.name.endsWith(".jar")
|
|
||||||
}.absolutePath
|
|
||||||
).loadPatches().also {
|
|
||||||
if (it.isEmpty()) throw IllegalStateException("No patches found")
|
|
||||||
}.let { bundle ->
|
|
||||||
arrayOf(JsonGenerator(), ReadmeGenerator()).forEach { it.generate(bundle) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
package app.revanced.meta
|
|
||||||
|
|
||||||
import app.revanced.patcher.data.Context
|
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.description
|
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
|
||||||
import app.revanced.patcher.patch.Patch
|
|
||||||
import java.io.File
|
|
||||||
|
|
||||||
internal class ReadmeGenerator : PatchesFileGenerator {
|
|
||||||
private companion object {
|
|
||||||
private const val TABLE_HEADER =
|
|
||||||
"| \uD83D\uDC8A Patch | \uD83D\uDCDC Description | \uD83C\uDFF9 Target Version |\n" +
|
|
||||||
"|:--------:|:--------------:|:-----------------:|"
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun generate(bundle: PatchBundlePatches) {
|
|
||||||
val output = StringBuilder()
|
|
||||||
|
|
||||||
mutableMapOf<String, MutableList<Class<out Patch<Context>>>>()
|
|
||||||
.apply {
|
|
||||||
for (patch in bundle) {
|
|
||||||
patch.compatiblePackages?.forEach { pkg ->
|
|
||||||
if (!contains(pkg.name)) put(pkg.name, mutableListOf())
|
|
||||||
this[pkg.name]!!.add(patch)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.entries
|
|
||||||
.sortedByDescending { it.value.size }
|
|
||||||
.forEach { (`package`, patches) ->
|
|
||||||
val mostCommonVersion = buildMap {
|
|
||||||
patches.forEach { patch ->
|
|
||||||
patch.compatiblePackages?.single { compatiblePackage -> compatiblePackage.name == `package` }?.versions?.let {
|
|
||||||
it.forEach { version -> merge(version, 1, Integer::sum) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.let { commonMap ->
|
|
||||||
commonMap.maxByOrNull { it.value }?.value?.let {
|
|
||||||
// This is not foolproof, because for example v1.0.0-dev.0 will be returned instead of v1.0.0-release.
|
|
||||||
// Unfortunately this can not be solved easily because versioning can be complex.
|
|
||||||
commonMap.entries.filter { mostCommon -> mostCommon.value == it }.maxBy { it.key }.key
|
|
||||||
} ?: "all"
|
|
||||||
}
|
|
||||||
|
|
||||||
output.apply {
|
|
||||||
appendLine("### [\uD83D\uDCE6 `${`package`}`](https://play.google.com/store/apps/details?id=${`package`})")
|
|
||||||
appendLine("<details>\n")
|
|
||||||
appendLine(TABLE_HEADER)
|
|
||||||
patches.forEach { patch ->
|
|
||||||
val recommendedPatchVersion = if (
|
|
||||||
patch.compatiblePackages?.single { it.name == `package` }?.versions?.isNotEmpty() == true
|
|
||||||
) mostCommonVersion else "all"
|
|
||||||
|
|
||||||
appendLine(
|
|
||||||
"| `${patch.patchName}` " +
|
|
||||||
"| ${patch.description} " +
|
|
||||||
"| $recommendedPatchVersion |"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
appendLine("</details>\n")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StringBuilder(File("README-template.md").readText())
|
|
||||||
.replace(Regex("\\{\\{\\s?table\\s?}}"), output.toString())
|
|
||||||
.let(File("README.md")::writeText)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package app.revanced.patches.all.interaction.gestures.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.ResourceContext
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.ResourcePatch
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
|
|
||||||
@Patch(false)
|
|
||||||
@Name("predictive-back-gesture")
|
|
||||||
@Description("Enables the predictive back gesture introduced on Android 13.")
|
|
||||||
@Version("0.0.1")
|
|
||||||
class PredictiveBackGesturePatch : ResourcePatch {
|
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
|
||||||
context.xmlEditor["AndroidManifest.xml"].use { editor ->
|
|
||||||
val document = editor.file
|
|
||||||
|
|
||||||
with(document.getElementsByTagName("application").item(0)) {
|
|
||||||
if (attributes.getNamedItem(FLAG) != null) return@with
|
|
||||||
|
|
||||||
document.createAttribute(FLAG)
|
|
||||||
.apply { value = "true" }
|
|
||||||
.let(attributes::setNamedItem)
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
|
|
||||||
private companion object {
|
|
||||||
const val FLAG = "android:enableOnBackInvokedCallback"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
package app.revanced.patches.all.screenshot.removerestriction.patch
|
|
||||||
|
|
||||||
import app.revanced.extensions.findMutableMethodOf
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
|
||||||
import org.jf.dexlib2.iface.reference.MethodReference
|
|
||||||
|
|
||||||
@Patch(false)
|
|
||||||
@Name("remove-screenshot-restriction")
|
|
||||||
@Description("Removes the restriction of making screenshots.")
|
|
||||||
@Version("0.0.1")
|
|
||||||
class RemoveScreenshotRestrictionPatch : BytecodePatch() {
|
|
||||||
|
|
||||||
private companion object {
|
|
||||||
const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/all/screenshot/removerestriction/RemoveScreenshotRestrictionPatch;"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Information about method calls we want to replace
|
|
||||||
private enum class MethodCall(
|
|
||||||
val definedClassName: String,
|
|
||||||
val methodName: String,
|
|
||||||
val replacementMethodDefinition: String
|
|
||||||
) {
|
|
||||||
SetFlags(
|
|
||||||
"Landroid/view/Window;",
|
|
||||||
"setFlags",
|
|
||||||
"setFlags(Landroid/view/Window;II)V",
|
|
||||||
);
|
|
||||||
|
|
||||||
fun replaceInstruction(method: MutableMethod, instruction: Instruction35c, instructionIndex: Int) {
|
|
||||||
when (this) {
|
|
||||||
SetFlags -> {
|
|
||||||
method.replaceInstruction(
|
|
||||||
instructionIndex,
|
|
||||||
"invoke-static { v${instruction.registerC}, v${instruction.registerD}, v${instruction.registerE} }, ${INTEGRATIONS_CLASS_DESCRIPTOR}->${replacementMethodDefinition}"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
fun fromMethodReference(methodReference: MethodReference) = values().firstOrNull { search ->
|
|
||||||
search.definedClassName == methodReference.definingClass && search.methodName == methodReference.name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
// Find all instructions where one of the methods is called
|
|
||||||
buildMap {
|
|
||||||
context.classes.forEach { classDef ->
|
|
||||||
if (classDef.type == INTEGRATIONS_CLASS_DESCRIPTOR) {
|
|
||||||
// avoid infinite recursion
|
|
||||||
return@forEach
|
|
||||||
}
|
|
||||||
|
|
||||||
classDef.methods.let { methods ->
|
|
||||||
buildMap methodList@{
|
|
||||||
methods.forEach methods@{ method ->
|
|
||||||
with(method.implementation?.instructions ?: return@methods) {
|
|
||||||
ArrayDeque<Triple<MethodCall, Instruction35c, Int>>().also { patchIndices ->
|
|
||||||
this.forEachIndexed { index, instruction ->
|
|
||||||
if (instruction.opcode != Opcode.INVOKE_VIRTUAL) return@forEachIndexed
|
|
||||||
|
|
||||||
val invokeInstruction = instruction as Instruction35c
|
|
||||||
val methodRef = invokeInstruction.reference as MethodReference
|
|
||||||
val methodCall = MethodCall.fromMethodReference(methodRef) ?: return@forEachIndexed
|
|
||||||
|
|
||||||
patchIndices.add(Triple(methodCall, invokeInstruction, index))
|
|
||||||
}
|
|
||||||
}.also { if (it.isEmpty()) return@methods }.let { patches ->
|
|
||||||
put(method, patches)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.also { if (it.isEmpty()) return@forEach }.let { methodPatches ->
|
|
||||||
put(classDef, methodPatches)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.forEach { (classDef, methods) ->
|
|
||||||
// And finally replace the instructions...
|
|
||||||
with(context.proxy(classDef).mutableClass) {
|
|
||||||
methods.forEach { (method, patches) ->
|
|
||||||
val mutableMethod = findMutableMethodOf(method)
|
|
||||||
while (!patches.isEmpty()) {
|
|
||||||
val (methodType, instruction, instructionIndex) = patches.removeLast()
|
|
||||||
methodType.replaceInstruction(mutableMethod, instruction, instructionIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package app.revanced.patches.backdrops.misc.pro.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility([Package("com.backdrops.wallpapers")])
|
|
||||||
internal annotation class ProUnlockCompatibility
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package app.revanced.patches.backdrops.misc.pro.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
object ProUnlockFingerprint : MethodFingerprint(
|
|
||||||
opcodes = listOf(
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.INVOKE_INTERFACE,
|
|
||||||
Opcode.MOVE_RESULT,
|
|
||||||
Opcode.IF_EQZ
|
|
||||||
),
|
|
||||||
customFingerprint = { it.definingClass == "Lcom/backdrops/wallpapers/data/local/DatabaseHandlerIAB;" && it.name == "lambda\$existPurchase\$0" }
|
|
||||||
)
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package app.revanced.patches.backdrops.misc.pro.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.extensions.instruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultError
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.backdrops.misc.pro.annotations.ProUnlockCompatibility
|
|
||||||
import app.revanced.patches.backdrops.misc.pro.fingerprints.ProUnlockFingerprint
|
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("pro-unlock")
|
|
||||||
@Description("Unlocks pro-only functions.")
|
|
||||||
@ProUnlockCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class ProUnlockPatch : BytecodePatch(
|
|
||||||
listOf(ProUnlockFingerprint)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
val result = ProUnlockFingerprint.result ?: return PatchResultError("${ProUnlockFingerprint.name} not found")
|
|
||||||
|
|
||||||
val moveRegisterInstruction = result.mutableMethod.instruction(result.scanResult.patternScanResult!!.endIndex - 1)
|
|
||||||
val register = (moveRegisterInstruction as OneRegisterInstruction).registerA
|
|
||||||
|
|
||||||
result.mutableMethod.addInstructions(
|
|
||||||
result.scanResult.patternScanResult!!.endIndex,
|
|
||||||
"""
|
|
||||||
const/4 v$register, 0x1
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package app.revanced.patches.citra.misc.premium.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
|
|
||||||
object PremiumUnlockFingerprint : MethodFingerprint(
|
|
||||||
customFingerprint = { it.definingClass == "Lorg/citra/citra_emu/ui/main/MainActivity;" && it.name == "isPremiumActive" }
|
|
||||||
)
|
|
||||||
@@ -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()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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 BootStateFingerprint : MethodFingerprint(
|
|
||||||
"Z",
|
|
||||||
access = AccessFlags.PUBLIC.value,
|
|
||||||
strings = listOf("Boot state of device: %s"),
|
|
||||||
customFingerprint = { methodDef ->
|
|
||||||
methodDef.definingClass.endsWith("/AttestationHelper;")
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -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",
|
|
||||||
access = AccessFlags.PUBLIC.value,
|
|
||||||
strings = listOf("Creation of attestation key succeeded", "Creation of attestation key failed"),
|
|
||||||
customFingerprint = { methodDef ->
|
|
||||||
methodDef.definingClass.endsWith("/AttestationHelper;")
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
package app.revanced.patches.finanzonline.detection.bootloader.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.addInstruction
|
|
||||||
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.shared.annotations.DetectionCompatibility
|
|
||||||
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("remove-bootloader-detection")
|
|
||||||
@Description("Removes the check for an unlocked bootloader.")
|
|
||||||
@DetectionCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class BootloaderDetectionPatch : BytecodePatch(
|
|
||||||
listOf(BootloaderDetectionFingerprint, BootStateFingerprint)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
arrayOf(BootloaderDetectionFingerprint, BootStateFingerprint).forEach { fingerprint ->
|
|
||||||
fingerprint.result?.mutableMethod?.addInstruction(
|
|
||||||
0,
|
|
||||||
"""
|
|
||||||
const/4 v0, 0x1
|
|
||||||
return v0
|
|
||||||
"""
|
|
||||||
) ?: return fingerprint.toErrorResult()
|
|
||||||
}
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package app.revanced.patches.finanzonline.detection.root.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
|
|
||||||
object RootDetectionFingerprint : MethodFingerprint(
|
|
||||||
"L",
|
|
||||||
customFingerprint = { methodDef ->
|
|
||||||
methodDef.definingClass == "Lat/gv/bmf/bmf2go/tools/utils/z;"
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
package app.revanced.patches.finanzonline.detection.root.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.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.root.fingerprints.RootDetectionFingerprint
|
|
||||||
import app.revanced.patches.finanzonline.detection.shared.annotations.DetectionCompatibility
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("remove-root-detection")
|
|
||||||
@Description("Removes the check for root permissions")
|
|
||||||
@DetectionCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class RootDetectionPatch : BytecodePatch(
|
|
||||||
listOf(RootDetectionFingerprint)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
RootDetectionFingerprint.result?.mutableMethod?.addInstructions(
|
|
||||||
0,
|
|
||||||
"""
|
|
||||||
sget-object v0, Ljava/lang/Boolean;->FALSE:Ljava/lang/Boolean;
|
|
||||||
return-object v0
|
|
||||||
"""
|
|
||||||
) ?: return RootDetectionFingerprint.toErrorResult()
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
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"))])
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class DetectionCompatibility
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package app.revanced.patches.hexeditor.ad.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility(
|
|
||||||
[
|
|
||||||
Package("com.myprog.hexedit")
|
|
||||||
]
|
|
||||||
)
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class HexEditorAdsCompatibility
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package app.revanced.patches.hexeditor.ad.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
|
|
||||||
object PrimaryAdsFingerprint : MethodFingerprint(
|
|
||||||
customFingerprint = { methodDef ->
|
|
||||||
methodDef.definingClass.endsWith("PreferencesHelper;") && methodDef.name == "isAdsDisabled"
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package app.revanced.patches.hexeditor.ad.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
|
||||||
import app.revanced.patcher.extensions.replaceInstructions
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.hexeditor.ad.annotations.HexEditorAdsCompatibility
|
|
||||||
import app.revanced.patches.hexeditor.ad.fingerprints.PrimaryAdsFingerprint
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("disable-ads")
|
|
||||||
@Description("Disables ads in HexEditor.")
|
|
||||||
@HexEditorAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class HexEditorAdsPatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
PrimaryAdsFingerprint
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
val method = PrimaryAdsFingerprint.result!!.mutableMethod
|
|
||||||
|
|
||||||
method.replaceInstructions(
|
|
||||||
0,
|
|
||||||
"""
|
|
||||||
const/4 v0, 0x1
|
|
||||||
return v0
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package app.revanced.patches.iconpackstudio.misc.pro.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility([Package("ginlemon.iconpackstudio")])
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class UnlockProCompatibility
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package app.revanced.patches.iconpackstudio.misc.pro.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
|
|
||||||
object CheckProFingerprint : MethodFingerprint(
|
|
||||||
"Z",
|
|
||||||
customFingerprint = { it.definingClass.endsWith("IPSPurchaseRepository;")}
|
|
||||||
)
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
package app.revanced.patches.iconpackstudio.misc.pro.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.iconpackstudio.misc.pro.annotations.UnlockProCompatibility
|
|
||||||
import app.revanced.patches.iconpackstudio.misc.pro.fingerprints.CheckProFingerprint
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("unlock-pro")
|
|
||||||
@Description("Unlocks all pro features.")
|
|
||||||
@UnlockProCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class UnlockProPatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
CheckProFingerprint
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
val method = CheckProFingerprint.result!!.mutableMethod
|
|
||||||
method.addInstructions(
|
|
||||||
0,
|
|
||||||
"""
|
|
||||||
const/4 v0, 0x1
|
|
||||||
return v0
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package app.revanced.patches.idaustria.detection.root.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
|
|
||||||
object RootDetectionFingerprint : MethodFingerprint(
|
|
||||||
"V",
|
|
||||||
access = AccessFlags.PUBLIC.value,
|
|
||||||
customFingerprint = { methodDef ->
|
|
||||||
methodDef.definingClass.endsWith("/DeviceIntegrityCheck;")
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package app.revanced.patches.idaustria.detection.root.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.*
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.idaustria.detection.root.fingerprints.RootDetectionFingerprint
|
|
||||||
import app.revanced.patches.idaustria.detection.shared.annotations.DetectionCompatibility
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("remove-root-detection")
|
|
||||||
@Description("Removes the check for root permissions and unlocked bootloader.")
|
|
||||||
@DetectionCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class RootDetectionPatch : BytecodePatch(
|
|
||||||
listOf(RootDetectionFingerprint)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
RootDetectionFingerprint.result!!.mutableMethod.addInstructions(0, "return-void")
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package app.revanced.patches.idaustria.detection.shared.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility([Package("at.gv.oe.app", arrayOf("2.5.2"))])
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class DetectionCompatibility
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package app.revanced.patches.idaustria.detection.signature.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
|
|
||||||
object SpoofSignatureFingerprint : MethodFingerprint(
|
|
||||||
"L",
|
|
||||||
parameters = listOf("L"),
|
|
||||||
access = AccessFlags.PRIVATE.value,
|
|
||||||
customFingerprint = { methodDef ->
|
|
||||||
methodDef.definingClass.endsWith("/SL2Step1Task;") && methodDef.name == "getPubKey"
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
package app.revanced.patches.idaustria.detection.signature.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.*
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.idaustria.detection.shared.annotations.DetectionCompatibility
|
|
||||||
import app.revanced.patches.idaustria.detection.signature.fingerprints.SpoofSignatureFingerprint
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("spoof-signature")
|
|
||||||
@Description("Spoofs the signature of the app.")
|
|
||||||
@DetectionCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class SpoofSignaturePatch : BytecodePatch(
|
|
||||||
listOf(SpoofSignatureFingerprint)
|
|
||||||
) {
|
|
||||||
companion object {
|
|
||||||
const val EXPECTED_SIGNATURE = "OpenSSLRSAPublicKey{modulus=ac3e6fd6050aa7e0d6010ae58190404cd89a56935b44f6fee" +
|
|
||||||
"067c149768320026e10b24799a1339e414605e448e3f264444a327b9ae292be2b62ad567dd1800dbed4a88f718a33dc6db6b" +
|
|
||||||
"f5178aa41aa0efff8a3409f5ca95dbfccd92c7b4298966df806ea7a0204a00f0e745f6d9f13bdf24f3df715d7b62c1600906" +
|
|
||||||
"15de1c8a956b9286764985a3b3c060963c435fb9481a5543aaf0671fc2dba6c5c2b17d1ef1d85137f14dc9bbdf3490288087" +
|
|
||||||
"324cd48341cce64fabf6a9b55d1a7bf23b2fcdff451fd85bf0c7feb0a5e884d7c5c078e413149566a12a686e6efa70ae5161" +
|
|
||||||
"a0201307692834cda336c55157fef125e67c01c1359886f94742105596b42a790404bbcda5dad6a65f115aaff5e45ef3c28b" +
|
|
||||||
"2316ff6cef07aa49a45aa58c07bf258051b13ef449ccb37a3679afd5cfb9132f70bb9d931a937897544f90c3bcc80ed012e9" +
|
|
||||||
"f6ba020b8cdc23f8c29ac092b88f0e370ff9434e4f0f359e614ae0868dc526fa41e4b7596533e8d10279b66e923ecd9f0b20" +
|
|
||||||
"0def55be2c1f6f9c72c92fb45d7e0a9ac571cb38f0a9a37bb33ea06f223fde8c7a92e8c47769e386f9799776e8f110c21df2" +
|
|
||||||
"77ef1be61b2c01ebdabddcbf53cc4b6fd9a3c445606ee77b3758162c80ad8f8137b3c6864e92db904807dcb2be9d7717dd21" +
|
|
||||||
"bf42c121d620ddfb7914f7a95c713d9e1c1b7bdb4a03d618e40cf7e9e235c0b5687e03b7ab3,publicExponent=10001}"
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
SpoofSignatureFingerprint.result!!.mutableMethod.addInstructions(
|
|
||||||
0,
|
|
||||||
"""
|
|
||||||
const-string v0, "$EXPECTED_SIGNATURE"
|
|
||||||
return-object v0
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package app.revanced.patches.moneymanager.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility([Package("com.ithebk.expensemanager")])
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class UnlockProCompatibility
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package app.revanced.patches.moneymanager.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
object UnlockProFingerprint : MethodFingerprint(
|
|
||||||
"Z",
|
|
||||||
AccessFlags.STATIC or AccessFlags.SYNTHETIC,
|
|
||||||
parameters = listOf("L"),
|
|
||||||
opcodes = listOf(
|
|
||||||
Opcode.IGET_BOOLEAN,
|
|
||||||
Opcode.RETURN
|
|
||||||
),
|
|
||||||
customFingerprint = { methodDef ->
|
|
||||||
methodDef.definingClass.endsWith("MainActivity;")
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
package app.revanced.patches.moneymanager.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.moneymanager.annotations.UnlockProCompatibility
|
|
||||||
import app.revanced.patches.moneymanager.fingerprints.UnlockProFingerprint
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("unlock-pro")
|
|
||||||
@Description("Unlocks pro features.")
|
|
||||||
@UnlockProCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class UnlockProPatch : BytecodePatch(
|
|
||||||
listOf(UnlockProFingerprint)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
UnlockProFingerprint.result!!.mutableMethod.addInstructions(
|
|
||||||
0,
|
|
||||||
"""
|
|
||||||
const/4 v0, 0x1
|
|
||||||
|
|
||||||
return v0
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
package app.revanced.patches.music.ad.video.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility(
|
|
||||||
[Package(
|
|
||||||
"com.google.android.apps.youtube.music",
|
|
||||||
arrayOf(
|
|
||||||
"5.14.53",
|
|
||||||
"5.16.51",
|
|
||||||
"5.17.51",
|
|
||||||
"5.21.52",
|
|
||||||
"5.22.54",
|
|
||||||
"5.23.50",
|
|
||||||
"5.25.51",
|
|
||||||
"5.25.52",
|
|
||||||
"5.26.52",
|
|
||||||
"5.27.51",
|
|
||||||
"5.28.52",
|
|
||||||
"5.29.52",
|
|
||||||
"5.31.50",
|
|
||||||
"5.34.51",
|
|
||||||
"5.36.51",
|
|
||||||
"5.38.53",
|
|
||||||
"5.39.52",
|
|
||||||
"5.40.51"
|
|
||||||
)
|
|
||||||
)]
|
|
||||||
)
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class MusicVideoAdsCompatibility
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package app.revanced.patches.music.ad.video.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
object ShowMusicVideoAdsFingerprint : MethodFingerprint(
|
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("Z"), listOf(
|
|
||||||
Opcode.IPUT_BOOLEAN,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.RETURN_VOID
|
|
||||||
)
|
|
||||||
)
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
package app.revanced.patches.music.ad.video.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.music.ad.video.annotations.MusicVideoAdsCompatibility
|
|
||||||
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsConstructorFingerprint
|
|
||||||
import app.revanced.patches.music.ad.video.fingerprints.ShowMusicVideoAdsFingerprint
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("music-video-ads")
|
|
||||||
@Description("Removes ads in the music player.")
|
|
||||||
@MusicVideoAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class MusicVideoAdsPatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
ShowMusicVideoAdsConstructorFingerprint
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
ShowMusicVideoAdsFingerprint.resolve(context, ShowMusicVideoAdsConstructorFingerprint.result!!.classDef)
|
|
||||||
|
|
||||||
val result = ShowMusicVideoAdsFingerprint.result!!
|
|
||||||
|
|
||||||
result.mutableMethod.addInstructions(
|
|
||||||
result.scanResult.patternScanResult!!.startIndex, """
|
|
||||||
const/4 p1, 0x0
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,29 +5,10 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music",
|
"com.google.android.apps.youtube.music", arrayOf("5.03.50")
|
||||||
arrayOf(
|
|
||||||
"5.14.53",
|
|
||||||
"5.16.51",
|
|
||||||
"5.17.51",
|
|
||||||
"5.21.52",
|
|
||||||
"5.22.54",
|
|
||||||
"5.23.50",
|
|
||||||
"5.25.51",
|
|
||||||
"5.25.52",
|
|
||||||
"5.26.52",
|
|
||||||
"5.27.51",
|
|
||||||
"5.28.52",
|
|
||||||
"5.29.52",
|
|
||||||
"5.31.50",
|
|
||||||
"5.34.51",
|
|
||||||
"5.36.51",
|
|
||||||
"5.38.53",
|
|
||||||
"5.39.52",
|
|
||||||
"5.40.51"
|
|
||||||
)
|
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
internal annotation class CodecsUnlockCompatibility
|
internal annotation class CodecsUnlockCompatibility
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,23 @@
|
|||||||
package app.revanced.patches.music.audio.codecs.fingerprints
|
package app.revanced.patches.music.audio.codecs.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher. fingerprint.method.impl.MethodFingerprint
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
@Name("all-codecs-reference-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Laari;",
|
||||||
|
"b",
|
||||||
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
|
@CodecsUnlockCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
object AllCodecsReferenceFingerprint : MethodFingerprint(
|
object AllCodecsReferenceFingerprint : MethodFingerprint(
|
||||||
"J", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
|
"J", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
|
||||||
Opcode.INVOKE_STATIC,
|
Opcode.INVOKE_STATIC,
|
||||||
|
|||||||
@@ -1,15 +1,27 @@
|
|||||||
package app.revanced.patches.music.audio.codecs.fingerprints
|
package app.revanced.patches.music.audio.codecs.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
@Name("codec-lock-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Labwj;",
|
||||||
|
"a",
|
||||||
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
|
@CodecsUnlockCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
object CodecsLockFingerprint : MethodFingerprint(
|
object CodecsLockFingerprint : MethodFingerprint(
|
||||||
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, opcodes = listOf(
|
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L", "L", "L"), listOf(
|
||||||
|
Opcode.INVOKE_STATIC,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.MOVE_RESULT,
|
Opcode.MOVE_RESULT,
|
||||||
@@ -17,13 +29,19 @@ object CodecsLockFingerprint : MethodFingerprint(
|
|||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.MOVE_RESULT,
|
Opcode.MOVE_RESULT,
|
||||||
Opcode.IF_NEZ,
|
Opcode.IF_NEZ,
|
||||||
Opcode.SGET_OBJECT,
|
Opcode.SGET,
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.INVOKE_STATIC,
|
Opcode.INVOKE_STATIC,
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
Opcode.INVOKE_INTERFACE,
|
Opcode.INVOKE_INTERFACE,
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
|
Opcode.MOVE_RESULT,
|
||||||
|
Opcode.IF_NEZ,
|
||||||
|
Opcode.SGET_OBJECT,
|
||||||
|
Opcode.INVOKE_VIRTUAL,
|
||||||
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
|
Opcode.CHECK_CAST,
|
||||||
|
Opcode.INVOKE_INTERFACE,
|
||||||
|
Opcode.INVOKE_DIRECT,
|
||||||
Opcode.RETURN_OBJECT
|
Opcode.RETURN_OBJECT
|
||||||
),
|
)
|
||||||
strings = listOf("eac3_supported")
|
)
|
||||||
)
|
|
||||||
@@ -3,21 +3,20 @@ package app.revanced.patches.music.audio.codecs.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.data.toMethodWalker
|
import app.revanced.patcher.data.impl.toMethodWalker
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patcher.util.smali.toInstruction
|
import app.revanced.patcher.util.smali.toInstruction
|
||||||
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
||||||
import app.revanced.patches.music.audio.codecs.fingerprints.AllCodecsReferenceFingerprint
|
import app.revanced.patches.music.audio.codecs.fingerprints.AllCodecsReferenceFingerprint
|
||||||
import app.revanced.patches.music.audio.codecs.fingerprints.CodecsLockFingerprint
|
import app.revanced.patches.music.audio.codecs.fingerprints.CodecsLockFingerprint
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("codecs-unlock")
|
@Name("codecs-unlock")
|
||||||
@Description("Adds more audio codec options. The new audio codecs usually result in better audio quality.")
|
@Description("Enables more audio codecs. Usually results in better audio quality but may depend on song and device.")
|
||||||
@CodecsUnlockCompatibility
|
@CodecsUnlockCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class CodecsUnlockPatch : BytecodePatch(
|
class CodecsUnlockPatch : BytecodePatch(
|
||||||
@@ -25,30 +24,20 @@ class CodecsUnlockPatch : BytecodePatch(
|
|||||||
CodecsLockFingerprint, AllCodecsReferenceFingerprint
|
CodecsLockFingerprint, AllCodecsReferenceFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val codecsLockResult = CodecsLockFingerprint.result!!
|
var result = CodecsLockFingerprint.result!!
|
||||||
|
|
||||||
val implementation = codecsLockResult.mutableMethod.implementation!!
|
val implementation = result.mutableMethod.implementation!!
|
||||||
|
|
||||||
val scanResultStartIndex = codecsLockResult.scanResult.patternScanResult!!.startIndex
|
val instructionIndex = result.patternScanResult!!.startIndex
|
||||||
val instructionIndex = scanResultStartIndex +
|
|
||||||
if (implementation.instructions[scanResultStartIndex - 1].opcode == Opcode.CHECK_CAST) {
|
|
||||||
// for 5.16.xx and lower
|
|
||||||
-3
|
|
||||||
} else {
|
|
||||||
// since 5.17.xx
|
|
||||||
-2
|
|
||||||
}
|
|
||||||
|
|
||||||
val allCodecsResult = AllCodecsReferenceFingerprint.result!!
|
result = AllCodecsReferenceFingerprint.result!!
|
||||||
val allCodecsMethod =
|
val codecMethod =
|
||||||
context.toMethodWalker(allCodecsResult.method)
|
data.toMethodWalker(result.method).nextMethod(result.patternScanResult!!.startIndex).getMethod()
|
||||||
.nextMethod(allCodecsResult.scanResult.patternScanResult!!.startIndex)
|
|
||||||
.getMethod()
|
|
||||||
|
|
||||||
implementation.replaceInstruction(
|
implementation.replaceInstruction(
|
||||||
instructionIndex,
|
instructionIndex,
|
||||||
"invoke-static {}, ${allCodecsMethod.definingClass}->${allCodecsMethod.name}()Ljava/util/Set;".toInstruction()
|
"invoke-static {}, ${codecMethod.definingClass}->${codecMethod.name}()Ljava/util/Set;".toInstruction()
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
|||||||
@@ -5,29 +5,10 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music",
|
"com.google.android.apps.youtube.music", arrayOf("5.03.50")
|
||||||
arrayOf(
|
|
||||||
"5.14.53",
|
|
||||||
"5.16.51",
|
|
||||||
"5.17.51",
|
|
||||||
"5.21.52",
|
|
||||||
"5.22.54",
|
|
||||||
"5.23.50",
|
|
||||||
"5.25.51",
|
|
||||||
"5.25.52",
|
|
||||||
"5.26.52",
|
|
||||||
"5.27.51",
|
|
||||||
"5.28.52",
|
|
||||||
"5.29.52",
|
|
||||||
"5.31.50",
|
|
||||||
"5.34.51",
|
|
||||||
"5.36.51",
|
|
||||||
"5.38.53",
|
|
||||||
"5.39.52",
|
|
||||||
"5.40.51"
|
|
||||||
)
|
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
internal annotation class ExclusiveAudioCompatibility
|
internal annotation class ExclusiveAudioCompatibility
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,23 @@
|
|||||||
package app.revanced.patches.music.audio.exclusiveaudio.fingerprints
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
@Name("audio-only-enabler-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lgmd;",
|
||||||
|
"d"
|
||||||
|
)
|
||||||
|
@DirectPatternScanMethod
|
||||||
|
@ExclusiveAudioCompatibility
|
||||||
|
@Version(
|
||||||
|
"0.0.1"
|
||||||
|
)
|
||||||
object AudioOnlyEnablerFingerprint: MethodFingerprint(
|
object AudioOnlyEnablerFingerprint: MethodFingerprint(
|
||||||
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
"Z", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
||||||
Opcode.IGET_OBJECT,
|
Opcode.IGET_OBJECT,
|
||||||
|
|||||||
@@ -1,13 +1,22 @@
|
|||||||
package app.revanced.patches.music.audio.exclusiveaudio.fingerprints
|
package app.revanced.patches.music.audio.exclusiveaudio.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
@Name("exclusive-audio-fingerprints")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lgmd;", "c"
|
||||||
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
|
@ExclusiveAudioCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
object ExclusiveAudioFingerprint : MethodFingerprint(
|
object ExclusiveAudioFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
|||||||
@@ -1,30 +1,34 @@
|
|||||||
package app.revanced.patches.music.audio.exclusiveaudio.patch
|
package app.revanced.patches.music.audio.exclusiveaudio.patch
|
||||||
|
|
||||||
|
import AudioOnlyEnablerFingerprint
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.extensions.addInstruction
|
import app.revanced.patcher.extensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
import app.revanced.patcher.extensions.replaceInstruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility
|
||||||
import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.AudioOnlyEnablerFingerprint
|
import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.ExclusiveAudioFingerprint
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("exclusive-audio-playback")
|
@Name("exclusive-audio-playback")
|
||||||
@Description("Enables the option to play music without video.")
|
@Description("Add the option to play music without video.")
|
||||||
@ExclusiveAudioCompatibility
|
@ExclusiveAudioCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class ExclusiveAudioPatch : BytecodePatch(
|
class ExclusiveAudioPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
AudioOnlyEnablerFingerprint
|
ExclusiveAudioFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val method = AudioOnlyEnablerFingerprint.result!!.mutableMethod
|
ExclusiveAudioFingerprint.resolve(data, AudioOnlyEnablerFingerprint.result!!.classDef)
|
||||||
|
|
||||||
|
val method = ExclusiveAudioFingerprint.result!!.mutableMethod
|
||||||
method.replaceInstruction(method.implementation!!.instructions.count() - 1, "const/4 v0, 0x1")
|
method.replaceInstruction(method.implementation!!.instructions.count() - 1, "const/4 v0, 0x1")
|
||||||
method.addInstruction("return v0")
|
method.addInstruction("return v0")
|
||||||
|
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
package app.revanced.patches.music.layout.compactheader.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility(
|
|
||||||
[Package(
|
|
||||||
"com.google.android.apps.youtube.music",
|
|
||||||
arrayOf(
|
|
||||||
"5.14.53",
|
|
||||||
"5.16.51",
|
|
||||||
"5.21.52",
|
|
||||||
"5.22.54",
|
|
||||||
"5.23.50",
|
|
||||||
"5.25.51",
|
|
||||||
"5.25.52",
|
|
||||||
"5.26.52",
|
|
||||||
"5.27.51",
|
|
||||||
"5.28.52",
|
|
||||||
"5.29.52",
|
|
||||||
"5.31.50",
|
|
||||||
"5.34.51",
|
|
||||||
"5.36.51",
|
|
||||||
"5.38.53",
|
|
||||||
"5.39.52",
|
|
||||||
"5.40.51"
|
|
||||||
)
|
|
||||||
)]
|
|
||||||
)
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class CompactHeaderCompatibility
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
package app.revanced.patches.music.layout.compactheader.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
object CompactHeaderConstructorFingerprint : MethodFingerprint(
|
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L", "L"), listOf(
|
|
||||||
Opcode.INVOKE_DIRECT,
|
|
||||||
Opcode.IPUT_OBJECT,
|
|
||||||
Opcode.IPUT_OBJECT,
|
|
||||||
Opcode.IPUT_OBJECT,
|
|
||||||
Opcode.NEW_INSTANCE,
|
|
||||||
Opcode.INVOKE_DIRECT,
|
|
||||||
Opcode.IPUT_OBJECT,
|
|
||||||
Opcode.CONST,
|
|
||||||
Opcode.CONST_4,
|
|
||||||
Opcode.INVOKE_STATIC,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.CHECK_CAST
|
|
||||||
)
|
|
||||||
)
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package app.revanced.patches.music.layout.compactheader.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.music.layout.compactheader.annotations.CompactHeaderCompatibility
|
|
||||||
import app.revanced.patches.music.layout.compactheader.fingerprints.CompactHeaderConstructorFingerprint
|
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction11x
|
|
||||||
|
|
||||||
@Patch(false)
|
|
||||||
@Name("compact-header")
|
|
||||||
@Description("Hides the music category bar at the top of the homepage.")
|
|
||||||
@CompactHeaderCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class CompactHeaderPatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
CompactHeaderConstructorFingerprint
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
val result = CompactHeaderConstructorFingerprint.result!!
|
|
||||||
val method = result.mutableMethod
|
|
||||||
|
|
||||||
val insertIndex = result.scanResult.patternScanResult!!.endIndex
|
|
||||||
val register = (method.implementation!!.instructions[insertIndex - 1] as BuilderInstruction11x).registerA
|
|
||||||
method.addInstructions(
|
|
||||||
insertIndex, """
|
|
||||||
const/16 v2, 0x8
|
|
||||||
invoke-virtual {v${register}, v2}, Landroid/view/View;->setVisibility(I)V
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
package app.revanced.patches.music.layout.minimizedplayback.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility(
|
|
||||||
[Package(
|
|
||||||
"com.google.android.apps.youtube.music",
|
|
||||||
arrayOf(
|
|
||||||
"5.14.53",
|
|
||||||
"5.16.51",
|
|
||||||
"5.17.51",
|
|
||||||
"5.21.52",
|
|
||||||
"5.22.54",
|
|
||||||
"5.23.50",
|
|
||||||
"5.25.51",
|
|
||||||
"5.25.52",
|
|
||||||
"5.26.52",
|
|
||||||
"5.27.51",
|
|
||||||
"5.28.52",
|
|
||||||
"5.29.52",
|
|
||||||
"5.31.50",
|
|
||||||
"5.34.51",
|
|
||||||
"5.36.51",
|
|
||||||
"5.38.53",
|
|
||||||
"5.39.52",
|
|
||||||
"5.40.51"
|
|
||||||
)
|
|
||||||
)]
|
|
||||||
)
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class MinimizedPlaybackCompatibility
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
package app.revanced.patches.music.layout.minimizedplayback.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
object MinimizedPlaybackManagerFingerprint : MethodFingerprint(
|
|
||||||
"V",
|
|
||||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
|
||||||
listOf("I", "L", "Z"),
|
|
||||||
listOf(
|
|
||||||
Opcode.IGET,
|
|
||||||
Opcode.IF_NE,
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.IF_NE,
|
|
||||||
Opcode.IGET_BOOLEAN,
|
|
||||||
Opcode.IF_EQ,
|
|
||||||
Opcode.GOTO,
|
|
||||||
Opcode.RETURN_VOID,
|
|
||||||
Opcode.SGET_OBJECT,
|
|
||||||
Opcode.CONST_4,
|
|
||||||
Opcode.IF_NE,
|
|
||||||
Opcode.IPUT_BOOLEAN,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
package app.revanced.patches.music.layout.minimizedplayback.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.music.layout.minimizedplayback.annotations.MinimizedPlaybackCompatibility
|
|
||||||
import app.revanced.patches.music.layout.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("minimized-playback-music")
|
|
||||||
@Description("Enables minimized playback on Kids music.")
|
|
||||||
@MinimizedPlaybackCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class MinimizedPlaybackPatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
MinimizedPlaybackManagerFingerprint
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstructions(
|
|
||||||
0, """
|
|
||||||
return-void
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
package app.revanced.patches.music.layout.premium.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility(
|
|
||||||
[Package(
|
|
||||||
"com.google.android.apps.youtube.music",
|
|
||||||
arrayOf(
|
|
||||||
"5.14.53",
|
|
||||||
"5.16.51",
|
|
||||||
"5.17.51",
|
|
||||||
"5.21.52",
|
|
||||||
"5.22.54",
|
|
||||||
"5.23.50",
|
|
||||||
"5.25.51",
|
|
||||||
"5.25.52",
|
|
||||||
"5.26.52",
|
|
||||||
"5.27.51",
|
|
||||||
"5.28.52",
|
|
||||||
"5.29.52",
|
|
||||||
"5.31.50",
|
|
||||||
"5.34.51",
|
|
||||||
"5.36.51",
|
|
||||||
"5.38.53",
|
|
||||||
"5.39.52"
|
|
||||||
)
|
|
||||||
)]
|
|
||||||
)
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class HideGetPremiumCompatibility
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
package app.revanced.patches.music.layout.premium.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
object HideGetPremiumFingerprint : MethodFingerprint(
|
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
|
||||||
Opcode.IF_NEZ,
|
|
||||||
Opcode.CONST_16,
|
|
||||||
Opcode.GOTO,
|
|
||||||
Opcode.NOP,
|
|
||||||
Opcode.INVOKE_VIRTUAL
|
|
||||||
)
|
|
||||||
)
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package app.revanced.patches.music.layout.premium.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
object HideGetPremiumParentFingerprint : MethodFingerprint(
|
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf(), listOf(
|
|
||||||
Opcode.IGET_BOOLEAN,
|
|
||||||
Opcode.CONST_4,
|
|
||||||
Opcode.IF_EQZ,
|
|
||||||
Opcode.IGET_OBJECT,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.INVOKE_STATIC
|
|
||||||
),
|
|
||||||
listOf("FEmusic_history"),
|
|
||||||
)
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
package app.revanced.patches.music.layout.premium.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.music.layout.premium.annotations.HideGetPremiumCompatibility
|
|
||||||
import app.revanced.patches.music.layout.premium.fingerprints.HideGetPremiumFingerprint
|
|
||||||
import app.revanced.patches.music.layout.premium.fingerprints.HideGetPremiumParentFingerprint
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("hide-get-premium")
|
|
||||||
@Description("Removes all \"Get Premium\" evidences from the avatar menu.")
|
|
||||||
@HideGetPremiumCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class HideGetPremiumPatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
HideGetPremiumParentFingerprint
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
val parentResult = HideGetPremiumParentFingerprint.result!!
|
|
||||||
HideGetPremiumFingerprint.resolve(context, parentResult.classDef)
|
|
||||||
|
|
||||||
val startIndex = parentResult.scanResult.patternScanResult!!.startIndex
|
|
||||||
|
|
||||||
val parentMethod = parentResult.mutableMethod
|
|
||||||
parentMethod.replaceInstruction(
|
|
||||||
startIndex, """
|
|
||||||
const/4 v1, 0x0
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
val result = HideGetPremiumFingerprint.result!!
|
|
||||||
val method = result.mutableMethod
|
|
||||||
method.addInstructions(
|
|
||||||
startIndex, """
|
|
||||||
const/16 v0, 0x8
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,33 +3,12 @@ package app.revanced.patches.music.layout.tastebuilder.annotations
|
|||||||
import app.revanced.patcher.annotation.Compatibility
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
import app.revanced.patcher.annotation.Package
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
/**
|
|
||||||
* -- Note 2022-08-05 --
|
|
||||||
* Since 5.17.xx the tastebuilder component is dismissible, so this patch is less useful
|
|
||||||
* also it is partly litho now
|
|
||||||
*/
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music",
|
"com.google.android.apps.youtube.music", arrayOf("5.03.50")
|
||||||
arrayOf(
|
|
||||||
"5.21.52",
|
|
||||||
"5.22.54",
|
|
||||||
"5.23.50",
|
|
||||||
"5.25.51",
|
|
||||||
"5.25.52",
|
|
||||||
"5.26.52",
|
|
||||||
"5.27.51",
|
|
||||||
"5.28.52",
|
|
||||||
"5.29.52",
|
|
||||||
"5.31.50",
|
|
||||||
"5.34.51",
|
|
||||||
"5.36.51",
|
|
||||||
"5.38.53",
|
|
||||||
"5.39.52",
|
|
||||||
"5.40.51"
|
|
||||||
)
|
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
internal annotation class RemoveTasteBuilderCompatibility
|
internal annotation class RemoveTasteBuilderCompatibility
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,24 @@
|
|||||||
package app.revanced.patches.music.layout.tastebuilder.fingerprints
|
package app.revanced.patches.music.layout.tastebuilder.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.music.layout.tastebuilder.annotations.RemoveTasteBuilderCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
@Name("taste-builder-constructor-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lkyu;", "<init>"
|
||||||
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
|
@RemoveTasteBuilderCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
object TasteBuilderConstructorFingerprint : MethodFingerprint(
|
object TasteBuilderConstructorFingerprint : MethodFingerprint(
|
||||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L"), listOf(
|
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L"), listOf(
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.NEW_INSTANCE,
|
Opcode.NEW_INSTANCE,
|
||||||
@@ -26,9 +35,9 @@ object TasteBuilderConstructorFingerprint : MethodFingerprint(
|
|||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
Opcode.MOVE_RESULT_OBJECT,
|
||||||
Opcode.CHECK_CAST,
|
Opcode.CHECK_CAST,
|
||||||
|
Opcode.IPUT_OBJECT,
|
||||||
Opcode.NEW_INSTANCE,
|
Opcode.NEW_INSTANCE,
|
||||||
Opcode.INVOKE_DIRECT,
|
Opcode.INVOKE_DIRECT,
|
||||||
Opcode.IPUT_OBJECT,
|
Opcode.IPUT_OBJECT
|
||||||
Opcode.CONST
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -3,19 +3,19 @@ package app.revanced.patches.music.layout.tastebuilder.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.music.layout.tastebuilder.annotations.RemoveTasteBuilderCompatibility
|
import app.revanced.patches.music.layout.tastebuilder.annotations.RemoveTasteBuilderCompatibility
|
||||||
import app.revanced.patches.music.layout.tastebuilder.fingerprints.TasteBuilderConstructorFingerprint
|
import app.revanced.patches.music.layout.tastebuilder.fingerprints.TasteBuilderConstructorFingerprint
|
||||||
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
import org.jf.dexlib2.iface.instruction.formats.Instruction22c
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("tasteBuilder-remover")
|
@Name("tasteBuilder-remover")
|
||||||
@Description("Removes the \"Tell us which artists you like\" card from the home screen.")
|
@Description("Removes the \"Tell us which artists you like\" card from the Home screen. The same functionality can be triggered from the settings anyway.")
|
||||||
@RemoveTasteBuilderCompatibility
|
@RemoveTasteBuilderCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class RemoveTasteBuilderPatch : BytecodePatch(
|
class RemoveTasteBuilderPatch : BytecodePatch(
|
||||||
@@ -23,11 +23,11 @@ class RemoveTasteBuilderPatch : BytecodePatch(
|
|||||||
TasteBuilderConstructorFingerprint
|
TasteBuilderConstructorFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result = TasteBuilderConstructorFingerprint.result!!
|
val result = TasteBuilderConstructorFingerprint.result!!
|
||||||
val method = result.mutableMethod
|
val method = result.mutableMethod
|
||||||
|
|
||||||
val insertIndex = result.scanResult.patternScanResult!!.endIndex - 8
|
val insertIndex = result.patternScanResult!!.endIndex - 8
|
||||||
val register = (method.implementation!!.instructions[insertIndex] as Instruction22c).registerA
|
val register = (method.implementation!!.instructions[insertIndex] as Instruction22c).registerA
|
||||||
method.addInstructions(
|
method.addInstructions(
|
||||||
insertIndex, """
|
insertIndex, """
|
||||||
|
|||||||
@@ -5,29 +5,10 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music",
|
"com.google.android.apps.youtube.music", arrayOf("5.03.50")
|
||||||
arrayOf(
|
|
||||||
"5.14.53",
|
|
||||||
"5.16.51",
|
|
||||||
"5.17.51",
|
|
||||||
"5.21.52",
|
|
||||||
"5.22.54",
|
|
||||||
"5.23.50",
|
|
||||||
"5.25.51",
|
|
||||||
"5.25.52",
|
|
||||||
"5.26.52",
|
|
||||||
"5.27.51",
|
|
||||||
"5.28.52",
|
|
||||||
"5.29.52",
|
|
||||||
"5.31.50",
|
|
||||||
"5.34.51",
|
|
||||||
"5.36.51",
|
|
||||||
"5.38.53",
|
|
||||||
"5.39.52",
|
|
||||||
"5.40.51"
|
|
||||||
)
|
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
internal annotation class RemoveUpgradeButtonCompatibility
|
internal annotation class RemoveUpgradeButtonCompatibility
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,22 @@
|
|||||||
package app.revanced.patches.music.layout.upgradebutton.fingerprints
|
package app.revanced.patches.music.layout.upgradebutton.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.music.layout.upgradebutton.annotations.RemoveUpgradeButtonCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
@Name("pivot-bar-constructor-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lhfu;", "<init2>"
|
||||||
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
|
@RemoveUpgradeButtonCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
object PivotBarConstructorFingerprint : MethodFingerprint(
|
object PivotBarConstructorFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ package app.revanced.patches.music.layout.upgradebutton.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patcher.util.smali.toInstructions
|
import app.revanced.patcher.util.smali.toInstructions
|
||||||
import app.revanced.patches.music.layout.upgradebutton.annotations.RemoveUpgradeButtonCompatibility
|
import app.revanced.patches.music.layout.upgradebutton.annotations.RemoveUpgradeButtonCompatibility
|
||||||
import app.revanced.patches.music.layout.upgradebutton.fingerprints.PivotBarConstructorFingerprint
|
import app.revanced.patches.music.layout.upgradebutton.fingerprints.PivotBarConstructorFingerprint
|
||||||
@@ -20,7 +20,7 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
|||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("upgrade-button-remover")
|
@Name("upgrade-button-remover")
|
||||||
@Description("Removes the upgrade tab from the pivot bar.")
|
@Description("Remove the upgrade tab from the pivot bar in YouTube music.")
|
||||||
@RemoveUpgradeButtonCompatibility
|
@RemoveUpgradeButtonCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class RemoveUpgradeButtonPatch : BytecodePatch(
|
class RemoveUpgradeButtonPatch : BytecodePatch(
|
||||||
@@ -28,12 +28,12 @@ class RemoveUpgradeButtonPatch : BytecodePatch(
|
|||||||
PivotBarConstructorFingerprint
|
PivotBarConstructorFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
val result = PivotBarConstructorFingerprint.result!!
|
val result = PivotBarConstructorFingerprint.result!!
|
||||||
val implementation = result.mutableMethod.implementation!!
|
val implementation = result.mutableMethod.implementation!!
|
||||||
|
|
||||||
val pivotBarElementFieldRef =
|
val pivotBarElementFieldRef =
|
||||||
(implementation.instructions[result.scanResult.patternScanResult!!.endIndex - 1] as Instruction22c).reference
|
(implementation.instructions[result.patternScanResult!!.endIndex - 1] as Instruction22c).reference
|
||||||
|
|
||||||
val register = (implementation.instructions.first() as Instruction35c).registerC
|
val register = (implementation.instructions.first() as Instruction35c).registerC
|
||||||
// first compile all the needed instructions
|
// first compile all the needed instructions
|
||||||
@@ -46,18 +46,16 @@ class RemoveUpgradeButtonPatch : BytecodePatch(
|
|||||||
""".toInstructions().toMutableList()
|
""".toInstructions().toMutableList()
|
||||||
|
|
||||||
|
|
||||||
val endIndex = result.scanResult.patternScanResult!!.endIndex
|
|
||||||
|
|
||||||
// replace the instruction to retain the label at given index
|
// replace the instruction to retain the label at given index
|
||||||
implementation.replaceInstruction(
|
implementation.replaceInstruction(
|
||||||
endIndex - 1, instructionList[0] // invoke-interface
|
result.patternScanResult!!.endIndex - 1, instructionList[0] // invoke-interface
|
||||||
)
|
)
|
||||||
// do not forget to remove this instruction since we added it already
|
// do not forget to remove this instruction since we added it already
|
||||||
instructionList.removeFirst()
|
instructionList.removeFirst()
|
||||||
|
|
||||||
val exitInstruction = instructionList.last() // iput-object
|
val exitInstruction = instructionList.last() // iput-object
|
||||||
implementation.addInstruction(
|
implementation.addInstruction(
|
||||||
endIndex, exitInstruction
|
result.patternScanResult!!.endIndex, exitInstruction
|
||||||
)
|
)
|
||||||
// do not forget to remove this instruction since we added it already
|
// do not forget to remove this instruction since we added it already
|
||||||
instructionList.removeLast()
|
instructionList.removeLast()
|
||||||
@@ -66,12 +64,12 @@ class RemoveUpgradeButtonPatch : BytecodePatch(
|
|||||||
instructionList.add(
|
instructionList.add(
|
||||||
2, // if-le
|
2, // if-le
|
||||||
BuilderInstruction22t(
|
BuilderInstruction22t(
|
||||||
Opcode.IF_LE, 1, 2, implementation.newLabelForIndex(endIndex)
|
Opcode.IF_LE, 1, 2, implementation.newLabelForIndex(result.patternScanResult!!.endIndex)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
implementation.addInstructions(
|
implementation.addInstructions(
|
||||||
endIndex, instructionList
|
result.patternScanResult!!.endIndex, instructionList
|
||||||
)
|
)
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
package app.revanced.patches.music.misc.microg.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility(
|
|
||||||
[Package(
|
|
||||||
"com.google.android.apps.youtube.music",
|
|
||||||
arrayOf(
|
|
||||||
"5.14.53",
|
|
||||||
"5.16.51",
|
|
||||||
"5.17.51",
|
|
||||||
"5.21.52",
|
|
||||||
"5.22.54",
|
|
||||||
"5.23.50",
|
|
||||||
"5.25.51",
|
|
||||||
"5.25.52",
|
|
||||||
"5.26.52",
|
|
||||||
"5.27.51",
|
|
||||||
"5.28.52",
|
|
||||||
"5.29.52",
|
|
||||||
"5.31.50",
|
|
||||||
"5.34.51",
|
|
||||||
"5.36.51",
|
|
||||||
"5.38.53",
|
|
||||||
"5.39.52",
|
|
||||||
"5.40.51"
|
|
||||||
)
|
|
||||||
)]
|
|
||||||
)
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class MusicMicroGPatchCompatibility
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
|
||||||
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
|
|
||||||
object CastContextFetchFingerprint : MethodFingerprint(
|
|
||||||
strings = listOf("Error fetching CastContext.")
|
|
||||||
)
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
|
||||||
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
|
|
||||||
object CastDynamiteModuleFingerprint : MethodFingerprint(
|
|
||||||
strings = listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
|
|
||||||
)
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
|
||||||
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
|
|
||||||
object CastDynamiteModuleV2Fingerprint : MethodFingerprint(
|
|
||||||
strings = listOf("Failed to load module via V2: ")
|
|
||||||
)
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
|
|
||||||
object GooglePlayUtilityFingerprint : MethodFingerprint(
|
|
||||||
"I",
|
|
||||||
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
|
||||||
listOf("L", "I"),
|
|
||||||
strings = listOf(
|
|
||||||
"This should never happen.",
|
|
||||||
"MetadataValueReader",
|
|
||||||
"GooglePlayServicesUtil",
|
|
||||||
"com.android.vending",
|
|
||||||
"android.hardware.type.embedded"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
|
||||||
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
|
|
||||||
object PrimeFingerprint : MethodFingerprint(
|
|
||||||
strings = listOf("com.google.android.GoogleCamera", "com.android.vending")
|
|
||||||
)
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package app.revanced.patches.music.misc.microg.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.extensions.or
|
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.AccessFlags
|
|
||||||
|
|
||||||
|
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
|
||||||
object ServiceCheckFingerprint : MethodFingerprint(
|
|
||||||
"V",
|
|
||||||
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
|
||||||
listOf("L", "I"),
|
|
||||||
strings = listOf("Google Play Services not available")
|
|
||||||
)
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
package app.revanced.patches.music.misc.microg.patch.bytecode
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
|
|
||||||
import app.revanced.patches.music.misc.microg.fingerprints.*
|
|
||||||
import app.revanced.patches.music.misc.microg.patch.resource.MusicMicroGResourcePatch
|
|
||||||
import app.revanced.patches.music.misc.microg.shared.Constants.MUSIC_PACKAGE_NAME
|
|
||||||
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_PACKAGE_NAME
|
|
||||||
import app.revanced.patches.youtube.misc.microg.shared.Constants
|
|
||||||
import app.revanced.util.microg.MicroGBytecodeHelper
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@DependsOn([MusicMicroGResourcePatch::class])
|
|
||||||
@Name("music-microg-support")
|
|
||||||
@Description("Allows YouTube Music ReVanced to run without root and under a different package name.")
|
|
||||||
@MusicMicroGPatchCompatibility
|
|
||||||
@Version("0.0.2")
|
|
||||||
class MusicMicroGBytecodePatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
ServiceCheckFingerprint,
|
|
||||||
GooglePlayUtilityFingerprint,
|
|
||||||
CastDynamiteModuleFingerprint,
|
|
||||||
CastDynamiteModuleV2Fingerprint,
|
|
||||||
CastContextFetchFingerprint,
|
|
||||||
PrimeFingerprint,
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
// NOTE: the previous patch also replaced the following strings, but it seems like they are not needed:
|
|
||||||
// - "com.google.android.gms.chimera.GmsIntentOperationService",
|
|
||||||
// - "com.google.android.gms.phenotype.internal.IPhenotypeCallbacks",
|
|
||||||
// - "com.google.android.gms.phenotype.internal.IPhenotypeService",
|
|
||||||
// - "com.google.android.gms.phenotype.PACKAGE_NAME",
|
|
||||||
// - "com.google.android.gms.phenotype.UPDATE",
|
|
||||||
// - "com.google.android.gms.phenotype",
|
|
||||||
override fun execute(context: BytecodeContext) =
|
|
||||||
// apply common microG patch
|
|
||||||
MicroGBytecodeHelper.patchBytecode(
|
|
||||||
context,
|
|
||||||
arrayOf(
|
|
||||||
MicroGBytecodeHelper.packageNameTransform(
|
|
||||||
Constants.PACKAGE_NAME,
|
|
||||||
Constants.REVANCED_PACKAGE_NAME
|
|
||||||
)
|
|
||||||
),
|
|
||||||
MicroGBytecodeHelper.PrimeMethodTransformationData(
|
|
||||||
PrimeFingerprint,
|
|
||||||
MUSIC_PACKAGE_NAME,
|
|
||||||
REVANCED_MUSIC_PACKAGE_NAME
|
|
||||||
),
|
|
||||||
listOf(
|
|
||||||
ServiceCheckFingerprint,
|
|
||||||
GooglePlayUtilityFingerprint,
|
|
||||||
CastDynamiteModuleFingerprint,
|
|
||||||
CastDynamiteModuleV2Fingerprint,
|
|
||||||
CastContextFetchFingerprint
|
|
||||||
)
|
|
||||||
).let { PatchResultSuccess() }
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
package app.revanced.patches.music.misc.microg.patch.resource
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.ResourceContext
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.ResourcePatch
|
|
||||||
import app.revanced.patches.music.misc.microg.annotations.MusicMicroGPatchCompatibility
|
|
||||||
import app.revanced.patches.music.misc.microg.shared.Constants.MUSIC_PACKAGE_NAME
|
|
||||||
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_APP_NAME
|
|
||||||
import app.revanced.patches.music.misc.microg.shared.Constants.REVANCED_MUSIC_PACKAGE_NAME
|
|
||||||
import app.revanced.patches.music.misc.microg.shared.Constants.SPOOFED_PACKAGE_NAME
|
|
||||||
import app.revanced.patches.music.misc.microg.shared.Constants.SPOOFED_PACKAGE_SIGNATURE
|
|
||||||
import app.revanced.util.microg.MicroGManifestHelper
|
|
||||||
import app.revanced.util.microg.MicroGResourceHelper
|
|
||||||
|
|
||||||
@Name("music-microg-resource-patch")
|
|
||||||
@Description("Resource patch to allow YouTube Music ReVanced to run without root and under a different package name.")
|
|
||||||
@MusicMicroGPatchCompatibility
|
|
||||||
@Version("0.0.2")
|
|
||||||
class MusicMicroGResourcePatch : ResourcePatch {
|
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
|
||||||
// update manifest
|
|
||||||
MicroGResourceHelper.patchManifest(
|
|
||||||
context,
|
|
||||||
MUSIC_PACKAGE_NAME,
|
|
||||||
REVANCED_MUSIC_PACKAGE_NAME,
|
|
||||||
REVANCED_MUSIC_APP_NAME
|
|
||||||
)
|
|
||||||
|
|
||||||
// add metadata to the manifest
|
|
||||||
MicroGManifestHelper.addSpoofingMetadata(
|
|
||||||
context,
|
|
||||||
SPOOFED_PACKAGE_NAME,
|
|
||||||
SPOOFED_PACKAGE_SIGNATURE
|
|
||||||
)
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package app.revanced.patches.music.misc.microg.shared
|
|
||||||
|
|
||||||
object Constants {
|
|
||||||
internal const val REVANCED_MUSIC_APP_NAME = "YT Music ReVanced"
|
|
||||||
internal const val REVANCED_MUSIC_PACKAGE_NAME = "app.revanced.android.apps.youtube.music"
|
|
||||||
internal const val MUSIC_PACKAGE_NAME = "com.google.android.apps.youtube.music"
|
|
||||||
internal const val SPOOFED_PACKAGE_NAME = MUSIC_PACKAGE_NAME
|
|
||||||
internal const val SPOOFED_PACKAGE_SIGNATURE = "afb0fed5eeaebdd86f56a97742f4b6b33ef59875"
|
|
||||||
}
|
|
||||||
@@ -5,29 +5,10 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.google.android.apps.youtube.music",
|
"com.google.android.apps.youtube.music", arrayOf("5.03.50")
|
||||||
arrayOf(
|
|
||||||
"5.14.53",
|
|
||||||
"5.16.51",
|
|
||||||
"5.17.51",
|
|
||||||
"5.21.52",
|
|
||||||
"5.22.54",
|
|
||||||
"5.23.50",
|
|
||||||
"5.25.51",
|
|
||||||
"5.25.52",
|
|
||||||
"5.26.52",
|
|
||||||
"5.27.51",
|
|
||||||
"5.28.52",
|
|
||||||
"5.29.52",
|
|
||||||
"5.31.50",
|
|
||||||
"5.34.51",
|
|
||||||
"5.36.51",
|
|
||||||
"5.38.53",
|
|
||||||
"5.39.52",
|
|
||||||
"5.40.51"
|
|
||||||
)
|
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
internal annotation class BackgroundPlayCompatibility
|
internal annotation class BackgroundPlayCompatibility
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,22 @@
|
|||||||
package app.revanced.patches.music.premium.backgroundplay.fingerprints
|
package app.revanced.patches.music.premium.backgroundplay.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.extensions.or
|
import app.revanced.patcher.extensions.or
|
||||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||||
|
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||||
|
import app.revanced.patches.music.premium.backgroundplay.annotations.BackgroundPlayCompatibility
|
||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
@Name("background-playback-disabler-fingerprint")
|
||||||
|
@MatchingMethod(
|
||||||
|
"Lafgf;", "e"
|
||||||
|
)
|
||||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||||
|
@BackgroundPlayCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
object BackgroundPlaybackDisableFingerprint : MethodFingerprint(
|
object BackgroundPlaybackDisableFingerprint : MethodFingerprint(
|
||||||
"Z", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), listOf(
|
"Z", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), listOf(
|
||||||
Opcode.CONST_4,
|
Opcode.CONST_4,
|
||||||
|
|||||||
@@ -3,18 +3,18 @@ package app.revanced.patches.music.premium.backgroundplay.patch
|
|||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.impl.BytecodeData
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.music.premium.backgroundplay.annotations.BackgroundPlayCompatibility
|
import app.revanced.patches.music.premium.backgroundplay.annotations.BackgroundPlayCompatibility
|
||||||
import app.revanced.patches.music.premium.backgroundplay.fingerprints.BackgroundPlaybackDisableFingerprint
|
import app.revanced.patches.music.premium.backgroundplay.fingerprints.BackgroundPlaybackDisableFingerprint
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("background-play")
|
@Name("background-play")
|
||||||
@Description("Enables playing music in the background.")
|
@Description("Enable playing music in the background.")
|
||||||
@BackgroundPlayCompatibility
|
@BackgroundPlayCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class BackgroundPlayPatch : BytecodePatch(
|
class BackgroundPlayPatch : BytecodePatch(
|
||||||
@@ -22,7 +22,7 @@ class BackgroundPlayPatch : BytecodePatch(
|
|||||||
BackgroundPlaybackDisableFingerprint
|
BackgroundPlaybackDisableFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(data: BytecodeData): PatchResult {
|
||||||
BackgroundPlaybackDisableFingerprint.result!!.mutableMethod.addInstructions(
|
BackgroundPlaybackDisableFingerprint.result!!.mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
package app.revanced.patches.myexpenses.misc.pro.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility([Package("org.totschnig.myexpenses")])
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class UnlockProCompatibility
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package app.revanced.patches.myexpenses.misc.pro.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
|
|
||||||
object IsEnabledFingerprint : MethodFingerprint(
|
|
||||||
"Z",
|
|
||||||
strings = listOf("feature", "feature.licenceStatus")
|
|
||||||
)
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
package app.revanced.patches.myexpenses.misc.pro.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.myexpenses.misc.pro.annotations.UnlockProCompatibility
|
|
||||||
import app.revanced.patches.myexpenses.misc.pro.fingerprints.IsEnabledFingerprint
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("unlock-pro")
|
|
||||||
@Description("Unlocks all professional features.")
|
|
||||||
@UnlockProCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class UnlockProPatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
IsEnabledFingerprint
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
val method = IsEnabledFingerprint.result!!.mutableMethod
|
|
||||||
method.addInstructions(
|
|
||||||
0,
|
|
||||||
"""
|
|
||||||
const/4 v0, 0x1
|
|
||||||
return v0
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package app.revanced.patches.nova.prime.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility(
|
|
||||||
[
|
|
||||||
Package("com.teslacoilsw.launcher")
|
|
||||||
]
|
|
||||||
)
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class UnlockPrimeCompatibility
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
package app.revanced.patches.nova.prime.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
import org.jf.dexlib2.Opcode
|
|
||||||
|
|
||||||
object UnlockPrimeFingerprint : MethodFingerprint(
|
|
||||||
"V",
|
|
||||||
opcodes = listOf(
|
|
||||||
Opcode.IPUT_OBJECT,
|
|
||||||
Opcode.CONST_STRING,
|
|
||||||
Opcode.CONST_4,
|
|
||||||
Opcode.INVOKE_INTERFACE,
|
|
||||||
Opcode.MOVE_RESULT
|
|
||||||
),
|
|
||||||
strings = listOf("1")
|
|
||||||
)
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
package app.revanced.patches.nova.prime.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.addInstruction
|
|
||||||
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.nova.prime.annotations.UnlockPrimeCompatibility
|
|
||||||
import app.revanced.patches.nova.prime.fingerprints.UnlockPrimeFingerprint
|
|
||||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction11x
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("unlock-prime")
|
|
||||||
@Description("Unlocks Nova Prime and all functions of the app.")
|
|
||||||
@UnlockPrimeCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class UnlockPrimePatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
UnlockPrimeFingerprint
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
private companion object {
|
|
||||||
// Any value except 0 unlocks prime, but 512 is needed for a protection mechanism
|
|
||||||
// which would reset the preferences if the value on disk had changed after a restart.
|
|
||||||
const val PRIME_STATUS: Int = 512
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
UnlockPrimeFingerprint.result?.apply {
|
|
||||||
val insertIndex = scanResult.patternScanResult!!.endIndex + 1
|
|
||||||
|
|
||||||
val primeStatusRegister =
|
|
||||||
(mutableMethod.implementation!!.instructions[insertIndex - 1] as BuilderInstruction11x).registerA
|
|
||||||
|
|
||||||
mutableMethod.addInstruction(
|
|
||||||
insertIndex,
|
|
||||||
"""
|
|
||||||
const/16 v$primeStatusRegister, $PRIME_STATUS
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
} ?: UnlockPrimeFingerprint.toErrorResult()
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package app.revanced.patches.nyx.misc.pro.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility([Package("com.awedea.nyx")])
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class UnlockProCompatibility
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package app.revanced.patches.nyx.misc.pro.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
|
|
||||||
object CheckProFingerprint : MethodFingerprint(
|
|
||||||
customFingerprint = { methodDef ->
|
|
||||||
methodDef.definingClass.endsWith("BillingManager;") && methodDef.name == "isProVersion"
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
package app.revanced.patches.nyx.misc.pro.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
|
||||||
import app.revanced.patcher.extensions.removeInstruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.nyx.misc.pro.annotations.UnlockProCompatibility
|
|
||||||
import app.revanced.patches.nyx.misc.pro.fingerprints.CheckProFingerprint
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("unlock-pro")
|
|
||||||
@Description("Unlocks all pro features.")
|
|
||||||
@UnlockProCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class UnlockProPatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
CheckProFingerprint
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
val method = CheckProFingerprint.result!!.mutableMethod
|
|
||||||
method.addInstructions(
|
|
||||||
0,
|
|
||||||
"""
|
|
||||||
const/4 v0, 0x1
|
|
||||||
return v0
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
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", arrayOf("2022.43.0")
|
|
||||||
)]
|
|
||||||
)
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class GeneralAdsCompatibility
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
package app.revanced.patches.reddit.ad.general.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.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.reddit.ad.general.annotations.GeneralAdsCompatibility
|
|
||||||
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
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("general-reddit-ads")
|
|
||||||
@Description("Removes general ads from the Reddit frontpage and subreddits.")
|
|
||||||
@GeneralAdsCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class GeneralAdsPatch : BytecodePatch() {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
context.classes.forEach { classDef ->
|
|
||||||
classDef.methods.forEach methodLoop@{ method ->
|
|
||||||
val implementation = method.implementation ?: return@methodLoop
|
|
||||||
|
|
||||||
implementation.instructions.forEachIndexed { i, instruction ->
|
|
||||||
if (instruction.opcode != Opcode.CONST_STRING) return@forEachIndexed
|
|
||||||
if (((instruction as ReferenceInstruction).reference as StringReference).string != "AdPost") return@forEachIndexed
|
|
||||||
|
|
||||||
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)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package app.revanced.patches.reddit.layout.premiumicon.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility([Package("com.reddit.frontpage")])
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class PremiumIconCompatibility
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user