Skip to content

Commit b8dbe6b

Browse files
committed
Sync with microG unofficial installer
1 parent 25928dd commit b8dbe6b

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

zip-content/inc/common-functions.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,19 +1211,19 @@ initialize()
12111211
ui_error 'Downgrade not allowed!!!' 95
12121212
fi
12131213

1214-
IS_INSTALLATION='true'
1214+
SETUP_TYPE='install'
12151215
if
12161216
test "${LIVE_SETUP_ENABLED:?}" = 'true' && {
12171217
test "${MODULE_VERCODE:?}" -eq "${PREV_MODULE_VERCODE:?}" || test "${PREV_INSTALL_FAILED:?}" = 'true'
12181218
}
12191219
then
12201220
choose 'What do you want to do?' '+) Reinstall' '-) Uninstall'
12211221
if test "${?}" != '3'; then
1222-
IS_INSTALLATION='false'
1222+
SETUP_TYPE='uninstall'
12231223
fi
12241224
fi
1225-
readonly IS_INSTALLATION
1226-
export IS_INSTALLATION
1225+
readonly SETUP_TYPE
1226+
export SETUP_TYPE
12271227

12281228
remount_read_write "${SYS_MOUNTPOINT:?}" || {
12291229
deinitialize
@@ -1864,11 +1864,11 @@ finalize_correctly()
18641864
deinitialize
18651865
touch "${TMP_PATH:?}/installed"
18661866

1867-
if test "${IS_INSTALLATION:?}" = 'true'; then
1868-
ui_msg 'Installation finished.'
1869-
else
1870-
ui_msg 'Uninstallation finished.'
1871-
fi
1867+
case "${SETUP_TYPE?}" in
1868+
'install') ui_msg 'Installation finished.' ;;
1869+
'uninstall') ui_msg 'Uninstallation finished.' ;;
1870+
*) ui_error 'Invalid setup type' ;;
1871+
esac
18721872
}
18731873

18741874
# Error checking functions

zip-content/scripts/install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ INSTALL_CALENDARSYNC="$(parse_setting 'INSTALL_CALENDARSYNC' "${INSTALL_CALENDAR
3030
display_info
3131
ui_msg_empty_line
3232

33-
if test "${IS_INSTALLATION:?}" = 'true'; then
33+
if test "${SETUP_TYPE:?}" = 'install'; then
3434
ui_msg 'Starting installation...'
3535
ui_msg_empty_line
3636

@@ -56,7 +56,7 @@ else
5656
ui_msg_empty_line
5757
fi
5858

59-
if test "${IS_INSTALLATION:?}" = 'true'; then
59+
if test "${SETUP_TYPE:?}" = 'install'; then
6060
disable_app 'com.google.android.syncadapters.calendar'
6161
disable_app 'com.google.android.syncadapters.contacts'
6262
disable_app 'com.google.android.backuptransport'
@@ -65,7 +65,7 @@ fi
6565
# Clean previous installations
6666
clean_previous_installations
6767

68-
if test "${IS_INSTALLATION:?}" != 'true'; then
68+
if test "${SETUP_TYPE:?}" = 'uninstall'; then
6969
clear_app 'com.google.android.syncadapters.calendar'
7070
clear_app 'com.google.android.syncadapters.contacts'
7171
clear_app 'com.google.android.backuptransport'

zip-content/scripts/uninstall.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if test "${IS_INCLUDED:-false}" = 'false'; then
5454

5555
# shellcheck disable=SC2034
5656
{
57-
IS_INSTALLATION='false'
57+
SETUP_TYPE='uninstall'
5858
FIRST_INSTALLATION='true'
5959
API=999
6060
SYS_PATH="${ANDROID_ROOT:-/system}"
@@ -138,7 +138,7 @@ uninstall_list | while IFS='|' read -r FILENAME INTERNAL_NAME _; do
138138

139139
if test -n "${INTERNAL_NAME}"; then
140140
# Only delete app updates during uninstallation or first-time installation
141-
if test "${IS_INSTALLATION:?}" != 'true' || test "${FIRST_INSTALLATION:?}" = 'true'; then
141+
if test "${SETUP_TYPE:?}" = 'uninstall' || test "${FIRST_INSTALLATION:?}" = 'true'; then
142142
delete "${DATA_PATH:?}/app/${INTERNAL_NAME}"
143143
delete "${DATA_PATH:?}/app/${INTERNAL_NAME}.apk"
144144
delete "${DATA_PATH:?}/app/${INTERNAL_NAME}"-*

0 commit comments

Comments
 (0)