Skip to content

Commit fa6eaa7

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

File tree

17 files changed

+478
-199
lines changed

17 files changed

+478
-199
lines changed

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ indent_style = tab
3333
[*.bat]
3434
end_of_line = crlf
3535

36-
[*.{xml,json}]
36+
[*.{xml,json,gradle}]
3737
indent_size = 4
3838

3939
[*.{yml,yaml,rst,md,json}]
@@ -42,5 +42,8 @@ quote_type = double
4242
[zip-content/customize.sh]
4343
keep_padding = true
4444

45+
[.git-hooks/*]
46+
shell_variant = bash
47+
4548
[recovery-simulator/recovery.sh]
4649
shell_variant = bash

.git-hooks/commit-msg

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env sh
1+
#!/usr/bin/env bash
22
# SPDX-FileCopyrightText: NONE
33
# SPDX-License-Identifier: CC0-1.0
44

@@ -8,7 +8,46 @@
88
# status after issuing an appropriate message if it wants to stop the
99
# commit. The hook is allowed to edit the commit message file.
1010

11-
grep -m 1 -e '^Signed-off-by: ' -- "${1}" || {
11+
COMMIT_MSG_FILE="${1:?}"
12+
13+
COMMIT_MSG="$(cat "${COMMIT_MSG_FILE:?}")" || exit 2
14+
CONVENTIONAL_COMMIT_REGEX='^(feat|fix|docs|style|refactor|test|chore|build|ci|perf|revert)(\([a-zA-Z0-9_.-]+\))?(!)?:\s.*$'
15+
16+
# Check if the commit message matches the regex.
17+
if ! [[ "${COMMIT_MSG?}" =~ ${CONVENTIONAL_COMMIT_REGEX:?} ]]; then
18+
{
19+
echo "ERROR: Commit message does not follow Conventional Commits format."
20+
echo ""
21+
echo "The commit message should be structured as follows:"
22+
echo "<type>(<optional scope>): <description>"
23+
echo "[optional body]"
24+
echo "[optional footer(s)]"
25+
echo ""
26+
echo "Valid types are:"
27+
echo " feat: A new feature."
28+
echo " fix: A bug fix."
29+
echo " docs: Documentation changes."
30+
echo " style: Code style changes (formatting, missing semicolons, etc.)."
31+
echo " refactor: Code refactoring (neither fixes a bug nor adds a feature)."
32+
echo " test: Adding or updating tests."
33+
echo " chore: Routine tasks like updating dependencies or build tools."
34+
echo " build: Changes affecting the build system or external dependencies."
35+
echo " ci: Changes to CI configuration files or scripts."
36+
echo " perf: Performance improvements."
37+
echo " revert: Reverting a previous commit."
38+
echo ""
39+
echo "Examples:"
40+
echo " feat(auth): add login functionality"
41+
echo " fix(api)!: resolve timeout issue"
42+
echo " docs(readme): update installation instructions"
43+
echo ""
44+
} 1>&2
45+
exit 1
46+
fi
47+
48+
grep -m 1 -e '^Signed-off-by: ' -- "${COMMIT_MSG_FILE:?}" || {
1249
echo 1>&2 "Missing Signed-off-by line."
1350
exit 46
1451
}
52+
53+
exit 0

.git-hooks/prepare-commit-msg

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
# SPDX-FileCopyrightText: NONE
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
# An hook script to prepare the commit log message.
6+
# Called by "git commit" with the name of the file that has the
7+
# commit message, followed by the description of the commit
8+
# message's source. The hook's purpose is to edit the commit
9+
# message file. If the hook fails with a non-zero status,
10+
# the commit is aborted.
11+
12+
COMMIT_MSG_FILE="${1:?}"
13+
#COMMIT_TYPE="${2?}"
14+
#AMENDED_COMMIT_SHA1="${3-}"
15+
16+
COMMIT_MSG="$(cat "${COMMIT_MSG_FILE:?}")" || exit 2
17+
GIT_REVERT_REGEX='^Revert\s".*"'
18+
19+
if [[ -n "${COMMIT_MSG?}" && "${COMMIT_MSG:?}" =~ ${GIT_REVERT_REGEX:?} ]]; then
20+
COMMIT_MSG="${COMMIT_MSG/#Revert/revert:}"
21+
COMMIT_MSG="${COMMIT_MSG/This reverts commit/Refs:}"
22+
printf '%s' "${COMMIT_MSG?}" 1> "${COMMIT_MSG_FILE:?}"
23+
fi
24+
25+
exit 0

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# SPDX-FileCopyrightText: NONE
22
# SPDX-License-Identifier: CC0-1.0
3+
34
java temurin-17
5+
gradle 8.11.1

.vscode/extensions.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"recommendations": [
3+
"timonwong.shellcheck",
4+
"marcovr.actions-shell-scripts",
5+
"codecov.codecov"
6+
],
7+
"unwantedRecommendations": [
8+
"vscjava.vscode-java-pack",
9+
"codacy-app.codacy"
10+
]
11+
}

.vscode/settings.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"shellcheck.enable": true,
3+
"shellcheck.enableQuickFix": true,
4+
"shellcheck.logLevel": "trace",
5+
"shellcheck.run": "onType",
6+
7+
"codecov.coverage.enabled": true,
8+
9+
"codacy.guardrails.analyzeGeneratedCode": "disabled",
10+
"codacy.guardrails.instructionsFile": "manual",
11+
12+
"java.import.gradle.enabled": false,
13+
"java.import.maven.enabled": false,
14+
"java.autobuild.enabled": false,
15+
"java.showBuildStatusOnStart.enabled": "off",
16+
"java.server.launchMode": "LightWeight",
17+
18+
"task.autoDetect": "off",
19+
"gradle.autoDetect": "off"
20+
}

.vscode/tasks.json

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
"problemMatcher": []
4444
},
4545
{
46-
"label": "installTest",
47-
"detail": "Emulate an Android recovery on your PC and inside it execute the flashable zip to see the result.",
46+
"label": "test",
47+
"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",
5050
"args": [
@@ -58,7 +58,6 @@
5858
},
5959
"options": {
6060
"env": {
61-
"LIVE_SETUP_ALLOWED": "false",
6261
"BB_GLOBBING": "1"
6362
}
6463
},
@@ -70,20 +69,6 @@
7069
"panel": "dedicated"
7170
},
7271
"problemMatcher": []
73-
},
74-
{
75-
"label": "dummy (do not use)",
76-
"detail": " ",
77-
"type": "java (build)",
78-
"paths": [
79-
"${workspace}"
80-
],
81-
"isFullBuild": true,
82-
"presentation": {
83-
"reveal": "never",
84-
"panel": "dedicated",
85-
"close": true
86-
}
8772
}
8873
]
8974
}

.vscode/tasks.json.license

Lines changed: 0 additions & 6 deletions
This file was deleted.

REUSE.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,14 @@ path = [
1010
]
1111
SPDX-FileCopyrightText = "NONE"
1212
SPDX-License-Identifier = "CC0-1.0"
13+
14+
[[annotations]]
15+
path = [
16+
".vscode/*.json"
17+
]
18+
SPDX-FileCopyrightText = "NONE"
19+
SPDX-License-Identifier = "CC0-1.0"
20+
SPDX-FileComment = [
21+
"https://code.visualstudio.com/docs/editor/tasks",
22+
"https://code.visualstudio.com/docs/editor/variables-reference"
23+
]

build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ private void initialize() {
3131

3232
description = String.valueOf(props.getProperty('description'))
3333
version = String.valueOf(props.getProperty('version')).toLowerCase(Locale.ENGLISH).trim()
34+
group = String.valueOf(props.getProperty('group'))
3435
ext.ourArchivesBaseName = String.valueOf(props.getProperty('id')).trim()
3536

3637
//ext.isBeta = version.endsWith('-beta')
@@ -148,7 +149,7 @@ tasks.named('build').configure {
148149

149150
tasks.register('installTest', Exec) {
150151
group = 'verification'
151-
description = 'Emulate an Android recovery on your PC and inside it execute the flashable zip to see the result.'
152+
description = 'Emulate an Android recovery on your PC and run the flashable zip file inside it to see the result.'
152153
mustRunAfter build, buildOta, buildOtaOSS
153154

154155
doFirst {
@@ -168,7 +169,7 @@ tasks.register('install')
168169

169170
tasks.named('wrapper').configure {
170171
println 'Gradle: ' + gradleVersionTarget
171-
gradleVersion gradleVersionTarget
172-
//distributionType Wrapper.DistributionType.ALL
173-
distributionSha256Sum gradleSha256Sum
172+
gradleVersion = gradleVersionTarget
173+
//distributionType = Wrapper.DistributionType.ALL
174+
distributionSha256Sum = gradleSha256Sum
174175
}

0 commit comments

Comments
 (0)