@mcesystems/adb-kit 1.0.25 → 1.0.26

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.
Binary file
@@ -1 +1 @@
1
- {"version":3,"file":"adbDeviceKit.d.ts","sourceRoot":"","sources":["../../../src/logic/adbDeviceKit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,SAAS,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAoB/C,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BhB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,WAAW,CAAC;AAEtD,qBAAa,YAAY;IAQvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAPtB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAuB;gBAGxC,QAAQ,EAAE,MAAM,EACC,IAAI,EAAE,MAAM;IAUjB,WAAW;YAKV,WAAW;IAqBZ,sBAAsB;IAOtB,mBAAmB,CAAC,UAAU,EAAE,cAAc,EAAE;IAWhD,UAAU,CAAC,OAAO,EAAE,MAAM;IAQ1B,YAAY,CAAC,WAAW,EAAE,MAAM;IAQhC,cAAc,CAAC,WAAW,EAAE,MAAM;IAQ/C;;;OAGG;IACU,SAAS;IAKT,eAAe;IAKf,mBAAmB,CAAC,OAAO,SAAS;IAgCpC,gBAAgB,CAAC,WAAW,EAAE,MAAM;IAW1C,WAAW;IAIX,OAAO;IAID,eAAe;CAI5B"}
1
+ {"version":3,"file":"adbDeviceKit.d.ts","sourceRoot":"","sources":["../../../src/logic/adbDeviceKit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,SAAS,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAc/C,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BhB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,WAAW,CAAC;AAEtD,qBAAa,YAAY;IAQvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAPtB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAuB;gBAGxC,QAAQ,EAAE,MAAM,EACC,IAAI,EAAE,MAAM;IAYjB,WAAW;YAKV,WAAW;IAqBZ,sBAAsB;IAOtB,mBAAmB,CAAC,UAAU,EAAE,cAAc,EAAE;IAWhD,UAAU,CAAC,OAAO,EAAE,MAAM;IAQ1B,YAAY,CAAC,WAAW,EAAE,MAAM;IAQhC,cAAc,CAAC,WAAW,EAAE,MAAM;IAQ/C;;;OAGG;IACU,SAAS;IAKT,eAAe;IAKf,mBAAmB,CAAC,OAAO,SAAS;IAgCpC,gBAAgB,CAAC,WAAW,EAAE,MAAM;IAW1C,WAAW;IAIX,OAAO;IAID,eAAe;CAI5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"adbPath.d.ts","sourceRoot":"","sources":["../../../src/utils/adbPath.ts"],"names":[],"mappings":"AAiCA;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CA4BhD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAwBlD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC"}
1
+ {"version":3,"file":"adbPath.d.ts","sourceRoot":"","sources":["../../../src/utils/adbPath.ts"],"names":[],"mappings":"AAiCA;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAkBhD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAwBlD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcesystems/adb-kit",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "ADB (Android Debug Bridge) toolkit for device management",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -30,7 +30,8 @@
30
30
  "dependencies": {
31
31
  "@devicefarmer/adbkit": "^3.3.8",
32
32
  "debug": "^4.4.3",
33
- "get-port": "^7.1.0"
33
+ "get-port": "^7.1.0",
34
+ "tsx": "^4.21.0"
34
35
  },
35
36
  "devDependencies": {
36
37
  "@types/debug": "^4.1.12",
@@ -39,16 +40,18 @@
39
40
  "esbuild": "^0.27.0",
40
41
  "esbuild-plugin-copy": "^2.1.1",
41
42
  "rimraf": "^6.0.1",
42
- "tsx": "^4.21.0",
43
43
  "typescript": "^5.7.2",
44
44
  "vitest": "^2.1.8"
45
45
  },
46
46
  "files": [
47
47
  "dist",
48
+ "scripts",
48
49
  "README.md"
49
50
  ],
51
+ "bin": {
52
+ "export-adb-resources": "./scripts/export-resources.ts"
53
+ },
50
54
  "scripts": {
51
- "prepareResources": "tsx scripts/prepareResources.ts",
52
55
  "build": "tsx esbuild.config.mts && tsc --emitDeclarationOnly",
53
56
  "clean": "node-gyp clean && rimraf dist",
54
57
  "pack": "npm pack",
@@ -0,0 +1,183 @@
1
+ # Export ADB Resources Script
2
+
3
+ This script downloads Android Debug Bridge (ADB) platform tools from Google and exports them to a specified target directory. The exported resources can be used by applications that depend on `@mcesystems/adb-kit`.
4
+
5
+ ## Usage
6
+
7
+ After installing `@mcesystems/adb-kit`:
8
+
9
+ ```bash
10
+ # Using the binary (recommended)
11
+ npx export-adb-resources <target-path> [options]
12
+
13
+ # Or run the script directly with tsx
14
+ npx tsx node_modules/@mcesystems/adb-kit/scripts/export-resources.ts <target-path> [options]
15
+ ```
16
+
17
+ ### Arguments
18
+
19
+ | Argument | Description |
20
+ |----------|-------------|
21
+ | `target-path` | Directory where resources will be exported |
22
+
23
+ ### Options
24
+
25
+ | Option | Description |
26
+ |--------|-------------|
27
+ | `--all` | Download resources for all platforms (Windows, macOS, Linux) |
28
+ | `--platform <name>` | Download resources for a specific platform (`windows`, `darwin`, `linux`) |
29
+ | `--help`, `-h` | Show usage information |
30
+
31
+ ### Examples
32
+
33
+ ```bash
34
+ # Export for current platform only
35
+ npx tsx export-resources.ts ./my-app/resources/adb-kit
36
+
37
+ # Export for all platforms
38
+ npx tsx export-resources.ts ./my-app/resources/adb-kit --all
39
+
40
+ # Export for a specific platform
41
+ npx tsx export-resources.ts ./my-app/resources/adb-kit --platform windows
42
+ ```
43
+
44
+ ### Output Structure
45
+
46
+ The script creates the following directory structure:
47
+
48
+ ```
49
+ <target-path>/
50
+ ├── bin/
51
+ │ ├── darwin/ # macOS
52
+ │ │ └── adb
53
+ │ ├── windows/ # Windows
54
+ │ │ ├── adb.exe
55
+ │ │ ├── AdbWinApi.dll
56
+ │ │ └── AdbWinUsbApi.dll
57
+ │ └── linux/ # Linux
58
+ │ └── adb
59
+ └── licenses/
60
+ └── APACHE-2.0.txt
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Prerequisites
66
+
67
+ ### All Platforms
68
+
69
+ 1. **Node.js 18+** with `tsx` available:
70
+ ```bash
71
+ npm install -g tsx
72
+ # or use npx
73
+ ```
74
+
75
+ 2. **Internet connection** to download from Google's servers
76
+
77
+ ### macOS / Linux
78
+
79
+ - **unzip** command available (usually pre-installed)
80
+
81
+ ### Windows
82
+
83
+ - **PowerShell** available (included with Windows 10+)
84
+
85
+ ---
86
+
87
+ ## How It Works
88
+
89
+ 1. Downloads the official platform-tools ZIP from Google's Android SDK repository
90
+ 2. Extracts the required ADB binaries
91
+ 3. Copies them to the target directory with proper permissions
92
+ 4. Creates a license file for Apache 2.0 compliance
93
+
94
+ ---
95
+
96
+ ## Files Included
97
+
98
+ ### Windows
99
+ | File | Description |
100
+ |------|-------------|
101
+ | `adb.exe` | Android Debug Bridge executable |
102
+ | `AdbWinApi.dll` | ADB Windows API library |
103
+ | `AdbWinUsbApi.dll` | ADB Windows USB API library |
104
+
105
+ ### macOS / Linux
106
+ | File | Description |
107
+ |------|-------------|
108
+ | `adb` | Android Debug Bridge executable |
109
+
110
+ ---
111
+
112
+ ## Integrating with Your Application
113
+
114
+ After exporting resources, configure `adb-kit` to use them:
115
+
116
+ ### Option 1: Environment Variable
117
+
118
+ Set `AdbBinPath` to point to the bin directory:
119
+
120
+ ```bash
121
+ # macOS
122
+ export AdbBinPath=/path/to/resources/bin/darwin
123
+
124
+ # Linux
125
+ export AdbBinPath=/path/to/resources/bin/linux
126
+
127
+ # Windows (PowerShell)
128
+ $env:AdbBinPath = "C:\path\to\resources\bin\windows"
129
+ ```
130
+
131
+ ### Option 2: Bundle with Your App
132
+
133
+ Copy the exported resources into your application's resources folder. The `adb-kit` package will automatically detect binaries in:
134
+ - `<your-app>/resources/bin/darwin/` (macOS)
135
+ - `<your-app>/resources/bin/linux/` (Linux)
136
+ - `<your-app>/resources/bin/windows/` (Windows)
137
+
138
+ ---
139
+
140
+ ## Driver Requirements
141
+
142
+ ### Windows
143
+
144
+ On Windows, you may need to install USB drivers for your Android device:
145
+
146
+ 1. **Google USB Driver** (for Nexus/Pixel devices):
147
+ - Download from [Android Developer site](https://developer.android.com/studio/run/win-usb)
148
+
149
+ 2. **Manufacturer drivers** (for other devices):
150
+ - Check your device manufacturer's website
151
+
152
+ ### macOS / Linux
153
+
154
+ No additional drivers required. USB works out of the box.
155
+
156
+ ### Linux udev Rules
157
+
158
+ On Linux, you may need to add udev rules for your device:
159
+
160
+ ```bash
161
+ # Create udev rules file
162
+ sudo nano /etc/udev/rules.d/51-android.rules
163
+
164
+ # Add a rule for your device (example for Google devices)
165
+ SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
166
+
167
+ # Reload udev rules
168
+ sudo udevadm control --reload-rules
169
+ sudo udevadm trigger
170
+ ```
171
+
172
+ ---
173
+
174
+ ## License
175
+
176
+ ADB is licensed under **Apache License 2.0**.
177
+
178
+ The binaries are downloaded from Google's official Android SDK repository:
179
+ - https://developer.android.com/studio/releases/platform-tools
180
+
181
+ Source code:
182
+ - https://android.googlesource.com/platform/packages/modules/adb/
183
+
@@ -0,0 +1,368 @@
1
+ #!/usr/bin/env tsx
2
+ /**
3
+ * Export ADB (Android Debug Bridge) resources to a specified path
4
+ *
5
+ * This script downloads ADB platform tools from Google and exports them
6
+ * to a target directory. The resources can then be used by applications
7
+ * that depend on adb-kit.
8
+ *
9
+ * Usage:
10
+ * npx tsx export-resources.ts <target-path>
11
+ *
12
+ * Example:
13
+ * npx tsx export-resources.ts /path/to/my-app/resources/adb-kit
14
+ *
15
+ * Platform support:
16
+ * - macOS: Downloads darwin platform-tools from Google
17
+ * - Windows: Downloads windows platform-tools from Google
18
+ * - Linux: Downloads linux platform-tools from Google
19
+ */
20
+
21
+ import { exec } from "node:child_process";
22
+ import {
23
+ chmodSync,
24
+ copyFileSync,
25
+ createWriteStream,
26
+ existsSync,
27
+ mkdirSync,
28
+ writeFileSync,
29
+ } from "node:fs";
30
+ import path from "node:path";
31
+ import { promisify } from "node:util";
32
+
33
+ const execAsync = promisify(exec);
34
+
35
+ // ============================================================================
36
+ // Configuration
37
+ // ============================================================================
38
+
39
+ // ADB download URLs from Google
40
+ const ADB_URLS: Record<string, string> = {
41
+ windows:
42
+ "https://dl.google.com/android/repository/platform-tools-latest-windows.zip",
43
+ darwin:
44
+ "https://dl.google.com/android/repository/platform-tools-latest-darwin.zip",
45
+ linux:
46
+ "https://dl.google.com/android/repository/platform-tools-latest-linux.zip",
47
+ };
48
+
49
+ // Files to extract from platform-tools per platform
50
+ const PLATFORM_FILES: Record<string, string[]> = {
51
+ windows: ["adb.exe", "AdbWinApi.dll", "AdbWinUsbApi.dll"],
52
+ darwin: ["adb"],
53
+ linux: ["adb"],
54
+ };
55
+
56
+ // ============================================================================
57
+ // Utility Functions
58
+ // ============================================================================
59
+
60
+ function printUsage(): void {
61
+ console.log(`
62
+ Usage: npx tsx export-resources.ts <target-path>
63
+
64
+ Arguments:
65
+ target-path Directory where resources will be exported
66
+
67
+ Examples:
68
+ npx tsx export-resources.ts ./my-app/resources/adb-kit
69
+ npx tsx export-resources.ts /absolute/path/to/resources
70
+
71
+ The script will create the following structure:
72
+ <target-path>/
73
+ bin/
74
+ darwin/ (macOS ADB binary)
75
+ windows/ (Windows ADB binaries and DLLs)
76
+ linux/ (Linux ADB binary)
77
+ licenses/
78
+ APACHE-2.0.txt
79
+ `);
80
+ }
81
+
82
+ async function downloadFile(url: string, destPath: string): Promise<void> {
83
+ console.log(`Downloading ${url}...`);
84
+
85
+ let response: Response;
86
+ try {
87
+ response = await fetch(url);
88
+ } catch {
89
+ // Fallback to https module if fetch is not available
90
+ const https = await import("node:https");
91
+ const http = await import("node:http");
92
+ const urlObj = new URL(url);
93
+ const client = urlObj.protocol === "https:" ? https : http;
94
+
95
+ return new Promise((resolve, reject) => {
96
+ const fileStream = createWriteStream(destPath);
97
+ const request = client.get(url, (res) => {
98
+ if (
99
+ res.statusCode &&
100
+ res.statusCode >= 300 &&
101
+ res.statusCode < 400 &&
102
+ res.headers.location
103
+ ) {
104
+ // Handle redirect
105
+ fileStream.close();
106
+ return downloadFile(res.headers.location, destPath)
107
+ .then(resolve)
108
+ .catch(reject);
109
+ }
110
+ if (res.statusCode && res.statusCode !== 200) {
111
+ fileStream.close();
112
+ reject(
113
+ new Error(
114
+ `Failed to download ${url}: ${res.statusCode} ${res.statusMessage}`
115
+ )
116
+ );
117
+ return;
118
+ }
119
+ res.pipe(fileStream);
120
+ fileStream.on("finish", () => {
121
+ fileStream.close();
122
+ resolve();
123
+ });
124
+ });
125
+ request.on("error", (err) => {
126
+ fileStream.close();
127
+ reject(err);
128
+ });
129
+ });
130
+ }
131
+
132
+ if (!response.ok) {
133
+ throw new Error(`Failed to download ${url}: ${response.statusText}`);
134
+ }
135
+
136
+ const fileStream = createWriteStream(destPath);
137
+ const reader = response.body?.getReader();
138
+ if (!reader) {
139
+ throw new Error(`Failed to get response body for ${url}`);
140
+ }
141
+
142
+ try {
143
+ while (true) {
144
+ const { done, value } = await reader.read();
145
+ if (done) break;
146
+ fileStream.write(value);
147
+ }
148
+ fileStream.end();
149
+ await new Promise<void>((resolve, reject) => {
150
+ fileStream.on("finish", resolve);
151
+ fileStream.on("error", reject);
152
+ });
153
+ console.log(`✓ Downloaded to ${destPath}`);
154
+ } finally {
155
+ reader.releaseLock();
156
+ }
157
+ }
158
+
159
+ async function extractZip(
160
+ zipPath: string,
161
+ extractDir: string
162
+ ): Promise<void> {
163
+ console.log(`Extracting ${zipPath}...`);
164
+
165
+ if (process.platform === "win32") {
166
+ // On Windows, use PowerShell Expand-Archive
167
+ try {
168
+ const escapedZipPath = zipPath.replace(/'/g, "''");
169
+ const escapedExtractDir = extractDir.replace(/'/g, "''");
170
+ await execAsync(
171
+ `powershell -Command "Expand-Archive -Path '${escapedZipPath}' -DestinationPath '${escapedExtractDir}' -Force"`
172
+ );
173
+ } catch (error) {
174
+ const err = error as { message?: string };
175
+ throw new Error(
176
+ `Failed to extract zip file. Please ensure PowerShell is available. Error: ${err.message || error}`
177
+ );
178
+ }
179
+ } else {
180
+ // On Unix-like systems, use unzip command
181
+ try {
182
+ await execAsync(`unzip -o "${zipPath}" -d "${extractDir}"`);
183
+ } catch (error) {
184
+ const err = error as { message?: string };
185
+ throw new Error(
186
+ `Failed to extract zip file. Please ensure 'unzip' is installed. Error: ${err.message || error}`
187
+ );
188
+ }
189
+ }
190
+ console.log(`✓ Extracted to ${extractDir}`);
191
+ }
192
+
193
+ async function copyFiles(
194
+ sourceDir: string,
195
+ targetDir: string,
196
+ files: string[]
197
+ ): Promise<void> {
198
+ mkdirSync(targetDir, { recursive: true });
199
+
200
+ for (const file of files) {
201
+ const sourcePath = path.join(sourceDir, "platform-tools", file);
202
+ const targetPath = path.join(targetDir, file);
203
+
204
+ if (!existsSync(sourcePath)) {
205
+ console.warn(`Warning: ${file} not found in ${sourcePath}`);
206
+ continue;
207
+ }
208
+
209
+ copyFileSync(sourcePath, targetPath);
210
+ console.log(`✓ Copied ${file}`);
211
+ }
212
+ }
213
+
214
+ function makeExecutable(filePath: string): void {
215
+ if (process.platform !== "win32") {
216
+ chmodSync(filePath, 0o755);
217
+ }
218
+ }
219
+
220
+ async function cleanupDir(dirPath: string): Promise<void> {
221
+ try {
222
+ const { rimraf } = await import("rimraf");
223
+ await rimraf(dirPath);
224
+ } catch {
225
+ // Ignore cleanup errors
226
+ }
227
+ }
228
+
229
+ // ============================================================================
230
+ // Export Functions
231
+ // ============================================================================
232
+
233
+ type PlatformType = "windows" | "darwin" | "linux";
234
+
235
+ async function exportPlatformResources(
236
+ platform: PlatformType,
237
+ targetDir: string
238
+ ): Promise<void> {
239
+ console.log(`\n=== Exporting ${platform} Resources ===\n`);
240
+
241
+ const binDir = path.join(targetDir, "bin", platform);
242
+ const files = PLATFORM_FILES[platform];
243
+ const url = ADB_URLS[platform];
244
+
245
+ // Create temp directory for extraction
246
+ const tempDir = path.join(targetDir, ".temp", platform);
247
+ mkdirSync(tempDir, { recursive: true });
248
+ const zipPath = path.join(tempDir, `platform-tools-${platform}.zip`);
249
+
250
+ try {
251
+ // Download
252
+ await downloadFile(url, zipPath);
253
+
254
+ // Extract
255
+ await extractZip(zipPath, tempDir);
256
+
257
+ // Copy files to target
258
+ await copyFiles(tempDir, binDir, files);
259
+
260
+ // Make executable on Unix
261
+ if (platform !== "windows") {
262
+ for (const file of files) {
263
+ makeExecutable(path.join(binDir, file));
264
+ }
265
+ }
266
+
267
+ console.log(`\n✓ ${platform} resources exported to: ${binDir}`);
268
+ } finally {
269
+ // Clean up temp directory
270
+ await cleanupDir(tempDir);
271
+ }
272
+ }
273
+
274
+ // ============================================================================
275
+ // License
276
+ // ============================================================================
277
+
278
+ function createLicenseFile(targetDir: string): void {
279
+ const licensesDir = path.join(targetDir, "licenses");
280
+ mkdirSync(licensesDir, { recursive: true });
281
+
282
+ const apacheLicense = `Apache License
283
+ Version 2.0, January 2004
284
+ http://www.apache.org/licenses/
285
+
286
+ Android Debug Bridge (ADB) is licensed under the Apache License 2.0.
287
+
288
+ For full license text, see:
289
+ https://www.apache.org/licenses/LICENSE-2.0
290
+
291
+ These binaries are downloaded from Google's official Android SDK repository:
292
+ https://developer.android.com/studio/releases/platform-tools
293
+
294
+ Source code is available at:
295
+ https://android.googlesource.com/platform/packages/modules/adb/
296
+ `;
297
+
298
+ const licensePath = path.join(licensesDir, "APACHE-2.0.txt");
299
+ writeFileSync(licensePath, apacheLicense);
300
+ console.log(`✓ Created license file: ${licensePath}`);
301
+ }
302
+
303
+ // ============================================================================
304
+ // Main
305
+ // ============================================================================
306
+
307
+ async function main(): Promise<void> {
308
+ const args = process.argv.slice(2);
309
+
310
+ if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
311
+ printUsage();
312
+ process.exit(args.length === 0 ? 1 : 0);
313
+ }
314
+
315
+ const targetPath = path.resolve(args[0]);
316
+
317
+ // Check for optional platform argument
318
+ let platforms: PlatformType[];
319
+ if (args.includes("--all")) {
320
+ platforms = ["windows", "darwin", "linux"];
321
+ } else if (args.includes("--platform")) {
322
+ const platformIdx = args.indexOf("--platform");
323
+ const platformArg = args[platformIdx + 1] as PlatformType;
324
+ if (!["windows", "darwin", "linux"].includes(platformArg)) {
325
+ console.error(`Invalid platform: ${platformArg}`);
326
+ console.error("Valid platforms: windows, darwin, linux");
327
+ process.exit(1);
328
+ }
329
+ platforms = [platformArg];
330
+ } else {
331
+ // Default to current platform
332
+ const currentPlatform =
333
+ process.platform === "win32" ? "windows" : process.platform;
334
+ if (!["windows", "darwin", "linux"].includes(currentPlatform)) {
335
+ console.error(`Unsupported platform: ${currentPlatform}`);
336
+ process.exit(1);
337
+ }
338
+ platforms = [currentPlatform as PlatformType];
339
+ }
340
+
341
+ console.log("=== ADB Resources Export ===");
342
+ console.log(`Target: ${targetPath}`);
343
+ console.log(`Platforms: ${platforms.join(", ")}`);
344
+
345
+ // Create target directory
346
+ mkdirSync(targetPath, { recursive: true });
347
+
348
+ // Export resources for each platform
349
+ for (const platform of platforms) {
350
+ await exportPlatformResources(platform, targetPath);
351
+ }
352
+
353
+ // Create license file
354
+ console.log("");
355
+ createLicenseFile(targetPath);
356
+
357
+ // Clean up temp directory
358
+ await cleanupDir(path.join(targetPath, ".temp"));
359
+
360
+ console.log("\n=== Export Complete ===");
361
+ console.log(`Resources exported to: ${targetPath}`);
362
+ }
363
+
364
+ main().catch((error) => {
365
+ console.error("Export failed:", error);
366
+ process.exit(1);
367
+ });
368
+
Binary file