metadidomi-builder 1.4.201125 → 1.5.241125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of metadidomi-builder might be problematic. Click here for more details.
- package/README.md +210 -565
- package/README_APK.md +772 -0
- package/build_tools/backup-manager.js +3 -0
- package/build_tools/build_apk.js +3 -0
- package/build_tools/create-example-app.js +73 -0
- package/build_tools/diagnose-apk.js +61 -0
- package/build_tools/generate-icons.js +3 -0
- package/build_tools/generate-resources.js +3 -0
- package/build_tools/restore-resources.js +3 -0
- package/build_tools_py/pyMetadidomi/README.md +98 -0
- package/create-app.bat +31 -0
- package/create-app.ps1 +27 -0
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
[](https://pay.lygosapp.com/$etsmeta)
|
|
7
7
|

|
|
8
8
|

|
|
9
|
-

|
|
10
9
|
|
|
11
10
|
---
|
|
12
11
|
|
|
@@ -14,14 +13,16 @@
|
|
|
14
13
|
|
|
15
14
|
1. **[À Propos](#-à-propos)** - Présentation générale
|
|
16
15
|
2. **[Installation](#-installation)** - Mise en place
|
|
17
|
-
3. **[
|
|
18
|
-
4. **[
|
|
19
|
-
5. **[Modes de Construction](#-modes-de-construction)** - Options de build
|
|
20
|
-
6. **[
|
|
21
|
-
7. **[
|
|
22
|
-
8. **[
|
|
23
|
-
9. **[
|
|
24
|
-
10. **[
|
|
16
|
+
3. **[Démarrage Rapide](#-démarrage-rapide)** - Premiers pas
|
|
17
|
+
4. **[Configuration](#-configuration)** - Personnalisation
|
|
18
|
+
5. **[Modes de Construction](#-modes-de-construction)** - Options de build
|
|
19
|
+
6. **[Gestion des Dépendances](#-gestion-des-dépendances)** - Electron et Python
|
|
20
|
+
7. **[Protection du Code](#-système-de-protection-avancé)** - Sécurité
|
|
21
|
+
8. **[Packaging Python](#-packaging-dapplications-python)** - Applications Python
|
|
22
|
+
9. **[Packaging Android](#-packaging-dapplications-android)** - Applications Android APK
|
|
23
|
+
10. **[Comparaison](#-comparaison-avec-electron-builder)** - vs electron-builder
|
|
24
|
+
11. **[Roadmap](#-roadmap)** - Futures versions
|
|
25
|
+
12. **[Support](#-support-et-contribution)** - Aide et contact
|
|
25
26
|
|
|
26
27
|
---
|
|
27
28
|
|
|
@@ -47,134 +48,29 @@ Votre soutien permet de :
|
|
|
47
48
|
|
|
48
49
|
## 🚀 Installation
|
|
49
50
|
|
|
50
|
-
###
|
|
51
|
+
### Dépendances Minimales
|
|
51
52
|
|
|
52
53
|
**Pour le développement :** Seuls `electron@^39.1.1` et Python 3.11+ sont requis.
|
|
53
|
-
[]
|
|
54
54
|
|
|
55
|
-
### Afficher toutes les commandes disponibles
|
|
56
|
-
|
|
57
|
-
> **Important :** Avant d'utiliser ces commandes, ajoutez les scripts suivants dans la section `scripts` de votre `package.json` :
|
|
58
|
-
>
|
|
59
|
-
> ```json
|
|
60
|
-
> "help": "node node_modules/metadidomi-builder/build_tools/commands-help.js",
|
|
61
|
-
> "help:electron": "node node_modules/metadidomi-builder/build_tools/commands-help.js --type=electron",
|
|
62
|
-
> "help:python": "node node_modules/metadidomi-builder/build_tools/commands-help.js --type=python",
|
|
63
|
-
> "help:all": "node node_modules/metadidomi-builder/build_tools/commands-help.js --all"
|
|
64
|
-
> ```
|
|
65
|
-
|
|
66
|
-
Pour voir toutes les commandes adaptées à votre projet (Electron ou Python), utilisez la commande d'aide interactive :
|
|
67
|
-
|
|
68
|
-
```powershell
|
|
69
|
-
npm run help # Affiche toutes les commandes disponibles
|
|
70
|
-
npm run help:electron # Affiche uniquement les commandes Electron
|
|
71
|
-
npm run help:python # Affiche uniquement les commandes Python
|
|
72
|
-
npm run help:all # Affiche tout (mode universel)
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
**Exemple d'affichage** :
|
|
76
|
-
```
|
|
77
|
-
> npm run help
|
|
78
|
-
|
|
79
|
-
─────────────────────────────
|
|
80
|
-
METADIDOMI BUILDER - COMMANDES DISPONIBLES
|
|
81
|
-
─────────────────────────────
|
|
82
|
-
|
|
83
|
-
1. BUILD
|
|
84
|
-
Crée un installateur Windows NSIS professionnel
|
|
85
|
-
Commande: npm run build
|
|
86
|
-
Alternatives: npx metadidomi-builder
|
|
87
|
-
Sortie: ./dist/MonApp-Setup-1.0.0.exe
|
|
88
|
-
|
|
89
|
-
2. BUILD:PYTHON
|
|
90
|
-
Build d'application Python en mode console
|
|
91
|
-
Commande: npm run build:python
|
|
92
|
-
Alternatives: npx metadidomi-builder-python
|
|
93
|
-
Sortie: ./dist/MonApp-Setup-1.0.0.exe
|
|
94
|
-
|
|
95
|
-
...etc
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
La commande détecte automatiquement le type de projet et affiche les commandes adaptées, avec explications et exemples.
|
|
99
|
-
|
|
100
|
-
Pour plus d'exemples, consultez la section "Exemples Pratiques" plus bas.
|
|
101
|
-
|
|
102
|
-
#### Option 1 : Installation dans votre projet
|
|
103
|
-
|
|
104
|
-
```powershell
|
|
105
|
-
# Installez le builder comme dépendance de développement
|
|
106
|
-
npm install --save-dev metadidomi-builder
|
|
107
|
-
|
|
108
|
-
# Ajoutez des scripts dans votre package.json
|
|
109
|
-
# "scripts": {
|
|
110
|
-
# "build": "metadidomi-builder",
|
|
111
|
-
# "build:lite": "set LITE_BUILD=true && metadidomi-builder",
|
|
112
|
-
# "build:portable": "set CREATE_PORTABLE_EXE=true && metadidomi-builder",
|
|
113
|
-
# "build:python": "node node_modules/metadidomi-builder/build_tools_py/builder.py",
|
|
114
|
-
# "build:python:gui": "node node_modules/metadidomi-builder/build_tools_py/builder.py --gui"
|
|
115
|
-
# }
|
|
116
|
-
|
|
117
|
-
# Puis lancez avec :
|
|
118
|
-
npm run build # Build Electron standard
|
|
119
|
-
# ou
|
|
120
|
-
npm run build:lite # Build Electron optimisé
|
|
121
|
-
npm run build:portable # Exécutable portable
|
|
122
|
-
npm run build:python # Build Python (console)
|
|
123
|
-
npm run build:python:gui # Build Python (GUI)
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
#### Option 2 : Utilisation directe avec npx
|
|
127
|
-
|
|
128
|
-
```powershell
|
|
129
|
-
# Lancez directement sans installation
|
|
130
|
-
npx metadidomi-builder
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
#### Option 3 : Installation Globale
|
|
134
|
-
|
|
135
|
-
```powershell
|
|
136
|
-
# Installez globalement
|
|
137
|
-
npm install -g metadidomi-builder
|
|
138
|
-
|
|
139
|
-
# Lancez depuis n'importe où
|
|
140
|
-
metadidomi-builder
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### Installation Manuelle (Avancé)
|
|
144
|
-
|
|
145
|
-
Si vous préférez installer manuellement :
|
|
146
|
-
|
|
147
|
-
1. **Clonez le repository**
|
|
148
|
-
```powershell
|
|
149
|
-
git clone https://github.com/METADIDOMIOFFICIEL/Metadidomi-Builder.git
|
|
150
|
-
cd metadidomi-builder
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
2. **Installez les dépendances**
|
|
154
55
|
```powershell
|
|
155
56
|
npm install
|
|
156
57
|
```
|
|
58
|
+
# � INSTALLATION DES DÉPENDANCES VENDOR
|
|
157
59
|
|
|
158
|
-
|
|
159
|
-
- Téléchargez `vendor.zip` depuis :
|
|
160
|
-
https://github.com/METADIDOMIOFFICIEL/Metadidomi-Builder/releases/download/1.3.171125/vendor.zip
|
|
161
|
-
- Extrayez dans `build_tools/vendor/`
|
|
60
|
+
Si lors de l'installation le dossier `build_tools/vendor` n'est pas présent, suivez ces instructions :
|
|
162
61
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
# Depuis le dossier d'installation
|
|
166
|
-
node build_tools/builder.js
|
|
62
|
+
. Téléchargez le fichier `vendor.zip` depuis :
|
|
63
|
+
https://github.com/METADIDOMIOFFICIEL/Metadidomi-Builder/releases/download/1.3.171125/vendor.zip
|
|
167
64
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
```
|
|
65
|
+
💡 **Suite** :
|
|
66
|
+
Vous pouvez aussi extraire manuellement le contenu de `vendor.zip` dans le dossier `build_tools/vendor`.
|
|
171
67
|
|
|
172
68
|
### Modules Embarqués - 100% Offline
|
|
173
69
|
|
|
174
|
-
Toutes les dépendances essentielles sont incluses dans `
|
|
70
|
+
Toutes les dépendances essentielles sont incluses dans `build_tools/vendor/` :
|
|
175
71
|
|
|
176
72
|
```
|
|
177
|
-
build_tools/vendor/
|
|
73
|
+
build_tools/vendor/
|
|
178
74
|
├── asar/ # Packaging et archivage
|
|
179
75
|
├── bytenode/ # Compilation JavaScript → bytecode V8
|
|
180
76
|
├── electron-asar/ # ASAR officiel Electron
|
|
@@ -202,26 +98,22 @@ Le builder intègre un **système automatique de signature** avec deux modes :
|
|
|
202
98
|
|
|
203
99
|
#### Mode 1 : Auto-signé (Défaut - Développement)
|
|
204
100
|
- ✅ Généré automatiquement lors du premier build
|
|
205
|
-
- 📁 Stocké dans `
|
|
206
|
-
- 🔑 Mot de passe dans `cert-[hash].key`
|
|
101
|
+
- 📁 Stocké dans `build_tools/certs/cert-[hash].pfx`
|
|
102
|
+
- 🔑 Mot de passe dans `build_tools/certs/cert-[hash].key`
|
|
207
103
|
- ⚡ Aucune configuration requise
|
|
208
104
|
|
|
209
105
|
#### Mode 2 : Certificat Personnalisé (Production)
|
|
210
106
|
|
|
211
107
|
```powershell
|
|
212
108
|
# Option 1 : Fichier dans le dossier par défaut
|
|
213
|
-
#
|
|
214
|
-
# Manuel: Placer dans build_tools/certs/signing.pfx
|
|
109
|
+
# Placer: build_tools/certs/signing.pfx
|
|
215
110
|
|
|
216
111
|
# Option 2 : Variables d'environnement
|
|
217
112
|
$env:PFX_PATH="chemin/vers/certificat.pfx"
|
|
218
113
|
$env:PFX_PASS="mot-de-passe-certificat"
|
|
219
114
|
|
|
220
|
-
# Lancer le build
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
# Ou avec npx
|
|
224
|
-
npx metadidomi-builder
|
|
115
|
+
# Lancer le build
|
|
116
|
+
node build_tools/builder.js
|
|
225
117
|
```
|
|
226
118
|
|
|
227
119
|
**Priorité de signature :**
|
|
@@ -232,46 +124,16 @@ npx metadidomi-builder
|
|
|
232
124
|
|
|
233
125
|
---
|
|
234
126
|
|
|
235
|
-
[⬆️ Retour en haut](#-multi-builder-premium)
|
|
236
|
-
|
|
237
127
|
## ⚡ Démarrage Rapide
|
|
238
128
|
|
|
239
|
-
### Pour les Pressés (< 5 min)
|
|
240
|
-
|
|
241
|
-
```powershell
|
|
242
|
-
# 1. Installez le builder
|
|
243
|
-
npm i metadidomi-builder
|
|
244
|
-
|
|
245
|
-
# 2. Lancez le builder
|
|
246
|
-
npm run build
|
|
247
|
-
|
|
248
|
-
# 3. C'est tout ! ✅
|
|
249
|
-
# Résultat: ./dist/MonApp-Setup-1.0.0.exe
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
**OU directement avec npx :**
|
|
129
|
+
### Pour les Pressés (< 5 min)
|
|
253
130
|
|
|
254
131
|
```powershell
|
|
255
132
|
# 1. Allez dans votre dossier d'application
|
|
256
133
|
cd D:\mon-app
|
|
257
134
|
|
|
258
|
-
# 2. Lancez le builder
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
> **À savoir :**
|
|
262
|
-
|
|
263
|
-
# 3. C'est tout ! ✅
|
|
264
|
-
# Résultat: ./dist/MonApp-Setup-1.0.0.exe
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
### Alternative : Installation Manuelle
|
|
268
|
-
|
|
269
|
-
```powershell
|
|
270
|
-
# 1. Allez dans votre dossier d'application
|
|
271
|
-
cd D:\mon-app
|
|
272
|
-
|
|
273
|
-
# 2. Lancez le builder manuellement
|
|
274
|
-
node "C:\chemin-vers\metadidomi-builder\build_tools\builder.js"
|
|
135
|
+
# 2. Lancez le builder
|
|
136
|
+
node D:\chemin-vers\metadidomi-builder\build_tools\builder.js
|
|
275
137
|
|
|
276
138
|
# 3. C'est tout ! ✅
|
|
277
139
|
# Résultat: ./dist/MonApp-Setup-1.0.0.exe
|
|
@@ -288,94 +150,6 @@ mon-app/
|
|
|
288
150
|
|
|
289
151
|
**Si aucun fichier n'existe, le builder génère une application de démo complète et fonctionnelle !** 🎉
|
|
290
152
|
|
|
291
|
-
### ⚠️ Éviter les Boucles Infinies de Build
|
|
292
|
-
|
|
293
|
-
**IMPORTANT :** Configurez correctement votre `package.json` pour éviter que le builder relance indéfiniment des builds.
|
|
294
|
-
|
|
295
|
-
#### ❌ MAUVAIS - Créé une boucle infinie
|
|
296
|
-
|
|
297
|
-
```json
|
|
298
|
-
{
|
|
299
|
-
"name": "mon-app",
|
|
300
|
-
"version": "1.0.0",
|
|
301
|
-
"scripts": {
|
|
302
|
-
"start": "npm run build",
|
|
303
|
-
"build": "metadidomi-builder"
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
**Problème :** `npm run build` → `metadidomi-builder` → (re)crée `package.json` → retrigger scripts → boucle infinie ❌
|
|
309
|
-
|
|
310
|
-
#### ✅ BON - Structure Correcte
|
|
311
|
-
|
|
312
|
-
```json
|
|
313
|
-
{
|
|
314
|
-
"name": "mon-app",
|
|
315
|
-
"version": "1.0.0",
|
|
316
|
-
"main": "main.js",
|
|
317
|
-
"scripts": {
|
|
318
|
-
"start": "electron .",
|
|
319
|
-
"dev": "electron .",
|
|
320
|
-
"build": "metadidomi-builder",
|
|
321
|
-
"build:lite": "set LITE_BUILD=true && metadidomi-builder",
|
|
322
|
-
"build:portable": "set CREATE_PORTABLE_EXE=true && metadidomi-builder"
|
|
323
|
-
},
|
|
324
|
-
"dependencies": {
|
|
325
|
-
"electron": "^31.0.0"
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
**Points clés :**
|
|
331
|
-
- ✅ `"start"` lance **Electron**, pas le builder
|
|
332
|
-
- ✅ `"build"` lance **SEULEMENT** le builder
|
|
333
|
-
- ✅ Les scripts ne s'appellent pas mutuellement
|
|
334
|
-
- ✅ Pas de hook `prestart` ou `postinstall` qui relancerait build
|
|
335
|
-
- ✅ Le builder ne modifie PAS le package.json existant
|
|
336
|
-
|
|
337
|
-
#### 🛡️ Règles de Sécurité pour npm scripts
|
|
338
|
-
|
|
339
|
-
| Script | Doit faire | Doit PAS faire |
|
|
340
|
-
|--------|-----------|---|
|
|
341
|
-
| `start` | Lancer Electron ou l'app | Lancer le builder |
|
|
342
|
-
| `build` | Lancer le builder | Lancer d'autres scripts |
|
|
343
|
-
| `dev` | Mode développement Electron | Lancer le builder |
|
|
344
|
-
| `test` | Exécuter les tests | Lancer le builder |
|
|
345
|
-
|
|
346
|
-
#### 🔒 Protéger votre package.json
|
|
347
|
-
|
|
348
|
-
**Ne pas ajouter ces hooks dangereux :**
|
|
349
|
-
|
|
350
|
-
```json
|
|
351
|
-
{
|
|
352
|
-
"scripts": {
|
|
353
|
-
"prestart": "npm run build", // ❌ DANGER: boucle
|
|
354
|
-
"postinstall": "npm run build", // ❌ DANGER: boucle
|
|
355
|
-
"prepare": "npm run build" // ❌ DANGER: boucle
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
#### ✅ Alternative Sûre : Scripts Séparés
|
|
361
|
-
|
|
362
|
-
Si vous voulez build ET lancer, créez deux scripts distincts :
|
|
363
|
-
|
|
364
|
-
```json
|
|
365
|
-
{
|
|
366
|
-
"scripts": {
|
|
367
|
-
"build": "metadidomi-builder",
|
|
368
|
-
"start": "electron .",
|
|
369
|
-
"build-and-run": "npm run build && npm start"
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
**Utilisation :**
|
|
375
|
-
```powershell
|
|
376
|
-
npm run build-and-run # ✅ Build PUIS lance l'app (une fois seulement)
|
|
377
|
-
```
|
|
378
|
-
|
|
379
153
|
---
|
|
380
154
|
|
|
381
155
|
## 📦 Gestion des Dépendances - Installation et Utilisation
|
|
@@ -511,11 +285,7 @@ axios.get('https://api.example.com/data')
|
|
|
511
285
|
|
|
512
286
|
### 2. Tester Localement Avant de Packager
|
|
513
287
|
```powershell
|
|
514
|
-
# Python
|
|
515
|
-
.\node_modules\metadidomi-builder\build_tools\vendor\python_embeddable\python.exe -m pip install -r requirements.txt
|
|
516
|
-
python __main__.py
|
|
517
|
-
|
|
518
|
-
# Python - Installation manuelle
|
|
288
|
+
# Python
|
|
519
289
|
.\build_tools\vendor\python_embeddable\python.exe -m pip install -r requirements.txt
|
|
520
290
|
python __main__.py
|
|
521
291
|
|
|
@@ -551,19 +321,6 @@ import numpy as np
|
|
|
551
321
|
|
|
552
322
|
### Python
|
|
553
323
|
|
|
554
|
-
**Installation npm :**
|
|
555
|
-
```powershell
|
|
556
|
-
# Voir les dépendances qui peuvent être mises à jour
|
|
557
|
-
.\node_modules\metadidomi-builder\build_tools\vendor\python_embeddable\python.exe -m pip list --outdated
|
|
558
|
-
|
|
559
|
-
# Mettre à jour une dépendance
|
|
560
|
-
.\node_modules\metadidomi-builder\build_tools\vendor\python_embeddable\python.exe -m pip install --upgrade requests
|
|
561
|
-
|
|
562
|
-
# Mettre à jour tous les packages
|
|
563
|
-
.\node_modules\metadidomi-builder\build_tools\vendor\python_embeddable\python.exe -m pip install --upgrade -r requirements.txt
|
|
564
|
-
```
|
|
565
|
-
|
|
566
|
-
**Installation manuelle :**
|
|
567
324
|
```powershell
|
|
568
325
|
# Voir les dépendances qui peuvent être mises à jour
|
|
569
326
|
.\build_tools\vendor\python_embeddable\python.exe -m pip list --outdated
|
|
@@ -596,21 +353,8 @@ npm update
|
|
|
596
353
|
|
|
597
354
|
#### ⭐ Standard (Défaut) - Installateur NSIS
|
|
598
355
|
|
|
599
|
-
**Avec npm :**
|
|
600
|
-
```powershell
|
|
601
|
-
npm run build
|
|
602
|
-
# Résultat: ./dist/MonApp-Setup-1.0.0.exe
|
|
603
|
-
```
|
|
604
|
-
|
|
605
|
-
**Avec npx :**
|
|
606
|
-
```powershell
|
|
607
|
-
npx metadidomi-builder
|
|
608
|
-
# Résultat: ./dist/MonApp-Setup-1.0.0.exe
|
|
609
|
-
```
|
|
610
|
-
|
|
611
|
-
**Manuel :**
|
|
612
356
|
```powershell
|
|
613
|
-
node
|
|
357
|
+
node build_tools/builder.js
|
|
614
358
|
# Résultat: ./dist/MonApp-Setup-1.0.0.exe
|
|
615
359
|
```
|
|
616
360
|
|
|
@@ -618,15 +362,9 @@ Crée un **installateur professionnel** avec options d'installation, raccourcis,
|
|
|
618
362
|
|
|
619
363
|
#### 💾 Portable - Exécutable Autonome
|
|
620
364
|
|
|
621
|
-
**Avec npm :**
|
|
622
|
-
```powershell
|
|
623
|
-
$env:CREATE_PORTABLE_EXE="true"; npm run build
|
|
624
|
-
# Résultat: ./dist/MonApp.exe (portable, ~130MB)
|
|
625
|
-
```
|
|
626
|
-
|
|
627
|
-
**Avec npx :**
|
|
628
365
|
```powershell
|
|
629
|
-
$env:CREATE_PORTABLE_EXE="true"
|
|
366
|
+
$env:CREATE_PORTABLE_EXE="true"
|
|
367
|
+
node build_tools/builder.js
|
|
630
368
|
# Résultat: ./dist/MonApp.exe (portable, ~130MB)
|
|
631
369
|
```
|
|
632
370
|
|
|
@@ -634,9 +372,9 @@ Exécutable indépendant sans installation requise.
|
|
|
634
372
|
|
|
635
373
|
#### ⚡ LITE - Mode Optimisé
|
|
636
374
|
|
|
637
|
-
**Avec npm :**
|
|
638
375
|
```powershell
|
|
639
|
-
$env:LITE_BUILD="true"
|
|
376
|
+
$env:LITE_BUILD="true"
|
|
377
|
+
node build_tools/builder.js
|
|
640
378
|
# Résultat: ./dist/MonApp-Setup-1.0.0.exe (optimisé)
|
|
641
379
|
# Rapport: electron-lite-deps-report.txt
|
|
642
380
|
```
|
|
@@ -645,52 +383,46 @@ Analyse et exclut automatiquement les modules inutiles. Génère un rapport dét
|
|
|
645
383
|
|
|
646
384
|
#### 🚫 Sans Installateur
|
|
647
385
|
|
|
648
|
-
**Avec npm :**
|
|
649
386
|
```powershell
|
|
650
|
-
$env:SKIP_INSTALLER="true"
|
|
387
|
+
$env:SKIP_INSTALLER="true"
|
|
388
|
+
node build_tools/builder.js
|
|
651
389
|
# Résultat: Ressources de base seulement
|
|
652
390
|
```
|
|
653
391
|
|
|
654
392
|
#### 🔐 Avec Chiffrement
|
|
655
393
|
|
|
656
|
-
**Avec npm :**
|
|
657
394
|
```powershell
|
|
658
|
-
$env:KEY="votre-clé-secrète"
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
**Avec npx :**
|
|
662
|
-
```powershell
|
|
663
|
-
$env:KEY="votre-clé-secrète"; npx metadidomi-builder
|
|
395
|
+
$env:KEY="votre-clé-secrète"
|
|
396
|
+
node build_tools/builder.js
|
|
664
397
|
```
|
|
665
398
|
|
|
666
399
|
#### ⚙️ Compression UPX (Optionnelle)
|
|
667
400
|
|
|
668
|
-
**Mode rapide (recommandé) :**
|
|
669
401
|
```powershell
|
|
670
|
-
|
|
671
|
-
|
|
402
|
+
# Mode rapide (recommandé)
|
|
403
|
+
$env:USE_UPX="true"
|
|
404
|
+
node build_tools/builder.js
|
|
672
405
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
$env:
|
|
406
|
+
# Mode ultra-brute (très lent, gain maximal)
|
|
407
|
+
$env:USE_UPX="true"
|
|
408
|
+
$env:UPX_ULTRA_BRUTE="true"
|
|
409
|
+
node build_tools/builder.js
|
|
676
410
|
```
|
|
677
411
|
|
|
678
412
|
#### 🔗 Combinaisons Utiles
|
|
679
413
|
|
|
680
|
-
**Portable + LITE + Chiffrement :**
|
|
681
414
|
```powershell
|
|
415
|
+
# Portable + LITE + Chiffrement
|
|
682
416
|
$env:CREATE_PORTABLE_EXE="true"
|
|
683
417
|
$env:LITE_BUILD="true"
|
|
684
418
|
$env:KEY="clé-secrète"
|
|
685
|
-
|
|
686
|
-
```
|
|
419
|
+
node build_tools/builder.js
|
|
687
420
|
|
|
688
|
-
|
|
689
|
-
```powershell
|
|
421
|
+
# Avec UPX + Signature personnalisée
|
|
690
422
|
$env:USE_UPX="true"
|
|
691
423
|
$env:PFX_PATH="cert.pfx"
|
|
692
424
|
$env:PFX_PASS="mot-de-passe"
|
|
693
|
-
|
|
425
|
+
node build_tools/builder.js
|
|
694
426
|
```
|
|
695
427
|
|
|
696
428
|
### Paramètres Avancés
|
|
@@ -781,25 +513,37 @@ mon-app/
|
|
|
781
513
|
|
|
782
514
|
Le builder intègre un **système complet de protection du code** avec obfuscation intelligente, chiffrement multi-couches, et anti-analyse.
|
|
783
515
|
|
|
784
|
-
###
|
|
516
|
+
### Deux Modes de Protection
|
|
785
517
|
|
|
786
|
-
**
|
|
518
|
+
**Mode Interactif** - Questions guidées pour chaque protection
|
|
787
519
|
```powershell
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
npm run build -- --heavy-protection
|
|
520
|
+
cd metadidomi-builder/build_tools_py/pyMetadidomi
|
|
521
|
+
python pyMetadidomi.py
|
|
791
522
|
```
|
|
792
523
|
|
|
793
|
-
**
|
|
524
|
+
**Mode CLI** - Automatisé avec arguments
|
|
794
525
|
```powershell
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
526
|
+
# Presets rapides
|
|
527
|
+
python pyMetadidomi.py script.py --light-protection # Léger
|
|
528
|
+
python pyMetadidomi.py script.py --medium-protection # Moyen
|
|
529
|
+
python pyMetadidomi.py script.py --heavy-protection # Maximal
|
|
530
|
+
|
|
531
|
+
# Options individuelles
|
|
532
|
+
python pyMetadidomi.py script.py --carbon # Obfuscation
|
|
533
|
+
python pyMetadidomi.py script.py --junk # Code parasite
|
|
534
|
+
python pyMetadidomi.py script.py --anti-vm # Anti-VM
|
|
535
|
+
python pyMetadidomi.py script.py --multi-encrypt # Chiffrement multi-couches
|
|
798
536
|
```
|
|
799
537
|
|
|
800
|
-
|
|
538
|
+
### Protection pour Electron
|
|
539
|
+
|
|
540
|
+
```powershell
|
|
541
|
+
node build_tools/builder.js --light-protection
|
|
542
|
+
node build_tools/builder.js --medium-protection
|
|
543
|
+
node build_tools/builder.js --heavy-protection
|
|
544
|
+
```
|
|
801
545
|
|
|
802
|
-
👉 **[📖 Documentation complète des protections →](
|
|
546
|
+
👉 **[📖 Documentation complète des protections →](build_tools_py/PROTECTION_COMMANDS.md)**
|
|
803
547
|
|
|
804
548
|
## Construction LITE (optimisation)
|
|
805
549
|
```powershell
|
|
@@ -811,22 +555,20 @@ Génère un rapport `electron-lite-deps-report.txt` avec les modules analysés.
|
|
|
811
555
|
## Clé de Chiffrement Personnalisée
|
|
812
556
|
```powershell
|
|
813
557
|
$env:KEY="votre-clé-secrète"
|
|
814
|
-
|
|
558
|
+
node build_tools/builder.js
|
|
815
559
|
```
|
|
816
560
|
Si non défini, une clé est générée automatiquement.
|
|
817
561
|
|
|
818
562
|
## Compression UPX
|
|
819
|
-
**Mode rapide (défaut) :**
|
|
820
563
|
```powershell
|
|
564
|
+
# Mode rapide (défaut)
|
|
821
565
|
$env:USE_UPX="true"
|
|
822
|
-
|
|
823
|
-
```
|
|
566
|
+
node build_tools/builder.js
|
|
824
567
|
|
|
825
|
-
|
|
826
|
-
```powershell
|
|
568
|
+
# Mode ultra-brute (très lent)
|
|
827
569
|
$env:USE_UPX="true"
|
|
828
570
|
$env:UPX_ULTRA_BRUTE="true"
|
|
829
|
-
|
|
571
|
+
node build_tools/builder.js
|
|
830
572
|
```
|
|
831
573
|
|
|
832
574
|
---
|
|
@@ -871,83 +613,19 @@ Builder (compile, chiffre, empaque, signe)
|
|
|
871
613
|
|
|
872
614
|
## 📝 Exemples Pratiques
|
|
873
615
|
|
|
874
|
-
### Installation npm + Utilisation - Electron
|
|
875
|
-
|
|
876
|
-
**Exemple 1 : Setup complet avec tous les scripts npm**
|
|
877
|
-
|
|
878
616
|
```powershell
|
|
879
|
-
#
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
# Ajoutez les scripts à votre package.json:
|
|
883
|
-
# "scripts": {
|
|
884
|
-
# "start": "electron .",
|
|
885
|
-
# "dev": "electron .",
|
|
886
|
-
# "build": "metadidomi-builder",
|
|
887
|
-
# "build:lite": "set LITE_BUILD=true && metadidomi-builder",
|
|
888
|
-
# "build:portable": "set CREATE_PORTABLE_EXE=true && metadidomi-builder",
|
|
889
|
-
# "build:encrypted": "set KEY=ma-cle-secrete && metadidomi-builder",
|
|
890
|
-
# "build-and-run": "npm run build && echo Build complete!"
|
|
891
|
-
# }
|
|
892
|
-
|
|
893
|
-
# Puis lancez avec :
|
|
894
|
-
npm run build # Build standard → ./dist/MonApp-Setup-1.0.0.exe
|
|
895
|
-
npm run build:lite # Build optimisé → ./dist/MonApp-Setup-1.0.0.exe
|
|
896
|
-
npm run build:portable # Exécutable portable → ./dist/MonApp.exe
|
|
897
|
-
npm run build:encrypted # Avec clé → ./dist/MonApp-Setup-1.0.0.exe (chiffré)
|
|
898
|
-
npm run build-and-run # Build puis message
|
|
899
|
-
```
|
|
900
|
-
|
|
901
|
-
**Exemple 2 : Avec options avancées dans package.json**
|
|
617
|
+
# Mode simple (depuis votre app)
|
|
618
|
+
cd D:\MonApp
|
|
619
|
+
node C:\metadidomi-builder\build_tools\builder.js
|
|
902
620
|
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
"name": "mon-app-electron",
|
|
906
|
-
"version": "1.0.0",
|
|
907
|
-
"main": "main.js",
|
|
908
|
-
"scripts": {
|
|
909
|
-
"start": "electron .",
|
|
910
|
-
"dev": "electron .",
|
|
911
|
-
"build": "metadidomi-builder",
|
|
912
|
-
"build:lite": "set LITE_BUILD=true && metadidomi-builder",
|
|
913
|
-
"build:portable": "set CREATE_PORTABLE_EXE=true && metadidomi-builder",
|
|
914
|
-
"build:upx": "set USE_UPX=true && metadidomi-builder",
|
|
915
|
-
"build:full": "set CREATE_PORTABLE_EXE=true && set LITE_BUILD=true && set USE_UPX=true && metadidomi-builder",
|
|
916
|
-
"build:protected": "set LITE_BUILD=true && metadidomi-builder --medium-protection"
|
|
917
|
-
},
|
|
918
|
-
"dependencies": {
|
|
919
|
-
"electron": "^31.0.0"
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
```
|
|
923
|
-
|
|
924
|
-
**Exemple 3 : Avec npx (sans installation)**
|
|
925
|
-
|
|
926
|
-
```powershell
|
|
927
|
-
npx metadidomi-builder # Build standard
|
|
928
|
-
npx metadidomi-builder --light-protection # Build avec protection légère
|
|
929
|
-
npx metadidomi-builder --medium-protection # Build avec protection moyenne
|
|
930
|
-
```
|
|
931
|
-
|
|
932
|
-
npm run build
|
|
933
|
-
# Résultat: ./dist/MonApp-Setup-1.0.0.exe
|
|
934
|
-
```
|
|
935
|
-
|
|
936
|
-
**Exemple 2 : Avec npx (sans installation)**
|
|
937
|
-
```powershell
|
|
938
|
-
npx metadidomi-builder
|
|
939
|
-
# Résultat: ./dist/MonApp-Setup-1.0.0.exe
|
|
940
|
-
```
|
|
621
|
+
# Avec source et sortie personnalisées
|
|
622
|
+
node build_tools/builder.js --app-src D:\mon-app --output D:\dist
|
|
941
623
|
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
# Ou
|
|
946
|
-
$env:KEY="ma-clé-secrète"; npm run build
|
|
947
|
-
```
|
|
624
|
+
# Avec chiffrement
|
|
625
|
+
$env:KEY="ma-clé-secrète"
|
|
626
|
+
node build_tools/builder.js --app-src C:\MonApp
|
|
948
627
|
|
|
949
|
-
|
|
950
|
-
```powershell
|
|
628
|
+
# Portable + LITE + UPX
|
|
951
629
|
$env:CREATE_PORTABLE_EXE="true"
|
|
952
630
|
$env:LITE_BUILD="true"
|
|
953
631
|
$env:USE_UPX="true"
|
|
@@ -1014,6 +692,11 @@ L'injection ajoute automatiquement :
|
|
|
1014
692
|
|
|
1015
693
|
---
|
|
1016
694
|
|
|
695
|
+
## 📊 Comparaison avec electron-builder
|
|
696
|
+
- Options d'obfuscation sûres et compatibles
|
|
697
|
+
- Pas de transformation agressive du code
|
|
698
|
+
- Préserve la stabilité de l'application
|
|
699
|
+
|
|
1017
700
|
### 📊 Protection multiniveau
|
|
1018
701
|
Cette approche assure :
|
|
1019
702
|
- ✅ **Sécurité maximale** : Protection forte contre l'analyse statique
|
|
@@ -1402,105 +1085,43 @@ L'empaquetage récursif est optimisé pour :
|
|
|
1402
1085
|
| **Chiffrement ressources** | ✅ AES-256 intégré | ❌ Addon requis |
|
|
1403
1086
|
| **Bytecode protection** | ✅ bytenode natif | ❌ Non |
|
|
1404
1087
|
| **Mode LITE** | ✅ Analyse dépendances | ❌ Non |
|
|
1405
|
-
| **Build reproducible** | ✅
|
|
1406
|
-
| **Packaging Python** | ✅ Oui (NSIS + obfuscation) | ❌ Non |
|
|
1407
|
-
| **Protection code Python** | ✅ pyMetadidomi (light/medium/heavy) | ❌ Non |
|
|
1408
|
-
| **Multi-plateforme** | ⏳ Q1-2026 (macOS/Linux) | ✅ Windows/macOS/Linux |
|
|
1409
|
-
| **Communauté** | 🆕 En croissance | ✅ Très large |
|
|
1410
|
-
| **Support commercial** | ✅ Direct (ETS METADIDOMI) | ✅ Communauté + sponsors |
|
|
1411
|
-
|
|
1412
|
-
### 🎯 Tableau Récapitulatif
|
|
1413
|
-
|
|
1414
|
-
**metadidomi-builder** :
|
|
1415
|
-
- ✅ **Sécurité maximale** - AES-256, bytecode, obfuscation pyMetadidomi
|
|
1416
|
-
- ✅ **100% offline** - Zéro dépendance externe, tous les outils embarqués
|
|
1417
|
-
- ✅ **Builds reproductibles** - Déterministe et versionnable
|
|
1418
|
-
- ✅ **Python support** - Applications Python complètes avec installateurs NSIS
|
|
1419
|
-
- ⏳ **Multi-plateforme** - Windows maintenant, macOS/Linux 2026
|
|
1420
|
-
|
|
1421
|
-
**electron-builder** :
|
|
1422
|
-
- ✅ **Multi-plateforme établi** - Windows, macOS, Linux, AppImage, Snap
|
|
1423
|
-
- ✅ **Configuration simple** - Template facile à adapter
|
|
1424
|
-
- ✅ **Communauté large** - Nombreuses extensions et plugins
|
|
1425
|
-
- ⚠️ **Dépendances réseau** - Nécessite téléchargements externe
|
|
1426
|
-
- ❌ **Python non supporté** - Electron uniquement
|
|
1427
|
-
|
|
1428
|
-
### 💡 Comment Choisir?
|
|
1429
|
-
|
|
1430
|
-
**Utilisez metadidomi-builder si vous avez besoin de :**
|
|
1431
|
-
- 🔐 Sécurité critique (finance, santé, militaire)
|
|
1432
|
-
- 📦 Packaging Python standalone avec installateur professionnel
|
|
1433
|
-
- 🔒 Obfuscation et protection du code (anti-reverse engineering)
|
|
1434
|
-
- 🚫 Environnement complètement offline
|
|
1435
|
-
- ⚙️ Contrôle total sur le processus de build
|
|
1436
|
-
|
|
1437
|
-
**Utilisez electron-builder si vous avez besoin de :**
|
|
1438
|
-
- 🖥️ Multi-plateforme stable et mature
|
|
1439
|
-
- 🚀 Setup rapide et facile (peu de configuration)
|
|
1440
|
-
- 👥 Accès à une large communauté et d'extensions
|
|
1441
|
-
- 📱 Support macOS/Linux dès maintenant
|
|
1442
|
-
- 🔄 Updates automatiques intégrées
|
|
1088
|
+
| **Build reproducible** | ✅ Oui | ⚠️ Partiel |
|
|
1443
1089
|
|
|
1444
|
-
|
|
1090
|
+
**metadidomi-builder** : Optimal pour sécurité maximale, 100% offline, protection bytecode
|
|
1091
|
+
**electron-builder** : Optimal pour multi-plateforme, configuration simple, communauté large
|
|
1092
|
+
|
|
1093
|
+
👉 **Choisir metadidomi-builder si** : sécurité critique, environnement offline, control total
|
|
1094
|
+
👉 **Choisir electron-builder si** : multi-plateforme, setup simple, app standard
|
|
1445
1095
|
|
|
1446
|
-
|
|
1096
|
+
---
|
|
1447
1097
|
|
|
1448
1098
|
## � Packaging d'Applications Python
|
|
1449
1099
|
|
|
1450
1100
|
Le builder inclut aussi un **système complet de packaging Python** via `builder.py` pour créer des applications Windows standalone avec installateurs NSIS professionnels.
|
|
1451
1101
|
|
|
1452
|
-
|
|
1453
1102
|
### 🚀 Démarrage Rapide - Applications Python
|
|
1454
1103
|
|
|
1455
|
-
**
|
|
1104
|
+
**Le plus simple** - Exécutez le builder Python depuis votre dossier d'application :
|
|
1456
1105
|
|
|
1457
1106
|
```powershell
|
|
1458
|
-
#
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
# Ajoutez des scripts dans votre package.json
|
|
1462
|
-
# "scripts": {
|
|
1463
|
-
# "build:python": "python node_modules\\metadidomi-builder\\build_tools_py\\builder.py --app-src ./src",
|
|
1464
|
-
# "build:python:gui": "python node_modules\\metadidomi-builder\\build_tools_py\\builder.py --gui --app-src ./src"
|
|
1465
|
-
# }
|
|
1466
|
-
|
|
1467
|
-
# Puis lancez avec :
|
|
1468
|
-
npm run build:python # Mode console (par défaut)
|
|
1469
|
-
# Résultat: ./dist/MonApp-Setup-1.0.0.exe
|
|
1107
|
+
# Depuis votre répertoire d'application Python
|
|
1108
|
+
cd D:\mon-app-python
|
|
1109
|
+
python D:\chemin-vers\metadidomi-builder\build_tools_py\builder.py
|
|
1470
1110
|
|
|
1471
|
-
# OU
|
|
1472
|
-
npm run build:python:gui # Mode GUI (sans console)
|
|
1473
1111
|
# Résultat: ./dist/MonApp-Setup-1.0.0.exe
|
|
1474
1112
|
```
|
|
1475
1113
|
|
|
1476
|
-
|
|
1477
|
-
> Placez vos fichiers sources Python (`config.py`, `__main__.py`, etc.) dans un dossier séparé (ex : `src/`).
|
|
1478
|
-
> Puis lancez le build en précisant le chemin source :
|
|
1479
|
-
> ```powershell
|
|
1480
|
-
> npm run build:python -- --app-src ./src
|
|
1481
|
-
> ```
|
|
1482
|
-
> Cela évite que le builder scanne le dossier `node_modules` et les vendors, et prévient les erreurs de chemin trop long ou manquant.
|
|
1483
|
-
|
|
1484
|
-
**Option 2 : Avec npx (sans installation)**
|
|
1114
|
+
**Ou avec options personnalisées :**
|
|
1485
1115
|
|
|
1486
1116
|
```powershell
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
```
|
|
1490
|
-
|
|
1491
|
-
**Option 3 : Installation Manuelle**
|
|
1492
|
-
|
|
1493
|
-
```powershell
|
|
1494
|
-
# Mode console simple
|
|
1495
|
-
node "C:\chemin-vers\metadidomi-builder\build_tools_py\builder.py"
|
|
1496
|
-
# Résultat: ./dist/MonApp-Setup-1.0.0.exe
|
|
1117
|
+
# Source et sortie personnalisées
|
|
1118
|
+
python builder.py --app-src D:\mon-app --output D:\dist
|
|
1497
1119
|
|
|
1498
1120
|
# Mode GUI (sans fenêtre console)
|
|
1499
|
-
|
|
1500
|
-
# Résultat: ./dist/MonApp-Setup-1.0.0.exe
|
|
1121
|
+
python builder.py --gui
|
|
1501
1122
|
|
|
1502
|
-
#
|
|
1503
|
-
|
|
1123
|
+
# Combiné
|
|
1124
|
+
python builder.py --app-src D:\mon-app --output D:\dist --gui
|
|
1504
1125
|
```
|
|
1505
1126
|
|
|
1506
1127
|
### 📋 Structure Minimale d'une Application Python
|
|
@@ -1720,9 +1341,7 @@ Le builder utilise **Python Embeddable** pour les utilisateurs finaux :
|
|
|
1720
1341
|
- ✅ Distribution portable
|
|
1721
1342
|
- ✅ Inclus dans l'installateur NSIS
|
|
1722
1343
|
|
|
1723
|
-
**Localisation :**
|
|
1724
|
-
- Installation npm : `node_modules/metadidomi-builder/build_tools/vendor/python_embeddable/`
|
|
1725
|
-
- Installation manuelle : `build_tools/vendor/python_embeddable/`
|
|
1344
|
+
**Localisation :** `build_tools/vendor/python_embeddable/`
|
|
1726
1345
|
|
|
1727
1346
|
### 🔐 Protection du Code Python
|
|
1728
1347
|
|
|
@@ -1745,24 +1364,6 @@ Le builder utilise **Python Embeddable** pour les utilisateurs finaux :
|
|
|
1745
1364
|
- Code Python injecté dynamiquement
|
|
1746
1365
|
- Exécution directe sans interpréteur externe
|
|
1747
1366
|
|
|
1748
|
-
#### Niveaux de protection du code Python
|
|
1749
|
-
|
|
1750
|
-
Vous pouvez protéger votre code Python lors du build avec différents niveaux de protection :
|
|
1751
|
-
|
|
1752
|
-
```powershell
|
|
1753
|
-
npm run build:python -- --app-src ./src --light-protection
|
|
1754
|
-
npm run build:python:gui -- --app-src ./src --medium-protection
|
|
1755
|
-
npm run build:python -- --app-src ./src --heavy-protection
|
|
1756
|
-
```
|
|
1757
|
-
|
|
1758
|
-
**Options de protection :**
|
|
1759
|
-
|
|
1760
|
-
- `--light-protection` : Obfuscation légère (carbon + junk)
|
|
1761
|
-
- `--medium-protection` : Obfuscation moyenne (carbon + junk + bugs + dead-code)
|
|
1762
|
-
- `--heavy-protection` : Protection maximale (toutes les options)
|
|
1763
|
-
|
|
1764
|
-
**Remarque :** Ces options ne concernent que les projets Python. Pour Electron, voir la section correspondante.
|
|
1765
|
-
|
|
1766
1367
|
### 📊 Fichiers Générés
|
|
1767
1368
|
|
|
1768
1369
|
```
|
|
@@ -1781,59 +1382,54 @@ dist/
|
|
|
1781
1382
|
|
|
1782
1383
|
#### Exemple 1 : Application Console Simple
|
|
1783
1384
|
|
|
1784
|
-
**Avec npm :**
|
|
1785
1385
|
```powershell
|
|
1786
1386
|
# Structure
|
|
1787
1387
|
mon-app/
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
__main__.py
|
|
1388
|
+
config.py
|
|
1389
|
+
__main__.py
|
|
1791
1390
|
|
|
1792
1391
|
# Build
|
|
1793
1392
|
cd mon-app
|
|
1794
|
-
|
|
1393
|
+
python ..\builder.py
|
|
1795
1394
|
# Résultat: ./dist/MonApp-Setup-1.0.0.exe
|
|
1796
1395
|
```
|
|
1797
1396
|
|
|
1798
1397
|
#### Exemple 2 : Application Tkinter GUI
|
|
1799
1398
|
|
|
1800
|
-
**Avec npm :**
|
|
1801
1399
|
```powershell
|
|
1802
1400
|
# Structure
|
|
1803
1401
|
mon-app-gui/
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
icon.ico
|
|
1402
|
+
config.py
|
|
1403
|
+
__main__.py ← Interface Tkinter
|
|
1404
|
+
assets/
|
|
1405
|
+
icon.ico
|
|
1809
1406
|
|
|
1810
1407
|
# Build (mode GUI pour éviter console)
|
|
1811
|
-
|
|
1408
|
+
cd mon-app-gui
|
|
1409
|
+
python ..\..\builder.py --gui
|
|
1812
1410
|
# Résultat: ./dist/MonApp-Setup-1.0.0.exe (pas de console)
|
|
1813
1411
|
```
|
|
1814
1412
|
|
|
1815
1413
|
#### Exemple 3 : Application Complexe Multi-Fichiers
|
|
1816
1414
|
|
|
1817
|
-
**Avec npm :**
|
|
1818
1415
|
```powershell
|
|
1819
1416
|
# Structure complexe
|
|
1820
1417
|
mon-app/
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
data.json
|
|
1418
|
+
config.py
|
|
1419
|
+
__main__.py
|
|
1420
|
+
utils/
|
|
1421
|
+
helpers.py
|
|
1422
|
+
validators.py
|
|
1423
|
+
lib/
|
|
1424
|
+
core.py
|
|
1425
|
+
handlers/
|
|
1426
|
+
events.py
|
|
1427
|
+
assets/
|
|
1428
|
+
icon.ico
|
|
1429
|
+
data.json
|
|
1834
1430
|
|
|
1835
|
-
# Build
|
|
1836
|
-
|
|
1431
|
+
# Build avec sortie personnalisée
|
|
1432
|
+
python builder.py --app-src D:\mon-app --output D:\dist
|
|
1837
1433
|
# TOUS les fichiers récursivement inclus ✅
|
|
1838
1434
|
```
|
|
1839
1435
|
|
|
@@ -1841,52 +1437,30 @@ npm run build:python -- --app-src ./src
|
|
|
1841
1437
|
|
|
1842
1438
|
#### Avec Clé de Chiffrement Personnalisée
|
|
1843
1439
|
|
|
1844
|
-
**Avec npm :**
|
|
1845
|
-
```powershell
|
|
1846
|
-
# Via variable d'environnement
|
|
1847
|
-
$env:KEY = "ma-clé-secrète-32-caractères"
|
|
1848
|
-
npm run build:python -- --app-src ./src
|
|
1849
|
-
```
|
|
1850
|
-
|
|
1851
|
-
**Manuel :**
|
|
1852
1440
|
```powershell
|
|
1853
1441
|
# Option 1: Via argument
|
|
1854
|
-
|
|
1442
|
+
python builder.py --key "ma-clé-secrète-32-caractères"
|
|
1855
1443
|
|
|
1856
1444
|
# Option 2: Via variable d'environnement
|
|
1857
1445
|
$env:KEY = "ma-clé-secrète-32-caractères"
|
|
1858
|
-
|
|
1446
|
+
python builder.py
|
|
1859
1447
|
```
|
|
1860
1448
|
|
|
1861
1449
|
#### Sans Compilation .pyc
|
|
1862
1450
|
|
|
1863
|
-
**Avec npm :**
|
|
1864
|
-
|
|
1865
|
-
```powershell
|
|
1866
|
-
npm run build:python -- --no-pyc --app-src ./src
|
|
1867
|
-
```
|
|
1868
|
-
|
|
1869
|
-
**Manuel :**
|
|
1870
1451
|
```powershell
|
|
1871
|
-
|
|
1452
|
+
python builder.py --no-pyc
|
|
1872
1453
|
# Les .py restent non compilés (plus rapide au build)
|
|
1873
1454
|
```
|
|
1874
1455
|
|
|
1875
1456
|
#### Combinaisons
|
|
1876
1457
|
|
|
1877
|
-
**Avec npm :**
|
|
1878
1458
|
```powershell
|
|
1879
|
-
# GUI + clé custom
|
|
1880
|
-
|
|
1881
|
-
```
|
|
1882
|
-
|
|
1883
|
-
**Manuel :**
|
|
1884
|
-
```powershell
|
|
1885
|
-
# GUI + clé custom
|
|
1886
|
-
node build_tools_py/builder.py --app-src ./src --gui --key "clé-secrète"
|
|
1459
|
+
# GUI + sortie personnalisée + clé custom
|
|
1460
|
+
python builder.py --gui --output D:\dist --key "clé-secrète"
|
|
1887
1461
|
|
|
1888
1462
|
# Source custom + GUI + sans .pyc
|
|
1889
|
-
|
|
1463
|
+
python builder.py --app-src D:\mon-app --gui --no-pyc
|
|
1890
1464
|
```
|
|
1891
1465
|
|
|
1892
1466
|
### 🔍 Dépistage et Débogage
|
|
@@ -1989,9 +1563,80 @@ Pour les questions sur le packaging Python :
|
|
|
1989
1563
|
|
|
1990
1564
|
---
|
|
1991
1565
|
|
|
1992
|
-
|
|
1566
|
+
## 📦 Packaging d'Applications Android
|
|
1567
|
+
|
|
1568
|
+
Le builder inclut un **système complet de packaging Android** via `build_apk.js` pour créer des applications Android (APK) native avec interface graphique et fonctionnalités complètes.
|
|
1569
|
+
|
|
1570
|
+
### 🎯 Fonctionnalités Android
|
|
1571
|
+
|
|
1572
|
+
- ✅ **Compilation complète** - Ressources XML, code Java, génération DEX
|
|
1573
|
+
- ✅ **Génération automatique** - AndroidManifest, ressources, styles
|
|
1574
|
+
- ✅ **Icônes multi-densité** - Auto-redimensionnement pour tous les écrans
|
|
1575
|
+
- ✅ **Gestion des ressources** - Préservation des customisations utilisateur
|
|
1576
|
+
- ✅ **Signature automatique** - Clé de développement auto-générée
|
|
1577
|
+
- ✅ **Validation stricte** - Vérification des fichiers minimums
|
|
1578
|
+
- ✅ **100% offline** - Tous les outils Android SDK embarqués
|
|
1579
|
+
|
|
1580
|
+
### 🚀 Démarrage Rapide - Applications Android
|
|
1581
|
+
|
|
1582
|
+
**La structure minimale requise :**
|
|
1583
|
+
|
|
1584
|
+
```
|
|
1585
|
+
MonApp/
|
|
1586
|
+
├── app-config.json # Configuration de l'app
|
|
1587
|
+
├── src/com/example/monapp/
|
|
1588
|
+
│ └── MainActivity.java # Code Java principal
|
|
1589
|
+
├── res/layout/
|
|
1590
|
+
│ └── activity_main.xml # Interface utilisateur
|
|
1591
|
+
└── res/values/
|
|
1592
|
+
└── strings.xml # Textes et ressources
|
|
1593
|
+
```
|
|
1594
|
+
|
|
1595
|
+
**Lancer la compilation :**
|
|
1596
|
+
|
|
1597
|
+
```powershell
|
|
1598
|
+
cd "chemin\vers\Metadidomi Crone"
|
|
1599
|
+
node "metadidomi-builder\build_tools\build_apk.js" "MonApp"
|
|
1600
|
+
# Résultat: MonApp/MonApp.apk (prête à installer)
|
|
1601
|
+
```
|
|
1602
|
+
|
|
1603
|
+
### 📖 Documentation Complète
|
|
1604
|
+
|
|
1605
|
+
Pour une documentation détaillée incluant :
|
|
1606
|
+
- ✅ Installation et configuration
|
|
1607
|
+
- ✅ Structure de projet complète
|
|
1608
|
+
- ✅ Guide étape par étape
|
|
1609
|
+
- ✅ Exemples pratiques (Counter App, etc.)
|
|
1610
|
+
- ✅ Solutions aux erreurs courantes
|
|
1611
|
+
- ✅ Options avancées
|
|
1612
|
+
|
|
1613
|
+
👉 **[📚 Consulter le Guide Complet Android →](README_APK.md)**
|
|
1614
|
+
|
|
1615
|
+
### 📋 Fichiers Générés
|
|
1616
|
+
|
|
1617
|
+
Après compilation réussie :
|
|
1618
|
+
|
|
1619
|
+
```
|
|
1620
|
+
MonApp/
|
|
1621
|
+
├── build/ # Dossier de compilation (généré)
|
|
1622
|
+
├── MonApp.apk # Application Android (~ 2-5 MB)
|
|
1623
|
+
└── ...autres fichiers...
|
|
1624
|
+
```
|
|
1625
|
+
|
|
1626
|
+
### ✨ Exemple : Application Counter
|
|
1627
|
+
|
|
1628
|
+
L'exemple complet `CounterApp/` démontre :
|
|
1629
|
+
- Interface graphique avec LinearLayout
|
|
1630
|
+
- Gestion d'état (compteur)
|
|
1631
|
+
- Listeners d'événements click
|
|
1632
|
+
- Mise à jour dynamique d'UI
|
|
1633
|
+
- Textes et ressources multi-langue
|
|
1634
|
+
|
|
1635
|
+
Consultez `CounterApp/` dans le dossier racine pour voir une implémentation complète.
|
|
1636
|
+
|
|
1637
|
+
---
|
|
1993
1638
|
|
|
1994
|
-
##
|
|
1639
|
+
## 🗺️ Roadmap - Vision Multi-Plateforme
|
|
1995
1640
|
|
|
1996
1641
|
### Phase 1 : Windows ✅ (Actuelle)
|
|
1997
1642
|
- ✅ Build portable (.exe)
|