Created
June 12, 2020 21:06
-
-
Save NICHOLAS85/cd360452bb2cbd7b74177325e142fc22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var menuOpts = { | |
a:{ | |
"Reboot Userspace":()=>{ | |
shellrun("launchctl reboot userspace") | |
}, | |
Respring:()=>{ | |
device.respring() | |
}, | |
"Safe Mode":()=>{ | |
shellrun("killall -SEGV SpringBoard") | |
}, | |
UICache:()=>{ | |
shellrun("uicache") | |
}, | |
More:()=>{ | |
presentMenu("More","","b") | |
} | |
}, | |
b:{ | |
"Run MK1 Script":()=>{ | |
prompt("Run MK1 Script","",(script)=>{ | |
if(script) MK1.runScript(script); | |
}) | |
} | |
}, | |
Cancel:()=>{ | |
// Does nothing | |
} | |
} | |
function presentMenu(title, msg, submenu){ | |
var list = Object.keys(menuOpts[submenu]) | |
list.push("Cancel") | |
menu(title, msg, list ,(choice)=>{ | |
(menuOpts[submenu][list[choice]] || menuOpts.Cancel)(); | |
}) | |
} | |
presentMenu("PowerSelector","","a") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment