给WebUI添加对KPM的操控支持
This commit is contained in:
@@ -19,6 +19,9 @@ import shirkneko.zako.sukisu.ui.util.listModules
|
|||||||
import shirkneko.zako.sukisu.ui.util.withNewRootShell
|
import shirkneko.zako.sukisu.ui.util.withNewRootShell
|
||||||
import org.json.JSONArray
|
import org.json.JSONArray
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
|
import shirkneko.zako.sukisu.ui.util.KsuCli
|
||||||
|
import shirkneko.zako.sukisu.ui.util.controlKpmModule
|
||||||
|
import shirkneko.zako.sukisu.ui.util.listKpmModules
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.concurrent.CompletableFuture
|
import java.util.concurrent.CompletableFuture
|
||||||
|
|
||||||
@@ -197,6 +200,18 @@ class WebViewInterface(
|
|||||||
}
|
}
|
||||||
return currentModuleInfo.toString()
|
return currentModuleInfo.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// =================== KPM支持 =============================
|
||||||
|
|
||||||
|
@JavascriptInterface
|
||||||
|
fun listAllKpm() : String {
|
||||||
|
return listKpmModules()
|
||||||
|
}
|
||||||
|
|
||||||
|
@JavascriptInterface
|
||||||
|
fun controlKpm(name: String, args: String) : Int {
|
||||||
|
return controlKpmModule(name, args)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hideSystemUI(window: Window) =
|
fun hideSystemUI(window: Window) =
|
||||||
|
|||||||
Reference in New Issue
Block a user