mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-06-11 15:48:03 +02:00
patches are now suspend
This commit is contained in:
parent
5ecda323c9
commit
e3beb1d078
|
@ -23,6 +23,7 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect:1.8.20-RC")
|
||||
testImplementation("org.jetbrains.kotlin:kotlin-test:1.8.20-RC")
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import app.revanced.utils.Options
|
|||
import app.revanced.utils.Options.setOptions
|
||||
import app.revanced.utils.adb.Adb
|
||||
import app.revanced.utils.apk.ApkSigner
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import picocli.CommandLine.*
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
|
@ -377,9 +378,11 @@ internal object MainCommand : Runnable {
|
|||
}
|
||||
}.asIterable().let(this::addPatches)
|
||||
|
||||
execute().forEach { (patch, exception) ->
|
||||
if (exception != null) logger.error("Executing $patch failed:\n${exception.stackTraceToString()}")
|
||||
else logger.info("Executing $patch succeeded")
|
||||
runBlocking {
|
||||
it.apply(false).collect { (patch, exception) ->
|
||||
if (exception != null) logger.error("Executing $patch failed:\n${exception.stackTraceToString()}")
|
||||
else logger.info("Executing $patch succeeded")
|
||||
}
|
||||
}
|
||||
}.write(unsignedDirectory).apkFiles
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.junit.jupiter.api.Test
|
|||
import org.junit.jupiter.api.TestMethodOrder
|
||||
|
||||
class PatchOptionsTestPatch : BytecodePatch() {
|
||||
override fun execute(context: BytecodeContext) {}
|
||||
override suspend fun execute(context: BytecodeContext) {}
|
||||
|
||||
companion object : OptionsContainer() {
|
||||
var key1 by option(
|
||||
|
|
Loading…
Reference in New Issue
Block a user