From 1fb0926ac6524a97c55dac76367eb2b84ddbbb5f Mon Sep 17 00:00:00 2001 From: ThePedroo Date: Sun, 14 Jul 2024 22:49:17 -0300 Subject: [PATCH] add: functional daemon action buttons This commit adds the function that allows functional daemon action buttons. --- webroot/index.html | 3 +++ webroot/js/daemon_actions.js | 37 ++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 webroot/js/daemon_actions.js diff --git a/webroot/index.html b/webroot/index.html index f46bcc5..e5d1c75 100644 --- a/webroot/index.html +++ b/webroot/index.html @@ -5,14 +5,17 @@ + + + diff --git a/webroot/js/daemon_actions.js b/webroot/js/daemon_actions.js new file mode 100644 index 0000000..f8725ee --- /dev/null +++ b/webroot/js/daemon_actions.js @@ -0,0 +1,37 @@ +import { exec } from './kernelsu.js' + +const daemon64_start = document.getElementById('daemon64_start_button') +const daemon64_stop = document.getElementById('daemon64_stop_button') +const daemon64_exit = document.getElementById('daemon64_exit_button') + +if (daemon64_start) { + daemon64_start.addEventListener('click', () => { + exec('/data/adb/modules/zygisksu/bin/zygisk-ptrace64 ctl start') + }) + + daemon64_stop.addEventListener('click', () => { + exec('/data/adb/modules/zygisksu/bin/zygisk-ptrace64 ctl stop') + }) + + daemon64_exit.addEventListener('click', () => { + exec('/data/adb/modules/zygisksu/bin/zygisk-ptrace64 ctl exit') + }) +} + +const daemon32_start = document.getElementById('daemon32_start_button') +const daemon32_stop = document.getElementById('daemon32_stop_button') +const daemon32_exit = document.getElementById('daemon32_exit_button') + +if (daemon32_start) { + daemon32_start.addEventListener('click', () => { + exec('/data/adb/modules/zygisksu/bin/zygisk-ptrace32 ctl start') + }) + + daemon32_stop.addEventListener('click', () => { + exec('/data/adb/modules/zygisksu/bin/zygisk-ptrace32 ctl stop') + }) + + daemon32_exit.addEventListener('click', () => { + exec('/data/adb/modules/zygisksu/bin/zygisk-ptrace32 ctl exit') + }) +} \ No newline at end of file