Skip to content

Commit c94b084

Browse files
committed
Sync with microG unofficial installer
1 parent 3b025fa commit c94b084

File tree

4 files changed

+35
-28
lines changed

4 files changed

+35
-28
lines changed

includes/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export ftp_proxy="${ftp_proxy-}"
7878
# shellcheck disable=SC2034
7979
{
8080
readonly WGET_CMD='wget'
81-
readonly DL_UA='Mozilla/5.0 (Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0'
81+
readonly DL_UA='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0'
8282
readonly DL_ACCEPT_HEADER='Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8'
8383
readonly DL_ACCEPT_ALL_HEADER='Accept: */*'
8484
readonly DL_ACCEPT_LANG_HEADER='Accept-Language: en-US,en;q=0.5'

zip-content/customize.sh

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,34 @@ ui_debug()
131131
printf '%s\n' "${1?}"
132132
}
133133

134+
_show_text_on_recovery()
135+
{
136+
if test "${RECOVERY_OUTPUT:?}" != 'true'; then return; fi # Nothing to do here
137+
138+
if test -e "${RECOVERY_PIPE:?}"; then
139+
printf 'ui_print %s\nui_print\n' "${1?}" >> "${RECOVERY_PIPE:?}"
140+
else
141+
printf 'ui_print %s\nui_print\n' "${1?}" 1>&"${OUTFD:?}"
142+
fi
143+
144+
if test "${DEBUG_LOG_ENABLED:?}" -eq 1; then printf 1>&2 '%s\n' "${1?}"; fi
145+
}
146+
134147
enable_debug_log()
135148
{
136149
if test "${DEBUG_LOG_ENABLED}" -eq 1; then return; fi
137-
export DEBUG_LOG_ENABLED=1
138150

139151
ui_debug "Creating log: ${LOG_PATH:?}"
152+
_show_text_on_recovery "Creating log: ${LOG_PATH:?}"
153+
140154
touch "${LOG_PATH:?}" || {
141-
ui_warning "Unable to write the log file at: ${LOG_PATH:-}"
142155
export DEBUG_LOG_ENABLED=0
156+
ui_warning "Unable to write the log file at: ${LOG_PATH:-}"
143157
return
144158
}
145159

160+
export DEBUG_LOG_ENABLED=1
161+
146162
# If they are already in use, then use alternatives
147163
if {
148164
command 1>&6 || command 1>&7
@@ -171,19 +187,6 @@ disable_debug_log()
171187
fi
172188
}
173189

174-
_show_text_on_recovery()
175-
{
176-
if test "${RECOVERY_OUTPUT:?}" != 'true'; then return; fi # Nothing to do here
177-
178-
if test -e "${RECOVERY_PIPE:?}"; then
179-
printf 'ui_print %s\nui_print\n' "${1?}" >> "${RECOVERY_PIPE:?}"
180-
else
181-
printf 'ui_print %s\nui_print\n' "${1?}" 1>&"${OUTFD:?}"
182-
fi
183-
184-
if test "${DEBUG_LOG_ENABLED:?}" -eq 1; then printf 1>&2 '%s\n' "${1?}"; fi
185-
}
186-
187190
ui_error()
188191
{
189192
ERROR_CODE=79

zip-content/inc/common-functions.sh

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -865,18 +865,22 @@ initialize()
865865
fi
866866

867867
if mount_partition_if_exist "${SLOT:+product}${SLOT-}${NL:?}product${NL:?}" 'product'; then
868+
PRODUCT_PATH="${LAST_MOUNTPOINT:?}"
868869
UNMOUNT_PRODUCT="${LAST_PARTITION_MUST_BE_UNMOUNTED:?}"
869870
remount_read_write_if_needed "${LAST_MOUNTPOINT:?}" false && PRODUCT_WRITABLE='true'
870871
fi
871872
if mount_partition_if_exist "${SLOT:+vendor}${SLOT-}${NL:?}vendor${NL:?}" 'vendor'; then
873+
VENDOR_PATH="${LAST_MOUNTPOINT:?}"
872874
UNMOUNT_VENDOR="${LAST_PARTITION_MUST_BE_UNMOUNTED:?}"
873875
remount_read_write_if_needed "${LAST_MOUNTPOINT:?}" false && VENDOR_WRITABLE='true'
874876
fi
875877
if mount_partition_if_exist "${SLOT:+system_ext}${SLOT-}${NL:?}system_ext${NL:?}" 'system_ext'; then
878+
SYS_EXT_PATH="${LAST_MOUNTPOINT:?}"
876879
UNMOUNT_SYS_EXT="${LAST_PARTITION_MUST_BE_UNMOUNTED:?}"
877880
remount_read_write_if_needed "${LAST_MOUNTPOINT:?}" false
878881
fi
879882
if mount_partition_if_exist "${SLOT:+odm}${SLOT-}${NL:?}odm${NL:?}" 'odm'; then
883+
ODM_PATH="${LAST_MOUNTPOINT:?}"
880884
UNMOUNT_ODM="${LAST_PARTITION_MUST_BE_UNMOUNTED:?}"
881885
remount_read_write_if_needed "${LAST_MOUNTPOINT:?}" false
882886
fi
@@ -885,7 +889,7 @@ initialize()
885889
if mount_partition_if_exist "userdata${NL:?}DATAFS${NL:?}" 'data' "${ANDROID_DATA-}"; then
886890
DATA_PATH="${LAST_MOUNTPOINT:?}"
887891
UNMOUNT_DATA="${LAST_PARTITION_MUST_BE_UNMOUNTED:?}"
888-
remount_read_write_if_needed "${DATA_PATH:?}" true
892+
remount_read_write_if_needed "${LAST_MOUNTPOINT:?}" true
889893
else
890894
ui_warning "The data partition cannot be mounted, so updates of installed / removed apps cannot be automatically deleted and their Dalvik cache cannot be automatically cleaned. I suggest to manually do a factory reset after flashing this ZIP."
891895
fi
@@ -1345,8 +1349,8 @@ verify_disk_space()
13451349
_free_space_bytes="$(get_free_disk_space_of_partition "${1:?}")" || _free_space_bytes='-1'
13461350
display_free_space "${1:?}" "${_free_space_bytes?}" || :
13471351

1348-
if test "${PRODUCT_WRITABLE:?}" = 'true'; then display_free_space '/product' "$(get_free_disk_space_of_partition '/product' || :)"; fi
1349-
if test "${VENDOR_WRITABLE:?}" = 'true'; then display_free_space '/vendor' "$(get_free_disk_space_of_partition '/vendor' || :)"; fi
1352+
if test "${PRODUCT_WRITABLE:?}" = 'true'; then display_free_space "${PRODUCT_PATH:?}" "$(get_free_disk_space_of_partition "${PRODUCT_PATH:?}" || :)"; fi
1353+
if test "${VENDOR_WRITABLE:?}" = 'true'; then display_free_space "${VENDOR_PATH:?}" "$(get_free_disk_space_of_partition "${VENDOR_PATH:?}" || :)"; fi
13501354

13511355
if test "${_needed_space_bytes:?}" -ge 0 && test "${_free_space_bytes:?}" -ge 0; then
13521356
: # OK
@@ -1603,17 +1607,17 @@ unmount()
16031607

16041608
unmount_extra_partitions()
16051609
{
1606-
if test "${UNMOUNT_PRODUCT:?}" = '1'; then
1607-
unmount '/product'
1610+
if test "${UNMOUNT_PRODUCT:?}" = '1' && test -n "${PRODUCT_PATH-}"; then
1611+
unmount "${PRODUCT_PATH:?}"
16081612
fi
1609-
if test "${UNMOUNT_VENDOR:?}" = '1'; then
1610-
unmount '/vendor'
1613+
if test "${UNMOUNT_VENDOR:?}" = '1' && test -n "${VENDOR_PATH-}"; then
1614+
unmount "${VENDOR_PATH:?}"
16111615
fi
1612-
if test "${UNMOUNT_SYS_EXT:?}" = '1'; then
1613-
unmount '/system_ext'
1616+
if test "${UNMOUNT_SYS_EXT:?}" = '1' && test -n "${SYS_EXT_PATH-}"; then
1617+
unmount "${SYS_EXT_PATH:?}"
16141618
fi
1615-
if test "${UNMOUNT_ODM:?}" = '1'; then
1616-
unmount '/odm'
1619+
if test "${UNMOUNT_ODM:?}" = '1' && test -n "${ODM_PATH-}"; then
1620+
unmount "${ODM_PATH:?}"
16171621
fi
16181622

16191623
return 0 # Never fail

zip-content/module.prop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
id=google-sync-addon
66
name=Google Sync add-on
7-
version=v1.3.1.75-alpha
7+
version=v1.3.1.76-alpha
88
versionCode=5
99
author=ale5000
1010
description=It installs Google sync adapters on Android.

0 commit comments

Comments
 (0)