mirror of
https://github.com/ReVanced/revanced-library.git
synced 2026-01-11 13:56:17 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4065c87d5f | ||
|
|
be8d7bf643 | ||
|
|
2328902b6b | ||
|
|
7ec6504619 | ||
|
|
e7a98b5795 | ||
|
|
649f06b19d | ||
|
|
cace51700a | ||
|
|
91cefc8598 | ||
|
|
735c1e39cd | ||
|
|
84cc315541 |
30
CHANGELOG.md
30
CHANGELOG.md
@@ -1,3 +1,33 @@
|
|||||||
|
# [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)
|
## [3.0.1](https://github.com/ReVanced/revanced-library/compare/v3.0.0...v3.0.1) (2024-10-13)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version = 3.0.1
|
version = 3.1.0
|
||||||
#Gradle
|
#Gradle
|
||||||
org.gradle.jvmargs = -Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options="-Xmx2048M"
|
org.gradle.jvmargs = -Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options="-Xmx2048M"
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
[versions]
|
[versions]
|
||||||
android = "8.5.1"
|
android = "8.5.2"
|
||||||
bcpkix-jdk18on = "1.77"
|
bcpkix-jdk18on = "1.77"
|
||||||
binary-compatibility-validator = "0.15.1"
|
binary-compatibility-validator = "0.15.1"
|
||||||
core-ktx = "1.13.1"
|
core-ktx = "1.15.0"
|
||||||
guava = "33.0.0-jre"
|
guava = "33.2.1-jre"
|
||||||
jadb = "1.2.1"
|
jadb = "1.2.1"
|
||||||
kotlin = "2.0.20"
|
kotlin = "2.0.20"
|
||||||
kotlinx-coroutines = "1.8.1"
|
kotlinx-coroutines = "1.8.1"
|
||||||
kotlinx-serialization = "1.7.1"
|
kotlinx-serialization = "1.7.1"
|
||||||
libsu = "5.2.2"
|
libsu = "5.2.2"
|
||||||
revanced-patcher = "20.0.0"
|
revanced-patcher = "21.0.0"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
apkzlib = { module = "com.android.tools.build:apkzlib", version.ref = "android" }
|
apkzlib = { module = "com.android.tools.build:apkzlib", version.ref = "android" }
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ object ApkUtils {
|
|||||||
// Delete resources that were staged for deletion.
|
// Delete resources that were staged for deletion.
|
||||||
if (resources.deleteResources.isNotEmpty()) {
|
if (resources.deleteResources.isNotEmpty()) {
|
||||||
targetApkZFile.entries().filter { entry ->
|
targetApkZFile.entries().filter { entry ->
|
||||||
resources.deleteResources.any { shouldDelete -> shouldDelete(entry.centralDirectoryHeader.name) }
|
entry.centralDirectoryHeader.name in resources.deleteResources
|
||||||
}.forEach(StoredEntry::delete)
|
}.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.
|
* @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 ->
|
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 {
|
try {
|
||||||
patch.options[option.key] = patchOptions[option.key] ?: return@option
|
patch.options[optionKey] = optionValue
|
||||||
} catch (e: OptionException) {
|
} catch (e: OptionException) {
|
||||||
logger.warning("Could not set option value for the \"${patch.name}\" patch: ${e.message}")
|
logger.warning("Could not set option value for the \"${patch.name}\" patch: ${e.message}")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,13 +122,12 @@ abstract class RootInstaller internal constructor(
|
|||||||
* @throws FailedToFindInstalledPackageException If the package is not installed.
|
* @throws FailedToFindInstalledPackageException If the package is not installed.
|
||||||
*/
|
*/
|
||||||
private fun String.assertInstalled() {
|
private fun String.assertInstalled() {
|
||||||
if (INSTALLED_APK_PATH(this)().output.isNotEmpty()) {
|
if (INSTALLED_APK_PATH(this)().output.isEmpty()) {
|
||||||
throw FailedToFindInstalledPackageException(this)
|
throw FailedToFindInstalledPackageException(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class FailedToFindInstalledPackageException internal constructor(packageName: String) :
|
internal class FailedToFindInstalledPackageException internal constructor(packageName: String) : Exception("Failed to find installed package \"$packageName\" because no activity was found")
|
||||||
Exception("Failed to find installed package \"$packageName\" because no activity was found")
|
|
||||||
|
|
||||||
internal class PackageNameRequiredException internal constructor() : Exception("Package name is required")
|
internal class PackageNameRequiredException internal constructor() : Exception("Package name is required")
|
||||||
internal class NoRootPermissionException internal constructor() : Exception("No root permission")
|
internal class NoRootPermissionException internal constructor() : Exception("No root permission")
|
||||||
|
|||||||
Reference in New Issue
Block a user