diff --git a/README.rst b/README.rst index 0042bade..9ca1b293 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ microG unofficial installer Description ----------- -microG unofficial installer is a flashable zip created for a simple installation of microG on Android. +microG unofficial installer is a flashable zip created for a simple installation of microG on Android from 2.2 to 15. This project is available on GitHub_, on GitLab_ as well as on XDA_. diff --git a/zip-content/inc/common-functions.sh b/zip-content/inc/common-functions.sh index 9aee2997..26359902 100644 --- a/zip-content/inc/common-functions.sh +++ b/zip-content/inc/common-functions.sh @@ -1149,9 +1149,9 @@ get_free_disk_space_of_partition() { local _stat_result - if _stat_result="$(stat 2> /dev/null -f -c '%f * %S' -- "${1:?}")"; then + if _stat_result="$(stat 2> /dev/null -f -c '%a * %S' -- "${1:?}")"; then : # OK - elif test -n "${DEVICE_STAT?}" && _stat_result="$(PATH="${PREVIOUS_PATH:?}" "${DEVICE_STAT:?}" 2> /dev/null -f -c '%f * %S' -- "${1:?}")"; then + elif test -n "${DEVICE_STAT?}" && _stat_result="$(PATH="${PREVIOUS_PATH:?}" "${DEVICE_STAT:?}" 2> /dev/null -f -c '%a * %S' -- "${1:?}")"; then : # OK else _stat_result='' @@ -1234,7 +1234,7 @@ verify_disk_space() if _free_space_bytes="$(get_free_disk_space_of_partition "${1:?}")" && test -n "${_free_space_bytes?}"; then ui_msg "Free disk space: $(convert_bytes_to_mb "${_free_space_bytes:?}" || :) MB ($(convert_bytes_to_human_readable_format "${_free_space_bytes:?}" || :))" else - ui_warning "Unable to get free disk space, output for '${1?}' => $(stat -f -c '%f * %S' -- "${1:?}" || :)" + ui_warning "Unable to get free disk space, output for '${1?}' => $(stat -f -c '%a * %S' -- "${1:?}" || :)" _free_space_bytes='-1' fi @@ -1254,19 +1254,22 @@ verify_disk_space() perform_secure_copy_to_device() { if test ! -e "${TMP_PATH:?}/files/${1:?}"; then return 0; fi - local _error_text='' + local _error_text ui_debug " Copying the '${1?}' folder to the device..." create_dir "${SYS_PATH:?}/${1:?}" + _error_text='' - if { - cp 2> /dev/null -r -p -f -- "${TMP_PATH:?}/files/${1:?}"/* "${SYS_PATH:?}/${1:?}"/ || - _error_text="$(cp 2>&1 -r -p -f -- "${TMP_PATH:?}/files/${1:?}"/* "${SYS_PATH:?}/${1:?}"/)" - } && _custom_rollback "${1:?}"; then + if + { + cp 2> /dev/null -r -p -f -- "${TMP_PATH:?}/files/${1:?}"/* "${SYS_PATH:?}/${1:?}/" || + _error_text="$(cp 2>&1 -r -p -f -- "${TMP_PATH:?}/files/${1:?}"/* "${SYS_PATH:?}/${1:?}/")" + } && _custom_rollback "${1:?}" + then return 0 elif _is_free_space_error "${_error_text?}"; then while _do_rollback_last_app "${1:?}"; do - if ! _something_exists "${TMP_PATH:?}/files/${1:?}"/* || cp 2> /dev/null -r -p -f -- "${TMP_PATH:?}/files/${1:?}"/* "${SYS_PATH:?}/${1:?}"/; then + if ! _something_exists "${TMP_PATH:?}/files/${1:?}"/* || cp 2> /dev/null -r -p -f -- "${TMP_PATH:?}/files/${1:?}"/* "${SYS_PATH:?}/${1:?}/"; then if test -n "${_error_text?}"; then ui_recovered_error "$(printf '%s\n' "${_error_text:?}" | head -n 1 || true)" else @@ -1285,15 +1288,20 @@ perform_secure_copy_to_device() df 2> /dev/null -h -T -- "${SYS_MOUNTPOINT:?}" || df -h -- "${SYS_MOUNTPOINT:?}" || : ui_debug '' - local _free_space_bytes + local _ret_code _free_space_bytes + if _free_space_bytes="$(get_free_disk_space_of_partition "${SYS_PATH:?}")" && test -n "${_free_space_bytes?}"; then ui_debug "Free disk space: $(convert_bytes_to_mb "${_free_space_bytes:?}" || :) MB ($(convert_bytes_to_human_readable_format "${_free_space_bytes:?}" || :))" + ui_debug '' fi + _ret_code=5 + ! _is_free_space_error "${_error_text?}" || _ret_code=28 + if test -n "${_error_text?}"; then - ui_error "Failed to copy '${1?}' to the device due to => $(printf '%s\n' "${_error_text?}" | head -n 1 || :)" + ui_error "Failed to copy '${1?}' to the device due to => $(printf '%s\n' "${_error_text?}" | head -n 1 || :)" "${_ret_code?}" fi - ui_error "Failed to copy '${1?}' to the device" + ui_error "Failed to copy '${1?}' to the device" "${_ret_code?}" } perform_installation() diff --git a/zip-content/module.prop b/zip-content/module.prop index 43308fc7..793ee6a0 100644 --- a/zip-content/module.prop +++ b/zip-content/module.prop @@ -4,7 +4,7 @@ id=microg-unofficial-installer name=microG unofficial installer -version=v1.3.1.73-alpha +version=v1.3.1.74-alpha versionCode=5 author=ale5000 description=It installs microG on Android.