metadidomi-builder 1.4.201125 → 1.6.2812251812
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 +1032 -572
- package/build_tools/backup-manager.js +3 -0
- package/build_tools/build_apk.js +3 -0
- package/build_tools/builder.js +2 -2
- package/build_tools/certs/cert-1a25871e.key +1 -0
- package/build_tools/certs/cert-1a25871e.pfx +0 -0
- package/build_tools/check-apk.js +211 -0
- package/build_tools/create-example-app.js +73 -0
- package/build_tools/decrypt_pfx_password.js +1 -26
- 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/manage-dependencies.js +3 -0
- package/build_tools/process-dependencies.js +203 -0
- package/build_tools/resolve-transitive-deps.js +3 -0
- package/build_tools/restore-resources.js +3 -0
- package/build_tools/setup-androidx.js +131 -0
- package/build_tools/templates/bootstrap.template.js +27 -0
- package/build_tools/verify-apk-dependencies.js +261 -0
- 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/README.md +98 -0
- package/build_tools_py/pyMetadidomi/__pycache__/pyMetadidomi.cpython-311.pyc +0 -0
- package/build_tools_py/pyMetadidomi/pyMetadidomi.py +16 -1675
- package/create-app.bat +31 -0
- package/create-app.ps1 +27 -0
- package/package.json +8 -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_py/pyMetadidomi/pyMetadidomi-obf.py +0 -19
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const https = require('https');
|
|
6
|
+
const http = require('http');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Gestionnaire automatique de dépendances
|
|
10
|
+
* Lit les dépendances depuis app-config.json et les traite automatiquement
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const projectDir = process.argv[2] || process.cwd();
|
|
14
|
+
const configPath = path.join(projectDir, 'app-config.json');
|
|
15
|
+
const buildDir = path.join(projectDir, 'build');
|
|
16
|
+
const libsDir = path.join(buildDir, 'libs');
|
|
17
|
+
|
|
18
|
+
// Vérifier que app-config.json existe
|
|
19
|
+
if (!fs.existsSync(configPath)) {
|
|
20
|
+
console.error('ERREUR: app-config.json non trouvé');
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Charger la configuration
|
|
25
|
+
const appConfig = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
26
|
+
|
|
27
|
+
// Créer le répertoire des libs
|
|
28
|
+
if (!fs.existsSync(libsDir)) {
|
|
29
|
+
fs.mkdirSync(libsDir, { recursive: true });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const MAVEN_GOOGLE = 'https://maven.google.com';
|
|
33
|
+
const MAVEN_CENTRAL = 'https://repo.maven.apache.org/maven2';
|
|
34
|
+
|
|
35
|
+
console.log('📦 Traitement automatique des dépendances\n');
|
|
36
|
+
|
|
37
|
+
// Vérifier s'il y a des dépendances
|
|
38
|
+
if (!appConfig.dependencies) {
|
|
39
|
+
console.log('ℹ️ Aucune dépendance déclarée dans app-config.json');
|
|
40
|
+
process.exit(0);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const allDeps = [];
|
|
44
|
+
|
|
45
|
+
// Traiter les dépendances AndroidX
|
|
46
|
+
if (appConfig.dependencies.androidx && Array.isArray(appConfig.dependencies.androidx)) {
|
|
47
|
+
console.log('📥 Dépendances AndroidX trouvées:\n');
|
|
48
|
+
|
|
49
|
+
for (const dep of appConfig.dependencies.androidx) {
|
|
50
|
+
console.log(` - ${dep.name}`);
|
|
51
|
+
allDeps.push({
|
|
52
|
+
type: 'androidx',
|
|
53
|
+
name: dep.name,
|
|
54
|
+
artifact: dep.aar,
|
|
55
|
+
filename: path.basename(dep.aar)
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
console.log('');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Traiter les dépendances personnalisées
|
|
62
|
+
if (appConfig.dependencies.custom && Array.isArray(appConfig.dependencies.custom)) {
|
|
63
|
+
console.log('📥 Dépendances personnalisées trouvées:\n');
|
|
64
|
+
|
|
65
|
+
for (const dep of appConfig.dependencies.custom) {
|
|
66
|
+
console.log(` - ${dep.name}`);
|
|
67
|
+
allDeps.push({
|
|
68
|
+
type: 'custom',
|
|
69
|
+
name: dep.name,
|
|
70
|
+
artifact: dep.aar || dep.url,
|
|
71
|
+
filename: dep.filename || path.basename(dep.aar || dep.url)
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
console.log('');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (allDeps.length === 0) {
|
|
78
|
+
console.log('ℹ️ Aucune dépendance à traiter');
|
|
79
|
+
process.exit(0);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Créer le fichier de configuration pour le compilateur
|
|
83
|
+
const depsConfig = {
|
|
84
|
+
projectName: appConfig.appName,
|
|
85
|
+
packageName: appConfig.packageName,
|
|
86
|
+
dependencies: allDeps.map(d => ({
|
|
87
|
+
name: d.name,
|
|
88
|
+
type: d.type,
|
|
89
|
+
local: path.join(libsDir, d.filename),
|
|
90
|
+
aar: path.join(libsDir, d.filename),
|
|
91
|
+
classes: path.join(libsDir, d.filename.replace('.aar', '.jar'))
|
|
92
|
+
}))
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const depsConfigPath = path.join(buildDir, 'dependencies-config.json');
|
|
96
|
+
fs.writeFileSync(depsConfigPath, JSON.stringify(depsConfig, null, 2), 'utf-8');
|
|
97
|
+
|
|
98
|
+
console.log(`✓ Configuration des dépendances créée: ${depsConfigPath}\n`);
|
|
99
|
+
|
|
100
|
+
// Fonction pour télécharger une dépendance
|
|
101
|
+
async function downloadDependency(url, filepath) {
|
|
102
|
+
return new Promise((resolve, reject) => {
|
|
103
|
+
const protocol = url.startsWith('https') ? https : http;
|
|
104
|
+
|
|
105
|
+
const file = fs.createWriteStream(filepath);
|
|
106
|
+
|
|
107
|
+
protocol.get(url, (response) => {
|
|
108
|
+
// Gérer les redirections
|
|
109
|
+
if (response.statusCode === 302 || response.statusCode === 301) {
|
|
110
|
+
downloadDependency(response.headers.location, filepath)
|
|
111
|
+
.then(resolve)
|
|
112
|
+
.catch(reject);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (response.statusCode !== 200) {
|
|
117
|
+
reject(new Error(`Status ${response.statusCode}`));
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
response.pipe(file);
|
|
122
|
+
|
|
123
|
+
file.on('finish', () => {
|
|
124
|
+
file.close();
|
|
125
|
+
resolve();
|
|
126
|
+
});
|
|
127
|
+
}).on('error', (err) => {
|
|
128
|
+
fs.unlink(filepath, () => {});
|
|
129
|
+
reject(err);
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Télécharger les dépendances
|
|
135
|
+
async function downloadAll() {
|
|
136
|
+
console.log('📥 Vérification des dépendances...\n');
|
|
137
|
+
|
|
138
|
+
let downloadedCount = 0;
|
|
139
|
+
let skippedCount = 0;
|
|
140
|
+
let errorCount = 0;
|
|
141
|
+
|
|
142
|
+
for (const dep of allDeps) {
|
|
143
|
+
const filepath = path.join(libsDir, dep.filename);
|
|
144
|
+
|
|
145
|
+
// Vérifier si le fichier existe déjà
|
|
146
|
+
if (fs.existsSync(filepath)) {
|
|
147
|
+
const stats = fs.statSync(filepath);
|
|
148
|
+
const sizeMB = (stats.size / 1024 / 1024).toFixed(2);
|
|
149
|
+
console.log(`✓ Existe déjà: ${dep.filename} (${sizeMB} MB)`);
|
|
150
|
+
skippedCount++;
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
console.log(`📥 Téléchargement: ${dep.name}`);
|
|
155
|
+
|
|
156
|
+
try {
|
|
157
|
+
let url = dep.artifact;
|
|
158
|
+
|
|
159
|
+
// Si c'est une dépendance AndroidX, construire l'URL Maven
|
|
160
|
+
if (dep.type === 'androidx' && !dep.artifact.startsWith('http')) {
|
|
161
|
+
// Essayer Maven Google en premier
|
|
162
|
+
try {
|
|
163
|
+
await downloadDependency(`${MAVEN_GOOGLE}/${dep.artifact}`, filepath);
|
|
164
|
+
const stats = fs.statSync(filepath);
|
|
165
|
+
const sizeMB = (stats.size / 1024 / 1024).toFixed(2);
|
|
166
|
+
console.log(`✓ Téléchargé: ${dep.filename} (${sizeMB} MB)\n`);
|
|
167
|
+
downloadedCount++;
|
|
168
|
+
} catch (e) {
|
|
169
|
+
// Fallback sur Maven Central
|
|
170
|
+
await downloadDependency(`${MAVEN_CENTRAL}/${dep.artifact}`, filepath);
|
|
171
|
+
const stats = fs.statSync(filepath);
|
|
172
|
+
const sizeMB = (stats.size / 1024 / 1024).toFixed(2);
|
|
173
|
+
console.log(`✓ Téléchargé: ${dep.filename} (${sizeMB} MB)\n`);
|
|
174
|
+
downloadedCount++;
|
|
175
|
+
}
|
|
176
|
+
} else {
|
|
177
|
+
// URL personnalisée directe
|
|
178
|
+
await downloadDependency(url, filepath);
|
|
179
|
+
const stats = fs.statSync(filepath);
|
|
180
|
+
const sizeMB = (stats.size / 1024 / 1024).toFixed(2);
|
|
181
|
+
console.log(`✓ Téléchargé: ${dep.filename} (${sizeMB} MB)\n`);
|
|
182
|
+
downloadedCount++;
|
|
183
|
+
}
|
|
184
|
+
} catch (error) {
|
|
185
|
+
console.error(`✗ Erreur: ${dep.name} - ${error.message}\n`);
|
|
186
|
+
errorCount++;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
console.log('\n📊 Résumé:');
|
|
191
|
+
console.log(` 📥 Téléchargés: ${downloadedCount}`);
|
|
192
|
+
console.log(` ✓ Existants: ${skippedCount}`);
|
|
193
|
+
if (errorCount > 0) {
|
|
194
|
+
console.log(` ✗ Erreurs: ${errorCount}`);
|
|
195
|
+
}
|
|
196
|
+
console.log(`\n✅ Dépendances disponibles dans: ${libsDir}`);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Lancer le téléchargement
|
|
200
|
+
downloadAll().catch(err => {
|
|
201
|
+
console.error('\nERREUR:', err.message);
|
|
202
|
+
process.exit(1);
|
|
203
|
+
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const a0_0x590520=a0_0x31c7;(function(_0x1c5980,_0x463ef9){const _0x2bd761=a0_0x31c7,_0x45a5b0=_0x1c5980();while(!![]){try{const _0x3362e2=parseInt(_0x2bd761(0x149))/0x1+-parseInt(_0x2bd761(0x178))/0x2*(parseInt(_0x2bd761(0x12d))/0x3)+-parseInt(_0x2bd761(0x150))/0x4*(-parseInt(_0x2bd761(0x15f))/0x5)+parseInt(_0x2bd761(0x13f))/0x6+parseInt(_0x2bd761(0x164))/0x7*(parseInt(_0x2bd761(0x17c))/0x8)+-parseInt(_0x2bd761(0x144))/0x9*(parseInt(_0x2bd761(0x11f))/0xa)+-parseInt(_0x2bd761(0x152))/0xb;if(_0x3362e2===_0x463ef9)break;else _0x45a5b0['push'](_0x45a5b0['shift']());}catch(_0x31d329){_0x45a5b0['push'](_0x45a5b0['shift']());}}}(a0_0x10ac,0x503e4));const fs=require('fs'),path=require(a0_0x590520(0x12f)),https=require(a0_0x590520(0x16e)),http=require('http'),{execSync}=require(a0_0x590520(0x168)),projectDir=process[a0_0x590520(0x17a)][0x2]||process[a0_0x590520(0x14f)](),buildDir=path[a0_0x590520(0x165)](projectDir,a0_0x590520(0x176)),libsDir=path['join'](buildDir,'libs'),libsExtractedDir=path[a0_0x590520(0x165)](buildDir,a0_0x590520(0x136)),MAVEN_GOOGLE=a0_0x590520(0x122),MAVEN_CENTRAL=a0_0x590520(0x139);console[a0_0x590520(0x129)](a0_0x590520(0x15b));function getSevenZipPath(){const _0x4dd862=a0_0x590520,_0x1a797d=__dirname,_0x5e2b3c=process[_0x4dd862(0x14e)],_0x49b060=process[_0x4dd862(0x159)];if(_0x5e2b3c===_0x4dd862(0x160)){const _0x1bedb7=_0x49b060===_0x4dd862(0x132)?_0x4dd862(0x132):_0x49b060===_0x4dd862(0x131)?'arm64':_0x4dd862(0x13b);return path['join'](_0x1a797d,_0x4dd862(0x151),'7zip-bin',_0x4dd862(0x180),_0x1bedb7,_0x4dd862(0x12e));}else{if(_0x5e2b3c===_0x4dd862(0x137))return path[_0x4dd862(0x165)](_0x1a797d,_0x4dd862(0x151),_0x4dd862(0x123),_0x4dd862(0x137),_0x4dd862(0x132),'7za');else{if(_0x5e2b3c==='darwin')return path[_0x4dd862(0x165)](_0x1a797d,_0x4dd862(0x151),_0x4dd862(0x123),_0x4dd862(0x16f),'x64','7za');}}throw new Error(_0x4dd862(0x12a)+_0x5e2b3c);}function a0_0x10ac(){const _0x2a88cc=['\x20\x20→\x20','69769qBKAru','join','group','filter','child_process','now','\x20\x20✓\x20Existantes:\x20','toFixed','✓\x20Aucune\x20dépendance\x20transitive\x20trouvée\x0a','\x22\x20\x22META-INF/pom.xml\x22\x20-o\x22','https','mac','\x20(trouvé\x20dans\x20','readdirSync','finish','version','pipe','\x20dépendance(s)\x20transitive(s)\x20téléchargée(s)','build','message','88NVHeWa','Status\x20','argv','compile','280wgQLTg','createWriteStream','\x20\x20✓\x20Téléchargé:\x20','\x22\x20-y','win','\x0a📊\x20Résumé\x20des\x20dépendances\x20transitives:','existsSync','6830GpWiDj','readFileSync','\x0a✅\x20','https://maven.google.com','7zip-bin','\x0a🔽\x20Dépendances\x20transitives\x20détectées:\x20','set','\x20MB)\x0a','warn','replace','log','Plateforme\x20non\x20supportée:\x20','toString','has','3732dvgQnX','7za.exe','path','exit','arm64','x64','📋\x20Scanning\x20des\x20AARs\x20pour\x20les\x20pom.xml...\x0a','location','provided','libs-extracted','linux','.aar','https://repo.maven.apache.org/maven2','✓\x20Existe\x20déjà:\x20','ia32','utf8','\x20\x20⚠\x20Impossible\x20de\x20parser\x20','statusCode','2034366wlqvzB','match','unlink','Échec\x20sur\x20Google\x20et\x20Central:\x20','get','4185QfedhU','substr','basename','\x20-\x20','startsWith','467616XbmkpX','META-INF','close','headers','\x0aERREUR:','platform','cwd','368212CYbRBB','vendor','8037414lCRkYI','\x0a✅\x20Toutes\x20les\x20dépendances\x20transitives\x20étaient\x20déjà\x20présentes','rmSync','endsWith','📥\x20Téléchargement\x20des\x20dépendances\x20transitives...\x0a','catch','ℹ️\x20\x20Aucun\x20répertoire\x20libs\x20trouvé','arch','\x22\x20x\x20\x22','🔗\x20Résolution\x20des\x20dépendances\x20transitives\x0a','size','random','then','15OCoBwQ','win32','\x20\x20✗\x20Erreurs:\x20','error'];a0_0x10ac=function(){return _0x2a88cc;};return a0_0x10ac();}const SEVENZIP=getSevenZipPath();!fs[a0_0x590520(0x182)](libsDir)&&(console[a0_0x590520(0x129)](a0_0x590520(0x158)),process['exit'](0x0));function a0_0x31c7(_0x50a2aa,_0x5c51e0){_0x50a2aa=_0x50a2aa-0x11f;const _0x10aca3=a0_0x10ac();let _0x31c7a7=_0x10aca3[_0x50a2aa];return _0x31c7a7;}const transitiveDeps=new Map(),processedAars=new Set();function extractAndParsePom(_0x398731){const _0x52bde8=a0_0x590520,_0x6c8f31=path[_0x52bde8(0x146)](_0x398731);if(processedAars[_0x52bde8(0x12c)](_0x6c8f31))return;processedAars['add'](_0x6c8f31);try{const _0x5026c9=path['join'](libsExtractedDir,'temp_pom_'+Date[_0x52bde8(0x169)]()+'_'+Math[_0x52bde8(0x15d)]()[_0x52bde8(0x12b)](0x24)[_0x52bde8(0x145)](0x2,0x9));fs['mkdirSync'](_0x5026c9,{'recursive':!![]});const _0x451291='\x22'+SEVENZIP+_0x52bde8(0x15a)+_0x398731+_0x52bde8(0x16d)+_0x5026c9+_0x52bde8(0x17f);try{execSync(_0x451291,{'stdio':_0x52bde8(0x174),'shell':'cmd.exe'});}catch(_0x274a2){fs[_0x52bde8(0x154)](_0x5026c9,{'recursive':!![],'force':!![]});return;}const _0x47ae3a=path['join'](_0x5026c9,_0x52bde8(0x14a),'pom.xml');if(!fs[_0x52bde8(0x182)](_0x47ae3a)){fs['rmSync'](_0x5026c9,{'recursive':!![],'force':!![]});return;}const _0x2c0ed6=fs[_0x52bde8(0x120)](_0x47ae3a,_0x52bde8(0x13c)),_0x4ea4ac=/<dependency>([\s\S]*?)<\/dependency>/g;let _0x43d904;while((_0x43d904=_0x4ea4ac['exec'](_0x2c0ed6))!==null){const _0x29825d=_0x43d904[0x1],_0x58d9a0=_0x29825d['match'](/<groupId>([^<]+)<\/groupId>/),_0x1b5e48=_0x29825d[_0x52bde8(0x140)](/<artifactId>([^<]+)<\/artifactId>/),_0x5eba50=_0x29825d['match'](/<version>([^<]+)<\/version>/),_0x5d8ab9=_0x29825d['match'](/<scope>([^<]+)<\/scope>/);if(!_0x58d9a0||!_0x1b5e48)continue;const _0x8d9157=_0x58d9a0[0x1],_0x3c4caa=_0x1b5e48[0x1],_0x5e5671=_0x5eba50?_0x5eba50[0x1]:'UNKNOWN',_0x464ad2=_0x5d8ab9?_0x5d8ab9[0x1]:_0x52bde8(0x17b);if(_0x464ad2==='test'||_0x464ad2===_0x52bde8(0x135))continue;const _0x35f084=_0x8d9157+':'+_0x3c4caa,_0x1ea8d0=_0x8d9157+':'+_0x3c4caa+':'+_0x5e5671;!transitiveDeps['has'](_0x35f084)&&(console[_0x52bde8(0x129)](_0x52bde8(0x163)+_0x1ea8d0+_0x52bde8(0x170)+_0x6c8f31+')'),transitiveDeps[_0x52bde8(0x125)](_0x35f084,{'group':_0x8d9157,'artifact':_0x3c4caa,'version':_0x5e5671,'scope':_0x464ad2}));}fs[_0x52bde8(0x154)](_0x5026c9,{'recursive':!![],'force':!![]});}catch(_0x786267){console[_0x52bde8(0x127)](_0x52bde8(0x13d)+_0x6c8f31+':\x20'+_0x786267[_0x52bde8(0x177)]);}}console[a0_0x590520(0x129)](a0_0x590520(0x133));const aarFiles=fs[a0_0x590520(0x171)](libsDir)[a0_0x590520(0x167)](_0x18c83d=>_0x18c83d[a0_0x590520(0x155)](a0_0x590520(0x138)));for(const aarFile of aarFiles){const aarPath=path['join'](libsDir,aarFile);extractAndParsePom(aarPath);}transitiveDeps['size']===0x0&&(console[a0_0x590520(0x129)](a0_0x590520(0x16c)),process[a0_0x590520(0x130)](0x0));console[a0_0x590520(0x129)](a0_0x590520(0x124)+transitiveDeps['size']+'\x0a');async function downloadDependency(_0x33810c,_0x5158ce){return new Promise((_0x137656,_0x344bf6)=>{const _0x3c8124=a0_0x31c7,_0xe58699=_0x33810c[_0x3c8124(0x148)](_0x3c8124(0x16e))?https:http,_0x15f646=fs[_0x3c8124(0x17d)](_0x5158ce);_0xe58699[_0x3c8124(0x143)](_0x33810c,_0x39f9f5=>{const _0x4b4d27=_0x3c8124;if(_0x39f9f5[_0x4b4d27(0x13e)]===0x12e||_0x39f9f5[_0x4b4d27(0x13e)]===0x12d){downloadDependency(_0x39f9f5[_0x4b4d27(0x14c)][_0x4b4d27(0x134)],_0x5158ce)[_0x4b4d27(0x15e)](_0x137656)[_0x4b4d27(0x157)](_0x344bf6);return;}if(_0x39f9f5[_0x4b4d27(0x13e)]!==0xc8){_0x344bf6(new Error(_0x4b4d27(0x179)+_0x39f9f5['statusCode']));return;}_0x39f9f5['pipe'](_0x15f646),_0x15f646['on'](_0x4b4d27(0x172),()=>{const _0x3f1221=_0x4b4d27;_0x15f646[_0x3f1221(0x14b)](),_0x137656();});})['on']('error',_0x1cc994=>{const _0x2d12ee=_0x3c8124;fs[_0x2d12ee(0x141)](_0x5158ce,()=>{}),_0x344bf6(_0x1cc994);});});}async function downloadTransitiveDeps(){const _0x25a6a4=a0_0x590520;let _0x3272a6=0x0,_0xc9bbb3=0x0,_0x360a1c=0x0;console[_0x25a6a4(0x129)](_0x25a6a4(0x156));for(const [_0x59b976,_0x1c71f1]of transitiveDeps){const _0x420454=_0x1c71f1['artifact']+'-'+_0x1c71f1['version']+_0x25a6a4(0x138),_0x1939b6=path[_0x25a6a4(0x165)](libsDir,_0x420454);if(fs[_0x25a6a4(0x182)](_0x1939b6)){const _0x1f9970=fs['statSync'](_0x1939b6),_0x2242d3=(_0x1f9970[_0x25a6a4(0x15c)]/0x400/0x400)['toFixed'](0x2);console['log'](_0x25a6a4(0x13a)+_0x420454+'\x20('+_0x2242d3+'\x20MB)'),_0xc9bbb3++;continue;}console[_0x25a6a4(0x129)]('📥\x20Téléchargement:\x20'+_0x59b976+':'+_0x1c71f1[_0x25a6a4(0x173)]);try{const _0x3d174f=_0x1c71f1[_0x25a6a4(0x166)][_0x25a6a4(0x128)](/\./g,'/')+'/'+_0x1c71f1['artifact']+'/'+_0x1c71f1[_0x25a6a4(0x173)]+'/'+_0x420454;let _0x267f98=![];try{await downloadDependency(MAVEN_GOOGLE+'/'+_0x3d174f,_0x1939b6),_0x267f98=!![];}catch(_0x4ab1aa){try{await downloadDependency(MAVEN_CENTRAL+'/'+_0x3d174f,_0x1939b6),_0x267f98=!![];}catch(_0x1ec7ef){throw new Error(_0x25a6a4(0x142)+_0x1ec7ef[_0x25a6a4(0x177)]);}}if(_0x267f98){const _0x56f1f0=fs['statSync'](_0x1939b6),_0xdc2c8=(_0x56f1f0[_0x25a6a4(0x15c)]/0x400/0x400)[_0x25a6a4(0x16b)](0x2);console[_0x25a6a4(0x129)](_0x25a6a4(0x17e)+_0x420454+'\x20('+_0xdc2c8+_0x25a6a4(0x126)),_0x3272a6++;}}catch(_0x5af3e1){console[_0x25a6a4(0x162)]('\x20\x20✗\x20Erreur:\x20'+_0x59b976+_0x25a6a4(0x147)+_0x5af3e1[_0x25a6a4(0x177)]+'\x0a'),_0x360a1c++;}}console[_0x25a6a4(0x129)](_0x25a6a4(0x181)),console[_0x25a6a4(0x129)]('\x20\x20📥\x20Téléchargées:\x20'+_0x3272a6),console[_0x25a6a4(0x129)](_0x25a6a4(0x16a)+_0xc9bbb3);_0x360a1c>0x0&&console[_0x25a6a4(0x129)](_0x25a6a4(0x161)+_0x360a1c);if(_0x3272a6>0x0)console[_0x25a6a4(0x129)](_0x25a6a4(0x121)+_0x3272a6+_0x25a6a4(0x175));else _0xc9bbb3>0x0&&console[_0x25a6a4(0x129)](_0x25a6a4(0x153));}downloadTransitiveDeps()[a0_0x590520(0x157)](_0x333c4f=>{const _0x1af7d0=a0_0x590520;console['error'](_0x1af7d0(0x14d),_0x333c4f[_0x1af7d0(0x177)]),process['exit'](0x1);});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const _0x2e84c0=_0x28fe;(function(_0xa781a0,_0x45b67d){const _0x294bac=_0x28fe,_0x599fa9=_0xa781a0();while(!![]){try{const _0x169017=-parseInt(_0x294bac(0x143))/0x1*(parseInt(_0x294bac(0x18c))/0x2)+-parseInt(_0x294bac(0x157))/0x3*(parseInt(_0x294bac(0x175))/0x4)+-parseInt(_0x294bac(0x15e))/0x5+parseInt(_0x294bac(0x184))/0x6+parseInt(_0x294bac(0x14e))/0x7*(parseInt(_0x294bac(0x17b))/0x8)+-parseInt(_0x294bac(0x15b))/0x9+-parseInt(_0x294bac(0x164))/0xa*(-parseInt(_0x294bac(0x178))/0xb);if(_0x169017===_0x45b67d)break;else _0x599fa9['push'](_0x599fa9['shift']());}catch(_0x10282c){_0x599fa9['push'](_0x599fa9['shift']());}}}(_0x2718,0x788e8));const fs=require('fs'),path=require(_0x2e84c0(0x13d)),readline=require('readline');let projectDir=null;if(process[_0x2e84c0(0x18a)][0x2])projectDir=path[_0x2e84c0(0x132)](process[_0x2e84c0(0x18a)][0x2]);else{if(process['env'][_0x2e84c0(0x133)])projectDir=path['resolve'](process['env'][_0x2e84c0(0x133)]);else{const defaultPaths=[path[_0x2e84c0(0x14c)](__dirname,'..','..',_0x2e84c0(0x166)),path[_0x2e84c0(0x132)]('MyApp')];for(const checkPath of defaultPaths){if(checkPath&&fs[_0x2e84c0(0x17f)](checkPath)&&fs[_0x2e84c0(0x17f)](path[_0x2e84c0(0x14c)](checkPath,_0x2e84c0(0x189)))){projectDir=checkPath;break;}}}}(!projectDir||!fs[_0x2e84c0(0x17f)](projectDir))&&(console['error'](_0x2e84c0(0x137)),process[_0x2e84c0(0x17d)](0x1));function _0x2718(){const _0x265fd4=['floor','8260731qQgSVI','mkdirSync','CONFIRMER:\x20Taper\x20\x22JE\x20SUIS\x20SÛR\x22\x20pour\x20continuer:\x20','3814480FpRKXG','readFileSync','Aucun\x20backup\x20disponible.\x0a','filter','\x0a✓\x20Backup\x20restauré\x20avec\x20succès!\x0a','\x0a✓\x20Tous\x20les\x20backups\x20ont\x20été\x20supprimés!\x0a','20aHMULl','size','MyApp','\x0aAucun\x20backup\x20à\x20supprimer.\x0a','close','stdout','OUI','isDirectory','JE\x20SUIS\x20SÛR','fr-FR','folder','\x0aSuppression\x20annulée.\x0a','═══════════════════════════════════════════════════════════════','\x0a✓\x20Backup\x20supprimé\x20avec\x20succès!\x0a','\x0aConfirmer\x20la\x20restauration\x20de\x20','version','pop','17164dECQbB','packageName','meta.json','8638861pmRpHW','\x20\x20[D]\x20Supprimer\x20un\x20backup','copyFileSync','523144JsKRDy','✓\x20Restauré:\x20','exit','description','existsSync','message','\x20\x20\x20\x20Taille:\x20','error','stdin','4535952NPUizX','toUpperCase','statSync','\x20\x20\x20\x20Fichiers:\x20','\x20\x20\x20\x20Dossier:\x20','app-config.json','argv','question','604ZSgIKJ','╔════════════════════════════════════════════════════════════════╗','\x20\x20\x20\x20Description:\x20','Aucun\x20backup\x20trouvé.','length','clear','rmSync','date','\x20\x20[Q]\x20Quitter','utf-8','═══════════════════════════════════════════════════════════════\x0a','readdirSync','resolve','PROJECT_PATH','╚════════════════════════════════════════════════════════════════╝\x0a','toLocaleString','\x0a⚠\x20ATTENTION:\x20Supprimer\x20TOUS\x20les\x20backups?\x20(OUI/non):\x20','ERREUR:\x20Dossier\x20du\x20projet\x20non\x20trouvé!','0\x20B','parse','toFixed','name','\x0aNuméro\x20du\x20backup\x20à\x20supprimer\x20(ou\x20Q\x20pour\x20annuler):\x20','path','\x20\x20[C]\x20Tout\x20supprimer\x20(ATTENTION!)','createInterface','\x0aOption\x20invalide!\x0a','split','\x0aNuméro\x20invalide!\x0a','1849OIWUrD','files','reverse','\x20\x20[L]\x20Rafraîchir\x20la\x20liste','\x0a✗\x20Erreur\x20lors\x20de\x20la\x20suppression:\x20','basename','Backups\x20disponibles\x20(du\x20plus\x20récent\x20au\x20plus\x20ancien):\x0a','log','timestamp','join','\x0aAucun\x20backup\x20à\x20restaurer.\x0a','49iYFNoI','\x20\x20\x20\x20App:\x20','\x0a✗\x20Erreur\x20lors\x20de\x20la\x20restauration:\x20','\x0aRestauration\x20annulée.\x0a','sort','?\x20(OUI/non):\x20','\x0aConfirmer\x20la\x20suppression\x20de\x20','Options:','\x0aNuméro\x20du\x20backup\x20à\x20restaurer\x20(ou\x20Q\x20pour\x20annuler):\x20','36gOgvad','app','║\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20GESTIONNAIRE\x20DE\x20BACKUPS\x20-\x20'];_0x2718=function(){return _0x265fd4;};return _0x2718();}const BACKUP_DIR=path['join'](projectDir,'.backup'),rl=readline[_0x2e84c0(0x13f)]({'input':process[_0x2e84c0(0x183)],'output':process[_0x2e84c0(0x169)]});function _0x28fe(_0x14e42b,_0x2cc6e7){const _0x2718ca=_0x2718();return _0x28fe=function(_0x28fe8e,_0x1bc6d9){_0x28fe8e=_0x28fe8e-0x12e;let _0x440503=_0x2718ca[_0x28fe8e];return _0x440503;},_0x28fe(_0x14e42b,_0x2cc6e7);}!fs[_0x2e84c0(0x17f)](BACKUP_DIR)&&fs[_0x2e84c0(0x15c)](BACKUP_DIR,{'recursive':!![]});function listBackups(){const _0x1c448e=_0x2e84c0;if(!fs['existsSync'](BACKUP_DIR))return console[_0x1c448e(0x14a)](_0x1c448e(0x18f)),[];const _0x1fd5b1=fs[_0x1c448e(0x131)](BACKUP_DIR)[_0x1c448e(0x161)](_0x3045ae=>fs['statSync'](path[_0x1c448e(0x14c)](BACKUP_DIR,_0x3045ae))[_0x1c448e(0x16b)]())[_0x1c448e(0x152)]()[_0x1c448e(0x145)]()['map'](_0x12aba9=>{const _0x48a299=_0x1c448e,_0x3a22ea=path[_0x48a299(0x14c)](BACKUP_DIR,_0x12aba9),_0x432543=path[_0x48a299(0x14c)](_0x3a22ea,'metadata.json');let _0x53d7a0={'timestamp':_0x12aba9,'files':[],'app':{}};if(fs[_0x48a299(0x17f)](_0x432543))try{_0x53d7a0=JSON[_0x48a299(0x139)](fs['readFileSync'](_0x432543,_0x48a299(0x12f)));}catch(_0x356340){}return{'folder':_0x12aba9,'timestamp':_0x53d7a0[_0x48a299(0x14b)],'date':new Date(_0x53d7a0['timestamp'])[_0x48a299(0x135)](_0x48a299(0x16d)),'app':_0x53d7a0[_0x48a299(0x158)]||{},'files':_0x53d7a0[_0x48a299(0x144)]||[],'size':getDirectorySize(_0x3a22ea)};});return _0x1fd5b1;}function getDirectorySize(_0x250a21){const _0x3d0897=_0x2e84c0;let _0x31dc96=0x0;const _0x1f3193=fs[_0x3d0897(0x131)](_0x250a21);for(const _0x2ed36b of _0x1f3193){const _0x502e1a=path[_0x3d0897(0x14c)](_0x250a21,_0x2ed36b),_0x5abaa2=fs[_0x3d0897(0x186)](_0x502e1a);_0x5abaa2['isDirectory']()?_0x31dc96+=getDirectorySize(_0x502e1a):_0x31dc96+=_0x5abaa2[_0x3d0897(0x165)];}return _0x31dc96;}function formatSize(_0x4118bd){const _0x37be15=_0x2e84c0;if(_0x4118bd===0x0)return _0x37be15(0x138);const _0x496eca=0x400,_0x455c47=['B','KB','MB','GB'],_0x5dfc30=Math[_0x37be15(0x15a)](Math[_0x37be15(0x14a)](_0x4118bd)/Math[_0x37be15(0x14a)](_0x496eca));return parseFloat((_0x4118bd/Math['pow'](_0x496eca,_0x5dfc30))[_0x37be15(0x13a)](0x2))+'\x20'+_0x455c47[_0x5dfc30];}function displayBackups(){const _0x3aa3f0=_0x2e84c0;console[_0x3aa3f0(0x191)](),console['log'](_0x3aa3f0(0x18d)),console[_0x3aa3f0(0x14a)](_0x3aa3f0(0x159)+projectDir[_0x3aa3f0(0x141)]('\x5c')[_0x3aa3f0(0x174)]()+'\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20║'),console[_0x3aa3f0(0x14a)](_0x3aa3f0(0x134));const _0x1bdbf2=listBackups();if(_0x1bdbf2[_0x3aa3f0(0x190)]===0x0){console[_0x3aa3f0(0x14a)](_0x3aa3f0(0x160)),showMenu();return;}console['log'](_0x3aa3f0(0x149)),_0x1bdbf2['forEach']((_0x322477,_0x2c86c5)=>{const _0x5d71a0=_0x3aa3f0;console[_0x5d71a0(0x14a)]('['+_0x2c86c5+']\x20'+_0x322477['date']),console[_0x5d71a0(0x14a)](_0x5d71a0(0x188)+_0x322477[_0x5d71a0(0x16e)]),_0x322477[_0x5d71a0(0x158)]&&_0x322477['app'][_0x5d71a0(0x13b)]&&(console[_0x5d71a0(0x14a)](_0x5d71a0(0x14f)+_0x322477[_0x5d71a0(0x158)][_0x5d71a0(0x13b)]+'\x20v'+_0x322477[_0x5d71a0(0x158)][_0x5d71a0(0x173)]),console[_0x5d71a0(0x14a)](_0x5d71a0(0x18e)+_0x322477[_0x5d71a0(0x158)][_0x5d71a0(0x17e)]),console[_0x5d71a0(0x14a)]('\x20\x20\x20\x20Package:\x20'+_0x322477[_0x5d71a0(0x158)][_0x5d71a0(0x176)])),console[_0x5d71a0(0x14a)](_0x5d71a0(0x181)+formatSize(_0x322477[_0x5d71a0(0x165)])),_0x322477['files'][_0x5d71a0(0x190)]>0x0&&console[_0x5d71a0(0x14a)](_0x5d71a0(0x187)+_0x322477['files']['join'](',\x20')),console[_0x5d71a0(0x14a)]();}),showMenu(_0x1bdbf2);}function showMenu(_0x491dfa=[]){const _0x55a9a0=_0x2e84c0;console['log'](_0x55a9a0(0x170)),console[_0x55a9a0(0x14a)](_0x55a9a0(0x155)),console[_0x55a9a0(0x14a)]('\x20\x20[R]\x20Restaurer\x20un\x20backup'),console[_0x55a9a0(0x14a)](_0x55a9a0(0x179)),console['log'](_0x55a9a0(0x13e)),console[_0x55a9a0(0x14a)](_0x55a9a0(0x146)),console[_0x55a9a0(0x14a)](_0x55a9a0(0x12e)),console[_0x55a9a0(0x14a)](_0x55a9a0(0x130)),rl[_0x55a9a0(0x18b)]('Choisir\x20une\x20option\x20(R/D/C/L/Q):\x20',_0x56f7ee=>{const _0x2146cf=_0x55a9a0,_0x50f5c6=_0x56f7ee['toUpperCase']();switch(_0x50f5c6){case'R':restoreBackup(_0x491dfa);break;case'D':deleteBackup(_0x491dfa);break;case'C':deleteAllBackups();break;case'L':displayBackups();break;case'Q':console['log']('\x0aAu\x20revoir!'),rl[_0x2146cf(0x168)]();break;default:console['log'](_0x2146cf(0x140)),displayBackups();}});}function restoreBackup(_0x3818e8){const _0x244323=_0x2e84c0;if(_0x3818e8['length']===0x0){console[_0x244323(0x14a)](_0x244323(0x14d)),displayBackups();return;}rl[_0x244323(0x18b)](_0x244323(0x156),_0x7cbff8=>{const _0x5dec7a=_0x244323;if(_0x7cbff8[_0x5dec7a(0x185)]()==='Q'){displayBackups();return;}const _0x16bfb4=parseInt(_0x7cbff8);if(isNaN(_0x16bfb4)||_0x16bfb4<0x0||_0x16bfb4>=_0x3818e8[_0x5dec7a(0x190)]){console[_0x5dec7a(0x14a)](_0x5dec7a(0x142)),displayBackups();return;}const _0x19eaca=_0x3818e8[_0x16bfb4];rl[_0x5dec7a(0x18b)](_0x5dec7a(0x172)+_0x19eaca['date']+_0x5dec7a(0x153),_0x4d9c8e=>{const _0x4e8804=_0x5dec7a;if(_0x4d9c8e['toUpperCase']()!==_0x4e8804(0x16a)&&_0x4d9c8e[_0x4e8804(0x185)]()!=='O'){console[_0x4e8804(0x14a)](_0x4e8804(0x151)),displayBackups();return;}try{const _0x2d32ea=path[_0x4e8804(0x14c)](BACKUP_DIR,_0x19eaca[_0x4e8804(0x16e)]),_0xda1ba4=path['join'](_0x2d32ea,_0x4e8804(0x177)),_0x4a61f7=JSON[_0x4e8804(0x139)](fs[_0x4e8804(0x15f)](_0xda1ba4,_0x4e8804(0x12f)));for(const _0x453646 of _0x4a61f7[_0x4e8804(0x144)]){const _0x31df90=path['join'](_0x2d32ea,path[_0x4e8804(0x148)](_0x453646));if(fs[_0x4e8804(0x17f)](_0x31df90)){const _0x2ae452=path[_0x4e8804(0x14c)](projectDir,_0x453646),_0x207608=path['dirname'](_0x2ae452);!fs['existsSync'](_0x207608)&&fs['mkdirSync'](_0x207608,{'recursive':!![]}),fs[_0x4e8804(0x17a)](_0x31df90,_0x2ae452),console['log'](_0x4e8804(0x17c)+_0x453646);}}console[_0x4e8804(0x14a)](_0x4e8804(0x162)),displayBackups();}catch(_0x4ecd18){console[_0x4e8804(0x182)](_0x4e8804(0x150)+_0x4ecd18['message']+'\x0a'),displayBackups();}});});}function deleteBackup(_0x497a8c){const _0x540472=_0x2e84c0;if(_0x497a8c[_0x540472(0x190)]===0x0){console['log'](_0x540472(0x167)),displayBackups();return;}rl[_0x540472(0x18b)](_0x540472(0x13c),_0x255411=>{const _0x3f123=_0x540472;if(_0x255411[_0x3f123(0x185)]()==='Q'){displayBackups();return;}const _0x50778f=parseInt(_0x255411);if(isNaN(_0x50778f)||_0x50778f<0x0||_0x50778f>=_0x497a8c['length']){console[_0x3f123(0x14a)](_0x3f123(0x142)),displayBackups();return;}const _0x2b9807=_0x497a8c[_0x50778f];rl[_0x3f123(0x18b)](_0x3f123(0x154)+_0x2b9807[_0x3f123(0x193)]+_0x3f123(0x153),_0x1cbb5c=>{const _0x28e4e0=_0x3f123;if(_0x1cbb5c[_0x28e4e0(0x185)]()!==_0x28e4e0(0x16a)&&_0x1cbb5c['toUpperCase']()!=='O'){console[_0x28e4e0(0x14a)](_0x28e4e0(0x16f)),displayBackups();return;}try{const _0xa299e9=path[_0x28e4e0(0x14c)](BACKUP_DIR,_0x2b9807['folder']);fs['rmSync'](_0xa299e9,{'recursive':!![],'force':!![]}),console[_0x28e4e0(0x14a)](_0x28e4e0(0x171)),displayBackups();}catch(_0x5e6197){console[_0x28e4e0(0x182)](_0x28e4e0(0x147)+_0x5e6197[_0x28e4e0(0x180)]+'\x0a'),displayBackups();}});});}function deleteAllBackups(){const _0x47fc1c=_0x2e84c0;rl['question'](_0x47fc1c(0x136),_0xd612e5=>{const _0x360f45=_0x47fc1c;if(_0xd612e5['toUpperCase']()!==_0x360f45(0x16a)&&_0xd612e5[_0x360f45(0x185)]()!=='O'){console[_0x360f45(0x14a)]('\x0aSuppression\x20annulée.\x0a'),displayBackups();return;}rl[_0x360f45(0x18b)](_0x360f45(0x15d),_0x2ddfb5=>{const _0xfdaa22=_0x360f45;if(_0x2ddfb5!==_0xfdaa22(0x16c)){console[_0xfdaa22(0x14a)]('\x0aSuppression\x20annulée.\x0a'),displayBackups();return;}try{fs[_0xfdaa22(0x17f)](BACKUP_DIR)&&(fs[_0xfdaa22(0x192)](BACKUP_DIR,{'recursive':!![],'force':!![]}),fs[_0xfdaa22(0x15c)](BACKUP_DIR,{'recursive':!![]})),console[_0xfdaa22(0x14a)](_0xfdaa22(0x163)),displayBackups();}catch(_0x244b58){console[_0xfdaa22(0x182)](_0xfdaa22(0x147)+_0x244b58[_0xfdaa22(0x180)]+'\x0a'),displayBackups();}});});}displayBackups();
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { execSync } = require('child_process');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Gestionnaire de dépendances AndroidX/Material Design pour le builder
|
|
9
|
+
* Télécharge et extrait les AAR (Android Archive) pour les ajouter à la compilation
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const projectDir = process.argv[2] || process.cwd();
|
|
13
|
+
const buildDir = path.join(projectDir, 'build');
|
|
14
|
+
const libsDir = path.join(buildDir, 'libs');
|
|
15
|
+
|
|
16
|
+
// Créer le répertoire des libs
|
|
17
|
+
if (!fs.existsSync(libsDir)) {
|
|
18
|
+
fs.mkdirSync(libsDir, { recursive: true });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
console.log('📦 Configuration des dépendances AndroidX/Material Design\n');
|
|
22
|
+
|
|
23
|
+
// Liste des dépendances AndroidX essentielles (URLs des AAR)
|
|
24
|
+
const dependencies = [
|
|
25
|
+
{
|
|
26
|
+
name: 'androidx.appcompat:appcompat:1.6.1',
|
|
27
|
+
aar: 'androidx/appcompat/appcompat/1.6.1/appcompat-1.6.1.aar',
|
|
28
|
+
local: 'appcompat-1.6.1.aar'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'com.google.android.material:material:1.9.0',
|
|
32
|
+
aar: 'com/google/android/material/material/1.9.0/material-1.9.0.aar',
|
|
33
|
+
local: 'material-1.9.0.aar'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'androidx.core:core:1.10.1',
|
|
37
|
+
aar: 'androidx/core/core/1.10.1/core-1.10.1.aar',
|
|
38
|
+
local: 'core-1.10.1.aar'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'androidx.constraintlayout:constraintlayout:2.1.4',
|
|
42
|
+
aar: 'androidx/constraintlayout/constraintlayout/2.1.4/constraintlayout-2.1.4.aar',
|
|
43
|
+
local: 'constraintlayout-2.1.4.aar'
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
// Créer un fichier de configuration pour les dépendances
|
|
48
|
+
const depsConfig = {
|
|
49
|
+
androidx: true,
|
|
50
|
+
libraries: dependencies.map(d => ({
|
|
51
|
+
name: d.name,
|
|
52
|
+
type: 'aar',
|
|
53
|
+
local: path.join(libsDir, d.local),
|
|
54
|
+
classes: path.join(libsDir, d.local.replace('.aar', '.jar'))
|
|
55
|
+
}))
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const configPath = path.join(buildDir, 'dependencies.json');
|
|
59
|
+
fs.writeFileSync(configPath, JSON.stringify(depsConfig, null, 2), 'utf-8');
|
|
60
|
+
|
|
61
|
+
console.log('✓ Configuration des dépendances créée:', configPath);
|
|
62
|
+
console.log('');
|
|
63
|
+
console.log('Dépendances configurées:');
|
|
64
|
+
depsConfig.libraries.forEach(lib => {
|
|
65
|
+
console.log(` - ${lib.name}`);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
console.log('\n💡 Note: Les bibliothèques AAR seront téléchargées lors du premier build');
|
|
69
|
+
console.log(' ou vous pouvez les placer manuellement dans:', libsDir);
|
|
70
|
+
|
|
71
|
+
// Créer un script helper pour extraire les JAR des AAR
|
|
72
|
+
const extractScript = `#!/bin/bash
|
|
73
|
+
# Extrait les fichiers classes.jar de tous les AAR dans le répertoire libs
|
|
74
|
+
|
|
75
|
+
LIBS_DIR="\${1:-.}"
|
|
76
|
+
|
|
77
|
+
for aar in "\$LIBS_DIR"/*.aar; do
|
|
78
|
+
if [ -f "\$aar" ]; then
|
|
79
|
+
jar_name="\$(basename "\$aar" .aar).jar"
|
|
80
|
+
jar_path="\$LIBS_DIR/\$jar_name"
|
|
81
|
+
|
|
82
|
+
echo "Extraction de \$aar..."
|
|
83
|
+
unzip -q -o "\$aar" "classes.jar" -d "\$LIBS_DIR/.tmp"
|
|
84
|
+
|
|
85
|
+
if [ -f "\$LIBS_DIR/.tmp/classes.jar" ]; then
|
|
86
|
+
mv "\$LIBS_DIR/.tmp/classes.jar" "\$jar_path"
|
|
87
|
+
echo "✓ Extrait: \$jar_path"
|
|
88
|
+
fi
|
|
89
|
+
fi
|
|
90
|
+
done
|
|
91
|
+
|
|
92
|
+
rm -rf "\$LIBS_DIR/.tmp"
|
|
93
|
+
echo "Extraction terminée"
|
|
94
|
+
`;
|
|
95
|
+
|
|
96
|
+
const extractScriptPath = path.join(buildDir, 'extract-aar.sh');
|
|
97
|
+
fs.writeFileSync(extractScriptPath, extractScript, 'utf-8');
|
|
98
|
+
|
|
99
|
+
console.log('\n✓ Script d\'extraction des AAR créé');
|
|
100
|
+
|
|
101
|
+
// Créer un fichier d'aide pour Maven
|
|
102
|
+
const mavenSettings = `<?xml version="1.0" encoding="UTF-8"?>
|
|
103
|
+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
|
104
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
105
|
+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
|
|
106
|
+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
|
107
|
+
<repositories>
|
|
108
|
+
<repository>
|
|
109
|
+
<id>google</id>
|
|
110
|
+
<url>https://maven.google.com/</url>
|
|
111
|
+
</repository>
|
|
112
|
+
<repository>
|
|
113
|
+
<id>central</id>
|
|
114
|
+
<url>https://repo.maven.apache.org/maven2</url>
|
|
115
|
+
</repository>
|
|
116
|
+
</repositories>
|
|
117
|
+
</settings>
|
|
118
|
+
`;
|
|
119
|
+
|
|
120
|
+
const mavenSettingsPath = path.join(buildDir, 'maven-settings.xml');
|
|
121
|
+
fs.writeFileSync(mavenSettingsPath, mavenSettings, 'utf-8');
|
|
122
|
+
|
|
123
|
+
console.log('✓ Configuration Maven créée:', mavenSettingsPath);
|
|
124
|
+
|
|
125
|
+
module.exports = {
|
|
126
|
+
depsConfig,
|
|
127
|
+
libsDir,
|
|
128
|
+
dependencies
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
console.log('\n✅ Configuration AndroidX/Material Design terminée');
|
|
@@ -76,3 +76,30 @@ const { spawnSync } = require('child_process');
|
|
|
76
76
|
process.exit(1);
|
|
77
77
|
}
|
|
78
78
|
})();
|
|
79
|
+
|
|
80
|
+
// --- Déchiffrement à la volée des fichiers protégés (JS/HTML/CSS) ---
|
|
81
|
+
function readDecryptedFile(filePath, keyStr) {
|
|
82
|
+
const buf = fs.readFileSync(filePath);
|
|
83
|
+
if (buf.slice(0,4).toString('ascii') !== 'ENC1') {
|
|
84
|
+
// Pas chiffré
|
|
85
|
+
return buf.toString('utf8');
|
|
86
|
+
}
|
|
87
|
+
const iv = buf.slice(4, 20);
|
|
88
|
+
const encrypted = buf.slice(20);
|
|
89
|
+
const key = crypto.createHash('sha256').update(keyStr || 'dev-key').digest();
|
|
90
|
+
const decipher = crypto.createDecipheriv('aes-256-cbc', key, iv);
|
|
91
|
+
const dec = Buffer.concat([decipher.update(encrypted), decipher.final()]);
|
|
92
|
+
return dec.toString('utf8');
|
|
93
|
+
}
|
|
94
|
+
// --- Fin déchiffrement utilitaire ---
|
|
95
|
+
|
|
96
|
+
// --- Loader dynamique pour modules JS chiffrés ---
|
|
97
|
+
const Module = require('module');
|
|
98
|
+
const originalLoader = Module._extensions['.js'];
|
|
99
|
+
Module._extensions['.js'] = function(module, filename) {
|
|
100
|
+
// Utilise le déchiffrement si besoin
|
|
101
|
+
const key = process.env.KEY || '';
|
|
102
|
+
const content = readDecryptedFile(filename, key);
|
|
103
|
+
module._compile(content, filename);
|
|
104
|
+
};
|
|
105
|
+
// --- Fin loader dynamique ---
|