You've already forked revanced-patcher
mirror of
https://github.com/revanced/revanced-patcher
synced 2025-09-13 18:30:49 +02:00
Compare commits
15 Commits
v14.2.0-de
...
v14.2.2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c4a7117ee8 | ||
![]() |
b4e900fde8 | ||
![]() |
9818d730e4 | ||
![]() |
11a3378659 | ||
![]() |
1bb05f22d3 | ||
![]() |
26b70554c4 | ||
![]() |
93b29d2e83 | ||
![]() |
072986374a | ||
![]() |
2c590d212a | ||
![]() |
6cc863efb3 | ||
![]() |
b832812767 | ||
![]() |
c44558cacd | ||
![]() |
6d83a720cd | ||
![]() |
8d0dd9c448 | ||
![]() |
64020eec49 |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
||||
- name: Build with Gradle
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./gradlew clean --no-daemon
|
||||
run: ./gradlew build clean --no-daemon
|
||||
- name: Setup semantic-release
|
||||
run: npm install
|
||||
- name: Release
|
||||
|
41
CHANGELOG.md
41
CHANGELOG.md
@@ -1,3 +1,44 @@
|
||||
## [14.2.2](https://github.com/ReVanced/revanced-patcher/compare/v14.2.1...v14.2.2) (2023-08-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allow setting `DexClassLoader.optimizedDirectory` ([11a3378](https://github.com/ReVanced/revanced-patcher/commit/11a337865947a6ac74a63ebb3f3f9bc2610f7771))
|
||||
|
||||
## [14.2.2-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v14.2.1...v14.2.2-dev.1) (2023-08-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allow setting `DexClassLoader.optimizedDirectory` ([11a3378](https://github.com/ReVanced/revanced-patcher/commit/11a337865947a6ac74a63ebb3f3f9bc2610f7771))
|
||||
|
||||
## [14.2.1](https://github.com/ReVanced/revanced-patcher/compare/v14.2.0...v14.2.1) (2023-08-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* do not flag resource table as sparse when main package is not loaded ([b832812](https://github.com/ReVanced/revanced-patcher/commit/b832812767a06ec6ec232291e6d14c8c2f14118c))
|
||||
|
||||
## [14.2.1-dev.1](https://github.com/ReVanced/revanced-patcher/compare/v14.2.0...v14.2.1-dev.1) (2023-08-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* do not flag resource table as sparse when main package is not loaded ([b832812](https://github.com/ReVanced/revanced-patcher/commit/b832812767a06ec6ec232291e6d14c8c2f14118c))
|
||||
|
||||
# [14.2.0](https://github.com/ReVanced/revanced-patcher/compare/v14.1.0...v14.2.0) (2023-08-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* load patches in lexicographical order ([e8f2087](https://github.com/ReVanced/revanced-patcher/commit/e8f2087a6ffa6077fb3a6a69e29f3aec72e2fc1b))
|
||||
* log when merging integrations ([983563e](https://github.com/ReVanced/revanced-patcher/commit/983563efb6d7c8d289464b8bf71a016b8a735630))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* compare types of classes ([55d6945](https://github.com/ReVanced/revanced-patcher/commit/55d694579ac2718b9e2c61ca5f38419c3775ef87))
|
||||
|
||||
# [14.2.0-dev.3](https://github.com/ReVanced/revanced-patcher/compare/v14.2.0-dev.2...v14.2.0-dev.3) (2023-08-26)
|
||||
|
||||
|
||||
|
843
api/revanced-patcher.api
Normal file
843
api/revanced-patcher.api
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
plugins {
|
||||
kotlin("jvm") version "1.8.20"
|
||||
`maven-publish`
|
||||
alias(libs.plugins.binary.compatibility.validator)
|
||||
}
|
||||
|
||||
group = "app.revanced"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
org.gradle.parallel = true
|
||||
org.gradle.caching = true
|
||||
kotlin.code.style = official
|
||||
version = 14.2.0-dev.3
|
||||
version = 14.2.2
|
||||
|
@@ -1,14 +1,13 @@
|
||||
[versions]
|
||||
android = "4.1.1.4"
|
||||
kotlin-reflect = "1.9.0"
|
||||
apktool-lib = "2.8.2-5"
|
||||
apktool-lib = "2.8.2-6"
|
||||
kotlin-test = "1.8.20-RC"
|
||||
kotlinx-coroutines-core = "1.7.1"
|
||||
multidexlib2 = "3.0.3.r2"
|
||||
shadow = "8.1.1"
|
||||
smali = "3.0.3"
|
||||
xpp3 = "1.1.4c"
|
||||
|
||||
binary-compatibility-validator = "0.13.2"
|
||||
|
||||
[libraries]
|
||||
android = { module = "com.google.android:android", version.ref = "android" }
|
||||
@@ -19,3 +18,6 @@ kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-c
|
||||
multidexlib2 = { module = "app.revanced:multidexlib2", version.ref = "multidexlib2" }
|
||||
smali = { module = "com.android.tools.smali:smali", version.ref = "smali" }
|
||||
xpp3 = { module = "xpp3:xpp3", version.ref = "xpp3" }
|
||||
|
||||
[plugins]
|
||||
binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binary-compatibility-validator" }
|
||||
|
@@ -16,6 +16,7 @@ import java.util.jar.JarFile
|
||||
/**
|
||||
* A patch bundle.
|
||||
*
|
||||
*
|
||||
* @param fromClasses The classes to get [Patch]es from.
|
||||
*/
|
||||
sealed class PatchBundleLoader private constructor(
|
||||
@@ -39,8 +40,10 @@ sealed class PatchBundleLoader private constructor(
|
||||
*
|
||||
* @param patchBundles The path to patch bundles of JAR format.
|
||||
*/
|
||||
class Jar(vararg patchBundles: File) :
|
||||
PatchBundleLoader(with(URLClassLoader(patchBundles.map { it.toURI().toURL() }.toTypedArray())) {
|
||||
class Jar(vararg patchBundles: File) : PatchBundleLoader(
|
||||
with(
|
||||
URLClassLoader(patchBundles.map { it.toURI().toURL() }.toTypedArray())
|
||||
) {
|
||||
patchBundles.flatMap { patchBundle ->
|
||||
// Get the names of all classes in the DEX file.
|
||||
|
||||
@@ -55,20 +58,25 @@ sealed class PatchBundleLoader private constructor(
|
||||
* A [PatchBundleLoader] for [Dex] files.
|
||||
*
|
||||
* @param patchBundles The path to patch bundles of DEX format.
|
||||
* @param optimizedDexDirectory The directory to store optimized DEX files in.
|
||||
* This parameter is deprecated and has no effect since API level 26.
|
||||
*/
|
||||
class Dex(vararg patchBundles: File) : PatchBundleLoader(with(
|
||||
DexClassLoader(
|
||||
patchBundles.joinToString(File.pathSeparator) { it.absolutePath },
|
||||
null,
|
||||
class Dex(vararg patchBundles: File, optimizedDexDirectory: File? = null) : PatchBundleLoader(
|
||||
with(
|
||||
DexClassLoader(
|
||||
patchBundles.joinToString(File.pathSeparator) { it.absolutePath }, optimizedDexDirectory?.absolutePath,
|
||||
null,
|
||||
PatchBundleLoader::class.java.classLoader
|
||||
)
|
||||
) {
|
||||
)
|
||||
) {
|
||||
patchBundles
|
||||
.flatMap {
|
||||
MultiDexIO.readDexFile(true, it, BasicDexFileNamer(), null, null).classes
|
||||
}
|
||||
.map { classDef -> classDef.type.substring(1, classDef.length - 1) }
|
||||
.map { loadClass(it) }
|
||||
})
|
||||
}) {
|
||||
@Deprecated("This constructor is deprecated. Use the constructor with the second parameter instead.")
|
||||
constructor(vararg patchBundles: File) : this(*patchBundles, optimizedDexDirectory = null)
|
||||
}
|
||||
}
|
@@ -109,6 +109,7 @@ class BytecodeContext internal constructor(private val options: PatcherOptions)
|
||||
|
||||
logger.info("Merging integrations")
|
||||
|
||||
// TODO: Multi-thread this.
|
||||
this@Integrations.forEach { integrations ->
|
||||
MultiDexIO.readDexFile(
|
||||
true,
|
||||
|
@@ -83,6 +83,16 @@ class ResourceContext internal constructor(
|
||||
versionInfo.let {
|
||||
metadata.packageVersion = it.versionName ?: it.versionCode
|
||||
}
|
||||
|
||||
/*
|
||||
The ResTable if flagged as sparse if the main package is not loaded, which is the case here,
|
||||
because ResourcesDecoder.decodeResources loads the main package
|
||||
and not XmlPullStreamDecoder.decodeManifest.
|
||||
See ARSCDecoder.readTableType for more info.
|
||||
|
||||
Set this to false again to prevent the ResTable from being flagged as sparse falsely.
|
||||
*/
|
||||
metadata.apkInfo.sparseResources = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,7 +3,9 @@ package app.revanced.patcher.patch
|
||||
import app.revanced.patcher.usage.bytecode.ExampleBytecodePatch
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.assertThrows
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertNotEquals
|
||||
import kotlin.test.assertNotNull
|
||||
|
||||
internal class PatchOptionsTest {
|
||||
private val options = ExampleBytecodePatch.options
|
||||
@@ -23,14 +25,14 @@ internal class PatchOptionsTest {
|
||||
is PatchOption.StringListOption -> {
|
||||
option.value = option.options.first()
|
||||
for (choice in option.options) {
|
||||
println(choice)
|
||||
assertNotNull(choice)
|
||||
}
|
||||
}
|
||||
|
||||
is PatchOption.IntListOption -> {
|
||||
option.value = option.options.first()
|
||||
for (choice in option.options) {
|
||||
println(choice)
|
||||
assertNotNull(choice)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,9 +40,9 @@ internal class PatchOptionsTest {
|
||||
val option = options.get<String>("key1")
|
||||
// or: val option: String? by options["key1"]
|
||||
// then you won't need `.value` every time
|
||||
println(option.value)
|
||||
assertEquals("Hello World", option.value)
|
||||
options["key1"] = "Hello, world!"
|
||||
println(option.value)
|
||||
assertEquals("Hello, world!", option.value)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -101,7 +103,7 @@ internal class PatchOptionsTest {
|
||||
@Test
|
||||
fun `should fail because getting a non-initialized option is illegal`() {
|
||||
assertThrows<RequirementNotMetException> {
|
||||
println(options["key5"].value)
|
||||
options["key5"].value
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user