Skip to content

Commit c3427b9

Browse files
author
LisoUseInAIKyrios
authored
chore: Merge branch dev to main (#326)
2 parents ead701b + f570a9f commit c3427b9

File tree

17 files changed

+985
-682
lines changed

17 files changed

+985
-682
lines changed

.github/workflows/build_pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@v5
1616
with:
1717
fetch-depth: 0
1818

1919
- name: Cache Gradle
20-
uses: burrunan/gradle-cache-action@v1
20+
uses: burrunan/gradle-cache-action@v3
2121

2222
- name: Build
2323
env:

.github/workflows/open_pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v5
1919

2020
- name: Open pull request
2121
uses: repo-sync/pull-request@v2

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@v5
2020
with:
2121
# Make sure the release step uses its own credentials:
2222
# https://github.com/cycjimmy/semantic-release-action#private-packages
2323
persist-credentials: false
2424
fetch-depth: 0
2525

2626
- name: Cache Gradle
27-
uses: burrunan/gradle-cache-action@v1
27+
uses: burrunan/gradle-cache-action@v3
2828

2929
- name: Build
3030
env:
3131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3232
run: ./gradlew build clean
3333

3434
- name: Setup Node.js
35-
uses: actions/setup-node@v4
35+
uses: actions/setup-node@v5
3636
with:
3737
node-version: "lts/*"
3838
cache: 'npm'

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
# [21.1.0-dev.4](https://github.com/ReVanced/revanced-patcher/compare/v21.1.0-dev.3...v21.1.0-dev.4) (2025-07-18)
2+
3+
4+
### Bug Fixes
5+
6+
* Correctly save XML files in UTF-8 by using a bufferedWriter ([#356](https://github.com/ReVanced/revanced-patcher/issues/356)) ([33fadcb](https://github.com/ReVanced/revanced-patcher/commit/33fadcbd0c7076b848bdca4d62a9c684d5781232))
7+
8+
# [21.1.0-dev.3](https://github.com/ReVanced/revanced-patcher/compare/v21.1.0-dev.2...v21.1.0-dev.3) (2025-06-20)
9+
10+
11+
### Bug Fixes
12+
13+
* Encode XML files as UTF-8 to fix compilation of resources ([#339](https://github.com/ReVanced/revanced-patcher/issues/339)) ([4f2ef3c](https://github.com/ReVanced/revanced-patcher/commit/4f2ef3c47cea76a26c464cfb45d4bb57fe7198b5))
14+
15+
# [21.1.0-dev.2](https://github.com/ReVanced/revanced-patcher/compare/v21.1.0-dev.1...v21.1.0-dev.2) (2025-06-20)
16+
17+
18+
### Bug Fixes
19+
20+
* Add back missing log by naming logger correctly ([#332](https://github.com/ReVanced/revanced-patcher/issues/332)) ([e4e66b0](https://github.com/ReVanced/revanced-patcher/commit/e4e66b0d8bb0986b79fb150b9c15da35b8e11561))
21+
* Support UTF-8 chars when compiling instructions in Smali in non UTF-8 environments ([#331](https://github.com/ReVanced/revanced-patcher/issues/331)) ([bb8771b](https://github.com/ReVanced/revanced-patcher/commit/bb8771bb8b8ab1724d957e56f4de88c02684d87b))
22+
23+
24+
### Features
25+
26+
* Use option name as key for simplicity and consistency ([754b02e](https://github.com/ReVanced/revanced-patcher/commit/754b02e4ca66ec10764d5205c6643f2d86d0c6a2))
27+
28+
29+
### Performance Improvements
30+
31+
* Use a buffered writer to reduce IO overhead ([#347](https://github.com/ReVanced/revanced-patcher/issues/347)) ([99f4318](https://github.com/ReVanced/revanced-patcher/commit/99f431897eb9e607987fd5d09b879d7eda442f3e))
32+
33+
# [21.1.0-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v21.0.0...v21.1.0-dev.1) (2024-12-07)
34+
35+
36+
### Features
37+
38+
* Add identity hash code to unnamed patches ([88a3252](https://github.com/ReVanced/revanced-patcher/commit/88a325257494939a79fb30dd51d60c5c52546755))
39+
140
# [21.0.0](https://github.com/ReVanced/revanced-patcher/compare/v20.0.2...v21.0.0) (2024-11-05)
241

342

api/revanced-patcher.api

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ public final class app/revanced/patcher/Patcher : java/io/Closeable {
7373
}
7474

7575
public final class app/revanced/patcher/PatcherConfig {
76+
public fun <init> (Ljava/io/File;Ljava/io/File;Ljava/io/File;Ljava/lang/String;)V
77+
public synthetic fun <init> (Ljava/io/File;Ljava/io/File;Ljava/io/File;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
7678
public fun <init> (Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;)V
7779
public synthetic fun <init> (Ljava/io/File;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
7880
}
@@ -169,9 +171,12 @@ public final class app/revanced/patcher/patch/BytecodePatchContext : app/revance
169171
public final class app/revanced/patcher/patch/Option {
170172
public fun <init> (Ljava/lang/String;Ljava/lang/Object;Ljava/util/Map;Ljava/lang/String;Ljava/lang/String;ZLkotlin/reflect/KType;Lkotlin/jvm/functions/Function2;)V
171173
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/Object;Ljava/util/Map;Ljava/lang/String;Ljava/lang/String;ZLkotlin/reflect/KType;Lkotlin/jvm/functions/Function2;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
174+
public fun <init> (Ljava/lang/String;Ljava/lang/Object;Ljava/util/Map;Ljava/lang/String;ZLkotlin/reflect/KType;Lkotlin/jvm/functions/Function2;)V
175+
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/Object;Ljava/util/Map;Ljava/lang/String;ZLkotlin/reflect/KType;Lkotlin/jvm/functions/Function2;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
172176
public final fun getDefault ()Ljava/lang/Object;
173177
public final fun getDescription ()Ljava/lang/String;
174178
public final fun getKey ()Ljava/lang/String;
179+
public final fun getName ()Ljava/lang/String;
175180
public final fun getRequired ()Z
176181
public final fun getTitle ()Ljava/lang/String;
177182
public final fun getType ()Lkotlin/reflect/KType;

docs/2_2_patch_anatomy.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,26 +73,26 @@ package app.revanced.patches.ads
7373
val disableAdsPatch = bytecodePatch(
7474
name = "Disable ads",
7575
description = "Disable ads in the app.",
76-
) {
76+
) {
7777
compatibleWith("com.some.app"("1.0.0"))
78-
78+
7979
// Patches can depend on other patches, executing them first.
8080
dependsOn(disableAdsResourcePatch)
8181

8282
// Merge precompiled DEX files into the patched app, before the patch is executed.
8383
extendWith("disable-ads.rve")
84-
84+
8585
// Business logic of the patch to disable ads in the app.
8686
execute {
8787
// Fingerprint to find the method to patch.
88-
val showAdsMatch by showAdsFingerprint {
89-
// More about fingerprints on the next page of the documentation.
88+
val showAdsFingerprint = fingerprint {
89+
// More about fingerprints on the next page of the documentation.
9090
}
91-
91+
9292
// In the method that shows ads,
9393
// call DisableAdsPatch.shouldDisableAds() from the extension (precompiled DEX file)
9494
// to enable or disable ads.
95-
showAdsMatch.method.addInstructions(
95+
showAdsFingerprint.method.addInstructions(
9696
0,
9797
"""
9898
invoke-static {}, LDisableAdsPatch;->shouldDisableAds()Z
@@ -122,11 +122,11 @@ To define an option, use the available `option` functions:
122122
```kt
123123
val patch = bytecodePatch(name = "Patch") {
124124
// Add an inbuilt option and delegate it to a property.
125-
val value by stringOption(key = "option")
125+
val value by stringOption(name = "Inbuilt option")
126126

127127
// Add an option with a custom type and delegate it to a property.
128-
val string by option<String>(key = "string")
129-
128+
val string by option<String>(name = "String option")
129+
130130
execute {
131131
println(value)
132132
println(string)
@@ -139,7 +139,7 @@ Options of a patch can be set after loading the patches with `PatchLoader` by ob
139139
```kt
140140
loadPatchesJar(patches).apply {
141141
// Type is checked at runtime.
142-
first { it.name == "Patch" }.options["option"] = "Value"
142+
first { it.name == "Patch" }.options["Option"] = "Value"
143143
}
144144
```
145145

@@ -152,7 +152,7 @@ option.type // The KType of the option. Captures the full type information of th
152152
Options can be declared outside a patch and added to a patch manually:
153153

154154
```kt
155-
val option = stringOption(key = "option")
155+
val option = stringOption(name = "Option")
156156

157157
bytecodePatch(name = "Patch") {
158158
val value by option()
@@ -183,18 +183,18 @@ and use it in a patch:
183183
```kt
184184
val patch = bytecodePatch(name = "Complex patch") {
185185
extendWith("complex-patch.rve")
186-
187-
execute {
188-
fingerprint.match!!.mutableMethod.addInstructions(0, "invoke-static { }, LComplexPatch;->doSomething()V")
186+
187+
execute {
188+
fingerprint.method.addInstructions(0, "invoke-static { }, LComplexPatch;->doSomething()V")
189189
}
190190
}
191191
```
192192

193-
ReVanced Patcher merges the classes from the extension into `context.classes` before executing the patch.
193+
ReVanced Patcher merges the classes from the extension into `context.classes` before executing the patch.
194194
When the patch is executed, it can reference the classes and methods from the extension.
195195

196196
> [!NOTE]
197-
>
197+
>
198198
> The [ReVanced Patches template](https://github.com/ReVanced/revanced-patches-template) repository
199199
> is a template project to create patches and extensions.
200200
@@ -211,9 +211,9 @@ A simple real-world example would be a patch that opens a resource file of the a
211211
Other patches that depend on this patch can write to the file, and the finalization block can close the file.
212212

213213
```kt
214-
val patch = bytecodePatch(name = "Patch") {
214+
val patch = bytecodePatch(name = "Patch") {
215215
dependsOn(
216-
bytecodePatch(name = "Dependency") {
216+
bytecodePatch(name = "Dependency") {
217217
execute {
218218
print("1")
219219
}
@@ -249,10 +249,10 @@ The same order is followed for multiple patches depending on the patch.
249249
- A patch can declare compatibility with specific packages and versions,
250250
but patches can still be executed on any package or version.
251251
It is recommended that compatibility is specified to present known compatible packages and versions.
252-
- If `compatibleWith` is not used, the patch is treated as compatible with any package
252+
- If `compatibleWith` is not used, the patch is treated as compatible with any package
253253
- If a package is specified with no versions, the patch is compatible with any version of the package
254254
- If an empty array of versions is specified, the patch is not compatible with any version of the package.
255-
This is useful for declaring incompatibility with a specific package.
255+
This is useful for declaring incompatibility with a specific package.
256256
- A patch can raise a `PatchException` at any time of execution to indicate that the patch failed to execute.
257257

258258
## ⏭️ What's next

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
org.gradle.parallel = true
22
org.gradle.caching = true
3-
version = 21.0.0
3+
version = 21.1.0-dev.4

gradle/libs.versions.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[versions]
22
android = "4.1.1.4"
3-
apktool-lib = "2.9.3"
4-
binary-compatibility-validator = "0.15.1"
5-
kotlin = "2.0.0"
6-
kotlinx-coroutines-core = "1.8.1"
7-
mockk = "1.13.10"
3+
apktool-lib = "2.10.1.1"
4+
binary-compatibility-validator = "0.18.1"
5+
kotlin = "2.0.20"
6+
kotlinx-coroutines-core = "1.10.2"
7+
mockk = "1.14.5"
88
multidexlib2 = "3.0.3.r3"
99
# Tracking https://github.com/google/smali/issues/64.
1010
#noinspection GradleDependency
11-
smali = "3.0.5"
11+
smali = "3.0.9"
1212
xpp3 = "1.1.4c"
1313

1414
[libraries]

0 commit comments

Comments
 (0)