diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index ca137bc..9b22258 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -26,13 +26,13 @@ jobs:
- name: Update dependency
run: |
- curl -Ls https://cdn.jsdelivr.net/npm/marked/marked.min.js > module/webui/scripts/marked.min.js
+ curl -Ls https://cdn.jsdelivr.net/npm/marked/marked.min.js > module/webui/scripts/assets/marked.min.js
# Commit if found changes
- if ! git diff --exit-code module/webui/scripts/marked.min.js > /dev/null; then
+ if ! git diff --exit-code module/webui/scripts/assets/marked.min.js > /dev/null; then
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- git add module/webui/scripts/marked.min.js
+ git add module/webui/scripts/assets/marked.min.js
git commit -m "deps: update marked.min.js"
git push
fi
diff --git a/module/webui/index.html b/module/webui/index.html
index e75e859..5a8fbea 100644
--- a/module/webui/index.html
+++ b/module/webui/index.html
@@ -19,7 +19,7 @@
-
+
diff --git a/module/webui/scripts/applist.js b/module/webui/scripts/applist.js
index 036f96e..75148ea 100644
--- a/module/webui/scripts/applist.js
+++ b/module/webui/scripts/applist.js
@@ -1,4 +1,5 @@
-import { basePath, exec, hideFloatingBtn, appsWithExclamation, appsWithQuestion, toast } from './main.js';
+import { exec, toast } from './assets/kernelsu.js';
+import { basePath, hideFloatingBtn, appsWithExclamation, appsWithQuestion } from './main.js';
const appTemplate = document.getElementById('app-template').content;
const modeOverlay = document.querySelector('.mode-overlay');
diff --git a/module/webui/scripts/assets/kernelsu.js b/module/webui/scripts/assets/kernelsu.js
new file mode 100644
index 0000000..ed09323
--- /dev/null
+++ b/module/webui/scripts/assets/kernelsu.js
@@ -0,0 +1,111 @@
+/**
+ * Imported from https://www.npmjs.com/package/kernelsu
+ * Slightly modified version by KOWX712
+ * Added full description
+ * Simplified spawn function
+ * Handle error on toast
+ */
+
+let callbackCounter = 0;
+function getUniqueCallbackName(prefix) {
+ return `${prefix}_callback_${Date.now()}_${callbackCounter++}`;
+}
+
+/**
+ * Execute shell command with ksu.exec
+ * @param {string} command - The command to execute
+ * @param {Object} [options={}] - Options object containing:
+ * - cwd - Current working directory of the child process
+ * - env {Object} - Environment key-value pairs
+ * @returns {Promise