Skip to content

Commit 2306c43

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

File tree

12 files changed

+197
-128
lines changed

12 files changed

+197
-128
lines changed

.github/workflows/coverage.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ jobs:
4343
with:
4444
ruby-version: "3.4"
4545
bundler-cache: "true"
46-
- name: "Install Bashcov and simplecov-lcov"
47-
shell: bash
48-
timeout-minutes: 10
49-
run: |
50-
# Installing Bashcov and simplecov-lcov...
51-
gem install bashcov:3.3.0 simplecov-lcov
5246
- name: "Use build cache"
5347
uses: actions/cache/restore@v5
5448
timeout-minutes: 5
@@ -73,7 +67,7 @@ jobs:
7367
# Executing code coverage...
7468
export BUILD_TYPE=oss
7569
#sudo apt-get -qq -y install moreutils 1>/dev/null
76-
bashcov '${{ github.workspace }}/build.sh' # To timestamp the output pipe it to: TZ=UTC ts '[%H:%M:%S]'
70+
bundle exec bashcov '${{ github.workspace }}/build.sh' # To timestamp the output pipe it to: TZ=UTC ts '[%H:%M:%S]'
7771
- name: "Testing (with coverage)"
7872
shell: bash
7973
timeout-minutes: 10
@@ -83,7 +77,7 @@ jobs:
8377
echo '==========================='
8478
echo 'TESTING OF ZIP INSTALLATION'
8579
echo '==========================='
86-
bashcov '${{ github.workspace }}/recovery-simulator/recovery.sh' '${{ steps.build.outputs.ZIP_FOLDER }}/${{ steps.build.outputs.ZIP_FILENAME }}'
80+
bundle exec bashcov '${{ github.workspace }}/recovery-simulator/recovery.sh' '${{ steps.build.outputs.ZIP_FOLDER }}/${{ steps.build.outputs.ZIP_FILENAME }}'
8781
printf '\n'
8882
echo '==============='
8983
echo 'RECOVERY OUTPUT'

.tool-versions

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-FileCopyrightText: NONE
22
# SPDX-License-Identifier: CC0-1.0
33

4-
java temurin-17
5-
gradle 8.11.1
4+
java latest:temurin-17 system

Makefile

Lines changed: 63 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,77 @@
11
#!/usr/bin/env -S make -f
2-
3-
# SPDX-FileCopyrightText: (c) 2024 ale5000
2+
# SPDX-FileCopyrightText: 2024 ale5000
43
# SPDX-License-Identifier: GPL-3.0-or-later
54

65
.POSIX:
76

8-
all: buildota buildotaoss ;
7+
# --- Performance optimizations & global config ---
8+
# Disable the default inference rule for .sh files early to speed up parsing
9+
.sh:
10+
@:
11+
12+
# --- Configurations && shell commands ---
13+
GET_PROJECT_NAME = (git 2> /dev/null rev-parse --show-toplevel | xargs 2> /dev/null basename) || basename '$(CURDIR)'
14+
OUTPUT_DIR = output
915

10-
.PHONY: all clean test check distcheck build
16+
REUSE_TOOL = reuse
17+
18+
# --- Target descriptions (for help logic) ---
19+
DESCRIPTION_TARGET_BUILDOTA = 🚀 Build the flashable zip [Full edition]
20+
DESCRIPTION_TARGET_BUILDOTAOSS = 🚀 Build the flashable zip [OSS edition]
21+
DESCRIPTION_TARGET_INSTALLTEST = 🧪 Test the flashable zip in a simulated Android recovery environment on your PC
22+
DESCRIPTION_TARGET_CLEAN = 🧹 Remove build artifacts
23+
DESCRIPTION_TARGET_REUSE_LINT = ⚖️ Verify license and copyright compliance (REUSE)
24+
DESCRIPTION_TARGET_SPDX = 📄 Generate the SBOM in SPDX format
25+
DESCRIPTION_TARGET_HELP = ❓ Display this help
26+
27+
# --- Primary targets ---
28+
.PHONY: all buildota buildotaoss installtest clean help
29+
30+
all: buildota buildotaoss ;
1131

1232
buildota:
13-
BUILD_TYPE=full "$(CURDIR)/build.sh" --no-default-build-type --no-pause $(ARGS)
33+
BUILD_TYPE=full '$(CURDIR)/build.sh' --no-default-build-type --no-pause $(ARGS)
1434

1535
buildotaoss:
16-
BUILD_TYPE=oss "$(CURDIR)/build.sh" --no-default-build-type --no-pause $(ARGS)
17-
build: buildotaoss ;
36+
BUILD_TYPE=oss '$(CURDIR)/build.sh' --no-default-build-type --no-pause $(ARGS)
1837

19-
test:
20-
"$(CURDIR)/recovery-simulator/recovery.sh" "$(CURDIR)"/output/*.zip
21-
check: test ;
22-
distcheck: check ;
38+
installtest:
39+
@'$(CURDIR)/recovery-simulator/recovery.sh' '$(CURDIR)'/output/*.zip
2340

2441
clean:
25-
rm -f "$(CURDIR)"/output/*.zip
26-
rm -f "$(CURDIR)"/output/*.zip.md5
27-
rm -f "$(CURDIR)"/output/*.zip.sha256
42+
rm -f '$(CURDIR)'/output/*.zip
43+
rm -f '$(CURDIR)'/output/*.zip.md5
44+
rm -f '$(CURDIR)'/output/*.zip.sha256
2845

29-
# Disable the default inference rule for .sh files
30-
.sh:
31-
@:
46+
# --- Compliance targets ---
47+
.PHONY: reuse-lint spdx
48+
49+
reuse-lint:
50+
@echo 'Checking REUSE compliance...'
51+
@'$(REUSE_TOOL)' lint
52+
53+
spdx: reuse-lint
54+
@echo ''
55+
@PROJECT_NAME="$$( $(GET_PROJECT_NAME) )"; \
56+
echo 'Generating SPDX SBOM at $(OUTPUT_DIR)/'"$${PROJECT_NAME:?}.spdx..."; \
57+
'$(REUSE_TOOL)' spdx --creator-person ale5000 --add-license-concluded -o '$(CURDIR)/$(OUTPUT_DIR)/'"$${PROJECT_NAME:?}.spdx"
58+
@echo 'Done.'
59+
60+
# --- Aliases & compatibility ---
61+
.PHONY: build test check distcheck sbom
62+
build: buildotaoss ;
63+
test: installtest ;
64+
check: test ;
65+
distcheck: test ;
66+
sbom: spdx ;
67+
68+
# --- Help system ---
69+
# Hide specific targets from the help list
70+
.hide: build test check distcheck sbom
71+
72+
help:
73+
@'$(MAKE)' 2>/dev/null -qnrp | awk \
74+
'/^DESCRIPTION_TARGET_[A-Z0-9_]+[[:space:]]*=/ { k=tolower(substr($$1,20)); gsub(/_/,"-",k); desc[k]=substr($$0,index($$0,"=")+2) } \
75+
/^\.hide:/ { n=split(substr($$0,7),a); for(i=1;i<=n;i++) hide[a[i]]=1 } \
76+
/^[a-zA-Z_][a-zA-Z0-9_-]*:/{ t=substr($$0,1,index($$0,":")-1); if(tolower(t)!="makefile") tgt[t]=1 } \
77+
END { n=0; for(t in tgt){ if(t in hide) continue; i=n; while(i>0&&keys[i]>t){ keys[i+1]=keys[i]; i-- }; keys[i+1]=t; n++ }; for(i=1;i<=n;i++){ if(keys[i] in desc) printf "%-15s %s\n",keys[i],desc[keys[i]]; else print keys[i] } }'

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
SPDX-FileCopyrightText: (c) 2023 ale5000
2+
SPDX-FileCopyrightText: 2023 ale5000
33
SPDX-License-Identifier: GPL-3.0-or-later
44
SPDX-FileType: DOCUMENTATION
55
-->

build.bat

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
@REM SPDX-FileCopyrightText: (c) 2016 ale5000
1+
@REM SPDX-FileCopyrightText: 2016 ale5000
22
@REM SPDX-License-Identifier: GPL-3.0-or-later
3-
@REM SPDX-FileType: SOURCE
43

54
@echo off
65
SETLOCAL 2> nul

build.gradle

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// -*- coding: utf-8; mode: conf-javaprop -*-
2-
// SPDX-FileCopyrightText: (c) 2016 ale5000
2+
// SPDX-FileCopyrightText: 2016 ale5000
33
// SPDX-License-Identifier: GPL-3.0-or-later
4-
// SPDX-FileType: SOURCE
54

65
buildscript {
76
apply from: 'dependencies.gradle'
@@ -43,7 +42,7 @@ private void initialize() {
4342
println 'OS: ' + System.properties['os.name']
4443

4544
if(JavaVersion.current() < JavaVersion.VERSION_17) {
46-
throw new GradleException('This require Java 17 or later')
45+
throw new GradleException('Java 17 or later is required')
4746
}
4847
}
4948

@@ -122,10 +121,10 @@ static String getScriptExt() {
122121

123122
tasks.register('buildOta', Exec) {
124123
group = '- OTA build'
125-
description = 'Build the flashable OTA zip.'
124+
description = 'Build the flashable zip [Full edition].'
126125

127126
doFirst {
128-
println 'Building the flashable OTA zip with Gradle...'
127+
println 'Building the flashable zip with Gradle...'
129128
environment BUILD_TYPE: 'full'
130129
environment NO_PAUSE: '1'
131130
executable "${projectDir}/build" + getScriptExt()
@@ -134,10 +133,10 @@ tasks.register('buildOta', Exec) {
134133

135134
tasks.register('buildOtaOSS', Exec) {
136135
group = '- OTA build'
137-
description = 'Build the flashable OTA zip (open-source components only).'
136+
description = 'Build the flashable zip [OSS edition].'
138137

139138
doFirst {
140-
println 'Building the flashable OTA zip (open-source components only) with Gradle...'
139+
println 'Building the flashable zip (open-source components only) with Gradle...'
141140
environment BUILD_TYPE: 'oss'
142141
environment NO_PAUSE: '1'
143142
executable "${projectDir}/build" + getScriptExt()
@@ -149,7 +148,7 @@ tasks.named('build').configure {
149148

150149
tasks.register('installTest', Exec) {
151150
group = 'verification'
152-
description = 'Emulate an Android recovery on your PC and run the flashable zip file inside it to see the result.'
151+
description = 'Test the flashable zip in a simulated Android recovery environment on your PC.'
153152
mustRunAfter build, buildOta, buildOtaOSS
154153

155154
doFirst {

0 commit comments

Comments
 (0)