Skip to content

Commit 0a3dc0f

Browse files
committed
Fix 2 CI to correct the order of the online/offline versions for versions earlier than 2.6.2.
1 parent e679ba6 commit 0a3dc0f

3 files changed

Lines changed: 21 additions & 4 deletions

File tree

‎.github/workflows/beta.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ jobs:
157157
| Variant | File | Network | Auto-update |
158158
|---|---|---|---|
159159
| **Online** | `MG4Control-online-*.apk` | yes | yes |
160-
| **Offline** | `MG4Control-offline-*.apk` | none | no |
160+
| **Offline** | `MG4Control-secure-*-offline.apk` | none | no |
161161
162162
# Purge des anciennes betas. Trois garde-fous, dans cet ordre :
163163
# 1. on ne touche QU'AUX prereleases (select .prerelease==true) — une erreur de filtre

‎.github/workflows/release.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ jobs:
5959
- name: Collect APKs
6060
run: |
6161
mkdir -p dist
62-
find app/build/outputs/apk -name "MG4Control-*-*.apk" -exec cp {} dist/ \;
62+
# Deux motifs volontairement larges : le nom de l'offline porte un préfixe qui le
63+
# fait trier après l'online dans les assets GitHub (voir app/build.gradle.kts).
64+
find app/build/outputs/apk -name "MG4Control-*.apk" -exec cp {} dist/ \;
6365
ls -la dist/
6466
6567
# /!\ --min-sdk-version 23 is REQUIRED for this report to tell the truth. Without it,
@@ -107,6 +109,6 @@ jobs:
107109
| Variant | File | Network | Auto-update | Target |
108110
|---|---|---|---|---|
109111
| **Online** | `MG4Control-online-*.apk` | yes | yes | standard use |
110-
| **Offline** 🔒 | `MG4Control-offline-*.apk` | none (network perms removed) | no | hardened on-vehicle deployment |
112+
| **Offline** 🔒 | `MG4Control-secure-*-offline.apk` | none (network perms removed) | no | hardened on-vehicle deployment |
111113
112114
> The offline APK has a distinct applicationId (`com.mg4.control.offline`) and can coexist with the online one.

‎app/build.gradle.kts‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,22 @@ android {
9797
outputs.all {
9898
val output = this as com.android.build.gradle.internal.api.BaseVariantOutputImpl
9999
if (variant.buildType.name == "release") {
100-
output.outputFileName = "MG4Control-${variant.flavorName}-${variant.versionName}.apk"
100+
// ⚠️ LE NOM DE L'APK OFFLINE EST FONCTIONNEL, PAS COSMÉTIQUE.
101+
//
102+
// L'API GitHub renvoie les assets d'une release triés PAR NOM, et les clients
103+
// antérieurs à la 2.6.3 téléchargent le PREMIER .apk qu'ils y trouvent, sans
104+
// regarder lequel. « offline » précédant « online » alphabétiquement, ces
105+
// versions installaient l'APK offline — qui porte un applicationId distinct
106+
// (com.mg4.control.offline) et apparaît donc comme une SECONDE application à
107+
// côté de la leur. Cas réellement constaté d'une 2.6.0 passée à la 2.6.6.
108+
//
109+
// Le préfixe « secure » place l'offline après l'online dans ce tri. Ne pas le
110+
// retirer, et ne jamais donner à l'offline un nom contenant « online » : c'est
111+
// sur cette sous-chaîne que selectApk distingue les deux depuis la 2.6.3.
112+
output.outputFileName = when (variant.flavorName) {
113+
"offline" -> "MG4Control-secure-${variant.versionName}.apk"
114+
else -> "MG4Control-${variant.flavorName}-${variant.versionName}.apk"
115+
}
101116
}
102117
}
103118
}

0 commit comments

Comments
 (0)