Skip to content

Commit 33bd7db

Browse files
committed
fix: merge upstream
1 parent dae16cf commit 33bd7db

16 files changed

Lines changed: 415 additions & 112 deletions

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[*.{kt,kts}]
2+
ktlint_code_style = intellij_idea
3+
ktlint_standard_no-wildcard-imports = disabled

.github/workflows/apidump.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: apiDump
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
apidump:
8+
name: dump api
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
# Make sure the release step uses its own credentials:
15+
# https://github.com/cycjimmy/semantic-release-action#private-packages
16+
persist-credentials: false
17+
fetch-depth: 0
18+
19+
- name: Cache Gradle
20+
uses: burrunan/gradle-cache-action@v1
21+
22+
- name: Build
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
25+
run: ./gradlew apiDump
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build pull request
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- dev
8+
9+
jobs:
10+
release:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Cache Gradle
20+
uses: burrunan/gradle-cache-action@v1
21+
22+
- name: Build
23+
run: ./gradlew build clean
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Open a PR to main
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
workflow_dispatch:
8+
9+
env:
10+
MESSAGE: Merge branch `${{ github.head_ref || github.ref_name }}` to `main`
11+
12+
jobs:
13+
pull-request:
14+
name: Open pull request
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Open pull request
21+
uses: repo-sync/pull-request@v2
22+
with:
23+
destination_branch: 'main'
24+
pr_title: 'chore: ${{ env.MESSAGE }}'
25+
pr_body: 'This pull request will ${{ env.MESSAGE }}.'
26+
pr_draft: true

.github/workflows/release.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ on:
66
branches:
77
- main
88
- dev
9-
pull_request:
10-
branches:
11-
- main
12-
- dev
139

1410
jobs:
1511
release:
@@ -24,12 +20,10 @@ jobs:
2420
persist-credentials: false
2521
fetch-depth: 0
2622

27-
# - name: Cache Gradle
28-
# uses: burrunan/gradle-cache-action@v1
29-
- name: Setup Gradle
30-
uses: gradle/actions/setup-gradle@v3
23+
- name: Cache Gradle
24+
uses: burrunan/gradle-cache-action@v1
3125

32-
- name: Build with Gradle
26+
- name: Build
3327
env:
3428
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
3529
run: ./gradlew build clean
@@ -43,6 +37,13 @@ jobs:
4337
- name: Install dependencies
4438
run: npm install
4539

40+
# - name: Import GPG key
41+
# uses: crazy-max/ghaction-import-gpg@v6
42+
# with:
43+
# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
44+
# passphrase: ${{ secrets.GPG_PASSPHRASE }}
45+
# fingerprint: ${{ env.GPG_FINGERPRINT }}
46+
4647
- name: Release
4748
env:
4849
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}

.releaserc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@
3333
{
3434
"assets": [
3535
{
36-
"path": "build/libs/*.jar"
37-
},
38-
{
39-
"path": "patches.json"
36+
"path": "build/libs/revanced-patches*"
4037
}
4138
],
4239
successComment: false

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## [1.2.1-dev.1](https://github.com/Indranil012/Dropped-Patches/compare/v1.2.0...v1.2.1-dev.1) (2024-03-04)
2+
3+
4+
### Bug Fixes
5+
6+
* **nova:** Update patch ([fe30abb](https://github.com/Indranil012/Dropped-Patches/commit/fe30abb9e524843ded97d64d9171e6be47309d7d))
7+
8+
## [1.2.1](https://github.com/Indranil012/Dropped-Patches/compare/v1.2.0...v1.2.1) (2024-03-04)
9+
10+
11+
### Bug Fixes
12+
13+
* **nova:** Update patch ([fe30abb](https://github.com/Indranil012/Dropped-Patches/commit/fe30abb9e524843ded97d64d9171e6be47309d7d))
14+
115
## [1.2.1](https://github.com/Indranil012/Dropped-Patches/compare/v1.2.0...v1.2.1) (2024-02-18)
216

317

api/dropped-patches.api

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
public final class app/revanced/patches/fxfileexplorer/unlockplus/UnlockPlusPatch : app/revanced/patcher/patch/BytecodePatch {
2+
public static final field INSTANCE Lapp/revanced/patches/fxfileexplorer/unlockplus/UnlockPlusPatch;
3+
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
4+
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
5+
}
6+
7+
public final class app/revanced/patches/fxfileexplorer/unlockplus/fingerprints/IsPlusUnlockedFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint {
8+
public static final field INSTANCE Lapp/revanced/patches/fxfileexplorer/unlockplus/fingerprints/IsPlusUnlockedFingerprint;
9+
}
10+
11+
public final class app/revanced/patches/nova/prime/fingerprints/UpdatePrimeStatusFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint {
12+
public static final field INSTANCE Lapp/revanced/patches/nova/prime/fingerprints/UpdatePrimeStatusFingerprint;
13+
}
14+
15+
public final class app/revanced/patches/nova/prime/patch/UnlockPrimePatch : app/revanced/patcher/patch/BytecodePatch {
16+
public static final field INSTANCE Lapp/revanced/patches/nova/prime/patch/UnlockPrimePatch;
17+
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
18+
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
19+
}
20+
21+
public final class app/revanced/patches/tasker/trial/unlock/fingerprints/CheckLicenseFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint {
22+
public static final field INSTANCE Lapp/revanced/patches/tasker/trial/unlock/fingerprints/CheckLicenseFingerprint;
23+
}
24+
25+
public final class app/revanced/patches/tasker/trial/unlock/patch/UnlockLicensePatch : app/revanced/patcher/patch/BytecodePatch {
26+
public static final field INSTANCE Lapp/revanced/patches/tasker/trial/unlock/patch/UnlockLicensePatch;
27+
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
28+
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
29+
}
30+

build.gradle.kts

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import org.gradle.kotlin.dsl.support.listFilesOrdered
22

33
plugins {
4-
kotlin("jvm") version "1.9.10"
4+
alias(libs.plugins.kotlin)
5+
alias(libs.plugins.binary.compatibility.validator)
56
`maven-publish`
7+
signing
68
}
79

810
group = "dropped"
@@ -12,26 +14,28 @@ repositories {
1214
mavenLocal()
1315
google()
1416
maven { url = uri("https://jitpack.io") }
17+
maven {
18+
// A repository must be speficied for some reason. "registry" is a dummy.
19+
url = uri("https://maven.pkg.github.com/revanced/registry")
20+
credentials {
21+
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
22+
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
23+
}
24+
}
1525
}
1626

1727
dependencies {
1828
implementation(libs.revanced.patcher)
1929
implementation(libs.revanced.patches)
2030
implementation(libs.smali)
21-
// TODO: Required because build fails without it. Find a way to remove this dependency.
22-
implementation(libs.guava)
23-
// Used in JsonGenerator.
24-
implementation(libs.gson)
25-
26-
// A dependency to the Android library unfortunately fails the build, which is why this is required.
27-
compileOnly(project("dummy"))
2831
}
2932

3033
kotlin {
3134
jvmToolchain(11)
3235
}
3336

34-
tasks.withType(Jar::class) {
37+
tasks {
38+
withType(Jar::class) {
3539
manifest {
3640
attributes["Name"] = "Dropped Patches"
3741
attributes["Description"] = "Patches for ReVanced."
@@ -43,49 +47,60 @@ tasks.withType(Jar::class) {
4347
attributes["Origin"] = "https://github.com/Indranil012/Dropped-Patches"
4448
attributes["License"] = "GNU General Public License v3.0"
4549
}
46-
}
50+
}
4751

48-
tasks {
49-
register<DefaultTask>("generateBundle") {
50-
description = "Generate DEX files and add them in the JAR file"
52+
register("buildDexJar") {
53+
description = "Build and add a DEX to the JAR file"
54+
group = "build"
5155

5256
dependsOn(build)
5357

5458
doLast {
5559
val d8 = File(System.getenv("ANDROID_HOME")).resolve("build-tools")
5660
.listFilesOrdered().last().resolve("d8").absolutePath
5761

58-
val artifacts = configurations.archives.get().allArtifacts.files.files.first().absolutePath
62+
val patchesJar = configurations.archives.get().allArtifacts.files.files.first().absolutePath
5963
val workingDirectory = layout.buildDirectory.dir("libs").get().asFile
6064

6165
exec {
6266
workingDir = workingDirectory
63-
commandLine = listOf(d8, artifacts)
67+
commandLine = listOf(d8, "--release", patchesJar)
6468
}
6569

6670
exec {
6771
workingDir = workingDirectory
68-
commandLine = listOf("zip", "-u", artifacts, "classes.dex")
72+
commandLine = listOf("zip", "-u", patchesJar, "classes.dex")
6973
}
7074
}
7175
}
7276

73-
// Required to run tasks because Gradle semantic-release plugin runs the publish task.
77+
// Needed by gradle-semantic-release-plugin.
7478
// Tracking: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
75-
named("publish") {
76-
dependsOn("generateBundle")
79+
publish {
80+
dependsOn("buildDexJar")
7781
}
7882
}
7983

8084
publishing {
85+
repositories {
86+
maven {
87+
name = "GitHubPackages"
88+
url = uri("https://maven.pkg.github.com/revanced/revanced-patches-template")
89+
credentials {
90+
username = System.getenv("GITHUB_ACTOR")
91+
password = System.getenv("GITHUB_TOKEN")
92+
}
93+
}
94+
}
95+
8196
publications {
8297
create<MavenPublication>("revanced-patches-publication") {
8398
from(components["java"])
8499

85100
pom {
86101
name = "Your Patches"
87102
description = "Patches for ReVanced."
88-
url = "https://your.homepage"
103+
url = "https://revanced.app"
89104

90105
licenses {
91106
license {
@@ -109,3 +124,9 @@ publishing {
109124
}
110125
}
111126
}
127+
128+
signing {
129+
useGpgCmd()
130+
131+
sign(publishing.publications["revanced-patches-publication"])
132+
}

dummy/build.gradle.kts

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)