You've already forked Tricky-Addon-Update-Target-List
mirror of
https://github.com/KOWX712/Tricky-Addon-Update-Target-List.git
synced 2025-09-06 06:37:09 +00:00
opt: use ksu.spawn for long script
This commit is contained in:
@@ -22,14 +22,12 @@ document.getElementById("boot-hash").addEventListener("click", async () => {
|
||||
}, 10);
|
||||
|
||||
// read current boot hash
|
||||
exec("cat /data/adb/boot_hash")
|
||||
exec(`sed '/^#/d; /^$/d' /data/adb/boot_hash`)
|
||||
.then(({ errno, stdout }) => {
|
||||
if (errno !== 0) {
|
||||
inputBox.value = "";
|
||||
} else {
|
||||
const validHash = stdout
|
||||
.split("\n")
|
||||
.filter(line => !line.startsWith("#") && line.trim())[0];
|
||||
const validHash = stdout.trim();
|
||||
inputBox.value = validHash || "";
|
||||
}
|
||||
});
|
||||
@@ -48,7 +46,7 @@ const closeBootHashMenu = () => {
|
||||
saveButton.addEventListener("click", async () => {
|
||||
const inputValue = inputBox.value.trim();
|
||||
exec(`
|
||||
resetprop -n ro.boot.vbmeta.digest ${inputValue}
|
||||
resetprop -n ro.boot.vbmeta.digest "${inputValue}"
|
||||
[ -z "${inputValue}" ] && rm -f /data/adb/boot_hash || {
|
||||
echo "${inputValue}" > /data/adb/boot_hash
|
||||
chmod 644 /data/adb/boot_hash
|
||||
|
||||
Reference in New Issue
Block a user