metadidomi-builder 1.4.171125 → 1.4.201125
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.
- package/README.md +565 -136
- package/build_tools/builder.js +1 -1
- package/build_tools/certs/cert-65198130.key +1 -0
- package/build_tools/certs/cert-65198130.pfx +0 -0
- package/build_tools/certs/cert-f1fad9b5.key +1 -0
- package/build_tools/certs/cert-f1fad9b5.pfx +0 -0
- package/build_tools/commands-help.js +465 -0
- package/build_tools/decrypt_pfx_password.js +26 -1
- package/build_tools/templates/nsis_template.nsi +8 -9
- package/build_tools_py/__pycache__/build_android_apk.cpython-311.pyc +0 -0
- package/build_tools_py/__pycache__/build_apk_complete.cpython-311.pyc +0 -0
- package/build_tools_py/__pycache__/build_apk_offline.cpython-311.pyc +0 -0
- package/build_tools_py/__pycache__/build_apk_real.cpython-311.pyc +0 -0
- package/build_tools_py/__pycache__/build_apk_ui.cpython-311.pyc +0 -0
- package/build_tools_py/build_nsis_installer.py +3 -3
- package/build_tools_py/builder.py +3 -3
- package/build_tools_py/pyMetadidomi/__pycache__/pyMetadidomi.cpython-311.pyc +0 -0
- package/build_tools_py/pyMetadidomi/pyMetadidomi-obf.py +19 -0
- package/build_tools_py/pyMetadidomi/pyMetadidomi.py +1675 -15
- package/build_tools_py/templates/gradle_build.template +46 -0
- package/build_tools_py/templates/settings_gradle.template +18 -0
- package/package.json +18 -6
- package/build_tools/7zsd.sfx +0 -0
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* commands-help.js
|
|
4
|
+
* Affiche toutes les commandes disponibles avec explications et exemples
|
|
5
|
+
* Détecte le type de projet (Electron ou Python) et affiche les commandes appropriées
|
|
6
|
+
*
|
|
7
|
+
* Utilisation:
|
|
8
|
+
* node commands-help.js
|
|
9
|
+
* npm run help
|
|
10
|
+
* npx metadidomi-builder-help
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const fs = require('fs');
|
|
14
|
+
const path = require('path');
|
|
15
|
+
|
|
16
|
+
// Couleurs pour le terminal
|
|
17
|
+
const colors = {
|
|
18
|
+
reset: '\x1b[0m',
|
|
19
|
+
bright: '\x1b[1m',
|
|
20
|
+
dim: '\x1b[2m',
|
|
21
|
+
cyan: '\x1b[36m',
|
|
22
|
+
green: '\x1b[32m',
|
|
23
|
+
yellow: '\x1b[33m',
|
|
24
|
+
red: '\x1b[31m',
|
|
25
|
+
blue: '\x1b[34m',
|
|
26
|
+
magenta: '\x1b[35m'
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Déterminer le type de projet
|
|
30
|
+
function detectProjectType() {
|
|
31
|
+
const cwd = process.cwd();
|
|
32
|
+
const packageJsonPath = path.join(cwd, 'package.json');
|
|
33
|
+
const configPyPath = path.join(cwd, 'config.py');
|
|
34
|
+
const mainPyPath = path.join(cwd, '__main__.py');
|
|
35
|
+
|
|
36
|
+
if (fs.existsSync(configPyPath) || fs.existsSync(mainPyPath)) {
|
|
37
|
+
return 'python';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (fs.existsSync(packageJsonPath)) {
|
|
41
|
+
try {
|
|
42
|
+
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
43
|
+
if (pkg.dependencies?.electron || pkg.devDependencies?.electron) {
|
|
44
|
+
return 'electron';
|
|
45
|
+
}
|
|
46
|
+
} catch (e) {
|
|
47
|
+
// Ignorer les erreurs de parsing
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return 'unknown';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Commandes pour Electron
|
|
55
|
+
const electronCommands = {
|
|
56
|
+
'build': {
|
|
57
|
+
description: 'Crée un installateur Windows NSIS professionnel',
|
|
58
|
+
command: 'npm run build',
|
|
59
|
+
alternatives: ['npx metadidomi-builder', 'node build_tools/builder.js'],
|
|
60
|
+
output: './dist/MonApp-Setup-1.0.0.exe',
|
|
61
|
+
details: 'Installateur avec options d\'installation, raccourcis, démarrage automatique.',
|
|
62
|
+
useCases: ['Distribution standard', 'Installation avec assistant']
|
|
63
|
+
},
|
|
64
|
+
'build:lite': {
|
|
65
|
+
description: 'Build optimisé - analyse et exclut les modules inutiles',
|
|
66
|
+
command: 'npm run build:lite',
|
|
67
|
+
alternatives: ['set LITE_BUILD=true && npx metadidomi-builder'],
|
|
68
|
+
output: './dist/MonApp-Setup-1.0.0.exe',
|
|
69
|
+
details: 'Analyse les dépendances, génère un rapport, crée un installateur optimisé.',
|
|
70
|
+
useCases: ['Distribution minimale', 'Réduction de la taille']
|
|
71
|
+
},
|
|
72
|
+
'build:portable': {
|
|
73
|
+
description: 'Exécutable portable autonome - sans installation requise',
|
|
74
|
+
command: 'npm run build:portable',
|
|
75
|
+
alternatives: ['set CREATE_PORTABLE_EXE=true && npx metadidomi-builder'],
|
|
76
|
+
output: './dist/MonApp.exe (~130MB)',
|
|
77
|
+
details: 'Exécutable indépendant qui s\'exécute directement sans installation.',
|
|
78
|
+
useCases: ['Distribution sur USB', 'Environnements restreints', 'Portabilité maximale']
|
|
79
|
+
},
|
|
80
|
+
'build:encrypted': {
|
|
81
|
+
description: 'Build avec clé de chiffrement personnalisée',
|
|
82
|
+
command: 'set KEY=votre-clé-secrète && npm run build',
|
|
83
|
+
alternatives: ['set KEY=my-secret-key && npx metadidomi-builder'],
|
|
84
|
+
output: './dist/MonApp-Setup-1.0.0.exe (chiffré)',
|
|
85
|
+
details: 'Chiffre les ressources avec votre clé personnalisée (défaut: clé auto-générée).',
|
|
86
|
+
useCases: ['Protection de ressources', 'Authentification personnalisée', 'Sécurité avancée']
|
|
87
|
+
},
|
|
88
|
+
'build:upx': {
|
|
89
|
+
description: 'Build avec compression UPX avancée',
|
|
90
|
+
command: 'set USE_UPX=true && npm run build',
|
|
91
|
+
alternatives: ['set USE_UPX=true && npx metadidomi-builder'],
|
|
92
|
+
output: './dist/MonApp-Setup-1.0.0.exe (compressé)',
|
|
93
|
+
details: 'Réduit la taille de l\'exécutable avec compression UPX. Mode rapide par défaut.',
|
|
94
|
+
useCases: ['Réduction de la taille finale', 'Distribution mobile/réseau lent']
|
|
95
|
+
},
|
|
96
|
+
'build:full': {
|
|
97
|
+
description: 'Build ULTRA: Portable + LITE + UPX + Chiffrement',
|
|
98
|
+
command: 'set CREATE_PORTABLE_EXE=true && set LITE_BUILD=true && set USE_UPX=true && set KEY=secret && npm run build',
|
|
99
|
+
alternatives: [],
|
|
100
|
+
output: './dist/MonApp.exe (optimisé, portable, chiffré, compressé)',
|
|
101
|
+
details: 'Combine tous les optimisations: portable, LITE, UPX et chiffrement personnalisé.',
|
|
102
|
+
useCases: ['Distribution ultra-optimisée', 'Sécurité maximale + performance', 'Usage multi-plateformes']
|
|
103
|
+
},
|
|
104
|
+
'build:protected': {
|
|
105
|
+
description: 'Build avec protection du code (obfuscation + chiffrement)',
|
|
106
|
+
command: 'npm run build -- --medium-protection',
|
|
107
|
+
alternatives: ['npx metadidomi-builder --light-protection', 'npx metadidomi-builder --heavy-protection'],
|
|
108
|
+
output: './dist/MonApp-Setup-1.0.0.exe (protégé)',
|
|
109
|
+
details: 'Obfusque et chiffre le code pour éviter l\'analyse reverse-engineering.',
|
|
110
|
+
useCases: ['Protection IP', 'Code propriétaire sensible', 'Anti-piratage']
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// Commandes pour Python
|
|
115
|
+
const pythonCommands = {
|
|
116
|
+
'build:python': {
|
|
117
|
+
description: 'Build d\'application Python en mode console',
|
|
118
|
+
command: 'npm run build:python',
|
|
119
|
+
alternatives: ['node build_tools_py/builder.py', 'npx metadidomi-builder-python'],
|
|
120
|
+
output: './dist/MonApp-Setup-1.0.0.exe',
|
|
121
|
+
details: 'Compile une application Python avec fenêtre console visible.',
|
|
122
|
+
useCases: ['Applications CLI', 'Affichage des logs', 'Debugging']
|
|
123
|
+
},
|
|
124
|
+
'build:python:gui': {
|
|
125
|
+
description: 'Build d\'application Python en mode GUI (sans console)',
|
|
126
|
+
command: 'npm run build:python:gui',
|
|
127
|
+
alternatives: ['node build_tools_py/builder.py --gui'],
|
|
128
|
+
output: './dist/MonApp-Setup-1.0.0.exe',
|
|
129
|
+
details: 'Compile une application Python sans fenêtre console (idéal pour Tkinter).',
|
|
130
|
+
useCases: ['Applications GUI Tkinter', 'Applications de bureau', 'Interface graphique']
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// Commandes universelles (tous les projets)
|
|
135
|
+
const universalCommands = {
|
|
136
|
+
'help': {
|
|
137
|
+
description: 'Affiche toutes les commandes disponibles',
|
|
138
|
+
command: 'node commands-help.js',
|
|
139
|
+
alternatives: ['npm run help', 'npx metadidomi-builder --help'],
|
|
140
|
+
output: 'Cet affichage',
|
|
141
|
+
details: 'Détecte le type de projet et affiche les commandes appropriées.',
|
|
142
|
+
useCases: ['Documentation locale', 'Référence rapide']
|
|
143
|
+
},
|
|
144
|
+
'build:signing': {
|
|
145
|
+
description: 'Build avec signature de code personnalisée',
|
|
146
|
+
command: 'set PFX_PATH=cert.pfx && set PFX_PASS=password && npm run build',
|
|
147
|
+
alternatives: ['set PFX_PASS=*** && npx metadidomi-builder'],
|
|
148
|
+
output: './dist/MonApp-Setup-1.0.0.exe (signé)',
|
|
149
|
+
details: 'Signe l\'exécutable avec votre certificat personnalisé.',
|
|
150
|
+
useCases: ['Distribution professionnelle', 'Signature d\'entreprise', 'Distribution Microsoft Store']
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// Affichage du header
|
|
155
|
+
function printHeader() {
|
|
156
|
+
console.log(`\n${colors.bright}${colors.cyan}╔════════════════════════════════════════════════════════════════╗${colors.reset}`);
|
|
157
|
+
console.log(`${colors.bright}${colors.cyan}║${colors.reset}${colors.bright} 🚀 METADIDOMI BUILDER - COMMANDES DISPONIBLES ${colors.cyan}║${colors.reset}`);
|
|
158
|
+
console.log(`${colors.bright}${colors.cyan}╚════════════════════════════════════════════════════════════════╝${colors.reset}\n`);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Affichage d'une commande
|
|
162
|
+
function printCommand(key, cmd, index) {
|
|
163
|
+
console.log(`${colors.bright}${colors.green}${index}. ${key.toUpperCase()}${colors.reset}`);
|
|
164
|
+
console.log(` ${colors.dim}${cmd.description}${colors.reset}`);
|
|
165
|
+
console.log(` ${colors.blue}Commande:${colors.reset} ${colors.bright}${cmd.command}${colors.reset}`);
|
|
166
|
+
|
|
167
|
+
if (cmd.alternatives && cmd.alternatives.length > 0) {
|
|
168
|
+
console.log(` ${colors.yellow}Alternatives:${colors.reset}`);
|
|
169
|
+
cmd.alternatives.forEach(alt => {
|
|
170
|
+
console.log(` • ${alt}`);
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (cmd.output) {
|
|
175
|
+
console.log(` ${colors.magenta}Sortie:${colors.reset} ${cmd.output}`);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (cmd.details) {
|
|
179
|
+
console.log(` ${colors.dim}Details:${colors.reset} ${cmd.details}`);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (cmd.useCases && cmd.useCases.length > 0) {
|
|
183
|
+
console.log(` ${colors.cyan}Cas d'usage:${colors.reset}`);
|
|
184
|
+
cmd.useCases.forEach(use => {
|
|
185
|
+
console.log(` ✓ ${use}`);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
console.log('');
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Affichage des variables d'environnement
|
|
193
|
+
function printEnvironmentVariables() {
|
|
194
|
+
console.log(`${colors.bright}${colors.yellow}📋 VARIABLES D'ENVIRONNEMENT${colors.reset}`);
|
|
195
|
+
console.log(`${colors.dim}(Utilisables pour tous les builds)${colors.reset}\n`);
|
|
196
|
+
|
|
197
|
+
const vars = {
|
|
198
|
+
'KEY': {
|
|
199
|
+
description: 'Clé de chiffrement personnalisée',
|
|
200
|
+
example: 'set KEY=ma-clé-secrète && npm run build',
|
|
201
|
+
default: 'Auto-générée (hex 32 chars)'
|
|
202
|
+
},
|
|
203
|
+
'CREATE_PORTABLE_EXE': {
|
|
204
|
+
description: 'Crée un exécutable portable au lieu d\'un installateur',
|
|
205
|
+
example: 'set CREATE_PORTABLE_EXE=true && npm run build',
|
|
206
|
+
default: 'false'
|
|
207
|
+
},
|
|
208
|
+
'LITE_BUILD': {
|
|
209
|
+
description: 'Mode LITE pour optimiser les dépendances',
|
|
210
|
+
example: 'set LITE_BUILD=true && npm run build',
|
|
211
|
+
default: 'false'
|
|
212
|
+
},
|
|
213
|
+
'USE_UPX': {
|
|
214
|
+
description: 'Applique la compression UPX (mode rapide par défaut)',
|
|
215
|
+
example: 'set USE_UPX=true && npm run build',
|
|
216
|
+
default: 'false'
|
|
217
|
+
},
|
|
218
|
+
'PFX_PATH': {
|
|
219
|
+
description: 'Chemin vers le certificat de signature (.pfx)',
|
|
220
|
+
example: 'set PFX_PATH=C:\\cert.pfx && npm run build',
|
|
221
|
+
default: 'Certificat auto-signé généré'
|
|
222
|
+
},
|
|
223
|
+
'PFX_PASS': {
|
|
224
|
+
description: 'Mot de passe du certificat de signature',
|
|
225
|
+
example: 'set PFX_PASS=password && npm run build',
|
|
226
|
+
default: 'Auto-généré'
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
let index = 1;
|
|
231
|
+
for (const [varName, info] of Object.entries(vars)) {
|
|
232
|
+
console.log(`${colors.bright}${index}. ${varName}${colors.reset}`);
|
|
233
|
+
console.log(` ${colors.dim}${info.description}${colors.reset}`);
|
|
234
|
+
console.log(` ${colors.yellow}Exemple:${colors.reset} ${info.example}`);
|
|
235
|
+
console.log(` ${colors.cyan}Défaut:${colors.reset} ${info.default}`);
|
|
236
|
+
console.log('');
|
|
237
|
+
index++;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Affichage des paramètres CLI
|
|
242
|
+
function printCLIParameters() {
|
|
243
|
+
console.log(`${colors.bright}${colors.yellow}⚙️ PARAMÈTRES CLI${colors.reset}`);
|
|
244
|
+
console.log(`${colors.dim}(Utilisables avec toutes les commandes)${colors.reset}\n`);
|
|
245
|
+
|
|
246
|
+
const params = {
|
|
247
|
+
'--app-src <chemin>': {
|
|
248
|
+
description: 'Dossier source personnalisé',
|
|
249
|
+
example: 'npx metadidomi-builder --app-src D:\\mon-app',
|
|
250
|
+
default: 'Répertoire courant'
|
|
251
|
+
},
|
|
252
|
+
'--output <chemin>': {
|
|
253
|
+
description: 'Dossier de sortie personnalisé',
|
|
254
|
+
example: 'npx metadidomi-builder --output D:\\dist',
|
|
255
|
+
default: './dist'
|
|
256
|
+
},
|
|
257
|
+
'--out <chemin>': {
|
|
258
|
+
description: 'Alias pour --output',
|
|
259
|
+
example: 'npx metadidomi-builder --out ./build',
|
|
260
|
+
default: './dist'
|
|
261
|
+
},
|
|
262
|
+
'--light-protection': {
|
|
263
|
+
description: 'Protection légère du code (obfuscation)',
|
|
264
|
+
example: 'npx metadidomi-builder --light-protection',
|
|
265
|
+
default: 'Pas de protection'
|
|
266
|
+
},
|
|
267
|
+
'--medium-protection': {
|
|
268
|
+
description: 'Protection moyenne (obfuscation + chiffrement)',
|
|
269
|
+
example: 'npx metadidomi-builder --medium-protection',
|
|
270
|
+
default: 'Pas de protection'
|
|
271
|
+
},
|
|
272
|
+
'--heavy-protection': {
|
|
273
|
+
description: 'Protection maximale (obfuscation heavy + chiffrement)',
|
|
274
|
+
example: 'npx metadidomi-builder --heavy-protection',
|
|
275
|
+
default: 'Pas de protection'
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
let index = 1;
|
|
280
|
+
for (const [param, info] of Object.entries(params)) {
|
|
281
|
+
console.log(`${colors.bright}${index}. ${param}${colors.reset}`);
|
|
282
|
+
console.log(` ${colors.dim}${info.description}${colors.reset}`);
|
|
283
|
+
console.log(` ${colors.yellow}Exemple:${colors.reset} ${info.example}`);
|
|
284
|
+
console.log(` ${colors.cyan}Défaut:${colors.reset} ${info.default}`);
|
|
285
|
+
console.log('');
|
|
286
|
+
index++;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// Affichage des exemples pratiques
|
|
291
|
+
function printExamples(projectType) {
|
|
292
|
+
console.log(`${colors.bright}${colors.magenta}💡 EXEMPLES PRATIQUES${colors.reset}`);
|
|
293
|
+
console.log(`${colors.dim}(Pour les projets ${projectType.toUpperCase()})${colors.reset}\n`);
|
|
294
|
+
|
|
295
|
+
const examples = projectType === 'electron' ? [
|
|
296
|
+
{
|
|
297
|
+
title: 'Build Standard Simple',
|
|
298
|
+
description: 'Crée un installateur professionnel',
|
|
299
|
+
commands: ['npm run build'],
|
|
300
|
+
result: './dist/MonApp-Setup-1.0.0.exe'
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
title: 'Build Portable Quick & Dirty',
|
|
304
|
+
description: 'Exécutable autonome sans installation',
|
|
305
|
+
commands: ['set CREATE_PORTABLE_EXE=true && npm run build'],
|
|
306
|
+
result: './dist/MonApp.exe (~130MB)'
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
title: 'Build LITE Ultra-Optimisé',
|
|
310
|
+
description: 'Analyse et exclut les modules inutiles',
|
|
311
|
+
commands: [
|
|
312
|
+
'npm run build:lite',
|
|
313
|
+
'ou',
|
|
314
|
+
'set LITE_BUILD=true && npm run build'
|
|
315
|
+
],
|
|
316
|
+
result: './dist/MonApp-Setup-1.0.0.exe (taille réduite)'
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
title: 'Build Sécurisé avec Chiffrement',
|
|
320
|
+
description: 'Chiffre les ressources avec clé personnalisée',
|
|
321
|
+
commands: [
|
|
322
|
+
'set KEY=ma-clé-ultra-secrète-123456 && npm run build',
|
|
323
|
+
'ou via npm run build:encrypted'
|
|
324
|
+
],
|
|
325
|
+
result: './dist/MonApp-Setup-1.0.0.exe (chiffré AES-256)'
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
title: 'Build Extrême: Portable + LITE + UPX + Chiffrement',
|
|
329
|
+
description: 'Combine tous les optimisations pour taille minimale + sécurité',
|
|
330
|
+
commands: [
|
|
331
|
+
'set CREATE_PORTABLE_EXE=true',
|
|
332
|
+
'set LITE_BUILD=true',
|
|
333
|
+
'set USE_UPX=true',
|
|
334
|
+
'set KEY=secret && npm run build'
|
|
335
|
+
],
|
|
336
|
+
result: './dist/MonApp.exe (ultra-compact, portable, sécurisé)'
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
title: 'Build Protégé avec Code Obfuscation',
|
|
340
|
+
description: 'Obfusque le code pour éviter reverse-engineering',
|
|
341
|
+
commands: ['npm run build -- --heavy-protection'],
|
|
342
|
+
result: './dist/MonApp-Setup-1.0.0.exe (code obfusqué)'
|
|
343
|
+
}
|
|
344
|
+
] : [
|
|
345
|
+
{
|
|
346
|
+
title: 'Build Python en Mode Console',
|
|
347
|
+
description: 'Application Python avec fenêtre console',
|
|
348
|
+
commands: ['npm run build:python'],
|
|
349
|
+
result: './dist/MonApp-Setup-1.0.0.exe'
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
title: 'Build Python GUI (Tkinter)',
|
|
353
|
+
description: 'Application Python sans fenêtre console',
|
|
354
|
+
commands: ['npm run build:python:gui'],
|
|
355
|
+
result: './dist/MonApp-Setup-1.0.0.exe'
|
|
356
|
+
}
|
|
357
|
+
];
|
|
358
|
+
|
|
359
|
+
examples.forEach((example, i) => {
|
|
360
|
+
console.log(`${colors.bright}${i + 1}. ${example.title}${colors.reset}`);
|
|
361
|
+
console.log(` ${colors.dim}${example.description}${colors.reset}`);
|
|
362
|
+
console.log(` ${colors.yellow}Commandes:${colors.reset}`);
|
|
363
|
+
example.commands.forEach(cmd => {
|
|
364
|
+
console.log(` $ ${colors.bright}${cmd}${colors.reset}`);
|
|
365
|
+
});
|
|
366
|
+
console.log(` ${colors.green}Résultat:${colors.reset} ${example.result}`);
|
|
367
|
+
console.log('');
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// Affichage des conseils de performance
|
|
372
|
+
function printPerformanceTips() {
|
|
373
|
+
console.log(`${colors.bright}${colors.yellow}⚡ CONSEILS DE PERFORMANCE${colors.reset}\n`);
|
|
374
|
+
|
|
375
|
+
const tips = [
|
|
376
|
+
{
|
|
377
|
+
title: 'Pour réduire la taille:',
|
|
378
|
+
items: ['Utilisez LITE_BUILD=true', 'Activez USE_UPX=true', 'Nettoyez node_modules avant le build']
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
title: 'Pour la sécurité:',
|
|
382
|
+
items: ['Utilisez KEY personnalisée', 'Ajoutez --heavy-protection', 'Signez le code avec PFX_PATH/PFX_PASS']
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
title: 'Pour le développement rapide:',
|
|
386
|
+
items: ['Utilisez npm run build sans options', 'Testez localement d\'abord', 'Utilisez CREATE_PORTABLE_EXE pour tester']
|
|
387
|
+
}
|
|
388
|
+
];
|
|
389
|
+
|
|
390
|
+
tips.forEach(tip => {
|
|
391
|
+
console.log(`${colors.cyan}• ${tip.title}${colors.reset}`);
|
|
392
|
+
tip.items.forEach(item => {
|
|
393
|
+
console.log(` ✓ ${item}`);
|
|
394
|
+
});
|
|
395
|
+
console.log('');
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// Fonction principale
|
|
400
|
+
function main() {
|
|
401
|
+
const projectType = detectProjectType();
|
|
402
|
+
|
|
403
|
+
printHeader();
|
|
404
|
+
|
|
405
|
+
// Détection du type de projet
|
|
406
|
+
console.log(`${colors.bright}${colors.blue}📁 TYPE DE PROJET DÉTECTÉ:${colors.reset} ${colors.bright}${projectType.toUpperCase()}${colors.reset}\n`);
|
|
407
|
+
|
|
408
|
+
if (projectType === 'electron') {
|
|
409
|
+
console.log(`${colors.bright}${colors.green}🎯 COMMANDES ELECTRON${colors.reset}\n`);
|
|
410
|
+
let index = 1;
|
|
411
|
+
for (const [key, cmd] of Object.entries(electronCommands)) {
|
|
412
|
+
printCommand(key, cmd, index);
|
|
413
|
+
index++;
|
|
414
|
+
}
|
|
415
|
+
} else if (projectType === 'python') {
|
|
416
|
+
console.log(`${colors.bright}${colors.green}🎯 COMMANDES PYTHON${colors.reset}\n`);
|
|
417
|
+
let index = 1;
|
|
418
|
+
for (const [key, cmd] of Object.entries(pythonCommands)) {
|
|
419
|
+
printCommand(key, cmd, index);
|
|
420
|
+
index++;
|
|
421
|
+
}
|
|
422
|
+
} else {
|
|
423
|
+
console.log(`${colors.yellow}⚠️ Type de projet inconnu - affichage de toutes les commandes${colors.reset}\n`);
|
|
424
|
+
console.log(`${colors.bright}${colors.green}🎯 COMMANDES ELECTRON${colors.reset}\n`);
|
|
425
|
+
let index = 1;
|
|
426
|
+
for (const [key, cmd] of Object.entries(electronCommands)) {
|
|
427
|
+
printCommand(key, cmd, index);
|
|
428
|
+
index++;
|
|
429
|
+
}
|
|
430
|
+
console.log(`${colors.bright}${colors.green}🎯 COMMANDES PYTHON${colors.reset}\n`);
|
|
431
|
+
index = 1;
|
|
432
|
+
for (const [key, cmd] of Object.entries(pythonCommands)) {
|
|
433
|
+
printCommand(key, cmd, index);
|
|
434
|
+
index++;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// Commandes universelles
|
|
439
|
+
console.log(`${colors.bright}${colors.green}🔧 COMMANDES UNIVERSELLES${colors.reset}\n`);
|
|
440
|
+
let index = 1;
|
|
441
|
+
for (const [key, cmd] of Object.entries(universalCommands)) {
|
|
442
|
+
printCommand(key, cmd, index);
|
|
443
|
+
index++;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// Variables d'environnement
|
|
447
|
+
printEnvironmentVariables();
|
|
448
|
+
|
|
449
|
+
// Paramètres CLI
|
|
450
|
+
printCLIParameters();
|
|
451
|
+
|
|
452
|
+
// Exemples pratiques
|
|
453
|
+
printExamples(projectType);
|
|
454
|
+
|
|
455
|
+
// Conseils de performance
|
|
456
|
+
printPerformanceTips();
|
|
457
|
+
|
|
458
|
+
// Footer
|
|
459
|
+
console.log(`${colors.bright}${colors.cyan}╔════════════════════════════════════════════════════════════════╗${colors.reset}`);
|
|
460
|
+
console.log(`${colors.bright}${colors.cyan}║${colors.reset} ${colors.dim}Pour plus d'informations, consultez le README.md ou la documentation${colors.reset} ${colors.bright}${colors.cyan}║${colors.reset}`);
|
|
461
|
+
console.log(`${colors.bright}${colors.cyan}╚════════════════════════════════════════════════════════════════╝${colors.reset}\n`);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// Exécuter
|
|
465
|
+
main();
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
const
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const crypto = require('crypto');
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
const certKeyPath = path.join(__dirname, 'certs', fs.readdirSync(path.join(__dirname,'certs')).find(f => f.endsWith('.key')));
|
|
7
|
+
if (!fs.existsSync(certKeyPath)) {
|
|
8
|
+
console.error('NO_KEY_FILE');
|
|
9
|
+
process.exit(2);
|
|
10
|
+
}
|
|
11
|
+
const raw = JSON.parse(fs.readFileSync(certKeyPath, 'utf8'));
|
|
12
|
+
const iv = Buffer.from(raw.iv, 'hex');
|
|
13
|
+
const key = Buffer.from(raw.key, 'hex');
|
|
14
|
+
const data = Buffer.from(raw.data, 'hex');
|
|
15
|
+
const tag = Buffer.from(raw.tag, 'hex');
|
|
16
|
+
|
|
17
|
+
const decipher = crypto.createDecipheriv('aes-256-gcm', key, iv);
|
|
18
|
+
decipher.setAuthTag(tag);
|
|
19
|
+
const decrypted = Buffer.concat([decipher.update(data), decipher.final()]);
|
|
20
|
+
const pwd = decrypted.toString('utf8');
|
|
21
|
+
// Print only the password
|
|
22
|
+
process.stdout.write(pwd);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.error('DECRYPT_ERROR', e.message);
|
|
25
|
+
process.exit(3);
|
|
26
|
+
}
|
|
@@ -105,20 +105,19 @@ Section "Application principale" SEC_MAIN
|
|
|
105
105
|
SetOverwrite on
|
|
106
106
|
|
|
107
107
|
; Vérifier que le répertoire source existe
|
|
108
|
-
IfFileExists "
|
|
109
|
-
MessageBox MB_ICONSTOP "Erreur: Les fichiers source sont introuvables dans
|
|
108
|
+
IfFileExists "${PAYLOAD_DIR}\*.*" +3
|
|
109
|
+
MessageBox MB_ICONSTOP "Erreur: Les fichiers source sont introuvables dans ${PAYLOAD_DIR}"
|
|
110
110
|
Abort
|
|
111
111
|
|
|
112
112
|
; Copier tous les fichiers
|
|
113
|
-
File /r "
|
|
113
|
+
File /r "${PAYLOAD_DIR}\*.*"
|
|
114
114
|
|
|
115
|
-
; Si c'est un projet Python, copier Python Embeddable
|
|
115
|
+
; Si c'est un projet Python, copier Python Embeddable (optionnel)
|
|
116
116
|
StrCmp "${APP_TYPE}" "python" 0 skipPythonEmbed
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
File /r ".\dist\python_embeddable\*.*"
|
|
117
|
+
; Le builder gère l'inclusion de Python Embeddable. Si aucun
|
|
118
|
+
; dossier "python_embeddable" n'est présent, cette étape est ignorée.
|
|
119
|
+
; Pour éviter les erreurs NSIS quand le dossier est absent, la copie
|
|
120
|
+
; est effectuée par le builder et non par le script NSIS.
|
|
122
121
|
skipPythonEmbed:
|
|
123
122
|
|
|
124
123
|
; Créer le désinstallateur
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|