mirror of
https://github.com/ReVanced/revanced-library.git
synced 2026-01-11 22:06:18 +00:00
Compare commits
24 Commits
v3.0.0
...
fix/hangin
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d97e792d81 | ||
|
|
2a3408599b | ||
|
|
38ff123296 | ||
|
|
4065c87d5f | ||
|
|
be8d7bf643 | ||
|
|
2328902b6b | ||
|
|
7ec6504619 | ||
|
|
e7a98b5795 | ||
|
|
649f06b19d | ||
|
|
cace51700a | ||
|
|
91cefc8598 | ||
|
|
735c1e39cd | ||
|
|
84cc315541 | ||
|
|
4fe9304570 | ||
|
|
8bb41be8fc | ||
|
|
4b8ac026c3 | ||
|
|
557b6035f8 | ||
|
|
bfc5394b4e | ||
|
|
5b1cf1f190 | ||
|
|
dd5c37ddec | ||
|
|
9adccc04dd | ||
|
|
ed94d29461 | ||
|
|
efc72cdc55 | ||
|
|
737e272481 |
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@@ -10,6 +10,9 @@ on:
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -49,5 +52,5 @@ jobs:
|
||||
|
||||
- name: Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: npm exec semantic-release
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
"assets": [
|
||||
"CHANGELOG.md",
|
||||
"gradle.properties"
|
||||
]
|
||||
],
|
||||
"message": "chore: Release v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
||||
}
|
||||
],
|
||||
[
|
||||
|
||||
48
CHANGELOG.md
48
CHANGELOG.md
@@ -1,3 +1,51 @@
|
||||
# [3.1.0](https://github.com/ReVanced/revanced-library/compare/v3.0.2...v3.1.0) (2024-11-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Detect if app is installed by fixing inversion ([649f06b](https://github.com/ReVanced/revanced-library/commit/649f06b19dd4d2a3f3216a0b3ea947b9fe0d475f))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Warn when option could not be set because the option does not exist ([7ec6504](https://github.com/ReVanced/revanced-library/commit/7ec650461935faf2a8fbb667db3cf137157b70b5))
|
||||
|
||||
# [3.1.0-dev.1](https://github.com/ReVanced/revanced-library/compare/v3.0.3-dev.1...v3.1.0-dev.1) (2024-11-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Warn when option could not be set because the option does not exist ([7ec6504](https://github.com/ReVanced/revanced-library/commit/7ec650461935faf2a8fbb667db3cf137157b70b5))
|
||||
|
||||
## [3.0.3-dev.1](https://github.com/ReVanced/revanced-library/compare/v3.0.2...v3.0.3-dev.1) (2024-11-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Detect if app is installed by fixing inversion ([649f06b](https://github.com/ReVanced/revanced-library/commit/649f06b19dd4d2a3f3216a0b3ea947b9fe0d475f))
|
||||
|
||||
## [3.0.2](https://github.com/ReVanced/revanced-library/compare/v3.0.1...v3.0.2) (2024-11-05)
|
||||
|
||||
## [3.0.2-dev.1](https://github.com/ReVanced/revanced-library/compare/v3.0.1...v3.0.2-dev.1) (2024-11-05)
|
||||
|
||||
## [3.0.1](https://github.com/ReVanced/revanced-library/compare/v3.0.0...v3.0.1) (2024-10-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Serialize compatible packages as a map instead of a set of pairs. ([737e272](https://github.com/ReVanced/revanced-library/commit/737e272481fe3b0b4c89233d139b5e657a0c1de4))
|
||||
|
||||
## [3.0.1-dev.3](https://github.com/ReVanced/revanced-library/compare/v3.0.1-dev.2...v3.0.1-dev.3) (2024-10-06)
|
||||
|
||||
## [3.0.1-dev.2](https://github.com/ReVanced/revanced-library/compare/v3.0.1-dev.1...v3.0.1-dev.2) (2024-10-01)
|
||||
|
||||
## [3.0.1-dev.1](https://github.com/ReVanced/revanced-library/compare/v3.0.0...v3.0.1-dev.1) (2024-08-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Serialize compatible packages as a map instead of a set of pairs. ([737e272](https://github.com/ReVanced/revanced-library/commit/737e272481fe3b0b4c89233d139b5e657a0c1de4))
|
||||
|
||||
# [3.0.0](https://github.com/ReVanced/revanced-library/compare/v2.3.0...v3.0.0) (2024-08-06)
|
||||
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ kotlin {
|
||||
commonMain.dependencies {
|
||||
implementation(libs.apksig)
|
||||
implementation(libs.apkzlib)
|
||||
implementation(libs.bcpkix.jdk15on)
|
||||
implementation(libs.bcpkix.jdk18on)
|
||||
implementation(libs.guava)
|
||||
implementation(libs.jadb)
|
||||
implementation(libs.kotlin.reflect)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version = 3.0.0
|
||||
version = 3.1.0
|
||||
#Gradle
|
||||
org.gradle.jvmargs = -Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options="-Xmx2048M"
|
||||
org.gradle.caching = true
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
[versions]
|
||||
android = "8.5.1"
|
||||
bcpkix-jdk15on = "1.70"
|
||||
android = "8.5.2"
|
||||
bcpkix-jdk18on = "1.77"
|
||||
binary-compatibility-validator = "0.15.1"
|
||||
core-ktx = "1.13.1"
|
||||
guava = "33.0.0-jre"
|
||||
core-ktx = "1.15.0"
|
||||
guava = "33.2.1-jre"
|
||||
jadb = "1.2.1"
|
||||
kotlin = "2.0.0"
|
||||
kotlin = "2.0.20"
|
||||
kotlinx-coroutines = "1.8.1"
|
||||
kotlinx-serialization = "1.7.1"
|
||||
libsu = "5.2.2"
|
||||
revanced-patcher = "20.0.0"
|
||||
revanced-patcher = "21.0.0"
|
||||
|
||||
[libraries]
|
||||
apkzlib = { module = "com.android.tools.build:apkzlib", version.ref = "android" }
|
||||
apksig = { module = "com.android.tools.build:apksig", version.ref = "android" }
|
||||
bcpkix-jdk15on = { module = "org.bouncycastle:bcpkix-jdk15on", version.ref = "bcpkix-jdk15on" }
|
||||
bcpkix-jdk18on = { module = "org.bouncycastle:bcpkix-jdk18on", version.ref = "bcpkix-jdk18on" }
|
||||
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" }
|
||||
guava = { module = "com.google.guava:guava", version.ref = "guava" }
|
||||
jadb = { module = "app.revanced:jadb", version.ref = "jadb" } # Fork with Shell v2 support.
|
||||
|
||||
3002
package-lock.json
generated
3002
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
"@saithodev/semantic-release-backmerge": "^4.0.1",
|
||||
"@semantic-release/changelog": "^6.0.3",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"gradle-semantic-release-plugin": "^1.9.1",
|
||||
"semantic-release": "^23.0.2"
|
||||
"gradle-semantic-release-plugin": "^1.10.1",
|
||||
"semantic-release": "^24.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ object ApkUtils {
|
||||
ZFile.openReadWrite(apkFile, zFileOptions).use { targetApkZFile ->
|
||||
dexFiles.forEach { dexFile ->
|
||||
targetApkZFile.add(dexFile.name, dexFile.stream)
|
||||
dexFile.stream.close()
|
||||
}
|
||||
|
||||
resources?.let { resources ->
|
||||
@@ -82,7 +83,7 @@ object ApkUtils {
|
||||
// Delete resources that were staged for deletion.
|
||||
if (resources.deleteResources.isNotEmpty()) {
|
||||
targetApkZFile.entries().filter { entry ->
|
||||
resources.deleteResources.any { shouldDelete -> shouldDelete(entry.centralDirectoryHeader.name) }
|
||||
entry.centralDirectoryHeader.name in resources.deleteResources
|
||||
}.forEach(StoredEntry::delete)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,11 +19,16 @@ private val logger = Logger.getLogger("Options")
|
||||
* @param options The options to set. The key is the patch name and the value is a map of option keys to option values.
|
||||
*/
|
||||
fun Set<Patch<*>>.setOptions(options: PatchesOptions) = filter { it.name != null }.forEach { patch ->
|
||||
val patchOptions = options[patch.name] ?: return@forEach
|
||||
options[patch.name]?.forEach setOption@{ (optionKey, optionValue) ->
|
||||
if (optionKey !in patch.options) {
|
||||
return@setOption logger.warning(
|
||||
"Could not set option for the \"${patch.name}\" patch because " +
|
||||
"option with key \"${optionKey}\" does not exist",
|
||||
)
|
||||
}
|
||||
|
||||
patch.options.forEach option@{ option ->
|
||||
try {
|
||||
patch.options[option.key] = patchOptions[option.key] ?: return@option
|
||||
patch.options[optionKey] = optionValue
|
||||
} catch (e: OptionException) {
|
||||
logger.warning("Could not set option value for the \"${patch.name}\" patch: ${e.message}")
|
||||
}
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
package app.revanced.library
|
||||
|
||||
import app.revanced.patcher.patch.*
|
||||
import kotlinx.serialization.*
|
||||
import app.revanced.patcher.patch.Option
|
||||
import app.revanced.patcher.patch.Patch
|
||||
import app.revanced.patcher.patch.VersionName
|
||||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.builtins.*
|
||||
import kotlinx.serialization.descriptors.buildClassSerialDescriptor
|
||||
import kotlinx.serialization.descriptors.element
|
||||
import kotlinx.serialization.encoding.Decoder
|
||||
import kotlinx.serialization.encoding.Encoder
|
||||
import kotlinx.serialization.encoding.encodeStructure
|
||||
import kotlinx.serialization.json.*
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.encodeToStream
|
||||
import kotlinx.serialization.serializer
|
||||
import java.io.OutputStream
|
||||
|
||||
private class PatchSerializer : KSerializer<Patch<*>> {
|
||||
@@ -17,7 +22,7 @@ private class PatchSerializer : KSerializer<Patch<*>> {
|
||||
element<String?>("description")
|
||||
element<Boolean>("use")
|
||||
element<List<String>>("dependencies")
|
||||
element<Set<Package>?>("compatiblePackages")
|
||||
element<Map<PackageName, Set<VersionName>?>?>("compatiblePackages")
|
||||
element("options", OptionSerializer.descriptor)
|
||||
}
|
||||
|
||||
@@ -52,8 +57,8 @@ private class PatchSerializer : KSerializer<Patch<*>> {
|
||||
encodeNullableSerializableElement(
|
||||
descriptor,
|
||||
4,
|
||||
SetSerializer(PairSerializer(String.serializer(), SetSerializer(String.serializer()).nullable)),
|
||||
value.compatiblePackages,
|
||||
MapSerializer(String.serializer(), SetSerializer(String.serializer()).nullable),
|
||||
value.compatiblePackages?.associate { (packageName, versions) -> packageName to versions },
|
||||
)
|
||||
encodeSerializableElement(
|
||||
descriptor,
|
||||
|
||||
@@ -122,13 +122,12 @@ abstract class RootInstaller internal constructor(
|
||||
* @throws FailedToFindInstalledPackageException If the package is not installed.
|
||||
*/
|
||||
private fun String.assertInstalled() {
|
||||
if (INSTALLED_APK_PATH(this)().output.isNotEmpty()) {
|
||||
if (INSTALLED_APK_PATH(this)().output.isEmpty()) {
|
||||
throw FailedToFindInstalledPackageException(this)
|
||||
}
|
||||
}
|
||||
|
||||
internal class FailedToFindInstalledPackageException internal constructor(packageName: String) :
|
||||
Exception("Failed to find installed package \"$packageName\" because no activity was found")
|
||||
internal class FailedToFindInstalledPackageException internal constructor(packageName: String) : Exception("Failed to find installed package \"$packageName\" because no activity was found")
|
||||
|
||||
internal class PackageNameRequiredException internal constructor() : Exception("Package name is required")
|
||||
internal class NoRootPermissionException internal constructor() : Exception("No root permission")
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package app.revanced.library
|
||||
|
||||
import app.revanced.patcher.patch.*
|
||||
import app.revanced.patcher.patch.booleanOption
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patcher.patch.floatsOption
|
||||
import app.revanced.patcher.patch.stringOption
|
||||
import kotlinx.serialization.json.*
|
||||
import java.io.ByteArrayOutputStream
|
||||
import kotlin.test.Test
|
||||
@@ -33,7 +36,7 @@ class SerializationTest {
|
||||
|
||||
assert(deserializedPatch["name"]!!.jsonPrimitive.content == "Test patch")
|
||||
|
||||
assert(deserializedPatch["compatiblePackages"]!!.jsonArray.size == 2) {
|
||||
assert(deserializedPatch["compatiblePackages"]!!.jsonObject.size == 2) {
|
||||
"The patch should be compatible with two packages."
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user