Skip to content

Commit 15e2c6e

Browse files
committed
Sync with microG unofficial installer
1 parent c84fb33 commit 15e2c6e

File tree

13 files changed

+290
-228
lines changed

13 files changed

+290
-228
lines changed

.github/workflows/auto-nightly.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ jobs:
5454
printf '%s\n' "::notice::SHA-256: ${ZIP_SHA256:-Missing}"
5555
printf '%s\n' "::notice::MD5: ${ZIP_MD5:-Missing}"
5656
: "${ZIP_FOLDER:?}" || exit "${?}"
57-
- name: "Do we need to release?"
58-
id: "release-decision"
57+
- name: "Do we need to release the nightly?"
58+
id: "nightly-logic"
5959
shell: bash
6060
run: |
61-
# Do we need to release?
61+
# Do we need to release the nightly?
6262
git fetch -q origin
6363
CREATE_RELEASE='false'
6464
IS_LATEST_COMMIT='false'
@@ -72,7 +72,7 @@ jobs:
7272
printf '%s\n' "${CREATE_RELEASE:?}"
7373
- name: "Delete previous nightly release"
7474
uses: actions/github-script@v7
75-
if: "${{ steps.release-decision.outputs.CREATE_RELEASE == 'true' }}"
75+
if: "${{ steps.nightly-logic.outputs.CREATE_RELEASE == 'true' }}"
7676
with:
7777
retries: 3
7878
script: |
@@ -108,7 +108,7 @@ jobs:
108108
});
109109
- name: "Create nightly release"
110110
uses: softprops/action-gh-release@v2
111-
if: "${{ steps.release-decision.outputs.CREATE_RELEASE == 'true' }}"
111+
if: "${{ steps.nightly-logic.outputs.CREATE_RELEASE == 'true' }}"
112112
with:
113113
name: "${{ steps.build.outputs.ZIP_VERSION }} nightly"
114114
tag_name: "nightly"

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ if test "${OPENSOURCE_ONLY:?}" = 'false'; then
242242
cp -f -- "${MAIN_DIR:?}/cache/${LOCAL_PATH:?}/${LOCAL_FILENAME:?}.apk" "${TEMP_DIR:?}/zip-content/origin/${LOCAL_PATH:?}/" || ui_error "Failed to copy to the temp dir the file => '${LOCAL_PATH}/${LOCAL_FILENAME}.apk'"
243243

244244
_extract_libs=''
245-
if test "${LOCAL_FILENAME:?}" = 'PlayStore'; then _extract_libs='libs'; fi
245+
if test "${LOCAL_FILENAME:?}" = 'PlayStore' || test "${LOCAL_FILENAME:?}" = 'PlayStoreARM64'; then _extract_libs='libs'; fi
246246

247247
printf '%s\n' "${LOCAL_PATH:?}/${LOCAL_FILENAME:?}|${MIN_API:?}|${MAX_API?}|${FINAL_FILENAME:?}|${_extract_libs?}|${INTERNAL_NAME:?}|${FILE_HASH:?}" >> "${TEMP_DIR:?}/zip-content/origin/file-list.dat"
248248
done

includes/common.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,20 @@ readonly NL='
3232

3333
pause_if_needed()
3434
{
35-
# shellcheck disable=SC3028 # In POSIX sh, SHLVL is undefined
36-
if test "${NO_PAUSE:-0}" = '0' && test "${CI:-false}" = 'false' && test "${TERM_PROGRAM-}" != 'vscode' && test "${SHLVL:-1}" = '1' && test -t 0 && test -t 1 && test -t 2; then
37-
printf 1>&2 '\n\033[1;32m%s\033[0m' 'Press any key to exit...' || :
38-
# shellcheck disable=SC3045
39-
IFS='' read 1> /dev/null 2>&1 -r -s -n 1 _ || IFS='' read 1>&2 -r _ || :
35+
# shellcheck disable=SC3028 # Ignore: In POSIX sh, SHLVL is undefined
36+
if test "${NO_PAUSE:-0}" = '0' && test "${no_pause:-0}" = '0' && test "${CI:-false}" = 'false' && test "${TERM_PROGRAM:-unknown}" != 'vscode' && test "${SHLVL:-1}" = '1' && test -t 0 && test -t 1 && test -t 2; then
37+
if test -n "${NO_COLOR-}"; then
38+
printf 1>&2 '\n%s' 'Press any key to exit... ' || :
39+
else
40+
printf 1>&2 '\n\033[1;32m\r%s' 'Press any key to exit... ' || :
41+
fi
42+
# shellcheck disable=SC3045 # Ignore: In POSIX sh, read -s / -n is undefined
43+
IFS='' read 2> /dev/null 1>&2 -r -s -n1 _ || IFS='' read 1>&2 -r _ || :
4044
printf 1>&2 '\n' || :
45+
test -n "${NO_COLOR-}" || printf 1>&2 '\033[0m\r \r' || :
4146
fi
47+
unset no_pause || :
48+
return "${1:-0}"
4249
}
4350

4451
beep()
@@ -51,7 +58,7 @@ beep()
5158
ui_error()
5259
{
5360
echo 1>&2 "ERROR: $1"
54-
pause_if_needed
61+
pause_if_needed 0
5562
restore_saved_title_if_exist
5663
test -n "${2-}" && exit "$2"
5764
exit 1

tools/bits-info.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,20 +1115,20 @@ clear_env()
11151115

11161116
pause_if_needed()
11171117
{
1118-
# shellcheck disable=SC3028 # Intended: In POSIX sh, SHLVL is undefined
1118+
# shellcheck disable=SC3028 # Ignore: In POSIX sh, SHLVL is undefined
11191119
if test "${NO_PAUSE:-0}" = '0' && test "${no_pause:-0}" = '0' && test "${CI:-false}" = 'false' && test "${TERM_PROGRAM:-unknown}" != 'vscode' && test "${SHLVL:-1}" = '1' && test -t 0 && test -t 1 && test -t 2; then
11201120
if test -n "${NO_COLOR-}"; then
11211121
printf 1>&2 '\n%s' 'Press any key to exit... ' || :
11221122
else
11231123
printf 1>&2 '\n\033[1;32m\r%s' 'Press any key to exit... ' || :
11241124
fi
1125-
# shellcheck disable=SC3045 # Intended: In POSIX sh, read -s / -n is undefined
1126-
IFS='' read 2> /dev/null 1>&2 -r -s -n 1 _ || IFS='' read 1>&2 -r _ || :
1125+
# shellcheck disable=SC3045 # Ignore: In POSIX sh, read -s / -n is undefined
1126+
IFS='' read 2> /dev/null 1>&2 -r -s -n1 _ || IFS='' read 1>&2 -r _ || :
11271127
printf 1>&2 '\n' || :
11281128
test -n "${NO_COLOR-}" || printf 1>&2 '\033[0m\r \r' || :
11291129
fi
1130-
unset no_pause
1131-
return "${1}"
1130+
unset no_pause || :
1131+
return "${1:-0}"
11321132
}
11331133

11341134
main()
@@ -1538,4 +1538,4 @@ if test "${execute_script}" = 'true'; then
15381538
fi
15391539

15401540
clear_env
1541-
pause_if_needed "${STATUS}"
1541+
pause_if_needed "${STATUS?}"

tools/list-permissions.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/usr/bin/env sh
2+
# SPDX-FileCopyrightText: (c) 2025 ale5000
3+
# SPDX-License-Identifier: GPL-3.0-or-later
4+
5+
# shellcheck enable=all
6+
# shellcheck disable=SC3043 # In POSIX sh, local is undefined
7+
8+
export SCRIPT_NAME='List permissions used by apps'
9+
export SCRIPT_VERSION='0.0.3'
10+
11+
# shellcheck disable=SC3040 # Ignore: In POSIX sh, set option pipefail is undefined
12+
case "$(set 2> /dev/null -o || set || :)" in *'pipefail'*) set -o pipefail || echo 1>&2 'Failed: pipefail' ;; *) ;; esac
13+
14+
pause_if_needed()
15+
{
16+
# shellcheck disable=SC3028 # Ignore: In POSIX sh, SHLVL is undefined
17+
if test "${NO_PAUSE:-0}" = '0' && test "${no_pause:-0}" = '0' && test "${CI:-false}" = 'false' && test "${TERM_PROGRAM:-unknown}" != 'vscode' && test "${SHLVL:-1}" = '1' && test -t 0 && test -t 1 && test -t 2; then
18+
if test -n "${NO_COLOR-}"; then
19+
printf 1>&2 '\n%s' 'Press any key to exit... ' || :
20+
else
21+
printf 1>&2 '\n\033[1;32m\r%s' 'Press any key to exit... ' || :
22+
fi
23+
# shellcheck disable=SC3045 # Ignore: In POSIX sh, read -s / -n is undefined
24+
IFS='' read 2> /dev/null 1>&2 -r -s -n1 _ || IFS='' read 1>&2 -r _ || :
25+
printf 1>&2 '\n' || :
26+
test -n "${NO_COLOR-}" || printf 1>&2 '\033[0m\r \r' || :
27+
fi
28+
unset no_pause || :
29+
return "${1:-0}"
30+
}
31+
32+
find_android_build_tool()
33+
{
34+
local _tool_path
35+
36+
if test -n "${2-}" && _tool_path="${2:?}"; then
37+
:
38+
elif _tool_path="$(command -v "${1:?}")" && test -n "${_tool_path?}"; then
39+
:
40+
elif test -n "${ANDROID_SDK_ROOT-}" && test -d "${ANDROID_SDK_ROOT:?}/build-tools" && _tool_path="$(find "${ANDROID_SDK_ROOT:?}/build-tools" -maxdepth 2 -iname "${1:?}*" | LC_ALL=C sort -V -r | head -n 1)" && test -n "${_tool_path?}"; then
41+
:
42+
else
43+
return 1
44+
fi
45+
46+
printf '%s\n' "${_tool_path:?}"
47+
}
48+
49+
main()
50+
{
51+
AAPT2_PATH="$(find_android_build_tool 'aapt2' "${AAPT2_PATH-}")" || AAPT_PATH="$(find_android_build_tool 'aapt' "${AAPT_PATH-}")" || :
52+
53+
if test -n "${AAPT2_PATH-}"; then
54+
"${AAPT2_PATH:?}" dump permissions "${@}" | grep -F -e 'uses-permission: ' | cut -d ':' -f '2-' -s | cut -b '2-' | LC_ALL=C sort || return "${?}"
55+
elif test -n "${AAPT_PATH-}"; then
56+
"${AAPT_PATH:?}" dump permissions "${@}" | grep -F -e 'uses-permission: ' | cut -d ':' -f '2-' -s | cut -b '2-' | LC_ALL=C sort || return "${?}"
57+
else
58+
return 255
59+
fi
60+
}
61+
62+
main "${@}"
63+
pause_if_needed "${?}"

zip-content/META-INF/com/google/android/update-binary.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# shellcheck enable=all
66
# shellcheck disable=SC3043 # In POSIX sh, local is undefined #
77

8-
echo 'PRELOADER'
8+
echo 'PRE-LOADER'
99

1010
### INIT OPTIONS ###
1111

zip-content/customize.sh

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ unset -f _log_path_setter || true
127127
readonly LOG_PATH
128128
export LOG_PATH
129129

130-
export KEYCHECK_ENABLED='false'
131-
132130
### FUNCTIONS ###
133131

134132
_send_text_to_recovery()
@@ -282,18 +280,6 @@ package_extract_file()
282280
}
283281
}
284282

285-
package_extract_file_may_fail()
286-
{
287-
{
288-
unzip -o -p -qq "${ZIPFILE:?}" "${1:?}" 1> "${2:?}" && test -s "${2:?}"
289-
} ||
290-
{
291-
rm -f -- "${2:?}" || true
292-
ui_debug "Failed to extract the file '${1}' from this archive"
293-
return 1
294-
}
295-
}
296-
297283
package_extract_file_safe()
298284
{
299285
"${OUR_BB}" unzip -opq "${ZIPFILE:?}" "${1:?}" 1> "${2:?}" || ui_error "Failed to extract the file '${1}' from this archive" 83
@@ -342,7 +328,7 @@ detect_recovery_arch()
342328
detect_recovery_arch
343329

344330
OUR_BB="${BASE_TMP_PATH:?}/busybox"
345-
if test -n "${CUSTOM_BUSYBOX:-}" && test -e "${CUSTOM_BUSYBOX:?}"; then
331+
if test -n "${CUSTOM_BUSYBOX-}" && test -x "${CUSTOM_BUSYBOX:?}"; then
346332
OUR_BB="${CUSTOM_BUSYBOX:?}"
347333
ui_debug "Using custom BusyBox... '${OUR_BB:?}'"
348334
elif test "${RECOVERY_ARCH}" = 'x86_64'; then
@@ -354,16 +340,14 @@ elif test "${RECOVERY_ARCH}" = 'x86'; then
354340
elif test "${RECOVERY_ARCH}" = 'arm64-v8a'; then
355341
ui_debug 'Extracting 64-bit ARM BusyBox...'
356342
package_extract_file 'misc/busybox/busybox-arm64.bin' "${OUR_BB:?}"
357-
package_extract_file_may_fail 'misc/keycheck/keycheck-arm.bin' "${BASE_TMP_PATH:?}/keycheck"
358343
elif test "${RECOVERY_ARCH}" = 'armeabi-v7a' || test "${RECOVERY_ARCH}" = 'armeabi'; then
359344
ui_debug 'Extracting ARM BusyBox...'
360345
package_extract_file 'misc/busybox/busybox-arm.bin' "${OUR_BB:?}"
361-
package_extract_file_may_fail 'misc/keycheck/keycheck-arm.bin' "${BASE_TMP_PATH:?}/keycheck"
362346
fi
363-
if ! test -e "${OUR_BB:?}"; then ui_error 'BusyBox not found'; fi
347+
if test ! -e "${OUR_BB:?}"; then ui_error 'BusyBox not found'; fi
364348

365349
# Give execution rights (if needed)
366-
if test -z "${CUSTOM_BUSYBOX:-}" || test "${OUR_BB:?}" != "${CUSTOM_BUSYBOX:?}"; then
350+
if test -z "${CUSTOM_BUSYBOX-}" || test "${OUR_BB:?}" != "${CUSTOM_BUSYBOX:?}"; then
367351
# Legacy versions of chmod don't support +x and --
368352
chmod 0755 "${OUR_BB:?}" || ui_error "chmod failed on '${OUR_BB:?}'" # Needed to make working the "safe" functions
369353
fi
@@ -423,25 +407,10 @@ DEBUG_LOG="$(_get_common_setting 'DEBUG_LOG' "${DEBUG_LOG:-0}")"
423407
test "${DEBUG_LOG:?}" -ne 0 && enable_debug_log # Enable file logging if needed
424408

425409
LIVE_SETUP_ALLOWED="${LIVE_SETUP_ALLOWED:-true}"
426-
KEYCHECK_PATH=''
427-
if test "${TEST_INSTALL:-false}" != 'false'; then
428-
"${OUR_BB:?}" rm -f "${BASE_TMP_PATH:?}/keycheck" || ui_error "Failed to remove keycheck"
429-
else
430-
# Setup Keycheck in the temp folder
431-
if test -e "${BASE_TMP_PATH:?}/keycheck"; then
432-
KEYCHECK_PATH="${TMP_PATH:?}/bin/keycheck"
433-
"${OUR_BB:?}" mv -f "${BASE_TMP_PATH:?}/keycheck" "${KEYCHECK_PATH:?}" || ui_error "Failed to move keycheck to the bin folder"
434-
# Give execution rights
435-
"${OUR_BB:?}" chmod 0755 "${KEYCHECK_PATH:?}" || ui_error "chmod failed on keycheck"
436-
export KEYCHECK_ENABLED='true'
437-
fi
438-
fi
439-
440-
# Live setup under continuous integration systems doesn't make sense
441-
if test "${CI:-false}" != 'false'; then LIVE_SETUP_ALLOWED='false'; fi
410+
if test "${CI:-false}" != 'false'; then LIVE_SETUP_ALLOWED='false'; fi # Live setup under continuous integration systems doesn't make sense
442411

443-
readonly LIVE_SETUP_ALLOWED KEYCHECK_PATH
444-
export LIVE_SETUP_ALLOWED KEYCHECK_PATH
412+
readonly LIVE_SETUP_ALLOWED
413+
export LIVE_SETUP_ALLOWED
445414

446415
# Extract scripts
447416
ui_debug 'Extracting scripts...'

0 commit comments

Comments
 (0)