mirror of
https://github.com/ReVanced/revanced-cli.git
synced 2026-01-26 12:41:06 +00:00
feat: Add CLI
This commit is contained in:
27
src/main/kotlin/app/revanced/cli/Main.kt
Normal file
27
src/main/kotlin/app/revanced/cli/Main.kt
Normal file
@@ -0,0 +1,27 @@
|
||||
package app.revanced.cli
|
||||
|
||||
import app.revanced.cli.utils.SignatureParser
|
||||
import app.revanced.patcher.Patcher
|
||||
import app.revanced.patches.Index.patches
|
||||
import java.io.File
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val patcher = Patcher(
|
||||
File(args[0]), // in.apk
|
||||
File(args[1]), // out path
|
||||
SignatureParser.parse(args[2]).toTypedArray() // signatures.json
|
||||
)
|
||||
|
||||
// load all patches
|
||||
for (patch in patches) {
|
||||
patcher.addPatches(patch())
|
||||
}
|
||||
|
||||
// apply all patches
|
||||
patcher.applyPatches().forEach{ (name, result) ->
|
||||
println("$name: $result")
|
||||
}
|
||||
|
||||
// save patched apk
|
||||
patcher.save()
|
||||
}
|
||||
Reference in New Issue
Block a user