Skip to content

Commit 2754252

Browse files
committed
chore: sync with microG unofficial installer
Signed-off-by: ale5000 <15793015+ale5000-git@users.noreply.github.com>
1 parent 51001be commit 2754252

7 files changed

Lines changed: 51 additions & 24 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ desktop.ini
2626
# VS Code files
2727
/.vscode/launch.json
2828

29+
# Git hooks
30+
/.git-hooks/post-checkout
31+
/.git-hooks/post-commit
32+
/.git-hooks/post-merge
33+
/.git-hooks/pre-push
34+
2935
# Gradle files
3036
/.gradle/
3137
/build/

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"problemMatcher": []
4444
},
4545
{
46-
"label": "test",
46+
"label": "installTest",
4747
"detail": "Emulate an Android recovery on your PC and run the flashable zip file inside it to see the result.",
4848
"type": "shell",
4949
"command": "${workspaceFolder}/recovery-simulator/recovery.sh",

config-git.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,24 @@ setup_gpg()
7171

7272
STATUS=0
7373

74-
printf '%s\n' "Repo dir: ${PWD?}" || STATUS="${?}"
75-
76-
test -d "${PWD:?}/.git-hooks"
77-
config_var core.hooksPath '.git-hooks' "${?}" || STATUS="${?}"
74+
printf '%s\n\n' "Repo dir: ${PWD?}" || STATUS="${?}"
7875

7976
test -f "${PWD:?}/allowed_signers"
8077
config_var gpg.ssh.allowedSignersFile 'allowed_signers' "${?}" || STATUS="${?}"
8178

82-
setup_gpg || STATUS="${?}"
83-
8479
config_var format.signOff 'true' || STATUS="${?}"
8580
config_var alias.cm 'commit -s' || STATUS="${?}"
8681

82+
printf '\n'
83+
84+
test -d "${PWD:?}/.git-hooks"
85+
config_var core.hooksPath '.git-hooks' "${?}" || STATUS="${?}"
86+
HOME="${USER_HOME:-${HOME:?}}" git lfs install --local || STATUS="${?}"
87+
88+
printf '\n'
89+
90+
setup_gpg || STATUS="${?}"
91+
8792
test "${STATUS:?}" = 0 || printf '%s\n' "Error code: ${STATUS:?}"
8893

8994
pause_if_needed "${STATUS:?}"

tools/dl-perm-list.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
readonly SCRIPT_NAME='Android permissions retriever'
1414
readonly SCRIPT_SHORTNAME='DlPermList'
15-
readonly SCRIPT_VERSION='0.3.0'
15+
readonly SCRIPT_VERSION='0.3.1'
1616
readonly SCRIPT_AUTHOR='ale5000'
1717

1818
set -u
@@ -41,7 +41,7 @@ readonly MAX_API='36'
4141
readonly TAG_API_33='android-13.0.0_r84' # Android 13
4242
readonly TAG_API_34='android-14.0.0_r75' # Android 14
4343
readonly TAG_API_35='android-15.0.0_r36' # Android 15
44-
readonly TAG_API_36='android-16.0.0_r2' # Android 16
44+
readonly TAG_API_36='android-16.0.0_r4' # Android 16
4545
}
4646

4747
readonly WGET_CMD='wget'

zip-content/customize.sh

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,28 @@ set -u 2> /dev/null || :
1616
(set -o pipefail 1> /dev/null 2>&1) && set -o pipefail || :
1717
}
1818

19+
### MAGISK / KERNELSU VARIABLES ###
20+
21+
SKIPUNZIP=1
22+
ASH_STANDALONE=1
23+
KSU="${KSU:-false}"
24+
readonly SKIPUNZIP ASH_STANDALONE KSU
25+
export SKIPUNZIP ASH_STANDALONE KSU
26+
27+
if test "${KSU:?}" != 'false'; then
28+
INSTALL_MODE='KernelSU'
29+
elif test -n "${MAGISK_VER_CODE-}"; then
30+
INSTALL_MODE='Magisk'
31+
else
32+
INSTALL_MODE='Pure'
33+
fi
34+
readonly INSTALL_MODE
35+
export INSTALL_MODE
36+
1937
### PREVENTIVE CHECKS ###
2038

39+
export OUTFD="${OUTFD:-2}"
40+
2141
if test -z "${BOOTMODE-}"; then
2242
printf 1>&2 '%s\n' 'Missing BOOTMODE variable'
2343
abort 2> /dev/null 'Missing BOOTMODE variable'
@@ -33,9 +53,9 @@ if test -z "${TMPDIR-}" || test ! -w "${TMPDIR:?}"; then
3353
abort 2> /dev/null 'The temp folder is missing (2)'
3454
exit 1
3555
fi
36-
if test -z "${OUTFD-}" || test "${OUTFD:?}" -lt 1; then
37-
printf 1>&2 '%s\n' 'Missing or invalid OUTFD variable'
38-
abort 2> /dev/null 'Missing or invalid OUTFD variable'
56+
if test "${OUTFD:?}" -lt 1; then
57+
printf 1>&2 '%s\n' 'Invalid OUTFD variable'
58+
abort 2> /dev/null 'Invalid OUTFD variable'
3959
exit 1
4060
fi
4161
RECOVERY_PIPE="/proc/self/fd/${OUTFD:?}"
@@ -44,19 +64,11 @@ test -e "${RECOVERY_PIPE:?}" || RECOVERY_PIPE=''
4464
export BOOTMODE
4565
export ZIPFILE
4666
export TMPDIR
47-
export OUTFD
4867
export RECOVERY_PIPE
4968
export ANDROID_ROOT
5069
export ANDROID_DATA
5170
unset REPLACE
5271

53-
### MAGISK VARIABLES ###
54-
55-
SKIPUNZIP=1
56-
ASH_STANDALONE=1
57-
readonly SKIPUNZIP ASH_STANDALONE
58-
export SKIPUNZIP ASH_STANDALONE
59-
6072
### GLOBAL VARIABLES ###
6173

6274
export DEBUG_LOG_ENABLED=0
@@ -397,11 +409,15 @@ detect_recovery_arch()
397409
armv6* | armv5*) RECOVERY_ARCH='armeabi' ;;
398410
#mips64) RECOVERY_ARCH='mips64' ;;
399411
#mips) RECOVERY_ARCH='mips' ;;
400-
*) ui_error "Unsupported architecture: $(uname -m || true)" ;;
412+
*) ui_error "Unsupported architecture: $(uname -m || :)" ;;
401413
esac
402414
}
403415
detect_recovery_arch
404416

417+
if test "${INSTALL_MODE:?}" != 'Pure'; then
418+
ui_error "This ZIP currently cannot be installed as ${INSTALL_MODE?} module"
419+
fi
420+
405421
OUR_BB="${BASE_TMP_PATH:?}/busybox"
406422
if test -n "${CUSTOM_BUSYBOX-}" && test -x "${CUSTOM_BUSYBOX:?}"; then
407423
OUR_BB="${CUSTOM_BUSYBOX:?}"

zip-content/inc/common-functions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ _generate_architectures_list()
13011301
export ARCH_LIST
13021302
}
13031303

1304-
is_new_architecture()
1304+
is_architecture_still_supported_by_Android()
13051305
{
13061306
case "${1:?}" in
13071307
'arm64-v8a' | 'armeabi-v7a' | 'x86_64' | 'x86') return 0 ;;
@@ -1731,7 +1731,7 @@ initialize()
17311731
if mount_partition_if_possible 'data' "userdata${NL:?}DATAFS${NL:?}" "$(generate_mountpoint_list 'data' "${_additional_data_mountpoint?}" || :)"; then
17321732
DATA_PATH="${LAST_MOUNTPOINT:?}"
17331733
UNMOUNT_DATA="${LAST_PARTITION_MUST_BE_UNMOUNTED:?}"
1734-
remount_read_write_if_possible "${LAST_MOUNTPOINT:?}"
1734+
remount_read_write_if_possible "${LAST_MOUNTPOINT:?}" false || ui_warning "The data partition cannot be remounted as read-write; I suggest to manually performing a factory reset after flashing this ZIP."
17351735
else
17361736
ui_warning "The data partition cannot be mounted; I suggest to manually performing a factory reset after flashing this ZIP."
17371737
fi

zip-content/module.prop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
id=google-sync-addon
66
numericId=928871
77
name=Google sync add-on
8-
version=v1.3.2.39-alpha
8+
version=v1.3.2.41-alpha
99
versionCode=6
1010
author=ale5000
1111
description=It installs Google sync adapters on Android.

0 commit comments

Comments
 (0)