-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootdroid
executable file
·65 lines (57 loc) · 1.32 KB
/
bootdroid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env bash
set -e -u
set -o pipefail
# write some cool doc here
function usage()
{
cat << EOF
Usage: ${0##*/} [OPTION]...
Options: --help, -h: show this help dialog
--reboot, -r: reboot phone before
EOF
}
function main()
{
local device=foles
local reboot=false
while getopts "hr-:" opt; do
case ${opt} in
h) # help message
usage
exit 0
;;
r)
reboot=true
;;
-)
case "${OPTARG}" in
help)
usage
exit 0
;;
reboot)
reboot=true
;;
*)
printf 'Unknown option, exiting now\n' >&2
exit 1
;;
esac
;;
?)
echo "Unknown option, exiting now" >&2
exit 1
;;
esac
done
shift $((OPTIND - 1))
[[ ${1:-} == '--' ]] && shift
if "${reboot}"; then
adb wait-for-device
adb reboot-bootloader
fi
fastboot boot $android/$device/magisk_patched.img
}
if [ "${BASH_SOURCE[0]}" == "$0" ]; then
main "$@"
fi