feat(modules/UpdaterModule): add methods to force bundle update
This commit is contained in:
parent
e0c75e30af
commit
da337dfd98
2 changed files with 13 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ import io.github.revenge.xposed.Utils
|
|||
import io.github.revenge.xposed.Utils.Companion.JSON
|
||||
import io.github.revenge.xposed.Utils.Companion.reloadApp
|
||||
import io.github.revenge.xposed.Utils.Log
|
||||
import io.github.revenge.xposed.modules.bridge.BridgeModule
|
||||
import io.ktor.client.*
|
||||
import io.ktor.client.call.*
|
||||
import io.ktor.client.engine.cio.*
|
||||
|
|
@ -71,6 +72,12 @@ object UpdaterModule : Module() {
|
|||
JSON.decodeFromString<LoaderConfig>(configFile.readText())
|
||||
} else LoaderConfig()
|
||||
}.getOrDefault(LoaderConfig())
|
||||
|
||||
BridgeModule.registerMethod("revenge.updater.clear") {
|
||||
if (bundle.exists()) bundle.delete()
|
||||
if (etag.exists()) etag.delete()
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
fun downloadScript(activity: Activity? = null): Job = scope.launch {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import android.os.Build
|
|||
import android.widget.Toast
|
||||
import io.github.revenge.xposed.Module
|
||||
import io.github.revenge.xposed.Utils
|
||||
import io.github.revenge.xposed.Utils.Companion.reloadApp
|
||||
import java.io.File
|
||||
|
||||
object AdditionalBridgeMethodsModule : Module() {
|
||||
|
|
@ -47,6 +48,11 @@ object AdditionalBridgeMethodsModule : Module() {
|
|||
|
||||
file.writeText(contents as String)
|
||||
}
|
||||
|
||||
BridgeModule.registerMethod("revenge.app.reload") {
|
||||
reloadApp()
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivity(activity: Activity) = with(activity) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue