Skip to content

Commit

Permalink
Sync with microG unofficial installer
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git committed Aug 17, 2023
1 parent 6978346 commit a34c302
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
30 changes: 15 additions & 15 deletions zip-content/inc/common-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -782,23 +782,28 @@ prepare_installation()
ui_debug "Moving apps into subdirs..."
if test -e "${TMP_PATH:?}/files/priv-app"; then
for entry in "${TMP_PATH:?}/files/priv-app"/*; do
if test ! -f "${entry:?}"; then continue; fi
path_without_ext="$(remove_ext "${entry:?}")"

mkdir -p -- "${path_without_ext:?}" || ui_error "Failed to create the dir '${path_without_ext:-}'"
mv -f -- "${entry:?}" "${path_without_ext:?}/" || ui_error "Failed to move the file '${entry:-}' to '${path_without_ext:-}'"
mkdir -p -- "${path_without_ext:?}" || ui_error "Failed to create the folder '${path_without_ext:-}'"
mv -f -- "${entry:?}" "${path_without_ext:?}/" || ui_error "Failed to move the file '${entry:-}' to folder '${path_without_ext:?}/'"
done
fi
if test -e "${TMP_PATH:?}/files/app"; then
for entry in "${TMP_PATH:?}/files/app"/*; do
if test ! -f "${entry:?}"; then continue; fi
path_without_ext="$(remove_ext "${entry:?}")"

mkdir -p -- "${path_without_ext:?}" || ui_error "Failed to create the dir '${path_without_ext:-}'"
mv -f -- "${entry:?}" "${path_without_ext:?}/" || ui_error "Failed to move the file '${entry:-}' to '${path_without_ext:-}'"
mkdir -p -- "${path_without_ext:?}" || ui_error "Failed to create the folder '${path_without_ext:-}'"
mv -f -- "${entry:?}" "${path_without_ext:?}/" || ui_error "Failed to move the file '${entry:-}' to folder '${path_without_ext:?}/'"
done
fi

IFS="${_backup_ifs:-}"
fi

set_std_perm_recursive "${TMP_PATH:?}/files"
if test -e "${TMP_PATH:?}/addon.d"; then set_std_perm_recursive "${TMP_PATH:?}/addon.d"; fi
}

perform_secure_copy_to_device()
Expand Down Expand Up @@ -1272,17 +1277,15 @@ select_lib()
fi
}

prepare_libs()
extract_libs()
{
local _lib_selected

ui_msg "Extracting libs from ${1:?}/${2:?}..."
create_dir "${TMP_PATH:?}/libs"
zip_extract_dir "${TMP_PATH:?}/files/${1:?}/${2:?}.apk" 'lib' "${TMP_PATH:?}/libs"

if test "${API:?}" -ge 21; then
zip_extract_dir "${TMP_PATH:?}/files/${1:?}/${2:?}/${2:?}.apk" 'lib' "${TMP_PATH:?}/libs"
set_std_perm_recursive "${TMP_PATH:?}/libs"

create_dir "${TMP_PATH:?}/selected-libs"

_lib_selected='false'
Expand Down Expand Up @@ -1314,19 +1317,16 @@ prepare_libs()
fi

if test "${_lib_selected:?}" = 'true'; then
create_dir "${TMP_PATH:?}/files/${1:?}/${2:?}/lib"
move_dir_content "${TMP_PATH:?}/selected-libs" "${TMP_PATH:?}/files/${1:?}/${2:?}/lib"
create_dir "${TMP_PATH:?}/files/${1:?}/${2:?}"
move_rename_dir "${TMP_PATH:?}/selected-libs" "${TMP_PATH:?}/files/${1:?}/${2:?}/lib"
elif test "${CPU64:?}" = 'mips64' || test "${CPU:?}" = 'mips'; then
: # Tolerate missing libraries
else
ui_error "Failed to select library"
fi

delete "${TMP_PATH:?}/selected-libs"
delete_temp "selected-libs"
else
zip_extract_dir "${TMP_PATH:?}/files/${1:?}/${2:?}.apk" 'lib' "${TMP_PATH:?}/libs"
set_std_perm_recursive "${TMP_PATH:?}/libs"

if test "${CPU64}" != false; then
create_dir "${TMP_PATH:?}/files/lib64"
move_dir_content "${TMP_PATH:?}/libs/lib/${CPU64}" "${TMP_PATH:?}/files/lib64"
Expand All @@ -1337,7 +1337,7 @@ prepare_libs()
fi
fi

delete "${TMP_PATH:?}/libs"
delete_temp "libs"
}

file_get_first_line_that_start_with()
Expand Down
3 changes: 0 additions & 3 deletions zip-content/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ fi

# Prepare installation
prepare_installation

set_std_perm_recursive "${TMP_PATH:?}/files"
if test -e "${TMP_PATH:?}/addon.d"; then set_std_perm_recursive "${TMP_PATH:?}/addon.d"; fi
set_perm 0 0 0755 "${TMP_PATH:?}/addon.d/00-1-google-sync.sh"

# Installing
Expand Down

0 comments on commit a34c302

Please sign in to comment.