-
-
Save georgenaranjo96/fe8bdef4c459a2f2880b4ef863b91f6a 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