mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-04-30 06:34:37 +02:00
build: bump dependencies
This commit is contained in:
parent
3fb9cf01c5
commit
26f29c0a12
25
.github/workflows/build_pull_request.yml
vendored
Normal file
25
.github/workflows/build_pull_request.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
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: Cache Gradle
|
||||||
|
uses: burrunan/gradle-cache-action@v1
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: ./gradlew build --no-daemon
|
30
.github/workflows/release.yml
vendored
30
.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,22 +20,30 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Cache Node modules
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
node_modules
|
|
||||||
key: npm-${{ hashFiles('package-lock.json') }}
|
|
||||||
|
|
||||||
- name: Cache Gradle
|
- name: Cache Gradle
|
||||||
uses: burrunan/gradle-cache-action@v1
|
uses: burrunan/gradle-cache-action@v1
|
||||||
|
|
||||||
- name: Build with Gradle
|
- name: Build
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: ./gradlew generateMeta clean
|
run: ./gradlew generateMeta clean
|
||||||
|
|
||||||
- name: Setup semantic-release
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "lts/*"
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
|
- name: Import GPG key
|
||||||
|
uses: crazy-max/ghaction-import-gpg@v6
|
||||||
|
with:
|
||||||
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
fingerprint: ${{ env.GPG_FINGERPRINT }}
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
|
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
|
||||||
|
18
.github/workflows/update-gradle-wrapper.yml
vendored
Normal file
18
.github/workflows/update-gradle-wrapper.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
name: Update Gradle wrapper
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 1 * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Update Gradle Wrapper
|
||||||
|
uses: gradle-update/update-gradle-wrapper-action@v1
|
||||||
|
with:
|
||||||
|
target-branch: dev
|
@ -33,7 +33,7 @@
|
|||||||
{
|
{
|
||||||
"assets": [
|
"assets": [
|
||||||
{
|
{
|
||||||
"path": "build/libs/*.jar"
|
"path": "build/libs/revanced-patches*"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "patches.json"
|
"path": "patches.json"
|
||||||
|
114
build.gradle.kts
114
build.gradle.kts
@ -1,7 +1,10 @@
|
|||||||
import org.gradle.kotlin.dsl.support.listFilesOrdered
|
import org.gradle.kotlin.dsl.support.listFilesOrdered
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("jvm") version "1.9.20"
|
alias(libs.plugins.kotlin)
|
||||||
|
`maven-publish`
|
||||||
|
signing
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "app.revanced"
|
group = "app.revanced"
|
||||||
@ -10,7 +13,13 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
google()
|
google()
|
||||||
maven { url = uri("https://jitpack.io") }
|
maven {
|
||||||
|
url = uri("https://maven.pkg.github.com/revanced/multidexlib2")
|
||||||
|
credentials {
|
||||||
|
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
|
||||||
|
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@ -21,45 +30,120 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvmToolchain(11)
|
compilerOptions {
|
||||||
|
jvmTarget.set(JvmTarget.JVM_11)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
register<DefaultTask>("generateBundle") {
|
withType(Jar::class) {
|
||||||
description = "Generate dex files from build and bundle them in the jar file"
|
exclude("app/revanced/generator")
|
||||||
|
|
||||||
|
manifest {
|
||||||
|
attributes["Name"] = "ReVanced Patches"
|
||||||
|
attributes["Description"] = "Patches for ReVanced."
|
||||||
|
attributes["Version"] = version
|
||||||
|
attributes["Timestamp"] = System.currentTimeMillis().toString()
|
||||||
|
attributes["Source"] = "git@github.com:revanced/revanced-patches.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)
|
dependsOn(build)
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
val d8 = File(System.getenv("ANDROID_HOME")).resolve("build-tools")
|
val d8 = File(System.getenv("ANDROID_HOME")).resolve("build-tools")
|
||||||
.listFilesOrdered().last().resolve("d8").absolutePath
|
.listFilesOrdered().last().resolve("d8").absolutePath
|
||||||
|
|
||||||
val artifacts = configurations.archives.get().allArtifacts.files.files.first().absolutePath
|
val patchesJar = configurations.archives.get().allArtifacts.files.files.first().absolutePath
|
||||||
val workingDirectory = layout.buildDirectory.dir("libs").get().asFile
|
val workingDirectory = layout.buildDirectory.dir("libs").get().asFile
|
||||||
|
|
||||||
exec {
|
exec {
|
||||||
workingDir = workingDirectory
|
workingDir = workingDirectory
|
||||||
commandLine = listOf(d8, artifacts)
|
commandLine = listOf(d8, "--release", patchesJar)
|
||||||
}
|
}
|
||||||
|
|
||||||
exec {
|
exec {
|
||||||
workingDir = workingDirectory
|
workingDir = workingDirectory
|
||||||
commandLine = listOf("zip", "-u", artifacts, "classes.dex")
|
commandLine = listOf("zip", "-u", patchesJar, "classes.dex")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
register<JavaExec>("generateMeta") {
|
register<JavaExec>("generatePatchesFiles") {
|
||||||
description = "Generate metadata for this bundle"
|
description = "Generate patches files"
|
||||||
|
|
||||||
dependsOn(build)
|
dependsOn(build)
|
||||||
|
|
||||||
classpath = sourceSets["main"].runtimeClasspath
|
classpath = sourceSets["main"].runtimeClasspath
|
||||||
mainClass.set("app.revanced.meta.PatchesFileGenerator")
|
mainClass.set("app.revanced.generator.MainKt")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Required to run tasks because Gradle semantic-release plugin runs the publish task.
|
// Needed by gradle-semantic-release-plugin.
|
||||||
// Tracking: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
// Tracking: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
|
||||||
register<DefaultTask>("publish") {
|
publish {
|
||||||
dependsOn("generateBundle")
|
dependsOn("buildDexJar")
|
||||||
dependsOn("generateMeta")
|
dependsOn("generatePatchesFiles")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
name = "GitHubPackages"
|
||||||
|
url = uri("https://maven.pkg.github.com/revanced/revanced-patches")
|
||||||
|
credentials {
|
||||||
|
username = System.getenv("GITHUB_ACTOR")
|
||||||
|
password = System.getenv("GITHUB_TOKEN")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
publications {
|
||||||
|
create<MavenPublication>("revanced-patches-publication") {
|
||||||
|
from(components["java"])
|
||||||
|
|
||||||
|
pom {
|
||||||
|
name = "ReVanced Patches"
|
||||||
|
description = "Patches 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.git"
|
||||||
|
developerConnection = "scm:git:git@github.com:revanced/revanced-patches.git"
|
||||||
|
url = "https://github.com/revanced/revanced-patches"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
signing {
|
||||||
|
useGpgCmd()
|
||||||
|
|
||||||
|
sign(publishing.publications["revanced-patches-publication"])
|
||||||
|
}
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
[versions]
|
[versions]
|
||||||
revanced-patcher = "19.1.0"
|
revanced-patcher = "19.3.1"
|
||||||
smali = "3.0.3"
|
smali = "3.0.5"
|
||||||
gson = "2.10.1"
|
gson = "2.10.1"
|
||||||
|
kotlin = "1.9.23"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
revanced-patcher = { module = "app.revanced:revanced-patcher", version.ref = "revanced-patcher" }
|
revanced-patcher = { module = "app.revanced:revanced-patcher", version.ref = "revanced-patcher" }
|
||||||
smali = { module = "com.android.tools.smali:smali", version.ref = "smali" }
|
smali = { module = "com.android.tools.smali:smali", version.ref = "smali" }
|
||||||
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
|
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
|
||||||
|
|
||||||
|
[plugins]
|
||||||
|
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||||
|
5450
package-lock.json
generated
5450
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@saithodev/semantic-release-backmerge": "^3.2.1",
|
"@saithodev/semantic-release-backmerge": "^4.0.1",
|
||||||
"@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.8.0",
|
"gradle-semantic-release-plugin": "^1.9.1",
|
||||||
"semantic-release": "^22.0.8"
|
"semantic-release": "^23.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,6 @@ rootProject.name = "revanced-patches"
|
|||||||
|
|
||||||
buildCache {
|
buildCache {
|
||||||
local {
|
local {
|
||||||
isEnabled = !System.getenv().containsKey("CI")
|
isEnabled = "CI" !in System.getenv()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,49 @@
|
|||||||
|
package app.revanced.generator
|
||||||
|
|
||||||
|
import app.revanced.patcher.PatchSet
|
||||||
|
import app.revanced.patcher.patch.Patch
|
||||||
|
import com.google.gson.GsonBuilder
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
internal class JsonPatchesFileGenerator : PatchesFileGenerator {
|
||||||
|
override fun generate(patches: PatchSet) = patches.sortedBy { it.name }.map {
|
||||||
|
JsonPatch(
|
||||||
|
it.name!!,
|
||||||
|
it.description,
|
||||||
|
it.compatiblePackages,
|
||||||
|
it.use,
|
||||||
|
it.requiresIntegrations,
|
||||||
|
it.options.values.map { option ->
|
||||||
|
JsonPatch.Option(
|
||||||
|
option.key,
|
||||||
|
option.default,
|
||||||
|
option.values,
|
||||||
|
option.title,
|
||||||
|
option.description,
|
||||||
|
option.required,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}.let {
|
||||||
|
File("patches.json").writeText(GsonBuilder().serializeNulls().create().toJson(it))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
private class JsonPatch(
|
||||||
|
val name: String? = null,
|
||||||
|
val description: String? = null,
|
||||||
|
val compatiblePackages: Set<Patch.CompatiblePackage>? = null,
|
||||||
|
val use: Boolean = true,
|
||||||
|
val requiresIntegrations: Boolean = false,
|
||||||
|
val options: List<Option>,
|
||||||
|
) {
|
||||||
|
class Option(
|
||||||
|
val key: String,
|
||||||
|
val default: Any?,
|
||||||
|
val values: Map<String, Any?>?,
|
||||||
|
val title: String?,
|
||||||
|
val description: String?,
|
||||||
|
val required: Boolean,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
12
src/main/kotlin/app/revanced/generator/Main.kt
Normal file
12
src/main/kotlin/app/revanced/generator/Main.kt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package app.revanced.generator
|
||||||
|
|
||||||
|
import app.revanced.patcher.PatchBundleLoader
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
internal fun main() = PatchBundleLoader.Jar(
|
||||||
|
File("build/libs/").listFiles { it -> it.name.endsWith(".jar") }!!.first(),
|
||||||
|
).also { loader ->
|
||||||
|
if (loader.isEmpty()) throw IllegalStateException("No patches found")
|
||||||
|
}.let { bundle ->
|
||||||
|
arrayOf(JsonPatchesFileGenerator(), ReadMeFileGenerator()).forEach { generator -> generator.generate(bundle) }
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package app.revanced.generator
|
||||||
|
|
||||||
|
import app.revanced.patcher.PatchSet
|
||||||
|
|
||||||
|
internal interface PatchesFileGenerator {
|
||||||
|
fun generate(patches: PatchSet)
|
||||||
|
}
|
@ -1,10 +1,10 @@
|
|||||||
package app.revanced.meta
|
package app.revanced.generator
|
||||||
|
|
||||||
import app.revanced.patcher.PatchSet
|
import app.revanced.patcher.PatchSet
|
||||||
import app.revanced.patcher.patch.Patch
|
import app.revanced.patcher.patch.Patch
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
internal class ReadmeGenerator : PatchesFileGenerator {
|
internal class ReadMeFileGenerator : PatchesFileGenerator {
|
||||||
private companion object {
|
private companion object {
|
||||||
private const val TABLE_HEADER =
|
private const val TABLE_HEADER =
|
||||||
"| \uD83D\uDC8A Patch | \uD83D\uDCDC Description | \uD83C\uDFF9 Target Version |\n" +
|
"| \uD83D\uDC8A Patch | \uD83D\uDCDC Description | \uD83C\uDFF9 Target Version |\n" +
|
@ -1,51 +0,0 @@
|
|||||||
package app.revanced.meta
|
|
||||||
|
|
||||||
import app.revanced.patcher.PatchSet
|
|
||||||
import app.revanced.patcher.patch.Patch
|
|
||||||
import com.google.gson.GsonBuilder
|
|
||||||
import java.io.File
|
|
||||||
|
|
||||||
internal class JsonGenerator : PatchesFileGenerator {
|
|
||||||
override fun generate(patches: PatchSet) = patches
|
|
||||||
.sortedBy { it.name }
|
|
||||||
.map {
|
|
||||||
JsonPatch(
|
|
||||||
it.name!!,
|
|
||||||
it.description,
|
|
||||||
it.compatiblePackages,
|
|
||||||
it.use,
|
|
||||||
it.requiresIntegrations,
|
|
||||||
it.options.values.map { option ->
|
|
||||||
JsonPatch.Option(
|
|
||||||
option.key,
|
|
||||||
option.default,
|
|
||||||
option.values,
|
|
||||||
option.title,
|
|
||||||
option.description,
|
|
||||||
option.required
|
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}.let {
|
|
||||||
File("patches.json").writeText(GsonBuilder().serializeNulls().create().toJson(it))
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("unused")
|
|
||||||
private class JsonPatch(
|
|
||||||
val name: String? = null,
|
|
||||||
val description: String? = null,
|
|
||||||
val compatiblePackages: Set<Patch.CompatiblePackage>? = null,
|
|
||||||
val use: Boolean = true,
|
|
||||||
val requiresIntegrations: Boolean = false,
|
|
||||||
val options: List<Option>
|
|
||||||
) {
|
|
||||||
class Option(
|
|
||||||
val key: String,
|
|
||||||
val default: Any?,
|
|
||||||
val values: Map<String, Any?>?,
|
|
||||||
val title: String?,
|
|
||||||
val description: String?,
|
|
||||||
val required: Boolean,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
package app.revanced.meta
|
|
||||||
|
|
||||||
import app.revanced.patcher.PatchBundleLoader
|
|
||||||
import app.revanced.patcher.PatchSet
|
|
||||||
import java.io.File
|
|
||||||
|
|
||||||
internal interface PatchesFileGenerator {
|
|
||||||
fun generate(patches: PatchSet)
|
|
||||||
|
|
||||||
private companion object {
|
|
||||||
@JvmStatic
|
|
||||||
fun main(args: Array<String>) = PatchBundleLoader.Jar(
|
|
||||||
File("build/libs/").listFiles { it -> it.name.endsWith(".jar") }!!.first()
|
|
||||||
).also { loader ->
|
|
||||||
if (loader.isEmpty()) throw IllegalStateException("No patches found")
|
|
||||||
}.let { bundle ->
|
|
||||||
arrayOf(JsonGenerator(), ReadmeGenerator()).forEach { generator ->
|
|
||||||
generator.generate(
|
|
||||||
bundle
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user