mirror of
https://github.com/ReVanced/revanced-patches-template.git
synced 2026-01-26 12:41:05 +00:00
Compare commits
17 Commits
v1.0.1
...
v1.0.2-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d670762cce | ||
|
|
ccc222c1ba | ||
|
|
624a4964c1 | ||
|
|
afde3145e6 | ||
|
|
afd7f3b99b | ||
|
|
9e9b90678c | ||
|
|
c61c2cfebf | ||
|
|
464ed6333d | ||
|
|
ff407c8f4a | ||
|
|
989c3f1a3e | ||
|
|
540fe504c7 | ||
|
|
6dc4cf08e5 | ||
|
|
7ff9985401 | ||
|
|
0338a66e26 | ||
|
|
e4220b2a65 | ||
|
|
a4c0d231cf | ||
|
|
568edafefe |
31
.github/workflows/build_pull_request.yml
vendored
Normal file
31
.github/workflows/build_pull_request.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
name: Build pull request
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Java
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: "temurin"
|
||||||
|
java-version: "17"
|
||||||
|
|
||||||
|
- name: Cache Gradle
|
||||||
|
uses: burrunan/gradle-cache-action@v1
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: ./gradlew build --no-daemon
|
||||||
12
.github/workflows/release.yml
vendored
12
.github/workflows/release.yml
vendored
@@ -6,10 +6,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- dev
|
- dev
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- dev
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
@@ -24,6 +20,12 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Java
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: "temurin"
|
||||||
|
java-version: "17"
|
||||||
|
|
||||||
- name: Cache Gradle
|
- name: Cache Gradle
|
||||||
uses: burrunan/gradle-cache-action@v1
|
uses: burrunan/gradle-cache-action@v1
|
||||||
|
|
||||||
@@ -46,7 +48,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
fingerprint: ${{ env.GPG_FINGERPRINT }}
|
fingerprint: ${{ vars.GPG_FINGERPRINT }}
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
"README.md",
|
"README.md",
|
||||||
"CHANGELOG.md",
|
"CHANGELOG.md",
|
||||||
"gradle.properties",
|
"gradle.properties",
|
||||||
"patches.json"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -33,7 +32,7 @@
|
|||||||
{
|
{
|
||||||
"assets": [
|
"assets": [
|
||||||
{
|
{
|
||||||
"path": "build/libs/revanced-patches*"
|
"path": "patches/build/libs/*.rvp"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
successComment: false
|
successComment: false
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
## [1.0.2-dev.1](https://github.com/ReVanced/revanced-patches-template/compare/v1.0.1...v1.0.2-dev.1) (2024-08-08)
|
||||||
|
|
||||||
## [1.0.1](https://github.com/ReVanced/revanced-patches-template/compare/v1.0.0...v1.0.1) (2024-02-21)
|
## [1.0.1](https://github.com/ReVanced/revanced-patches-template/compare/v1.0.0...v1.0.1) (2024-02-21)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
43
README.md
43
README.md
@@ -10,15 +10,17 @@ For an example repository, see [ReVanced Patches](https://github.com/revanced/re
|
|||||||
To start using this template, follow these steps:
|
To start using this template, follow these steps:
|
||||||
|
|
||||||
1. [Create a new repository using this template](https://github.com/new?template_name=revanced-patches-template&template_owner=ReVanced)
|
1. [Create a new repository using this template](https://github.com/new?template_name=revanced-patches-template&template_owner=ReVanced)
|
||||||
2. Set up the [build.gradle.kts](build.gradle.kts) file (Specifically, the [group of the project](build.gradle.kts#L10), [manifest attributes](build.gradle.kts#L37-L47), and the [POM](build.gradle.kts#L98-L121))
|
2. Set up the [build.gradle.kts](patches/build.gradle.kts) file (Specifically, the [group of the project](patches/build.gradle.kts#L1),
|
||||||
|
and the [About](patches/build.gradle.kts#L5-L11))
|
||||||
3. Update dependencies in the [libs.versions.toml](gradle/libs.versions.toml) file
|
3. Update dependencies in the [libs.versions.toml](gradle/libs.versions.toml) file
|
||||||
4. [Create a pass-phrased GPG master key and subkey](https://mikeross.xyz/create-gpg-key-pair-with-subkeys/)
|
4. [Create a pass-phrased GPG master key and subkey](https://mikeross.xyz/create-gpg-key-pair-with-subkeys/)
|
||||||
1. Add the private key as a secret named [GPG_PRIVATE_KEY](.github/workflows/release.yml#L47) to your repository
|
1. Add the private key as a secret named [GPG_PRIVATE_KEY](.github/workflows/release.yml#L48) to your repository
|
||||||
2. Add the passphrase as a secret named [GPG_PASSPHRASE](.github/workflows/release.yml#L48) to your repository
|
2. Add the passphrase as a secret named [GPG_PASSPHRASE](.github/workflows/release.yml#L49) to your repository
|
||||||
3. Add the fingerprint of the GPG subkey as a secret named [GPG_FINGERPRINT](.github/workflows/release.yml#L49) to your repository
|
3. Add the fingerprint of the GPG subkey as a secret named [GPG_FINGERPRINT](.github/workflows/release.yml#L50) to your repository
|
||||||
6. [Create a PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) with [push access](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/ci-configuration.md#authentication)
|
6. [Create a PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) with [push access](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/ci-configuration.md#authentication)
|
||||||
1. Add it as a secret named [REPOSITORY_PUSH_ACCESS](.github/workflows/release.yml#L53) to your repository
|
1. Add it as a secret named [REPOSITORY_PUSH_ACCESS](.github/workflows/release.yml#L54) to your repository
|
||||||
7. Set up the [README.md](README.md) file[^1] (e.g, title, description, license, summary of the patches that are included in the repository)
|
7. Set up the [README.md](README.md) file[^1] (e.g, title, description, license, summary of the patches
|
||||||
|
that are included in the repository)
|
||||||
|
|
||||||
🎉 You are now ready to start creating patches!
|
🎉 You are now ready to start creating patches!
|
||||||
|
|
||||||
@@ -28,32 +30,39 @@ You can also add the following things to the repository:
|
|||||||
|
|
||||||
- [Issue templates](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository)[^2]
|
- [Issue templates](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository)[^2]
|
||||||
- Contribution guidelines[^3]
|
- Contribution guidelines[^3]
|
||||||
- Documentation, if you want to publish your patches as a library[^4]
|
- API documentation, if you want to publish your patches as a library
|
||||||
|
|
||||||
[^1]: [Example README.md file](https://github.com/ReVanced/revanced-patches/blob/main/README.md)
|
[^1]: [Example README.md file](https://github.com/ReVanced/revanced-patches/blob/main/README.md)
|
||||||
[^2]: [Example issue templates](https://github.com/ReVanced/revanced-patches/tree/main/.github/ISSUE_TEMPLATE)
|
[^2]: [Example issue templates](https://github.com/ReVanced/revanced-patches/tree/main/.github/ISSUE_TEMPLATE)
|
||||||
[^3]: [Example contribution guidelines](https://github.com/ReVanced/revanced-patches/blob/main/CONTRIBUTING.md)
|
[^3]: [Example contribution guidelines](https://github.com/ReVanced/revanced-patches/blob/main/CONTRIBUTING.md)
|
||||||
[^4]: [Example documentation](https://github.com/ReVanced/revanced-patches/tree/docs/docs)
|
|
||||||
|
|
||||||
## 🧑💻 Usage
|
## 🧑💻 Usage
|
||||||
|
|
||||||
In order to develop and release ReVanced Patches using this template, some things need to be considered:
|
To develop and release ReVanced Patches using this template, some things need to be considered:
|
||||||
|
|
||||||
- Development occurs in feature branches. Once a feature branch is ready, it is squshed and merged into the `dev` branch
|
- Development occurs in feature branches. Once a feature branch is ready, it is squashed and merged into the `dev` branch
|
||||||
- The `dev` branch is merged into the `main` branch once it is ready for release
|
- The `dev` branch is merged into the `main` branch once it is ready for release
|
||||||
- Semantic versioning is used for versioning ReVanced Patches. ReVanced Patches have a public API for other patches to use
|
- Semantic versioning is used to version ReVanced Patches. ReVanced Patches have a public API for other patches to use
|
||||||
- Semantic commit messages are used for commits
|
- Semantic commit messages are used for commits
|
||||||
- Commits on the `dev` branch and `main` branch are automatically released via the [release.yml](.github/workflows/release.yml) workflow, which is also responsible for generating the changelog and updating the version of ReVanced Patches. It is triggered by pushing to the `dev` or `main` branch. The workflow uses the `publish` task to publish the release of ReVanced Patches
|
- Commits on the `dev` branch and `main` branch are automatically released
|
||||||
- In order to build ReVanced Patches, that can be used on Android, the [`buildDexJar`](build.gradle.kts#L50-L73) task needs to be run. The [`publish` task depends on the `buildDexJar`](build.gradle.kts#L78) task, so it will be run automatically when publishing a release.
|
via the [release.yml](.github/workflows/release.yml) workflow, which is also responsible for generating the changelog
|
||||||
|
and updating the version of ReVanced Patches. It is triggered by pushing to the `dev` or `main` branch.
|
||||||
|
The workflow uses the `publish` task to publish the release of ReVanced Patches
|
||||||
|
- The `buildAndroid` task is used to build ReVanced Patches so that it can be used on Android.
|
||||||
|
The `publish` task depends on the `buildAndroid` task, so it will be run automatically when publishing a release.
|
||||||
|
|
||||||
## 📚 Everything else
|
## 📚 Everything else
|
||||||
|
|
||||||
### 🛠️ Building
|
### 🛠️ Building
|
||||||
|
|
||||||
In order to build ReVanced Patches template, you can follow the [ReVanced documentation](https://github.com/ReVanced/revanced-documentation).
|
To build ReVanced Patches template,
|
||||||
|
you can follow the [ReVanced documentation](https://github.com/ReVanced/revanced-documentation).
|
||||||
|
|
||||||
## 📜 Licence
|
## 📜 Licence
|
||||||
|
|
||||||
ReVanced Patches template is licensed under the GPLv3 licence. Please see the [licence file](LICENSE) for more information.
|
ReVanced Patches template is licensed under the GPLv3 licence.
|
||||||
[tl;dr](https://www.tldrlegal.com/license/gnu-general-public-license-v3-gpl-3) you may copy, distribute and modify ReVanced Patches template as long as you track changes/dates in source files.
|
Please see the [license file](LICENSE) for more information.
|
||||||
Any modifications to ReVanced Patches template must also be made available under the GPL along with build & install instructions.
|
[tl;dr](https://www.tldrlegal.com/license/gnu-general-public-license-v3-gpl-3) you may copy, distribute
|
||||||
|
and modify ReVanced Patches template as long as you track changes/dates in source files.
|
||||||
|
Any modifications to ReVanced Patches template must also be made available under the GPL,
|
||||||
|
along with build & install instructions.
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
public final class app/revanced/patches/example/ExamplePatch : app/revanced/patcher/patch/BytecodePatch {
|
|
||||||
public static final field INSTANCE Lapp/revanced/patches/example/ExamplePatch;
|
|
||||||
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
|
|
||||||
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
|
||||||
}
|
|
||||||
|
|
||||||
130
build.gradle.kts
130
build.gradle.kts
@@ -1,130 +0,0 @@
|
|||||||
import org.gradle.kotlin.dsl.support.listFilesOrdered
|
|
||||||
|
|
||||||
plugins {
|
|
||||||
alias(libs.plugins.kotlin)
|
|
||||||
alias(libs.plugins.binary.compatibility.validator)
|
|
||||||
`maven-publish`
|
|
||||||
signing
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "app.revanced"
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
mavenLocal()
|
|
||||||
google()
|
|
||||||
maven {
|
|
||||||
// A repository must be speficied for some reason. "registry" is a dummy.
|
|
||||||
url = uri("https://maven.pkg.github.com/revanced/registry")
|
|
||||||
credentials {
|
|
||||||
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
|
|
||||||
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation(libs.revanced.patcher)
|
|
||||||
implementation(libs.smali)
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
jvmToolchain(11)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
|
||||||
withType(Jar::class) {
|
|
||||||
manifest {
|
|
||||||
attributes["Name"] = "ReVanced Patches template"
|
|
||||||
attributes["Description"] = "Patches template for ReVanced."
|
|
||||||
attributes["Version"] = version
|
|
||||||
attributes["Timestamp"] = System.currentTimeMillis().toString()
|
|
||||||
attributes["Source"] = "git@github.com:revanced/revanced-patches-template.git"
|
|
||||||
attributes["Author"] = "ReVanced"
|
|
||||||
attributes["Contact"] = "contact@revanced.app"
|
|
||||||
attributes["Origin"] = "https://revanced.app"
|
|
||||||
attributes["License"] = "GNU General Public License v3.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
register("buildDexJar") {
|
|
||||||
description = "Build and add a DEX to the JAR file"
|
|
||||||
group = "build"
|
|
||||||
|
|
||||||
dependsOn(build)
|
|
||||||
|
|
||||||
doLast {
|
|
||||||
val d8 = File(System.getenv("ANDROID_HOME")).resolve("build-tools")
|
|
||||||
.listFilesOrdered().last().resolve("d8").absolutePath
|
|
||||||
|
|
||||||
val patchesJar = configurations.archives.get().allArtifacts.files.files.first().absolutePath
|
|
||||||
val workingDirectory = layout.buildDirectory.dir("libs").get().asFile
|
|
||||||
|
|
||||||
exec {
|
|
||||||
workingDir = workingDirectory
|
|
||||||
commandLine = listOf(d8, "--release", patchesJar)
|
|
||||||
}
|
|
||||||
|
|
||||||
exec {
|
|
||||||
workingDir = workingDirectory
|
|
||||||
commandLine = listOf("zip", "-u", patchesJar, "classes.dex")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Needed by gradle-semantic-release-plugin.
|
|
||||||
// Tracking: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
|
||||||
publish {
|
|
||||||
dependsOn("buildDexJar")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
name = "GitHubPackages"
|
|
||||||
url = uri("https://maven.pkg.github.com/revanced/revanced-patches-template")
|
|
||||||
credentials {
|
|
||||||
username = System.getenv("GITHUB_ACTOR")
|
|
||||||
password = System.getenv("GITHUB_TOKEN")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
publications {
|
|
||||||
create<MavenPublication>("revanced-patches-publication") {
|
|
||||||
from(components["java"])
|
|
||||||
|
|
||||||
pom {
|
|
||||||
name = "ReVanced Patches template"
|
|
||||||
description = "Patches template for ReVanced."
|
|
||||||
url = "https://revanced.app"
|
|
||||||
|
|
||||||
licenses {
|
|
||||||
license {
|
|
||||||
name = "GNU General Public License v3.0"
|
|
||||||
url = "https://www.gnu.org/licenses/gpl-3.0.en.html"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
developers {
|
|
||||||
developer {
|
|
||||||
id = "ReVanced"
|
|
||||||
name = "ReVanced"
|
|
||||||
email = "contact@revanced.app"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
scm {
|
|
||||||
connection = "scm:git:git://github.com/revanced/revanced-patches-template.git"
|
|
||||||
developerConnection = "scm:git:git@github.com:revanced/revanced-patches-template.git"
|
|
||||||
url = "https://github.com/revanced/revanced-patches-template"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
signing {
|
|
||||||
useGpgCmd()
|
|
||||||
|
|
||||||
sign(publishing.publications["revanced-patches-publication"])
|
|
||||||
}
|
|
||||||
7
extensions/extension/build.gradle.kts
Normal file
7
extensions/extension/build.gradle.kts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
extension {
|
||||||
|
name = "extensions/extension.rve"
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = "app.revanced.extension"
|
||||||
|
}
|
||||||
1
extensions/extension/src/main/AndroidManifest.xml
Normal file
1
extensions/extension/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<manifest/>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package app.revanced.extension;
|
||||||
|
|
||||||
|
public class ExampleExtension {
|
||||||
|
public static void get() {
|
||||||
|
// TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 1.0.1
|
version = 1.0.2-dev.1
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
[versions]
|
[versions]
|
||||||
revanced-patcher = "19.3.1"
|
revanced-patcher = "20.0.0"
|
||||||
smali = "3.0.4"
|
# Tracking https://github.com/google/smali/issues/64.
|
||||||
binary-compatibility-validator = "0.14.0"
|
#noinspection GradleDependency
|
||||||
kotlin = "1.9.22"
|
smali = "3.0.5"
|
||||||
|
|
||||||
[libraries]
|
|
||||||
revanced-patcher = { module = "app.revanced:revanced-patcher", version.ref = "revanced-patcher" }
|
|
||||||
smali = { module = "com.android.tools.smali:smali", version.ref = "smali" }
|
|
||||||
|
|
||||||
[plugins]
|
|
||||||
binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binary-compatibility-validator" }
|
|
||||||
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
|
||||||
|
|||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
8
gradle/wrapper/gradle-wrapper.properties
vendored
8
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,8 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
|
||||||
distributionSha256Sum=9631d53cf3e74bfa726893aee1f8994fee4e060c401335946dba2156f440f24c
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dist
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
22
gradlew
vendored
22
gradlew
vendored
@@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -55,7 +57,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@@ -83,7 +85,9 @@ done
|
|||||||
# This is normally unused
|
# This is normally unused
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||||
|
' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
@@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@@ -201,11 +205,11 @@ fi
|
|||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command:
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# and any embedded shellness will be escaped.
|
||||||
# double quotes to make sure that they get re-expanded; and
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
|||||||
22
gradlew.bat
vendored
22
gradlew.bat
vendored
@@ -13,6 +13,8 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
|||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
|||||||
3059
package-lock.json
generated
3059
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,6 @@
|
|||||||
"@semantic-release/changelog": "^6.0.3",
|
"@semantic-release/changelog": "^6.0.3",
|
||||||
"@semantic-release/git": "^10.0.1",
|
"@semantic-release/git": "^10.0.1",
|
||||||
"gradle-semantic-release-plugin": "^1.9.1",
|
"gradle-semantic-release-plugin": "^1.9.1",
|
||||||
"semantic-release": "^23.0.2"
|
"semantic-release": "^23.0.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
4
patches/api/patches.api
Normal file
4
patches/api/patches.api
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
public final class app/revanced/patches/example/ExamplePatchKt {
|
||||||
|
public static final fun getExamplePatch ()Lapp/revanced/patcher/patch/BytecodePatch;
|
||||||
|
}
|
||||||
|
|
||||||
13
patches/build.gradle.kts
Normal file
13
patches/build.gradle.kts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
group = "app.revanced"
|
||||||
|
|
||||||
|
patches {
|
||||||
|
about {
|
||||||
|
name = "ReVanced Patches template"
|
||||||
|
description = "Patches template for ReVanced"
|
||||||
|
source = "git@github.com:revanced/revanced-patches-template.git"
|
||||||
|
author = "ReVanced"
|
||||||
|
contact = "contact@revanced.app"
|
||||||
|
website = "https://revanced.app"
|
||||||
|
license = "GNU General Public License v3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package app.revanced.patches.example
|
||||||
|
|
||||||
|
import app.revanced.patcher.patch.bytecodePatch
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
val examplePatch = bytecodePatch(
|
||||||
|
name = "Example Patch",
|
||||||
|
description = "This is an example patch to start with.",
|
||||||
|
) {
|
||||||
|
compatibleWith("com.example.app"("1.0.0"))
|
||||||
|
|
||||||
|
extendWith("extensions/extension.rve")
|
||||||
|
|
||||||
|
execute {
|
||||||
|
// TODO("Not yet implemented")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,20 @@
|
|||||||
rootProject.name = "revanced-patches-template"
|
rootProject.name = "revanced-patches-template"
|
||||||
|
|
||||||
buildCache {
|
pluginManagement {
|
||||||
local {
|
repositories {
|
||||||
isEnabled = "CI" !in System.getenv()
|
gradlePluginPortal()
|
||||||
|
google()
|
||||||
|
maven {
|
||||||
|
name = "GitHubPackages"
|
||||||
|
url = uri("https://maven.pkg.github.com/revanced/registry")
|
||||||
|
credentials {
|
||||||
|
username = providers.gradleProperty("gpr.user").orNull ?: System.getenv("GITHUB_ACTOR")
|
||||||
|
password = providers.gradleProperty("gpr.key").orNull ?: System.getenv("GITHUB_TOKEN")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("app.revanced.patches") version "1.0.0-dev.4"
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
package app.revanced.patches.example
|
|
||||||
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
|
||||||
import app.revanced.patcher.patch.annotation.Patch
|
|
||||||
|
|
||||||
@Patch(
|
|
||||||
name = "Example Patch",
|
|
||||||
description = "This is an example patch to start with.",
|
|
||||||
compatiblePackages = [
|
|
||||||
CompatiblePackage("com.example.app", ["1.0.0"]),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
@Suppress("unused")
|
|
||||||
object ExamplePatch : BytecodePatch(emptySet()) {
|
|
||||||
override fun execute(context: BytecodeContext) {
|
|
||||||
// TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user