mirror of
https://github.com/revanced/revanced-cli.git
synced 2024-12-11 20:57:49 +01:00
chore: apply breaking changes from patcher
This commit is contained in:
parent
1b6757ff40
commit
b1372c0e9f
@ -3,19 +3,19 @@ package app.revanced.cli
|
||||
import app.revanced.cli.utils.SignatureParser
|
||||
import app.revanced.patcher.Patcher
|
||||
import app.revanced.patches.Index.patches
|
||||
import org.jf.dexlib2.writer.io.MemoryDataStore
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
// add integrations dex container
|
||||
patcher.addFiles(File(args[3]))
|
||||
|
||||
// load all patches
|
||||
for (patch in patches) {
|
||||
patcher.addPatches(patch())
|
||||
}
|
||||
@ -25,5 +25,8 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
|
||||
// save patched apk
|
||||
patcher.save()
|
||||
val dexFiles: Map<String, MemoryDataStore> = patcher.save()
|
||||
dexFiles.forEach { (t, p) ->
|
||||
Files.write(File(args[1], t).toPath(), p.buffer)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user