mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-06-02 11:26:06 +02:00
refactor: use type-alias for patch list
This commit is contained in:
parent
32d3514827
commit
58b578908f
|
@ -7,16 +7,19 @@ import app.revanced.cli.patcher.logging.impl.PatcherLogger
|
|||
import app.revanced.cli.signing.Signing
|
||||
import app.revanced.cli.signing.SigningOptions
|
||||
import app.revanced.patcher.PatcherOptions
|
||||
import app.revanced.patcher.data.Context
|
||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
||||
import app.revanced.patcher.extensions.PatchExtensions.description
|
||||
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
||||
import app.revanced.patcher.patch.Patch
|
||||
import app.revanced.patcher.util.patch.PatchBundle
|
||||
import app.revanced.utils.OptionsLoader
|
||||
import app.revanced.utils.adb.Adb
|
||||
import picocli.CommandLine.*
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
|
||||
internal typealias PatchList = List<Class<out Patch<Context>>>
|
||||
|
||||
private class CLIVersionProvider : IVersionProvider {
|
||||
override fun getVersion() = arrayOf(
|
||||
MainCommand::class.java.`package`.implementationVersion ?: "unknown"
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package app.revanced.cli.patcher
|
||||
|
||||
import app.revanced.cli.command.PatchList
|
||||
import app.revanced.patcher.PatcherResult
|
||||
import app.revanced.patcher.data.Context
|
||||
import app.revanced.patcher.patch.Patch
|
||||
import app.revanced.utils.patcher.addPatchesFiltered
|
||||
import app.revanced.utils.patcher.applyPatchesVerbose
|
||||
import app.revanced.utils.patcher.mergeFiles
|
||||
|
@ -10,7 +9,7 @@ import app.revanced.utils.patcher.mergeFiles
|
|||
internal object Patcher {
|
||||
internal fun start(
|
||||
patcher: app.revanced.patcher.Patcher,
|
||||
allPatches: List<Class<out Patch<Context>>>
|
||||
allPatches: PatchList
|
||||
): PatcherResult {
|
||||
// merge files like necessary integrations
|
||||
patcher.mergeFiles()
|
||||
|
|
|
@ -3,6 +3,7 @@ package app.revanced.utils.patcher
|
|||
import app.revanced.cli.command.MainCommand
|
||||
import app.revanced.cli.command.MainCommand.args
|
||||
import app.revanced.cli.command.MainCommand.logger
|
||||
import app.revanced.cli.command.PatchList
|
||||
import app.revanced.patcher.Patcher
|
||||
import app.revanced.patcher.data.Context
|
||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
||||
|
@ -10,7 +11,7 @@ import app.revanced.patcher.extensions.PatchExtensions.include
|
|||
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
||||
import app.revanced.patcher.patch.Patch
|
||||
|
||||
fun Patcher.addPatchesFiltered(allPatches: List<Class<out Patch<Context>>>) {
|
||||
fun Patcher.addPatchesFiltered(allPatches: PatchList) {
|
||||
val packageName = this.context.packageMetadata.packageName
|
||||
val packageVersion = this.context.packageMetadata.packageVersion
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user