Skip to content

Commit d188939

Browse files
committed
Sync with microG unofficial installer
1 parent 421165c commit d188939

16 files changed

+174
-106
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ switch_case_indent = true
2828
space_redirects = true
2929
function_next_line = true
3030

31+
[Makefile]
32+
indent_style = tab
33+
3134
[*.bat]
3235
end_of_line = crlf
3336

.gitattributes

+14-14
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,33 @@ docs/CODEOWNERS text eol=lf
88
.gitattributes text eol=lf
99
.gitignore text eol=lf
1010
.gitmodules text eol=lf
11+
12+
.editorconfig text eol=lf
1113
.semgrepignore text eol=lf
14+
.shellcheckrc text eol=lf
15+
.simplecov text eol=lf
1216

1317
*.yml text eol=lf
1418
*.xml text eol=lf
1519
*.json text eol=lf
1620
*.dis text eol=lf
17-
.simplecov text eol=lf
18-
.shellcheckrc text eol=lf
19-
.editorconfig text eol=lf
2021

2122
.reuse/dep5 text eol=lf
2223
*.license text eol=lf
2324
*.spdx text eol=lf
2425

26+
Makefile text eol=lf
27+
etc/profile text eol=lf
28+
2529
# Batch scripts
2630
*.bat text eol=crlf
2731

28-
# Text
32+
# Gradle files
33+
gradlew text eol=lf
34+
*.gradle text eol=lf
35+
36+
# Textual formats
37+
*.properties text eol=lf
2938
*.rst text eol=lf
3039
*.md text eol=lf
3140
*.txt text eol=lf
@@ -43,25 +52,16 @@ docs/CODEOWNERS text eol=lf
4352
*.py text eol=lf
4453

4554
# Our custom files
46-
build text eol=lf
4755
recovery-simulator/override/* text eol=lf
4856

49-
# Gradle files
50-
gradlew text eol=lf
51-
*.gradle text eol=lf
52-
*.properties text eol=lf
53-
54-
# Other files
55-
fastlane/Appfile text eol=lf
56-
fastlane/Fastfile text eol=lf
57-
5857
# Uncompressed text manuals
5958
*.1 text eol=lf
6059

6160
# Binaries
6261
*.exe binary
6362
*.bin binary
6463
*.apk binary
64+
*.zip binary
6565
*.jar binary
6666
*.gz binary
6767
*.png binary

.github/workflows/base.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ name: "Base"
66
permissions: {}
77
on:
88
push:
9-
branches:
10-
- main
11-
tags:
12-
- "v*"
139
pull_request:
1410
workflow_dispatch:
1511
jobs:
@@ -68,7 +64,7 @@ jobs:
6864
sha256_hash='${{ steps.coverage.outputs.sha256_hash }}'; readonly sha256_hash
6965
echo "::notice::${sha256_hash:-Missing hash}"
7066
- name: "Upload artifacts"
71-
if: "${{ false && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}"
67+
if: "${{ false && github.event_name != 'pull_request' }}"
7268
uses: actions/upload-artifact@v4
7369
with:
7470
name: "Google Sync add-on OSS build (extract it)"

.github/workflows/code-linting.yml

-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ name: "Code linting"
66
permissions: {}
77
on:
88
push:
9-
branches:
10-
- main
11-
tags:
12-
- "v*"
139
pull_request:
1410
workflow_dispatch:
1511
jobs:

.github/workflows/periodic-checks.yml

+24-10
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,31 @@ permissions: {}
77
on:
88
push:
99
paths:
10+
- ".github/workflows/periodic-checks.yml"
1011
- "gradle/wrapper/gradle-wrapper.jar"
11-
- ".reuse/dep5"
1212
- "**codecov.yml"
13+
- "Makefile"
14+
- ".reuse/dep5"
1315
pull_request:
1416
paths:
17+
- ".github/workflows/periodic-checks.yml"
1518
- "gradle/wrapper/gradle-wrapper.jar"
16-
- ".reuse/dep5"
1719
- "**codecov.yml"
20+
- "Makefile"
21+
- ".reuse/dep5"
1822
schedule:
1923
- cron: "0 0 * * 1"
2024
workflow_dispatch:
2125

2226
jobs:
23-
base-job:
27+
base:
2428
name: "Base job"
2529
runs-on: ubuntu-latest
2630

2731
steps:
28-
- name: "Check out code"
32+
- name: "Checkout sources"
2933
uses: actions/checkout@v4
30-
with:
31-
fetch-depth: "0"
32-
- name: "Gradle Wrapper validation"
34+
- name: "Validate Gradle Wrapper"
3335
uses: gradle/actions/wrapper-validation@v4
3436
- name: "Validate Codecov configuration"
3537
shell: bash
@@ -48,14 +50,26 @@ jobs:
4850
if test "${status:?}" -eq 0; then echo 'Result: pass'; else echo 'Result: fail'; exit "${status:?}"; fi
4951
fi
5052
51-
dep5-validator:
53+
makefile-validation:
54+
name: "Validate makefile"
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- name: "Checkout sources"
59+
uses: actions/checkout@v4
60+
- name: "Validation"
61+
uses: Uno-Takashi/checkmake-action@v2
62+
with:
63+
makefile: "Makefile"
64+
65+
dep5-validation:
5266
name: "Validate dep5"
5367
runs-on: ubuntu-latest
5468

5569
steps:
56-
- name: "Check out code"
70+
- name: "Checkout sources"
5771
uses: actions/checkout@v4
58-
- name: "Validate dep5"
72+
- name: "Validation"
5973
shell: bash
6074
run: |
6175
# Validating dep5

.gitignore

+6-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
# VS Code files
1212
/.vscode/launch.json
1313

14-
# Local files
15-
/.local/
16-
/local/
17-
1814
# Gradle files
1915
/.gradle/
2016
/build/
@@ -23,6 +19,12 @@
2319
local.properties
2420
user.gradle
2521

22+
# Files to ignore
23+
/local/
24+
/.local/
25+
/build
26+
/cmdline
27+
2628
# Code scanning, log and other files
2729
*.log
2830
*.sarif

Makefile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# SPDX-FileCopyrightText: (c) 2024 ale5000
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
.POSIX:
5+
.PHONY: all clean test build cmdline
6+
7+
all: buildota buildotaoss
8+
9+
buildota:
10+
OPENSOURCE_ONLY=false NO_PAUSE=1 "$(CURDIR)/build.sh" $(ARGS)
11+
12+
build: buildotaoss ;
13+
buildotaoss:
14+
OPENSOURCE_ONLY=true NO_PAUSE=1 "$(CURDIR)/build.sh" $(ARGS)
15+
16+
cmdline: ;

build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ tasks.register('buildOta', Exec) {
126126
doFirst {
127127
println 'Building the flashable OTA zip with Gradle...'
128128
environment OPENSOURCE_ONLY: 'false'
129+
environment NO_PAUSE: '1'
129130
executable "${projectDir}/build" + getScriptExt()
130131
}
131132
}
@@ -137,6 +138,7 @@ tasks.register('buildOtaOSS', Exec) {
137138
doFirst {
138139
println 'Building the flashable OTA zip (open-source components only) with Gradle...'
139140
environment OPENSOURCE_ONLY: 'true'
141+
environment NO_PAUSE: '1'
140142
executable "${projectDir}/build" + getScriptExt()
141143
}
142144
}

cmdline.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ IF "%USER_HOME%" == "" (
2525

2626
SET "STARTED_FROM_BATCH_FILE=1"
2727
SET "IS_PATH_INITIALIZED="
28-
SET "QUOTED_PARAMS="
28+
SET "__QUOTED_PARAMS="
2929

3030
SET "DO_INIT_CMDLINE=1"
3131
"%~dp0tools\win\busybox.exe" ash -s -c ". '%~dp0includes\common.sh' || exit ${?}" "ash" %*

cmdline.sh

+49-44
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,67 @@
11
#!/usr/bin/env bash
2+
23
# SPDX-FileCopyrightText: (c) 2016 ale5000
34
# SPDX-License-Identifier: GPL-3.0-or-later
4-
55
# shellcheck enable=all
66

7-
set -u
8-
# shellcheck disable=SC3040,SC3041,SC2015 # Ignore: In POSIX sh, set option xxx is undefined. / In POSIX sh, set flag -X is undefined. / C may run when A is true.
9-
{
10-
# Unsupported set options may cause the shell to exit (even without set -e), so first try them in a subshell to avoid this issue
11-
(set 2> /dev/null -o posix) && set -o posix || true
12-
(set 2> /dev/null +H) && set +H || true
13-
(set 2> /dev/null -o pipefail) && set -o pipefail || true
14-
}
15-
167
if test "${A5K_FUNCTIONS_INCLUDED:-false}" = 'false'; then
8+
main()
9+
{
10+
local _newline _main_dir
1711

18-
# Execute only if the first initialization has not already been done
19-
if test -z "${MODULE_NAME-}"; then
12+
# Execute only if the first initialization has not already been done
13+
if test -z "${MAIN_DIR-}" || test -z "${PLATFORM-}" || test -z "${MODULE_NAME-}"; then
2014

21-
if test -d '/usr/bin'; then PATH="/usr/bin:${PATH:-/usr/bin}"; fi
15+
if test -d '/usr/bin'; then PATH="/usr/bin:${PATH:-/usr/bin}"; fi
2216

23-
if test -z "${MAIN_DIR-}"; then
24-
# shellcheck disable=SC3028 # Ignore: In POSIX sh, BASH_SOURCE is undefined.
25-
if test -n "${BASH_SOURCE-}" && MAIN_DIR="$(dirname "${BASH_SOURCE:?}")" && MAIN_DIR="$(realpath "${MAIN_DIR:?}")"; then
26-
export MAIN_DIR
27-
else
28-
unset MAIN_DIR
17+
if test -z "${MAIN_DIR-}"; then
18+
# shellcheck disable=SC3028 # Ignore: In POSIX sh, BASH_SOURCE is undefined.
19+
if test -n "${BASH_SOURCE-}" && MAIN_DIR="$(dirname "${BASH_SOURCE:?}")" && MAIN_DIR="$(realpath "${MAIN_DIR:?}")"; then
20+
export MAIN_DIR
21+
else
22+
unset MAIN_DIR
23+
fi
24+
fi
25+
26+
if test -n "${MAIN_DIR-}" && test -z "${USER_HOME-}"; then
27+
if test "${TERM_PROGRAM-}" = 'mintty'; then unset TERM_PROGRAM; fi
28+
export USER_HOME="${HOME-}"
29+
export HOME="${MAIN_DIR:?}"
2930
fi
30-
fi
3131

32-
if test -n "${MAIN_DIR-}" && test -z "${USER_HOME-}"; then
33-
if test "${TERM_PROGRAM-}" = 'mintty'; then unset TERM_PROGRAM; fi
34-
export USER_HOME="${HOME-}"
35-
export HOME="${MAIN_DIR:?}"
3632
fi
3733

38-
fi
34+
unset STARTED_FROM_BATCH_FILE
35+
unset IS_PATH_INITIALIZED
36+
unset __QUOTED_PARAMS
3937

40-
unset STARTED_FROM_BATCH_FILE
41-
unset IS_PATH_INITIALIZED
42-
unset QUOTED_PARAMS
43-
if test "${#}" -gt 0; then
44-
case "${*}" in
45-
*"'"*)
46-
printf 'WARNING: Single quote found, parameters dropped\n'
47-
;;
48-
*)
49-
QUOTED_PARAMS="$(printf " '%s'" "${@}")"
50-
export QUOTED_PARAMS
51-
;;
52-
esac
53-
fi
38+
export DO_INIT_CMDLINE=1
39+
if test -n "${MAIN_DIR-}"; then _main_dir="${MAIN_DIR:?}"; else _main_dir='.'; fi
40+
41+
if test "${PLATFORM-}" = 'win' && test "${IS_BUSYBOX-}" = 'true'; then
42+
exec ash -s -c ". '${_main_dir:?}/includes/common.sh' || exit \${?}" 'ash' "${@}"
43+
else
44+
if test "${#}" -gt 0; then
45+
_newline='
46+
'
47+
case "${*}" in
48+
*"${_newline:?}"*)
49+
printf 'WARNING: Newline character found, parameters dropped\n'
50+
;;
51+
*)
52+
__QUOTED_PARAMS="$(printf '%s\n' "${@}")"
53+
export __QUOTED_PARAMS
54+
;;
55+
esac
56+
fi
5457

55-
export DO_INIT_CMDLINE=1
56-
if test -n "${MAIN_DIR-}"; then
57-
exec "${BASH:-${SHELL:-bash}}" --init-file "${MAIN_DIR:?}/includes/common.sh"
58+
exec "${BASH:-${SHELL:-bash}}" --init-file "${_main_dir:?}/includes/common.sh"
59+
fi
60+
}
61+
62+
if test "${#}" -gt 0; then
63+
main "${@}"
5864
else
59-
exec "${BASH:-${SHELL:-bash}}" --init-file './includes/common.sh'
65+
main
6066
fi
61-
6267
fi

0 commit comments

Comments
 (0)