dsh-apk-vm 0.13.0 → 0.14.0
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/CHANGELOG.md +12 -0
- package/CHANGELOG.zh-CN.md +11 -0
- package/README.md +14 -1
- package/client.js +1 -1
- package/cordis.patch.yml +7 -1
- package/docs/AGENTS.md +10 -0
- package/index.js +45 -8
- package/lib/android.js +16 -0
- package/lib/setup.js +27 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.14.0 — 2026-11-21
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **ARM translation (arm64-v8a APKs on x86_64 hosts).** `armTranslation: true` selects the
|
|
8
|
+
Google APIs image (`system-images;android-34;google_apis;x86_64`), which ships Google's
|
|
9
|
+
`libndk_translation.so` native bridge plus the `arm64-v8a` ABI, so arm64-only APKs install and
|
|
10
|
+
run without bundling a proprietary blob. `apk_vm info` and `/apk-vm/state` report the guest
|
|
11
|
+
`abilist`/`nativeBridge`/`armTranslation` state, and an APK whose native libraries match no
|
|
12
|
+
guest ABI now fails with an actionable error that names this option. The AOSP `default` image
|
|
13
|
+
remains the zero-config default.
|
|
14
|
+
|
|
3
15
|
## 0.13.0
|
|
4
16
|
|
|
5
17
|
### Added
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
0.12.0 之前的历史仅保留在英文文件中。发布时请在 [docs/RELEASING.md](docs/RELEASING.md)
|
|
5
5
|
的检查清单里确认本文件已同步更新。
|
|
6
6
|
|
|
7
|
+
## 0.14.0 — 2026-11-21
|
|
8
|
+
|
|
9
|
+
### 新增
|
|
10
|
+
|
|
11
|
+
- **ARM 转译(x86_64 主机运行 arm64-v8a APK)。** 设置 `armTranslation: true` 后使用 Google APIs
|
|
12
|
+
镜像(`system-images;android-34;google_apis;x86_64`),该镜像自带 Google 的
|
|
13
|
+
`libndk_translation.so` 原生桥与 `arm64-v8a` ABI,因此仅含 arm64 原生库的 APK 可直接安装运行,
|
|
14
|
+
无需插件捆绑任何专有库。`apk_vm info` 与 `/apk-vm/state` 会报告 guest 的
|
|
15
|
+
`abilist`/`nativeBridge`/`armTranslation` 状态;若 APK 的原生库与 guest 所有 ABI 都不匹配,
|
|
16
|
+
安装会返回可操作的错误并提示该配置项。AOSP `default` 镜像仍为零配置默认。
|
|
17
|
+
|
|
7
18
|
## 0.13.0
|
|
8
19
|
|
|
9
20
|
归属管理版本:专属虚拟机在重启后依然保留,接管必须显式确认。
|
package/README.md
CHANGED
|
@@ -527,6 +527,17 @@ the local panel is the human operator and can still operate a locked VM) or `off
|
|
|
527
527
|
advisory markers and never block). `lockControl` is `all` (default: an agent or the panel may
|
|
528
528
|
lock/unlock) or `user` (only the panel/user may lock or unlock; the `lock_vm`/`unlock_vm`
|
|
529
529
|
actions return an error).
|
|
530
|
+
|
|
531
|
+
### ARM translation (arm64-v8a APKs on x86_64 hosts)
|
|
532
|
+
|
|
533
|
+
Android 14 Google APIs images ship Google's `libndk_translation.so` native bridge and advertise the
|
|
534
|
+
`arm64-v8a` ABI, so APKs with only arm64 native libraries install and run on the x86_64 emulator.
|
|
535
|
+
Set `armTranslation: true` (or point `systemImage` at a Google APIs image yourself) to use
|
|
536
|
+
`system-images;android-34;google_apis;x86_64` instead of the AOSP image; the image is provisioned
|
|
537
|
+
through `sdkmanager` (about 1.3 GB, first download needs `allowSetupDownloads: true`). The guest
|
|
538
|
+
reports its ABI list and native bridge in `apk_vm info` (`abilist`, `nativeBridge`,
|
|
539
|
+
`armTranslation`) and `/apk-vm/state` (`armTranslation`). Installing an APK whose native libraries
|
|
540
|
+
match no ABI of the guest returns an actionable error that names this option.
|
|
530
541
|
## Multiple instances, physical devices and snapshots
|
|
531
542
|
|
|
532
543
|
- **Isolated extra instances.** `POST /apk-vm/instances {"name":"agent-a","start":true}` creates a
|
|
@@ -806,6 +817,7 @@ config:
|
|
|
806
817
|
leaseReservationTtlMs: 86400000 # dedicated (conversation/project) lease reservation; 24h
|
|
807
818
|
lockEnforcement: all # all | agents | off (operation-lock policy)
|
|
808
819
|
lockControl: all # all | user (who may lock/unlock a VM)
|
|
820
|
+
# armTranslation: true # use the Google APIs image (libndk_translation + arm64-v8a ABIs)
|
|
809
821
|
allowRemote: false # reject non-loopback VM API clients
|
|
810
822
|
autoSetup: true # zero-config first run: auto-provision JDK 17 + SDK + image + AVD
|
|
811
823
|
setupRetries: 3 # retries per provisioning step (exponential backoff)
|
|
@@ -865,7 +877,7 @@ All keys are optional; defaults are shown in the **Default** column.
|
|
|
865
877
|
| `port` | `5558` | Emulator console port used when spawning. |
|
|
866
878
|
| `sdkRoot` | `ANDROID_HOME` / `ANDROID_SDK_ROOT` | Android SDK root for `adb`, `aapt2`, `emulator-check`, `sdkmanager`/`avdmanager`. |
|
|
867
879
|
| `adbPath` | `<sdk>/platform-tools/adb` | Explicit adb executable. |
|
|
868
|
-
| `systemImage` | `system-images;android-34;default;x86_64` (`arm64-v8a` on arm64 hosts) | System image required by the Environment card and used for AVD creation. |
|
|
880
|
+
| `systemImage` | `system-images;android-34;default;x86_64` (`arm64-v8a` on arm64 hosts) | System image required by the Environment card and used for AVD creation. Set `armTranslation: true` instead to use the Google APIs image, which ships `libndk_translation.so` and the `arm64-v8a` ABI. |
|
|
869
881
|
| `spawnEmulator` | `true` | Set `false` to only attach (never spawn). |
|
|
870
882
|
| `emulatorArgs` | `[]` | Extra argv appended to the emulator command line. |
|
|
871
883
|
| `roots` | `[]` | Extra APK discovery roots. The DSH working directory, `process.cwd()` and the home directory are added automatically. |
|
|
@@ -899,6 +911,7 @@ All keys are optional; defaults are shown in the **Default** column.
|
|
|
899
911
|
| `leaseReservationTtlMs` | `86400000` | How long a `conversation`/`project` lease stays reserved for its owner across restarts. The VM cannot be claimed by another owner until it expires (explicit takeover still allowed). |
|
|
900
912
|
| `lockEnforcement` | `all` | Operation-lock policy: `all` (hard lock for every other mutating client, including a panel takeover), `agents` (only other agents are blocked; the local panel may still operate a locked VM), `off` (locks are advisory and never block). |
|
|
901
913
|
| `lockControl` | `all` | Who may lock/unlock: `all` (agents or the panel) or `user` (panel/user only; `lock_vm`/`unlock_vm` return an error). |
|
|
914
|
+
| `armTranslation` | `false` | Use the Google APIs system image (`system-images;android-34;google_apis;x86_64`), which ships Google's `libndk_translation.so` and the `arm64-v8a` ABI so arm64-only APKs install and run on the x86_64 emulator. An explicit `systemImage` wins over this flag. |
|
|
902
915
|
| `allowRemote` | `false` | Allow non-loopback clients to reach `/apk-vm/*` and `/apk-vm/ws` (only behind your own authenticated proxy). |
|
|
903
916
|
| `allowSetupDownloads` | `false` | Allow the Environment card's `install-image` action to run `sdkmanager --install` (large download). |
|
|
904
917
|
| `autoSetup` | `true` | Provision a missing JDK 17 / SDK packages / system image / AVD automatically on first use (roughly 2.5 GB on a cold machine). Set `false` to keep setup manual. |
|
package/client.js
CHANGED
|
@@ -30,7 +30,7 @@ window.__ModuleLoader__.load({
|
|
|
30
30
|
var SWIPE_THRESHOLD_PX = 24;
|
|
31
31
|
var FRAME_INTERVAL_MS = 500;
|
|
32
32
|
var STATE_INTERVAL_MS = 2000;
|
|
33
|
-
var CLIENT_VERSION = '0.
|
|
33
|
+
var CLIENT_VERSION = '0.14.0';
|
|
34
34
|
|
|
35
35
|
/* ------------------------------------------------------------------ *
|
|
36
36
|
* Optional dsh-better-sidebar integration.
|
package/cordis.patch.yml
CHANGED
|
@@ -10,7 +10,13 @@
|
|
|
10
10
|
# emulatorPath explicitly only for non-standard installs.
|
|
11
11
|
# sdkRoot: 'D:/Android/sdk'
|
|
12
12
|
# emulatorPath: 'D:/Android/sdk/emulator/emulator.exe'
|
|
13
|
-
systemImage: 'system-images;android-34;default;x86_64'
|
|
13
|
+
# systemImage: 'system-images;android-34;default;x86_64'
|
|
14
|
+
# ARM translation: use the Google APIs image instead of the AOSP one.
|
|
15
|
+
# Android 14 x86_64 Google APIs images ship Google's libndk_translation
|
|
16
|
+
# native bridge plus the arm64-v8a ABI, so arm64-only APKs install and
|
|
17
|
+
# run. The image is downloaded through sdkmanager (about 1.3 GB) and
|
|
18
|
+
# needs allowSetupDownloads: true for first-time provisioning.
|
|
19
|
+
armTranslation: false
|
|
14
20
|
avdName: dsh_apk
|
|
15
21
|
bootTimeoutMs: 1200000
|
|
16
22
|
gpuMode: host
|
package/docs/AGENTS.md
CHANGED
|
@@ -152,6 +152,16 @@ The plugin configuration can relax this: `lockEnforcement: agents` blocks only o
|
|
|
152
152
|
`lockControl: user` limits lock/unlock to the panel/user (`lock_vm`/`unlock_vm` return a
|
|
153
153
|
`vm-lock-restricted` error).
|
|
154
154
|
|
|
155
|
+
## ARM translation
|
|
156
|
+
|
|
157
|
+
By default the VM runs the AOSP `default` image, which has `x86_64` only. A VM created with
|
|
158
|
+
`armTranslation: true` uses the Android 14 Google APIs image instead: it ships Google's
|
|
159
|
+
`libndk_translation.so` native bridge and advertises `arm64-v8a`, so APKs with only arm64 native
|
|
160
|
+
libraries install and run. `apk_vm info` exposes `abilist`, `nativeBridge` and `armTranslation`;
|
|
161
|
+
`/apk-vm/state` exposes `armTranslation.{enabled,guestArmTranslation,abilist,nativeBridge}`. An
|
|
162
|
+
APK with no matching native ABI (for example an arm64-only APK on the AOSP image) fails with
|
|
163
|
+
`INSTALL_FAILED_NO_MATCHING_ABIS` plus a hint to enable `armTranslation` and recreate the VM.
|
|
164
|
+
|
|
155
165
|
## Instances and remote VMs
|
|
156
166
|
|
|
157
167
|
- `list_instances` lists `default`, extra instances and remote sessions. Remote sessions appear
|
package/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import { defaultInstanceNamesPath } from './lib/instance-names.js';
|
|
|
28
28
|
import { OWNER_SCOPE, VmLeaseConflict, normalizeScope } from './lib/vm-ownership.js';
|
|
29
29
|
import { TAKEOVER_HEADER, checkOwnerAccess, ownerFromHttp, takeoverFromHttp } from './lib/http-owner.js';
|
|
30
30
|
import { ScrcpySession, annexbToAvcc, CONTROL_MESSAGE_TYPE } from './lib/scrcpy.js';
|
|
31
|
-
import { detectEnvironment, createAvd, installSystemImage, installSdkPackages, bootstrapSdk,
|
|
31
|
+
import { detectEnvironment, createAvd, installSystemImage, installSdkPackages, bootstrapSdk, resolveSystemImage } from './lib/setup.js';
|
|
32
32
|
import { createAutoSetup } from './lib/autosetup.js';
|
|
33
33
|
import { ensureJdk, defaultJdkRoot } from './lib/jdk.js';
|
|
34
34
|
import { acceptWebSocket } from './lib/ws.js';
|
|
@@ -373,6 +373,11 @@ export function apply(ctx, config = {}) {
|
|
|
373
373
|
? cfg.lockEnforcement
|
|
374
374
|
: 'all';
|
|
375
375
|
const lockControl = cfg.lockControl === 'user' ? 'user' : 'all';
|
|
376
|
+
// ARM translation: the Google APIs image ships Google's libndk_translation
|
|
377
|
+
// native bridge plus the arm64-v8a ABI, so arm64-only APKs install and run
|
|
378
|
+
// without bundling any proprietary blob.
|
|
379
|
+
const armTranslation = cfg.armTranslation === true;
|
|
380
|
+
const systemImage = resolveSystemImage({ systemImage: cfg.systemImage, armTranslation });
|
|
376
381
|
const vm = new AndroidVm({
|
|
377
382
|
sdkRoot: cfg.sdkRoot || process.env.ANDROID_HOME || process.env.ANDROID_SDK_ROOT || undefined,
|
|
378
383
|
adbPath: cfg.adbPath || undefined,
|
|
@@ -405,7 +410,7 @@ export function apply(ctx, config = {}) {
|
|
|
405
410
|
sdkRoot: vm.sdkRoot || cfg.sdkRoot || undefined,
|
|
406
411
|
adbPath: vm.adbPath,
|
|
407
412
|
emulatorPath: vm.emulatorPath,
|
|
408
|
-
systemImage:
|
|
413
|
+
systemImage: systemImage,
|
|
409
414
|
baseAvdName: cfg.avdName || 'dsh_apk',
|
|
410
415
|
namesFile: defaultInstanceNamesPath(dataRoot),
|
|
411
416
|
maxInstances: cfg.maxInstances || 3,
|
|
@@ -562,7 +567,7 @@ export function apply(ctx, config = {}) {
|
|
|
562
567
|
adbPath: cfg.adbPath || undefined,
|
|
563
568
|
emulatorPath: cfg.emulatorPath || undefined,
|
|
564
569
|
avdName: cfg.avdName || undefined,
|
|
565
|
-
systemImage:
|
|
570
|
+
systemImage: systemImage,
|
|
566
571
|
jdkRoot: configuredJdkRoot,
|
|
567
572
|
});
|
|
568
573
|
setupCacheAt = now;
|
|
@@ -687,7 +692,7 @@ export function apply(ctx, config = {}) {
|
|
|
687
692
|
adbPath: cfg.adbPath || undefined,
|
|
688
693
|
emulatorPath: cfg.emulatorPath || undefined,
|
|
689
694
|
avdName: cfg.avdName || 'dsh_apk',
|
|
690
|
-
systemImage:
|
|
695
|
+
systemImage: systemImage,
|
|
691
696
|
platform: process.platform,
|
|
692
697
|
jdkRoot: configuredJdkRoot,
|
|
693
698
|
jdkMirror: cfg.jdkMirror,
|
|
@@ -1434,7 +1439,21 @@ export function apply(ctx, config = {}) {
|
|
|
1434
1439
|
}
|
|
1435
1440
|
const status = await vm.status();
|
|
1436
1441
|
if (!isReady(status)) throw new Error(`VM is not ready (state: ${status.state}); start it first`);
|
|
1437
|
-
|
|
1442
|
+
let meta;
|
|
1443
|
+
try {
|
|
1444
|
+
meta = await vm.installApk(apkPath);
|
|
1445
|
+
} catch (error) {
|
|
1446
|
+
const message = String((error && error.message) || error);
|
|
1447
|
+
if (/INSTALL_FAILED_NO_MATCHING_ABIS/i.test(message)) {
|
|
1448
|
+
throw new Error(
|
|
1449
|
+
`${message} — the APK ships native libraries for an ABI this VM does not support. ` +
|
|
1450
|
+
'Enable ARM translation (armTranslation: true) in <profile>/cordis.patch.yml: it selects ' +
|
|
1451
|
+
'the Google APIs image, which carries libndk_translation.so and the arm64-v8a ABI. ' +
|
|
1452
|
+
'Then restart the VM and install again.',
|
|
1453
|
+
);
|
|
1454
|
+
}
|
|
1455
|
+
throw error;
|
|
1456
|
+
}
|
|
1438
1457
|
lastApk = {
|
|
1439
1458
|
path: apkPath,
|
|
1440
1459
|
packageName: meta.packageName || null,
|
|
@@ -1688,6 +1707,14 @@ export function apply(ctx, config = {}) {
|
|
|
1688
1707
|
shared: instanceManager && typeof instanceManager.sharedStatus === 'function' ? instanceManager.sharedStatus() : null,
|
|
1689
1708
|
// Operation-lock policy: 'all' | 'agents' | 'off' + lock control 'all' | 'user'.
|
|
1690
1709
|
lockPolicy: { enforcement: lockEnforcement, control: lockControl },
|
|
1710
|
+
// ARM64 translation: config intent plus what the guest actually reports.
|
|
1711
|
+
armTranslation: {
|
|
1712
|
+
enabled: armTranslation,
|
|
1713
|
+
systemImage,
|
|
1714
|
+
guestArmTranslation: Boolean(status.identity && status.identity.armTranslation),
|
|
1715
|
+
abilist: status.identity && Array.isArray(status.identity.abilist) ? status.identity.abilist : [],
|
|
1716
|
+
nativeBridge: status.identity ? status.identity.nativeBridge || null : null,
|
|
1717
|
+
},
|
|
1691
1718
|
client: lastClientReport,
|
|
1692
1719
|
owner: instanceManager ? instanceManager.ownerInfo('default') : null,
|
|
1693
1720
|
instances: [
|
|
@@ -2704,7 +2731,7 @@ export function apply(ctx, config = {}) {
|
|
|
2704
2731
|
jdkRoot: configuredJdkRoot,
|
|
2705
2732
|
emulatorPath: cfg.emulatorPath || undefined,
|
|
2706
2733
|
avdName: body.avdName || cfg.avdName || 'dsh_apk',
|
|
2707
|
-
systemImage:
|
|
2734
|
+
systemImage: systemImage,
|
|
2708
2735
|
});
|
|
2709
2736
|
setupCache = null;
|
|
2710
2737
|
sendJson(res, 200, { ok: result.ok === true, action, result });
|
|
@@ -2718,7 +2745,7 @@ export function apply(ctx, config = {}) {
|
|
|
2718
2745
|
const result = await installSystemImage({
|
|
2719
2746
|
sdkRoot: cfg.sdkRoot || undefined,
|
|
2720
2747
|
jdkRoot: configuredJdkRoot,
|
|
2721
|
-
systemImage:
|
|
2748
|
+
systemImage: systemImage,
|
|
2722
2749
|
acceptLicenses: true,
|
|
2723
2750
|
...provisionNetworkOptions(),
|
|
2724
2751
|
});
|
|
@@ -2731,7 +2758,7 @@ export function apply(ctx, config = {}) {
|
|
|
2731
2758
|
sendError(res, 403, 'downloading Android SDK components is disabled; set allowSetupDownloads: true to enable it');
|
|
2732
2759
|
return;
|
|
2733
2760
|
}
|
|
2734
|
-
const image = String(
|
|
2761
|
+
const image = String(systemImage);
|
|
2735
2762
|
const apiLevel = (image.split(';')[1] || 'android-34').replace(/^android-/, '');
|
|
2736
2763
|
const packages = Array.isArray(body.packages) && body.packages.length
|
|
2737
2764
|
? body.packages
|
|
@@ -2984,6 +3011,16 @@ export function apply(ctx, config = {}) {
|
|
|
2984
3011
|
installing: Boolean(instance.installInFlight),
|
|
2985
3012
|
origin: serverOrigin,
|
|
2986
3013
|
stream: { fps: 2, hostFps: null, h264: instance.videoStatus ? instance.videoStatus() : { enabled: false, active: false, clients: 0, maxFps: 0 } },
|
|
3014
|
+
armTranslation: (() => {
|
|
3015
|
+
const identity = instance.vm && instance.vm._identity ? instance.vm._identity : null;
|
|
3016
|
+
return {
|
|
3017
|
+
enabled: armTranslation,
|
|
3018
|
+
systemImage,
|
|
3019
|
+
guestArmTranslation: Boolean(identity && identity.armTranslation),
|
|
3020
|
+
abilist: identity && Array.isArray(identity.abilist) ? identity.abilist : [],
|
|
3021
|
+
nativeBridge: (identity && identity.nativeBridge) || null,
|
|
3022
|
+
};
|
|
3023
|
+
})(),
|
|
2987
3024
|
};
|
|
2988
3025
|
};
|
|
2989
3026
|
|
package/lib/android.js
CHANGED
|
@@ -2592,12 +2592,24 @@ export class AndroidVm {
|
|
|
2592
2592
|
const match = /^\[([^\]]+)\]: \[(.*)\]$/.exec(line.trim());
|
|
2593
2593
|
if (match) props[match[1]] = match[2];
|
|
2594
2594
|
}
|
|
2595
|
+
const abilist = String(props['ro.product.cpu.abilist'] || '')
|
|
2596
|
+
.split(',')
|
|
2597
|
+
.map((entry) => entry.trim())
|
|
2598
|
+
.filter(Boolean);
|
|
2599
|
+
const nativeBridgeRaw = String(props['ro.dalvik.vm.native.bridge'] || '').trim();
|
|
2600
|
+
// Android reports "0" when no native bridge is active.
|
|
2601
|
+
const nativeBridge =
|
|
2602
|
+
nativeBridgeRaw && !/^(0|false|none)$/i.test(nativeBridgeRaw) ? nativeBridgeRaw : null;
|
|
2603
|
+
const armAbis = abilist.filter((entry) => entry.startsWith('arm') || entry === 'armeabi');
|
|
2595
2604
|
this._identity = {
|
|
2596
2605
|
release: props['ro.build.version.release'] || null,
|
|
2597
2606
|
sdk: props['ro.build.version.sdk'] ? Number(props['ro.build.version.sdk']) : null,
|
|
2598
2607
|
model: props['ro.product.model'] || null,
|
|
2599
2608
|
device: props['ro.product.device'] || null,
|
|
2600
2609
|
abi: props['ro.product.cpu.abi'] || props['ro.product.cpu.abilist'] || null,
|
|
2610
|
+
abilist,
|
|
2611
|
+
nativeBridge: nativeBridge || null,
|
|
2612
|
+
armTranslation: armAbis.length > 0 || Boolean(nativeBridge),
|
|
2601
2613
|
debugBuild: props['ro.debuggable'] === '1',
|
|
2602
2614
|
adbSecure: props['ro.adb.secure'] === '1',
|
|
2603
2615
|
root: this._root === true,
|
|
@@ -2933,6 +2945,10 @@ export class AndroidVm {
|
|
|
2933
2945
|
external: this._external === true,
|
|
2934
2946
|
debugToolkit: this._debugToolkitPath,
|
|
2935
2947
|
identity,
|
|
2948
|
+
abi: identity ? identity.abi : null,
|
|
2949
|
+
abilist: identity && Array.isArray(identity.abilist) ? identity.abilist : [],
|
|
2950
|
+
nativeBridge: identity ? identity.nativeBridge || null : null,
|
|
2951
|
+
armTranslation: identity ? identity.armTranslation === true : false,
|
|
2936
2952
|
size,
|
|
2937
2953
|
physicalSize,
|
|
2938
2954
|
density,
|
package/lib/setup.js
CHANGED
|
@@ -129,6 +129,32 @@ export const DEFAULT_SYSTEM_IMAGE =
|
|
|
129
129
|
? 'system-images;android-34;default;arm64-v8a'
|
|
130
130
|
: 'system-images;android-34;default;x86_64';
|
|
131
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Google APIs image used when ARM translation is requested. On x86_64 hosts
|
|
134
|
+
* the Google APIs image ships Google's `libndk_translation.so` native bridge
|
|
135
|
+
* plus the `arm64-v8a` ABI, so arm64-only APKs run without bundling any
|
|
136
|
+
* proprietary blob. On Apple Silicon the same image tag is available as
|
|
137
|
+
* arm64-v8a and runs natively.
|
|
138
|
+
*/
|
|
139
|
+
export const ARM_TRANSLATION_SYSTEM_IMAGE =
|
|
140
|
+
process.arch === 'arm64'
|
|
141
|
+
? 'system-images;android-34;google_apis;arm64-v8a'
|
|
142
|
+
: 'system-images;android-34;google_apis;x86_64';
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Resolve the system image for a run. An explicit `systemImage` wins; else
|
|
146
|
+
* `armTranslation: true` selects the Google APIs (NDK translation) image; the
|
|
147
|
+
* AOSP `default` image is the fallback. Kept side-effect free so it is cheap
|
|
148
|
+
* to unit test.
|
|
149
|
+
*/
|
|
150
|
+
export function resolveSystemImage(options = {}) {
|
|
151
|
+
if (typeof options.systemImage === 'string' && options.systemImage.trim()) {
|
|
152
|
+
return options.systemImage.trim();
|
|
153
|
+
}
|
|
154
|
+
if (options.armTranslation === true) return ARM_TRANSLATION_SYSTEM_IMAGE;
|
|
155
|
+
return DEFAULT_SYSTEM_IMAGE;
|
|
156
|
+
}
|
|
157
|
+
|
|
132
158
|
/** Default AVD name expected by `lib/android.js` when spawning the emulator. */
|
|
133
159
|
export const DEFAULT_AVD_NAME = 'dsh_apk';
|
|
134
160
|
|
|
@@ -533,7 +559,7 @@ function normalizeOptions(options, functionName) {
|
|
|
533
559
|
|
|
534
560
|
let systemImage = options.systemImage;
|
|
535
561
|
if (systemImage === undefined || systemImage === null || systemImage === '') {
|
|
536
|
-
systemImage =
|
|
562
|
+
systemImage = resolveSystemImage(options);
|
|
537
563
|
} else if (typeof systemImage !== 'string' || !SYSTEM_IMAGE_RE.test(systemImage)) {
|
|
538
564
|
throw new TypeError(
|
|
539
565
|
`${functionName}(options): options.systemImage must look like ` +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-apk-vm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local AOSP Android VM for DeepSeek Harness: preview rooted APKs at up to 60 fps, automate UIAutomator flows, and give each Agent an isolated VM.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"scripts": {
|
|
41
41
|
"check": "node --check index.js && node --check client.js && node --check lib/android.js && node --check lib/apk-bundle.js && node --check lib/flows.js && node --check lib/storage.js && node --check lib/ui-inspector.js && node --check lib/x509.js && node --check lib/scrcpy.js && node --check lib/ws.js && node --check lib/setup.js && node --check lib/instances.js && node --check lib/lease-store.js && node --check lib/vm-ownership.js && node --check lib/http-owner.js && node --check lib/video-stream.js && node --check lib/aab.js && node --check lib/har.js && node --check lib/ui-tests.js && node --check lib/remote.js && node --check lib/cdp.js && node --check lib/json-safe.js && node --check lib/png-annotate.js && node --check lib/image-features.js && node --check lib/control-codebook.js && node --check lib/app-skills.js && node --check lib/jdk.js && node --check lib/autosetup.js && node --check lib/activity-log.js && node --check lib/installed-apps.js && node --check lib/remote-instance.js && node --check lib/media.js && node --check lib/emulator-inventory.js && node --check lib/instance-names.js && node --check lib/memory.js && node scripts/check-version.mjs",
|
|
42
42
|
"privacy": "node scripts/privacy-scan.mjs",
|
|
43
|
-
"test": "node spike/ui-smoke.cjs && node spike/ui-better-sidebar-smoke.cjs && node spike/setup-smoke.mjs && node spike/jdk-test.mjs && node spike/autosetup-test.mjs && node spike/tool-core-test.mjs && node spike/activity-log-test.mjs && node spike/installed-apps-test.mjs && node spike/instance-names-test.mjs && node spike/snapshot-recovery-test.mjs && node spike/memory-test.mjs && node spike/android/mock-device.mjs && node spike/android/resilience-test.mjs && node spike/android/launch-plan.mjs && node spike/instances-smoke.mjs && node spike/shared-resident-test.mjs && node spike/storage-clean-test.mjs && node spike/ownership-test.mjs && node spike/cdp-test.mjs && node spike/features.mjs && node spike/aab-test.mjs && node spike/har-test.mjs && node spike/ui-tests-test.mjs && node spike/remote-test.mjs && node spike/remote-instance-test.mjs && node spike/media-test.mjs && node spike/emulator-inventory-test.mjs && node spike/skill-test.mjs"
|
|
43
|
+
"test": "node spike/ui-smoke.cjs && node spike/ui-better-sidebar-smoke.cjs && node spike/setup-smoke.mjs && node spike/jdk-test.mjs && node spike/autosetup-test.mjs && node spike/tool-core-test.mjs && node spike/activity-log-test.mjs && node spike/installed-apps-test.mjs && node spike/instance-names-test.mjs && node spike/snapshot-recovery-test.mjs && node spike/memory-test.mjs && node spike/arm-translation-test.mjs && node spike/android/mock-device.mjs && node spike/android/resilience-test.mjs && node spike/android/launch-plan.mjs && node spike/instances-smoke.mjs && node spike/shared-resident-test.mjs && node spike/storage-clean-test.mjs && node spike/ownership-test.mjs && node spike/cdp-test.mjs && node spike/features.mjs && node spike/aab-test.mjs && node spike/har-test.mjs && node spike/ui-tests-test.mjs && node spike/remote-test.mjs && node spike/remote-instance-test.mjs && node spike/media-test.mjs && node spike/emulator-inventory-test.mjs && node spike/skill-test.mjs"
|
|
44
44
|
},
|
|
45
45
|
"exports": {
|
|
46
46
|
".": "./index.js",
|