-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathmain.sh
63 lines (54 loc) · 1.51 KB
/
main.sh
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
#!/usr/bin/bash
main() {
setEnv SOURCE "ReVanced" init .config
setEnv LIGHT_THEME "off" init .config
setEnv PREFER_SPLIT_APK "on" init .config
setEnv LAUNCH_APP_AFTER_MOUNT "on" init .config
setEnv ALLOW_APP_VERSION_DOWNGRADE "off" init .config
source .config
mkdir -p "assets" "apps" "$STORAGE" "$STORAGE/Patched" "$STORAGE/Stock"
[ "$ROOT_ACCESS" == true ] && MENU_ENTRY=(7 "Unmount Patched app")
[ "$LIGHT_THEME" == "on" ] && THEME="LIGHT" || THEME="DARK"
export DIALOGRC="config/.DIALOGRC_$THEME"
while true; do
MAIN=$("${DIALOG[@]}" \
--title '| Main Menu |' \
--ok-label 'Select' \
--cancel-label 'Exit' \
--menu "$NAVIGATION_HINT" -1 -1 0 1 "Patch App" 2 "Update Assets" 3 "Change Source" 4 "Configure" 5 "Delete Assets" 6 "Delete Apps" "${MENU_ENTRY[@]}" \
2>&1 > /dev/tty
) || break
case "$MAIN" in
1 )
initiateWorkflow
;;
2 )
fetchAssetsInfo || break
fetchAssets
;;
3 )
changeSource
;;
4 )
configure
;;
5 )
deleteAssets
;;
6 )
deleteApps
;;
7 )
umountApp
;;
esac
done
}
tput civis
ROOT_ACCESS="$1"
for MODULE in $(find modules -type f -name "*.sh"); do
source "$MODULE"
done
trap terminate SIGTERM SIGINT SIGABRT
main || terminate 1
terminate "$?"