mirror of
https://github.com/revanced/revanced-documentation.git
synced 2024-12-29 13:05:47 +01:00
docs: split documentation to revanced-cli
and ReVanced development
This commit is contained in:
parent
2053f45bb4
commit
f7770106f8
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -6,3 +6,7 @@
|
||||
path = repositories/revanced-manager
|
||||
url = git@github.com:revanced/revanced-manager.git
|
||||
branch = docs
|
||||
[submodule "repositories/revanced-cli"]
|
||||
path = repositories/revanced-cli
|
||||
url = git@github.com:revanced/revanced-cli.git
|
||||
branch = feat/docs
|
||||
|
@ -4,6 +4,7 @@ Documentation for ReVanced, also contains guides, walkthroughs and tutorials.
|
||||
|
||||
## π Table of contents
|
||||
|
||||
- [π» ReVanced CLI](./docs/revanced-cli)
|
||||
- [𧩠ReVanced Patches](./docs/revanced-patches)
|
||||
- [π ReVanced Manager](./docs/revanced-manager)
|
||||
- [π» ReVanced Development](./docs/revanced-development)
|
||||
- [π οΈ ReVanced Development](./docs/revanced-development)
|
||||
|
1
docs/revanced-cli
Symbolic link
1
docs/revanced-cli
Symbolic link
@ -0,0 +1 @@
|
||||
repositories/revanced-cli
|
@ -1,20 +1,15 @@
|
||||
# Requirements
|
||||
# πΌ Prerequisites
|
||||
|
||||
- ADB
|
||||
- x86/x86_64 host architecture
|
||||
- Zulu JDK 17
|
||||
- Latest Android SDK if you plan to build the integrations from the source
|
||||
- The APK file you want to patch (e.g. YouTube v17.49.37 or YouTube Music v5.36.51). If you want to mount patched applications as root, make sure the same version is installed on your device.
|
||||
To develop with ReVanced, you will need to fulfill certain requirements.
|
||||
|
||||
You can continue by either [building everything from source](2_building_from_source.md) or [downloading the prebuilt packages](1_downloading.md).
|
||||
## π€ Requirements
|
||||
|
||||
## Overview
|
||||
- A Java IDE such as [IntelliJ IDEA](https://www.jetbrains.com/idea/)
|
||||
- An Android IDE such as [Android Studio](https://developer.android.com/studio)
|
||||
- Understanding on how to use the ReVanced CLI
|
||||
|
||||
- [Prerequisites](0_prerequisites.md)
|
||||
- [Downloading prebuilt Packages](1_downloading.md)
|
||||
- [Building from source](2_building_from_source.md)
|
||||
- [1. Building the ReVanced Patcher](3_building_revanced_patcher.md)
|
||||
- [2. Building the ReVanced Patches](4_building_revanced_patches.md)
|
||||
- [3. Building the ReVanced Integrations](5_building_revanced_integrations.md)
|
||||
- [4. Building the ReVanced CLI](6_building_revanced_cli.md)
|
||||
- [Using the ReVanced CLI](7_usage.md)
|
||||
## βοΈ Whats next
|
||||
|
||||
The next section will explain, how to setup a convenient development environment for ReVanced with [IntelliJ IDEA](https://www.jetbrains.com/idea/) and [Android Studio](https://developer.android.com/studio)
|
||||
|
||||
Continue: [π¨βπ» Setup a development environment for ReVanced](1_setup_development_environment.md)
|
||||
|
@ -1,9 +0,0 @@
|
||||
# Downloading the packages
|
||||
|
||||
- [ReVanced CLI](https://github.com/revanced/revanced-cli/releases/latest)
|
||||
- [ReVanced Patches](https://github.com/revanced/revanced-patches/releases/latest)
|
||||
- [ReVanced Integrations](https://github.com/revanced/revanced-integrations/releases/latest)
|
||||
|
||||
## Next step
|
||||
|
||||
[Using the ReVanced CLI](7_usage.md)
|
109
docs/revanced-development/1_setup_development_environment.md
Normal file
109
docs/revanced-development/1_setup_development_environment.md
Normal file
@ -0,0 +1,109 @@
|
||||
# π¨βπ» Setup a development environment for ReVanced
|
||||
|
||||
A certain development environment is suggested to allow for streamlined development on ReVanced.
|
||||
|
||||
## 1. β¬οΈ Clone necessary repositories
|
||||
|
||||
```bash
|
||||
repositories=(
|
||||
"revanced-cli"
|
||||
"revanced-patches"
|
||||
"revanced-patcher" # optional
|
||||
"revanced-integrations"
|
||||
)
|
||||
|
||||
for repository in "${repositories[@]}" ; do
|
||||
git clone -b dev --single-branch --depth 1 https://github.com/revanced/$repository
|
||||
done
|
||||
```
|
||||
|
||||
## 2. π οΈ Build from source
|
||||
|
||||
### Before building you need to be authenticated to GitHub Packages. This will assume you have a GitHub account
|
||||
|
||||
Create a PAT with the scope `read:packages` [here](https://github.com/settings/tokens/new?scopes=read:packages&description=Revanced) and add your token to `~/.gradle/gradle.properties`.
|
||||
|
||||
Example `gradle.properties` file:
|
||||
|
||||
```properties
|
||||
gpr.user = ReVanced
|
||||
gpr.key = ghp_key
|
||||
```
|
||||
|
||||
### To build all projects, run the following command from the directory which contains the repositories
|
||||
|
||||
```bash
|
||||
repositories=(
|
||||
"revanced-cli"
|
||||
"revanced-patches"
|
||||
"revanced-patcher" # optional
|
||||
"revanced-integrations"
|
||||
)
|
||||
|
||||
for repository in "${repositories[@]}" ; do
|
||||
cd $repository
|
||||
./gradlew build
|
||||
cd ..
|
||||
done
|
||||
```
|
||||
|
||||
## 3. βοΈ Setup IntelliJ IDEA
|
||||
|
||||
1. Open the `revanced-cli` project in IntelliJ IDEA and ensure you are using the right JDK from [πΌ Prerequisites](0_prerequisites.md)
|
||||
2. Import the `revanced-patches` and optionally the `revanced-patcher` project as modules into the `revanced-cli` project
|
||||
3. Add a new Run/Debug configuration for the `revanced-cli` project
|
||||
|
||||
Example configuration:
|
||||
|
||||
```xml
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Run ReVanced CLI" type="JetRunConfigurationType">
|
||||
<option name="MAIN_CLASS_NAME" value="app.revanced.cli.main.MainKt" />
|
||||
<module name="revanced-cli.main" />
|
||||
<option name="PROGRAM_PARAMETERS" value="
|
||||
--options ../options.toml
|
||||
-o ../revanced.apk
|
||||
-a ../binaries/unpatched-input.apk
|
||||
-t ../revanced-cache
|
||||
-b ../revanced-patches\build\libs\revanced-patches-<version>.jar
|
||||
-m ..\revanced-integrations\app\build\outputs\apk\release\revanced-integrations-<version>.apk
|
||||
-d device-name"
|
||||
/>
|
||||
<shortenClasspath name="NONE" />
|
||||
<method v="2">
|
||||
<option name="RunConfigurationTask" enabled="true" run_configuration_name="revanced-patcher [publish]" run_configuration_type="GradleRunConfiguration" />
|
||||
<option name="RunConfigurationTask" enabled="true" run_configuration_name="revanced-patches [build]" run_configuration_type="GradleRunConfiguration" />
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
```
|
||||
|
||||
> **Note**: The builds of the `revanced-patches` and `revanced-integrations` change. **Do not forget to update them as well in the run configuration program arguments.**
|
||||
|
||||
## 5. βοΈ Setup Android Studio
|
||||
|
||||
1. Open the `revanced-integrations` project in Android Studio and ensure you are using the latest Android SDK.
|
||||
2. Add a new default build configuration and confirm if it succeeds.
|
||||
|
||||
## 6. β οΈ Troubleshoot your development environment
|
||||
|
||||
To confirm your development environment works as intended, set a breakpoint in any patch in IntelliJ IDEA. Run the configuration and confirm, that your IDE reaches and breaks at the breakpoint. Continue and let the ReVanced CLI exit.
|
||||
|
||||
- If the ReVanced CLI output is unexpected, confirm if you supplied the correct program arguments by following [π» ReVanced CLI](./docs/revanced-development).
|
||||
|
||||
- If the breakpoint was not hit, confirm, that you correctly added the necessary projects as modules to the `revanced-cli` project
|
||||
|
||||
## β Afterword
|
||||
|
||||
Couple things should be considered with the development environment for ReVanced:
|
||||
|
||||
- Follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
|
||||
|
||||
- Pull new commits from remote to keep your branch up to date
|
||||
|
||||
- Keep your Run/Debug configuration up to date. Make sure, you use the correct paths in your program argument after you pull new commits. If you forget to do this, you might end up debugging for hours until realizing, you supply the wrong paths to the ReVanced CLI
|
||||
|
||||
- Use development branches and always branch off and PR to the `dev` branch
|
||||
|
||||
- To use the local `revanced-patches` project in the `revanced-cli` and `revanced-patches` projects, make sure you publish it to the local Maven repository with `./gradlew publish` and use the correct version in the `build.gradle.kts` file in the `revanced-cli` and `revanced-patches` projects, otherwise, it will use the package from GitHub Packages
|
@ -1,21 +0,0 @@
|
||||
# Building from source
|
||||
|
||||
If you have already downloaded the prebuilt packages you can skip to [Using the ReVanced CLI](7_usage.md).
|
||||
|
||||
Before continuing you need to be authenticated to GitHub Packages.
|
||||
\
|
||||
This will assume you have a GitHub account. Create a PAT with the scope `read:packages` [here](https://github.com/settings/tokens/new?scopes=read:packages&description=Revanced) and add your token to ~/.gradle/gradle.properties.
|
||||
\
|
||||
Example `gradle.properties` file:
|
||||
|
||||
```properties
|
||||
gpr.user = YourUsername
|
||||
gpr.key = ghp_longrandomkey
|
||||
```
|
||||
|
||||
## Overview
|
||||
|
||||
1. [Building the ReVanced Patcher](3_building_revanced_patcher.md)
|
||||
2. [Building the ReVanced Patches](4_building_revanced_patches.md)
|
||||
3. [Building the ReVanced Integrations](5_building_revanced_integrations.md)
|
||||
4. [Building the ReVanced CLI](6_building_revanced_cli.md)
|
@ -1,17 +0,0 @@
|
||||
# Building the ReVanced Patcher
|
||||
|
||||
1. Clone the repository
|
||||
|
||||
```bash
|
||||
git clone https://github.com/revanced/revanced-patcher && cd revanced-patcher
|
||||
```
|
||||
|
||||
2. Publish the patcher to your local maven repository
|
||||
|
||||
```bash
|
||||
./gradlew publish
|
||||
```
|
||||
|
||||
## Next step
|
||||
|
||||
[Building the ReVanced Patches](4_building_revanced_patches.md)
|
@ -1,19 +0,0 @@
|
||||
# Building the ReVanced Patches
|
||||
|
||||
1. Clone the repository
|
||||
|
||||
```bash
|
||||
git clone https://github.com/revanced/revanced-patches && cd revanced-patches
|
||||
```
|
||||
|
||||
2. Build the patches
|
||||
|
||||
```bash
|
||||
./gradlew build
|
||||
```
|
||||
|
||||
The file will be located in `build/libs/revanced-patches-VERSION.jar`
|
||||
|
||||
## Next step
|
||||
|
||||
[Building the ReVanced integrations](5_building_revanced_integrations.md)
|
@ -1,21 +0,0 @@
|
||||
# Building the ReVanced Integrations
|
||||
|
||||
1. Make sure `$ANDROID_SDK_ROOT` or `$ANDROID_HOME` is set correctly
|
||||
|
||||
2. Clone the repository
|
||||
|
||||
```bash
|
||||
git clone https://github.com/revanced/revanced-integrations && cd revanced-integrations
|
||||
```
|
||||
|
||||
3. Build the integrations
|
||||
|
||||
```bash
|
||||
./gradlew build
|
||||
```
|
||||
|
||||
The file will be located in `app/build/outputs/apk/release/app-release-unsigned.apk`
|
||||
|
||||
## Next step
|
||||
|
||||
[Building the ReVanced CLI](6_building_revanced_cli.md)
|
@ -1,19 +0,0 @@
|
||||
# Building the ReVanced CLI
|
||||
|
||||
1. Clone the repository
|
||||
|
||||
```bash
|
||||
git clone https://github.com/revanced/revanced-cli && cd revanced-cli
|
||||
```
|
||||
|
||||
Build the CLI
|
||||
|
||||
```bash
|
||||
./gradlew build
|
||||
```
|
||||
|
||||
The file will be located in `build/libs/revanced-cli-VERSION-all.jar`
|
||||
|
||||
## Next step
|
||||
|
||||
[Using the ReVanced CLI](7_usage.md)
|
@ -1,47 +0,0 @@
|
||||
# Using the ReVanced CLI
|
||||
|
||||
1. Make sure your device is connected
|
||||
|
||||
```bash
|
||||
adb shell exit
|
||||
```
|
||||
|
||||
If you plan to use the root variant, check if you have root access
|
||||
|
||||
```bash
|
||||
adb shell su -c exit
|
||||
```
|
||||
|
||||
2. Copy the ADB device name
|
||||
|
||||
```bash
|
||||
adb devices
|
||||
```
|
||||
|
||||
3. Run the CLI
|
||||
|
||||
```bash
|
||||
# Non-Root
|
||||
java -jar revanced-cli-all.jar \
|
||||
-a input.apk \
|
||||
-c \
|
||||
-d device-name \
|
||||
-o output.apk \
|
||||
-b revanced-patches.jar
|
||||
|
||||
# Root
|
||||
# In the case of YouTube you want to exlude the patch 'microg-support' with the option '-e'. The option '-e' allows you to exclude patches (e.g. -e microg-support -e amoled ...)
|
||||
java -jar revanced-cli-all.jar \
|
||||
-a input.apk \
|
||||
-c \
|
||||
-d device-name \
|
||||
-o output.apk \
|
||||
-b revanced-patches.jar \
|
||||
-e microg-support \
|
||||
--mount
|
||||
```
|
||||
|
||||
> **Note**: Patches might require additional integrations to be merged. Merge integrations with the option `-m`.
|
||||
> **Note**: You can list all patches available by using the option `-l`.
|
||||
|
||||
If you specified an ADB device the patched application will be automatically installed.
|
@ -1,14 +1,8 @@
|
||||
# π» ReVanced Development
|
||||
# π οΈ ReVanced Development
|
||||
|
||||
Instructions to build and install ReVanced.
|
||||
Documentation to develop with ReVanced.
|
||||
|
||||
## π Table of contents
|
||||
|
||||
- [Prerequisites](0_prerequisites.md)
|
||||
- [Downloading prebuilt Packages](1_downloading.md)
|
||||
- [Building from source](2_building_from_source.md)
|
||||
- [1. Building the ReVanced Patcher](3_building_revanced_patcher.md)
|
||||
- [2. Building the ReVanced Patches](4_building_revanced_patches.md)
|
||||
- [3. Building the ReVanced Integrations](5_building_revanced_integrations.md)
|
||||
- [4. Building the ReVanced CLI](6_building_revanced_cli.md)
|
||||
- [Using the ReVanced CLI](7_usage.md)
|
||||
- [πΌ Prerequisites](0_prerequisites.md)
|
||||
- [π¨βπ» Setup a development environment for ReVanced](1_setup_development_environment.md)
|
||||
|
1
repositories/revanced-cli
Submodule
1
repositories/revanced-cli
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 6bd7d42e32450974a52e1bb9df4a31512d399842
|
Loadingβ¦
Reference in New Issue
Block a user