@@ -3,8 +3,8 @@ package app.revanced.cli
3
3
import app.revanced.cli.utils.PatchLoader
4
4
import app.revanced.cli.utils.Patches
5
5
import app.revanced.cli.utils.Preconditions
6
- import app.revanced.cli.utils.SignatureParser
7
6
import app.revanced.patcher.Patcher
7
+ import app.revanced.patcher.patch.PatchMetadata
8
8
import app.revanced.patcher.patch.PatchResult
9
9
import kotlinx.cli.ArgParser
10
10
import kotlinx.cli.ArgType
@@ -21,7 +21,6 @@ class Main {
21
21
companion object {
22
22
private fun runCLI (
23
23
inApk : String ,
24
- inSignatures : String ,
25
24
inPatches : String ,
26
25
inIntegrations : String? ,
27
26
inOutput : String ,
@@ -35,21 +34,19 @@ class Main {
35
34
.maxHint(1 )
36
35
.setExtraMessage(" Initializing" )
37
36
val apk = Preconditions .isFile(inApk)
38
- val signatures = Preconditions .isFile(inSignatures)
39
37
val patchesFile = Preconditions .isFile(inPatches)
40
38
val output = Preconditions .isDirectory(inOutput)
41
39
bar.step()
42
40
43
41
val patcher = Patcher (
44
42
apk,
45
- SignatureParser .parse(signatures.readText(), bar)
46
43
)
47
44
48
45
inIntegrations?.let {
49
46
bar.reset().maxHint(1 )
50
47
.extraMessage = " Merging integrations"
51
48
val integrations = Preconditions .isFile(it)
52
- patcher.addFiles(listOf (integrations))
49
+ // patcher.addFiles(listOf(integrations))
53
50
bar.step()
54
51
}
55
52
@@ -83,12 +80,12 @@ class Main {
83
80
printResults(results)
84
81
}
85
82
86
- private fun printResults (results : Map <String , Result <PatchResult >>) {
87
- for ((name , result) in results) {
83
+ private fun printResults (results : Map <PatchMetadata , Result <PatchResult >>) {
84
+ for ((metadata , result) in results) {
88
85
if (result.isSuccess) {
89
- println (" Patch $ name was applied successfully!" )
86
+ println (" ${metadata. name} was applied successfully!" )
90
87
} else {
91
- println (" Patch $ name failed to apply! Cause:" )
88
+ println (" ${metadata. name} failed to apply! Cause:" )
92
89
result.exceptionOrNull()!! .printStackTrace()
93
90
}
94
91
}
@@ -105,12 +102,6 @@ class Main {
105
102
shortName = " a" ,
106
103
description = " APK file"
107
104
).required()
108
- val signatures by parser.option(
109
- ArgType .String ,
110
- fullName = " signatures" ,
111
- shortName = " s" ,
112
- description = " Signatures JSON file"
113
- ).required()
114
105
val patches by parser.option(
115
106
ArgType .String ,
116
107
fullName = " patches" ,
@@ -133,7 +124,6 @@ class Main {
133
124
parser.parse(args)
134
125
runCLI(
135
126
apk,
136
- signatures,
137
127
patches,
138
128
integrations,
139
129
output,
0 commit comments