mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 01:02:22 +01:00
Renamed Jar2ASM
to Io
due to reader & writer class
This commit is contained in:
parent
5d146c362f
commit
ded2538605
2 changed files with 6 additions and 6 deletions
|
@ -4,7 +4,7 @@ import net.revanced.patcher.cache.Cache
|
|||
import net.revanced.patcher.patch.Patch
|
||||
import net.revanced.patcher.resolver.MethodResolver
|
||||
import net.revanced.patcher.signature.Signature
|
||||
import net.revanced.patcher.util.Jar2ASM
|
||||
import net.revanced.patcher.util.Io
|
||||
import java.io.InputStream
|
||||
import java.io.OutputStream
|
||||
|
||||
|
@ -23,7 +23,7 @@ class Patcher(
|
|||
private val patches: MutableList<Patch> = mutableListOf()
|
||||
|
||||
init {
|
||||
val classes = Jar2ASM.jar2asm(input);
|
||||
val classes = Io.readClassesFromJar(input);
|
||||
cache = Cache(classes, MethodResolver(classes, signatures).resolve())
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,6 @@ class Patcher(
|
|||
}
|
||||
|
||||
fun saveTo(output: OutputStream) {
|
||||
Jar2ASM.asm2jar(input, output, cache.classes)
|
||||
Io.writeClassesToJar(input, output, cache.classes)
|
||||
}
|
||||
}
|
|
@ -9,8 +9,8 @@ import java.util.jar.JarEntry
|
|||
import java.util.jar.JarInputStream
|
||||
import java.util.jar.JarOutputStream
|
||||
|
||||
object Jar2ASM {
|
||||
fun jar2asm(input: InputStream) = mutableListOf<ClassNode>().apply {
|
||||
object Io {
|
||||
fun readClassesFromJar(input: InputStream) = mutableListOf<ClassNode>().apply {
|
||||
val jar = JarInputStream(input)
|
||||
while (true) {
|
||||
val e = jar.nextJarEntry ?: break
|
||||
|
@ -23,7 +23,7 @@ object Jar2ASM {
|
|||
}
|
||||
}
|
||||
|
||||
fun asm2jar(input: InputStream, output: OutputStream, classes: List<ClassNode>) {
|
||||
fun writeClassesToJar(input: InputStream, output: OutputStream, classes: List<ClassNode>) {
|
||||
val jis = JarInputStream(input)
|
||||
val jos = JarOutputStream(output)
|
||||
|
Loading…
Reference in a new issue