mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
refactor: more cleanup
This commit is contained in:
parent
a4b5fc4796
commit
2f78af7f08
@ -11,6 +11,7 @@ import app.revanced.manager.flutter.utils.zip.structures.ZipEntry
|
|||||||
import app.revanced.patcher.Patcher
|
import app.revanced.patcher.Patcher
|
||||||
import app.revanced.patcher.PatcherOptions
|
import app.revanced.patcher.PatcherOptions
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
||||||
|
import app.revanced.patcher.logging.Logger
|
||||||
import app.revanced.patcher.util.patch.impl.DexPatchBundle
|
import app.revanced.patcher.util.patch.impl.DexPatchBundle
|
||||||
import dalvik.system.DexClassLoader
|
import dalvik.system.DexClassLoader
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
@ -141,77 +142,7 @@ class MainActivity : FlutterActivity() {
|
|||||||
resourcePatching,
|
resourcePatching,
|
||||||
Aapt.binary(applicationContext).absolutePath,
|
Aapt.binary(applicationContext).absolutePath,
|
||||||
cacheDirPath,
|
cacheDirPath,
|
||||||
logger =
|
logger = ManagerLogger()
|
||||||
object :
|
|
||||||
app.revanced.patcher.logging.Logger {
|
|
||||||
override fun error(msg: String) {
|
|
||||||
handler.post {
|
|
||||||
installerChannel
|
|
||||||
.invokeMethod(
|
|
||||||
"update",
|
|
||||||
mapOf(
|
|
||||||
"progress" to
|
|
||||||
-1.0,
|
|
||||||
"header" to
|
|
||||||
"",
|
|
||||||
"log" to
|
|
||||||
msg
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun warn(msg: String) {
|
|
||||||
handler.post {
|
|
||||||
installerChannel
|
|
||||||
.invokeMethod(
|
|
||||||
"update",
|
|
||||||
mapOf(
|
|
||||||
"progress" to
|
|
||||||
-1.0,
|
|
||||||
"header" to
|
|
||||||
"",
|
|
||||||
"log" to
|
|
||||||
msg
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun info(msg: String) {
|
|
||||||
handler.post {
|
|
||||||
installerChannel
|
|
||||||
.invokeMethod(
|
|
||||||
"update",
|
|
||||||
mapOf(
|
|
||||||
"progress" to
|
|
||||||
-1.0,
|
|
||||||
"header" to
|
|
||||||
"",
|
|
||||||
"log" to
|
|
||||||
msg
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun trace(msg: String) {
|
|
||||||
handler.post {
|
|
||||||
installerChannel
|
|
||||||
.invokeMethod(
|
|
||||||
"update",
|
|
||||||
mapOf(
|
|
||||||
"progress" to
|
|
||||||
-1.0,
|
|
||||||
"header" to
|
|
||||||
"",
|
|
||||||
"log" to
|
|
||||||
msg
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -326,4 +257,43 @@ class MainActivity : FlutterActivity() {
|
|||||||
}
|
}
|
||||||
.start()
|
.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inner class ManagerLogger : Logger {
|
||||||
|
override fun error(msg: String) {
|
||||||
|
handler.post {
|
||||||
|
installerChannel
|
||||||
|
.invokeMethod(
|
||||||
|
"update",
|
||||||
|
mapOf("progress" to -1.0, "header" to "", "log" to msg)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun warn(msg: String) {
|
||||||
|
handler.post {
|
||||||
|
installerChannel.invokeMethod(
|
||||||
|
"update",
|
||||||
|
mapOf("progress" to -1.0, "header" to "", "log" to msg)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun info(msg: String) {
|
||||||
|
handler.post {
|
||||||
|
installerChannel.invokeMethod(
|
||||||
|
"update",
|
||||||
|
mapOf("progress" to -1.0, "header" to "", "log" to msg)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun trace(msg: String) {
|
||||||
|
handler.post {
|
||||||
|
installerChannel.invokeMethod(
|
||||||
|
"update",
|
||||||
|
mapOf("progress" to -1.0, "header" to "", "log" to msg)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user