Skip to content

Commit be8d7bf

Browse files
authored
chore: Merge branch dev to main (#65)
2 parents cace517 + 2328902 commit be8d7bf

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# [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)
2+
3+
4+
### Features
5+
6+
* Warn when option could not be set because the option does not exist ([7ec6504](https://github.com/ReVanced/revanced-library/commit/7ec650461935faf2a8fbb667db3cf137157b70b5))
7+
8+
## [3.0.3-dev.1](https://github.com/ReVanced/revanced-library/compare/v3.0.2...v3.0.3-dev.1) (2024-11-11)
9+
10+
11+
### Bug Fixes
12+
13+
* Detect if app is installed by fixing inversion ([649f06b](https://github.com/ReVanced/revanced-library/commit/649f06b19dd4d2a3f3216a0b3ea947b9fe0d475f))
14+
115
## [3.0.2](https://github.com/ReVanced/revanced-library/compare/v3.0.1...v3.0.2) (2024-11-05)
216

317
## [3.0.2-dev.1](https://github.com/ReVanced/revanced-library/compare/v3.0.1...v3.0.2-dev.1) (2024-11-05)

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 3.0.2
1+
version = 3.1.0-dev.1
22
#Gradle
33
org.gradle.jvmargs = -Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options="-Xmx2048M"
44
org.gradle.caching = true

src/commonMain/kotlin/app/revanced/library/Options.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,16 @@ private val logger = Logger.getLogger("Options")
1919
* @param options The options to set. The key is the patch name and the value is a map of option keys to option values.
2020
*/
2121
fun Set<Patch<*>>.setOptions(options: PatchesOptions) = filter { it.name != null }.forEach { patch ->
22-
val patchOptions = options[patch.name] ?: return@forEach
22+
options[patch.name]?.forEach setOption@{ (optionKey, optionValue) ->
23+
if (optionKey !in patch.options) {
24+
return@setOption logger.warning(
25+
"Could not set option for the \"${patch.name}\" patch because " +
26+
"option with key \"${optionKey}\" does not exist",
27+
)
28+
}
2329

24-
patch.options.forEach option@{ option ->
2530
try {
26-
patch.options[option.key] = patchOptions[option.key] ?: return@option
31+
patch.options[optionKey] = optionValue
2732
} catch (e: OptionException) {
2833
logger.warning("Could not set option value for the \"${patch.name}\" patch: ${e.message}")
2934
}

src/commonMain/kotlin/app/revanced/library/installation/installer/RootInstaller.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,12 @@ abstract class RootInstaller internal constructor(
122122
* @throws FailedToFindInstalledPackageException If the package is not installed.
123123
*/
124124
private fun String.assertInstalled() {
125-
if (INSTALLED_APK_PATH(this)().output.isNotEmpty()) {
125+
if (INSTALLED_APK_PATH(this)().output.isEmpty()) {
126126
throw FailedToFindInstalledPackageException(this)
127127
}
128128
}
129129

130-
internal class FailedToFindInstalledPackageException internal constructor(packageName: String) :
131-
Exception("Failed to find installed package \"$packageName\" because no activity was found")
130+
internal class FailedToFindInstalledPackageException internal constructor(packageName: String) : Exception("Failed to find installed package \"$packageName\" because no activity was found")
132131

133132
internal class PackageNameRequiredException internal constructor() : Exception("Package name is required")
134133
internal class NoRootPermissionException internal constructor() : Exception("No root permission")

0 commit comments

Comments
 (0)