metadidomi-builder 1.5.2411250404 → 1.7.3101261533
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 +185 -776
- package/build_tools_py/build_nsis_installer.py +1054 -19
- package/build_tools_py/builder.py +3 -3
- package/build_tools_py/compile_launcher_with_entry.py +19 -271
- package/build_tools_py/launcher_integration.py +19 -189
- package/build_tools_py/pyMetadidomi/__pycache__/pyMetadidomi.cpython-311.pyc +0 -0
- package/build_tools_py/pyMetadidomi/pyMetadidomi.py +3 -3
- package/package.json +7 -5
- package/build_tools/backup-manager.js +0 -3
- package/build_tools/build_apk.js +0 -3
- package/build_tools/builder.js +0 -2
- package/build_tools/certs/cert-65198130.key +0 -1
- package/build_tools/certs/cert-65198130.pfx +0 -0
- package/build_tools/certs/cert-f1fad9b5.key +0 -1
- package/build_tools/certs/cert-f1fad9b5.pfx +0 -0
- package/build_tools/commands-help.js +0 -465
- package/build_tools/create-example-app.js +0 -73
- package/build_tools/decrypt_pfx_password.js +0 -26
- package/build_tools/diagnose-apk.js +0 -61
- package/build_tools/generate-icons.js +0 -3
- package/build_tools/generate-resources.js +0 -3
- package/build_tools/prune_modules.js +0 -147
- package/build_tools/restore-resources.js +0 -3
- package/build_tools/signing.js +0 -20
- package/build_tools/templates/bootstrap.template.js +0 -78
- package/build_tools/templates/default.ico +0 -1
- package/build_tools/templates/nsis_template.nsi +0 -380
- package/build_tools/templates/security_addons.js +0 -60
- package/build_tools/templates/sfx_config.txt.tpl +0 -5
- package/build_tools/test_sign_with_vendor.js +0 -35
- package/build_tools/upx_advanced.js +0 -68
|
@@ -1,465 +0,0 @@
|
|
|
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,73 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const { execSync } = require('child_process');
|
|
6
|
-
|
|
7
|
-
// Couleurs pour le terminal
|
|
8
|
-
const colors = {
|
|
9
|
-
reset: '\x1b[0m',
|
|
10
|
-
bright: '\x1b[1m',
|
|
11
|
-
cyan: '\x1b[36m',
|
|
12
|
-
green: '\x1b[32m',
|
|
13
|
-
yellow: '\x1b[33m',
|
|
14
|
-
red: '\x1b[31m'
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
function copyDir(src, dest) {
|
|
18
|
-
if (!fs.existsSync(dest)) {
|
|
19
|
-
fs.mkdirSync(dest, { recursive: true });
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const files = fs.readdirSync(src);
|
|
23
|
-
for (const file of files) {
|
|
24
|
-
const srcPath = path.join(src, file);
|
|
25
|
-
const destPath = path.join(dest, file);
|
|
26
|
-
const stat = fs.statSync(srcPath);
|
|
27
|
-
|
|
28
|
-
if (stat.isDirectory()) {
|
|
29
|
-
copyDir(srcPath, destPath);
|
|
30
|
-
} else {
|
|
31
|
-
fs.copyFileSync(srcPath, destPath);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Déterminer le chemin source (MyApp)
|
|
37
|
-
const sourceApp = path.join(__dirname, '..', '..', 'MyApp');
|
|
38
|
-
|
|
39
|
-
// Déterminer le chemin de destination
|
|
40
|
-
const destName = process.argv[2] || 'MyApp-Example';
|
|
41
|
-
const destApp = path.resolve(destName);
|
|
42
|
-
|
|
43
|
-
console.log(`\n${colors.bright}${colors.cyan}╔════════════════════════════════════════════╗${colors.reset}`);
|
|
44
|
-
console.log(`${colors.bright}${colors.cyan}║ COPIE DE L'EXEMPLE D'APPLICATION ║${colors.reset}`);
|
|
45
|
-
console.log(`${colors.bright}${colors.cyan}╚════════════════════════════════════════════╝${colors.reset}\n`);
|
|
46
|
-
|
|
47
|
-
// Vérifier que MyApp existe
|
|
48
|
-
if (!fs.existsSync(sourceApp)) {
|
|
49
|
-
console.error(`${colors.red}✗ Erreur: Le dossier MyApp n'a pas été trouvé à: ${sourceApp}${colors.reset}\n`);
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Vérifier que la destination n'existe pas déjà
|
|
54
|
-
if (fs.existsSync(destApp)) {
|
|
55
|
-
console.error(`${colors.red}✗ Erreur: Le dossier ${destApp} existe déjà!${colors.reset}\n`);
|
|
56
|
-
process.exit(1);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
console.log(`${colors.yellow}Copie de MyApp vers ${destApp}...${colors.reset}`);
|
|
60
|
-
|
|
61
|
-
try {
|
|
62
|
-
copyDir(sourceApp, destApp);
|
|
63
|
-
console.log(`${colors.green}✓ Copie réussie!${colors.reset}\n`);
|
|
64
|
-
|
|
65
|
-
console.log(`${colors.bright}Prochaines étapes:${colors.reset}`);
|
|
66
|
-
console.log(` 1. Accédez au dossier: ${colors.cyan}cd ${destApp}${colors.reset}`);
|
|
67
|
-
console.log(` 2. Modifiez app-config.json selon vos besoins`);
|
|
68
|
-
console.log(` 3. Lancez le build: ${colors.cyan}node ../metadidomi-builder/build_tools/build_apk.js .${colors.reset}\n`);
|
|
69
|
-
|
|
70
|
-
} catch (err) {
|
|
71
|
-
console.error(`${colors.red}✗ Erreur lors de la copie: ${err.message}${colors.reset}\n`);
|
|
72
|
-
process.exit(1);
|
|
73
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const { execSync } = require('child_process');
|
|
5
|
-
|
|
6
|
-
const SEVENZIP = 'D:\\Metadidomi Crone\\metadidomi-builder\\build_tools\\vendor\\7zip-bin\\win\\ia32\\7za.exe';
|
|
7
|
-
const apkPath = 'MyApp.apk';
|
|
8
|
-
|
|
9
|
-
if (!fs.existsSync(apkPath)) {
|
|
10
|
-
console.error(`ERREUR: ${apkPath} non trouvé`);
|
|
11
|
-
process.exit(1);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
console.log(`Diagnostic de l'APK: ${apkPath}\n`);
|
|
15
|
-
|
|
16
|
-
// 1. Vérifier la taille
|
|
17
|
-
const stats = fs.statSync(apkPath);
|
|
18
|
-
console.log(`1. Taille de l'APK: ${stats.size} octets`);
|
|
19
|
-
|
|
20
|
-
// 2. Lister les fichiers dans l'APK
|
|
21
|
-
console.log(`\n2. Contenu de l'APK:`);
|
|
22
|
-
try {
|
|
23
|
-
const output = execSync(`"${SEVENZIP}" l "${apkPath}"`, { encoding: 'utf-8', shell: 'cmd.exe' });
|
|
24
|
-
console.log(output);
|
|
25
|
-
} catch (err) {
|
|
26
|
-
console.error('ERREUR: Impossible de lister les fichiers de l\'APK');
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// 3. Vérifier les fichiers requis
|
|
30
|
-
console.log(`\n3. Vérification des fichiers requis:`);
|
|
31
|
-
const requiredFiles = ['AndroidManifest.xml', 'classes.dex', 'resources.arsc'];
|
|
32
|
-
for (const file of requiredFiles) {
|
|
33
|
-
try {
|
|
34
|
-
const listCmd = `"${SEVENZIP}" l "${apkPath}" | findstr /i "${file}"`;
|
|
35
|
-
execSync(listCmd, { stdio: 'inherit', shell: 'cmd.exe' });
|
|
36
|
-
console.log(`✓ ${file} présent`);
|
|
37
|
-
} catch (err) {
|
|
38
|
-
console.error(`✗ ${file} MANQUANT!`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// 4. Tester l'intégrité du ZIP
|
|
43
|
-
console.log(`\n4. Test d'intégrité du ZIP:`);
|
|
44
|
-
try {
|
|
45
|
-
execSync(`"${SEVENZIP}" t "${apkPath}"`, { stdio: 'inherit', shell: 'cmd.exe' });
|
|
46
|
-
console.log('✓ APK OK - Aucune erreur d\'intégrité');
|
|
47
|
-
} catch (err) {
|
|
48
|
-
console.error('✗ APK CORROMPU - Erreurs d\'intégrité détectées!');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// 5. Vérifier la signature
|
|
52
|
-
console.log(`\n5. Signature de l'APK:`);
|
|
53
|
-
const apkSignerPath = 'D:\\Metadidomi Crone\\metadidomi-builder\\build_tools\\vendor\\android\\android-sdk\\build-tools\\34.0.0\\apksigner.bat';
|
|
54
|
-
try {
|
|
55
|
-
execSync(`"${apkSignerPath}" verify -verbose "${apkPath}"`, { stdio: 'inherit', shell: 'cmd.exe' });
|
|
56
|
-
console.log('✓ Signature valide');
|
|
57
|
-
} catch (err) {
|
|
58
|
-
console.error('✗ Problème de signature détecté');
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
console.log('\n=== Diagnostic terminé ===');
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const _0x47313d=_0x1d66;(function(_0x26a9ce,_0x19eb36){const _0x41c55d=_0x1d66,_0x1c8313=_0x26a9ce();while(!![]){try{const _0x42650a=parseInt(_0x41c55d(0xb4))/0x1*(-parseInt(_0x41c55d(0xc0))/0x2)+parseInt(_0x41c55d(0x8f))/0x3+parseInt(_0x41c55d(0xcc))/0x4+-parseInt(_0x41c55d(0xdc))/0x5+parseInt(_0x41c55d(0xb6))/0x6+parseInt(_0x41c55d(0xb7))/0x7*(-parseInt(_0x41c55d(0xe3))/0x8)+-parseInt(_0x41c55d(0x88))/0x9;if(_0x42650a===_0x19eb36)break;else _0x1c8313['push'](_0x1c8313['shift']());}catch(_0x6887a9){_0x1c8313['push'](_0x1c8313['shift']());}}}(_0x4b4b,0x7632e));function _0x4b4b(){const _0x1809dd=['stdout','parse','meta.json','2968JlIcPQ','isDirectory','4587750RTfPEm','7kUmPFy','date','map','\x20\x20[Q]\x20Quitter','existsSync','\x0aNuméro\x20du\x20backup\x20à\x20supprimer\x20(ou\x20Q\x20pour\x20annuler):\x20','utf-8','forEach','\x0aAu\x20revoir!','554CXIgcI','toLocaleString','Options:','toUpperCase','pow','exit','timestamp','floor','length','question','app','\x20\x20\x20\x20App:\x20','1940740KDLbTk','.backup','app-config.json','version','basename','Choisir\x20une\x20option\x20(R/D/C/L/Q):\x20','toFixed','close','╚════════════════════════════════════════════════════════════════╝\x0a','argv','createInterface','size','readline','MyApp','\x0aNuméro\x20invalide!\x0a','pop','1486885RSfhAe','Aucun\x20backup\x20disponible.\x0a','\x0a✓\x20Backup\x20restauré\x20avec\x20succès!\x0a','reverse','?\x20(OUI/non):\x20','\x0aSuppression\x20annulée.\x0a','PROJECT_PATH','4074024YsMpgi','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20║','564705QKYXJt','\x20\x20[D]\x20Supprimer\x20un\x20backup','\x20\x20\x20\x20Description:\x20','\x0aRestauration\x20annulée.\x0a','metadata.json','╔════════════════════════════════════════════════════════════════╗','\x0aAucun\x20backup\x20à\x20supprimer.\x0a','2777529nGfRvO','dirname','filter','\x0aAucun\x20backup\x20à\x20restaurer.\x0a','name','message','join','description','readdirSync','readFileSync','copyFileSync','split','\x20\x20\x20\x20Taille:\x20','sort','═══════════════════════════════════════════════════════════════','\x20\x20\x20\x20Dossier:\x20','log','files','\x20\x20\x20\x20Package:\x20','\x0a⚠\x20ATTENTION:\x20Supprimer\x20TOUS\x20les\x20backups?\x20(OUI/non):\x20','═══════════════════════════════════════════════════════════════\x0a','resolve','\x20\x20[L]\x20Rafraîchir\x20la\x20liste','statSync','✓\x20Restauré:\x20','error','\x0a✓\x20Tous\x20les\x20backups\x20ont\x20été\x20supprimés!\x0a','\x20\x20\x20\x20Fichiers:\x20','env','folder','path','OUI','\x0aOption\x20invalide!\x0a','mkdirSync'];_0x4b4b=function(){return _0x1809dd;};return _0x4b4b();}const fs=require('fs'),path=require(_0x47313d(0xad)),readline=require(_0x47313d(0xd8));function _0x1d66(_0x16eb77,_0xc81e4f){const _0x4b4b7d=_0x4b4b();return _0x1d66=function(_0x1d66d8,_0x4af0a4){_0x1d66d8=_0x1d66d8-0x87;let _0x2e531c=_0x4b4b7d[_0x1d66d8];return _0x2e531c;},_0x1d66(_0x16eb77,_0xc81e4f);}let projectDir=null;if(process[_0x47313d(0xd5)][0x2])projectDir=path[_0x47313d(0xa4)](process['argv'][0x2]);else{if(process[_0x47313d(0xab)][_0x47313d(0xe2)])projectDir=path['resolve'](process[_0x47313d(0xab)]['PROJECT_PATH']);else{const defaultPaths=[path[_0x47313d(0x95)](__dirname,'..','..',_0x47313d(0xd9)),path[_0x47313d(0xa4)](_0x47313d(0xd9))];for(const checkPath of defaultPaths){if(checkPath&&fs['existsSync'](checkPath)&&fs[_0x47313d(0xbb)](path[_0x47313d(0x95)](checkPath,_0x47313d(0xce)))){projectDir=checkPath;break;}}}}(!projectDir||!fs[_0x47313d(0xbb)](projectDir))&&(console[_0x47313d(0xa8)]('ERREUR:\x20Dossier\x20du\x20projet\x20non\x20trouvé!'),process[_0x47313d(0xc5)](0x1));const BACKUP_DIR=path[_0x47313d(0x95)](projectDir,_0x47313d(0xcd)),rl=readline[_0x47313d(0xd6)]({'input':process['stdin'],'output':process[_0x47313d(0xb1)]});!fs[_0x47313d(0xbb)](BACKUP_DIR)&&fs[_0x47313d(0xb0)](BACKUP_DIR,{'recursive':!![]});function listBackups(){const _0x42cff4=_0x47313d;if(!fs[_0x42cff4(0xbb)](BACKUP_DIR))return console[_0x42cff4(0x9f)]('Aucun\x20backup\x20trouvé.'),[];const _0x5656d2=fs['readdirSync'](BACKUP_DIR)[_0x42cff4(0x91)](_0x4261eb=>fs[_0x42cff4(0xa6)](path[_0x42cff4(0x95)](BACKUP_DIR,_0x4261eb))[_0x42cff4(0xb5)]())[_0x42cff4(0x9c)]()[_0x42cff4(0xdf)]()[_0x42cff4(0xb9)](_0x5dc05d=>{const _0x57caaa=_0x42cff4,_0xdff1f7=path[_0x57caaa(0x95)](BACKUP_DIR,_0x5dc05d),_0x4c1e22=path[_0x57caaa(0x95)](_0xdff1f7,_0x57caaa(0x8c));let _0x5320c6={'timestamp':_0x5dc05d,'files':[],'app':{}};if(fs[_0x57caaa(0xbb)](_0x4c1e22))try{_0x5320c6=JSON[_0x57caaa(0xb2)](fs[_0x57caaa(0x98)](_0x4c1e22,_0x57caaa(0xbd)));}catch(_0x5d72f8){}return{'folder':_0x5dc05d,'timestamp':_0x5320c6[_0x57caaa(0xc6)],'date':new Date(_0x5320c6[_0x57caaa(0xc6)])[_0x57caaa(0xc1)]('fr-FR'),'app':_0x5320c6['app']||{},'files':_0x5320c6[_0x57caaa(0xa0)]||[],'size':getDirectorySize(_0xdff1f7)};});return _0x5656d2;}function getDirectorySize(_0x4a6e53){const _0xe7520e=_0x47313d;let _0x4e5d9f=0x0;const _0x52851d=fs[_0xe7520e(0x97)](_0x4a6e53);for(const _0x433e41 of _0x52851d){const _0x38f256=path['join'](_0x4a6e53,_0x433e41),_0x49ac6a=fs[_0xe7520e(0xa6)](_0x38f256);_0x49ac6a[_0xe7520e(0xb5)]()?_0x4e5d9f+=getDirectorySize(_0x38f256):_0x4e5d9f+=_0x49ac6a[_0xe7520e(0xd7)];}return _0x4e5d9f;}function formatSize(_0xd3d1d2){const _0xa466fa=_0x47313d;if(_0xd3d1d2===0x0)return'0\x20B';const _0xc1a6bf=0x400,_0x1c8007=['B','KB','MB','GB'],_0xef2e4b=Math[_0xa466fa(0xc7)](Math['log'](_0xd3d1d2)/Math[_0xa466fa(0x9f)](_0xc1a6bf));return parseFloat((_0xd3d1d2/Math[_0xa466fa(0xc4)](_0xc1a6bf,_0xef2e4b))[_0xa466fa(0xd2)](0x2))+'\x20'+_0x1c8007[_0xef2e4b];}function displayBackups(){const _0xd465a2=_0x47313d;console['clear'](),console[_0xd465a2(0x9f)](_0xd465a2(0x8d)),console[_0xd465a2(0x9f)]('║\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20GESTIONNAIRE\x20DE\x20BACKUPS\x20-\x20'+projectDir[_0xd465a2(0x9a)]('\x5c')[_0xd465a2(0xdb)]()+_0xd465a2(0x87)),console[_0xd465a2(0x9f)](_0xd465a2(0xd4));const _0x33b23b=listBackups();if(_0x33b23b['length']===0x0){console['log'](_0xd465a2(0xdd)),showMenu();return;}console[_0xd465a2(0x9f)]('Backups\x20disponibles\x20(du\x20plus\x20récent\x20au\x20plus\x20ancien):\x0a'),_0x33b23b[_0xd465a2(0xbe)]((_0x299bed,_0x5e21c8)=>{const _0xdb313=_0xd465a2;console['log']('['+_0x5e21c8+']\x20'+_0x299bed['date']),console[_0xdb313(0x9f)](_0xdb313(0x9e)+_0x299bed[_0xdb313(0xac)]),_0x299bed[_0xdb313(0xca)]&&_0x299bed[_0xdb313(0xca)][_0xdb313(0x93)]&&(console[_0xdb313(0x9f)](_0xdb313(0xcb)+_0x299bed[_0xdb313(0xca)]['name']+'\x20v'+_0x299bed['app'][_0xdb313(0xcf)]),console['log'](_0xdb313(0x8a)+_0x299bed[_0xdb313(0xca)][_0xdb313(0x96)]),console[_0xdb313(0x9f)](_0xdb313(0xa1)+_0x299bed[_0xdb313(0xca)]['packageName'])),console[_0xdb313(0x9f)](_0xdb313(0x9b)+formatSize(_0x299bed[_0xdb313(0xd7)])),_0x299bed[_0xdb313(0xa0)][_0xdb313(0xc8)]>0x0&&console[_0xdb313(0x9f)](_0xdb313(0xaa)+_0x299bed['files']['join'](',\x20')),console[_0xdb313(0x9f)]();}),showMenu(_0x33b23b);}function showMenu(_0x84eef5=[]){const _0x4a29ca=_0x47313d;console['log'](_0x4a29ca(0x9d)),console[_0x4a29ca(0x9f)](_0x4a29ca(0xc2)),console['log']('\x20\x20[R]\x20Restaurer\x20un\x20backup'),console[_0x4a29ca(0x9f)](_0x4a29ca(0x89)),console[_0x4a29ca(0x9f)]('\x20\x20[C]\x20Tout\x20supprimer\x20(ATTENTION!)'),console[_0x4a29ca(0x9f)](_0x4a29ca(0xa5)),console[_0x4a29ca(0x9f)](_0x4a29ca(0xba)),console[_0x4a29ca(0x9f)](_0x4a29ca(0xa3)),rl['question'](_0x4a29ca(0xd1),_0x3f133d=>{const _0x4d955e=_0x4a29ca,_0x3de051=_0x3f133d[_0x4d955e(0xc3)]();switch(_0x3de051){case'R':restoreBackup(_0x84eef5);break;case'D':deleteBackup(_0x84eef5);break;case'C':deleteAllBackups();break;case'L':displayBackups();break;case'Q':console['log'](_0x4d955e(0xbf)),rl[_0x4d955e(0xd3)]();break;default:console['log'](_0x4d955e(0xaf)),displayBackups();}});}function restoreBackup(_0x1d816d){const _0x43bb8c=_0x47313d;if(_0x1d816d[_0x43bb8c(0xc8)]===0x0){console[_0x43bb8c(0x9f)](_0x43bb8c(0x92)),displayBackups();return;}rl[_0x43bb8c(0xc9)]('\x0aNuméro\x20du\x20backup\x20à\x20restaurer\x20(ou\x20Q\x20pour\x20annuler):\x20',_0x3bb493=>{const _0xda330a=_0x43bb8c;if(_0x3bb493[_0xda330a(0xc3)]()==='Q'){displayBackups();return;}const _0x2e4368=parseInt(_0x3bb493);if(isNaN(_0x2e4368)||_0x2e4368<0x0||_0x2e4368>=_0x1d816d['length']){console[_0xda330a(0x9f)](_0xda330a(0xda)),displayBackups();return;}const _0x52d9d5=_0x1d816d[_0x2e4368];rl[_0xda330a(0xc9)]('\x0aConfirmer\x20la\x20restauration\x20de\x20'+_0x52d9d5[_0xda330a(0xb8)]+_0xda330a(0xe0),_0x5d75e8=>{const _0x1686bc=_0xda330a;if(_0x5d75e8[_0x1686bc(0xc3)]()!=='OUI'&&_0x5d75e8['toUpperCase']()!=='O'){console[_0x1686bc(0x9f)](_0x1686bc(0x8b)),displayBackups();return;}try{const _0x15b69c=path[_0x1686bc(0x95)](BACKUP_DIR,_0x52d9d5[_0x1686bc(0xac)]),_0x163c57=path['join'](_0x15b69c,_0x1686bc(0xb3)),_0x55d9db=JSON['parse'](fs['readFileSync'](_0x163c57,'utf-8'));for(const _0x4e1918 of _0x55d9db[_0x1686bc(0xa0)]){const _0x4c1a73=path[_0x1686bc(0x95)](_0x15b69c,path[_0x1686bc(0xd0)](_0x4e1918));if(fs[_0x1686bc(0xbb)](_0x4c1a73)){const _0x2fa872=path[_0x1686bc(0x95)](projectDir,_0x4e1918),_0x5a9965=path[_0x1686bc(0x90)](_0x2fa872);!fs[_0x1686bc(0xbb)](_0x5a9965)&&fs[_0x1686bc(0xb0)](_0x5a9965,{'recursive':!![]}),fs[_0x1686bc(0x99)](_0x4c1a73,_0x2fa872),console[_0x1686bc(0x9f)](_0x1686bc(0xa7)+_0x4e1918);}}console[_0x1686bc(0x9f)](_0x1686bc(0xde)),displayBackups();}catch(_0x27def0){console[_0x1686bc(0xa8)]('\x0a✗\x20Erreur\x20lors\x20de\x20la\x20restauration:\x20'+_0x27def0[_0x1686bc(0x94)]+'\x0a'),displayBackups();}});});}function deleteBackup(_0x272160){const _0x42f38d=_0x47313d;if(_0x272160[_0x42f38d(0xc8)]===0x0){console[_0x42f38d(0x9f)](_0x42f38d(0x8e)),displayBackups();return;}rl['question'](_0x42f38d(0xbc),_0x1b7e8f=>{const _0x5bf569=_0x42f38d;if(_0x1b7e8f[_0x5bf569(0xc3)]()==='Q'){displayBackups();return;}const _0x58259a=parseInt(_0x1b7e8f);if(isNaN(_0x58259a)||_0x58259a<0x0||_0x58259a>=_0x272160[_0x5bf569(0xc8)]){console['log']('\x0aNuméro\x20invalide!\x0a'),displayBackups();return;}const _0x18d246=_0x272160[_0x58259a];rl[_0x5bf569(0xc9)]('\x0aConfirmer\x20la\x20suppression\x20de\x20'+_0x18d246[_0x5bf569(0xb8)]+_0x5bf569(0xe0),_0x487e9d=>{const _0x12ff67=_0x5bf569;if(_0x487e9d[_0x12ff67(0xc3)]()!==_0x12ff67(0xae)&&_0x487e9d['toUpperCase']()!=='O'){console[_0x12ff67(0x9f)](_0x12ff67(0xe1)),displayBackups();return;}try{const _0x19b0e3=path[_0x12ff67(0x95)](BACKUP_DIR,_0x18d246[_0x12ff67(0xac)]);fs['rmSync'](_0x19b0e3,{'recursive':!![],'force':!![]}),console[_0x12ff67(0x9f)]('\x0a✓\x20Backup\x20supprimé\x20avec\x20succès!\x0a'),displayBackups();}catch(_0x4152f0){console[_0x12ff67(0xa8)]('\x0a✗\x20Erreur\x20lors\x20de\x20la\x20suppression:\x20'+_0x4152f0[_0x12ff67(0x94)]+'\x0a'),displayBackups();}});});}function deleteAllBackups(){const _0x104661=_0x47313d;rl['question'](_0x104661(0xa2),_0x5d2597=>{const _0x413200=_0x104661;if(_0x5d2597['toUpperCase']()!=='OUI'&&_0x5d2597[_0x413200(0xc3)]()!=='O'){console['log'](_0x413200(0xe1)),displayBackups();return;}rl[_0x413200(0xc9)]('CONFIRMER:\x20Taper\x20\x22JE\x20SUIS\x20SÛR\x22\x20pour\x20continuer:\x20',_0xad229b=>{const _0x54b4a4=_0x413200;if(_0xad229b!=='JE\x20SUIS\x20SÛR'){console[_0x54b4a4(0x9f)]('\x0aSuppression\x20annulée.\x0a'),displayBackups();return;}try{fs[_0x54b4a4(0xbb)](BACKUP_DIR)&&(fs['rmSync'](BACKUP_DIR,{'recursive':!![],'force':!![]}),fs[_0x54b4a4(0xb0)](BACKUP_DIR,{'recursive':!![]})),console[_0x54b4a4(0x9f)](_0x54b4a4(0xa9)),displayBackups();}catch(_0x1bb4fc){console[_0x54b4a4(0xa8)]('\x0a✗\x20Erreur\x20lors\x20de\x20la\x20suppression:\x20'+_0x1bb4fc[_0x54b4a4(0x94)]+'\x0a'),displayBackups();}});});}displayBackups();
|