@swmansion/argent 0.30.2-next.11 → 0.30.2-next.13

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/dist/cli-cmds.mjs CHANGED
@@ -35578,7 +35578,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
35578
35578
  var SESSION_ID2 = randomUUID5();
35579
35579
  function readCliVersion() {
35580
35580
  if (true) {
35581
- return "0.30.2-next.11";
35581
+ return "0.30.2-next.13";
35582
35582
  }
35583
35583
  return "0.0.0";
35584
35584
  }
@@ -16899,7 +16899,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16899
16899
  var SESSION_ID = randomUUID4();
16900
16900
  function readCliVersion() {
16901
16901
  if (true) {
16902
- return "0.30.2-next.11";
16902
+ return "0.30.2-next.13";
16903
16903
  }
16904
16904
  return "0.0.0";
16905
16905
  }
@@ -100944,7 +100944,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
100944
100944
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
100945
100945
  function readCliVersion() {
100946
100946
  if (true) {
100947
- return "0.30.2-next.11";
100947
+ return "0.30.2-next.13";
100948
100948
  }
100949
100949
  return "0.0.0";
100950
100950
  }
@@ -174644,7 +174644,7 @@ async function runSnapshot(env, opts) {
174644
174644
  }
174645
174645
  };
174646
174646
  }
174647
- const within = result.mismatchPercentage <= opts.maxMismatch;
174647
+ const within = result.mismatchPercentage <= opts.maxMismatch * (1 + 1e-14);
174648
174648
  const reason2 = `diff ${result.mismatchPercentage.toFixed(2)}% ${within ? "\u2264" : ">"} ${opts.maxMismatch}% (${key2})`;
174649
174649
  if (within) {
174650
174650
  return { status: "pass", reason: reason2, ...captureWarned };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.30.2-next.11",
3
+ "version": "0.30.2-next.13",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator and Android Emulator control",
6
6
  "license": "Apache-2.0",
@@ -66,6 +66,49 @@ Only `enter` (alias `return`), `backspace` (alias `delete`), `space`, `arrow-lef
66
66
  - `reinstall-app` takes one `.hap` file as `appPath` and the bundle name from its `module.json` as `bundleId`; a mismatch is refused before anything is uninstalled. A multi-module `.app` bundle is not accepted.
67
67
  - `open-url` resolves any scheme through `aa start -U`, and every result carries a `note`: `aa` reports success whenever the system accepts the URI. A web URL can leave the screen unchanged, and `tel:` / `mailto:` can leave a "No options to open with" dialog over it. Confirm with `describe` or `screenshot` before treating the link as followed. It fails whenever `aa` refuses the URI, as it does a scheme nothing claims.
68
68
 
69
+ ## Building and signing a HAP
70
+
71
+ Both blocks below use the default macOS install, the only layout verified; elsewhere point `C` and the Java path at the matching DevEco Studio directories. The build assumes the module `entry` and the product `default`, which the output path depends on. Build from the project root without the IDE:
72
+
73
+ ```bash
74
+ C=/Applications/DevEco-Studio.app/Contents
75
+ export DEVECO_SDK_HOME=$C/sdk PATH=$C/tools/node/bin:$C/tools/ohpm/bin:$C/jbr/Contents/Home/bin:$PATH
76
+ ohpm install --all
77
+ rm -rf entry/build/default/outputs
78
+ node $C/tools/hvigor/bin/hvigorw.js --mode module -p module=entry@default -p product=default -p buildMode=debug assembleHap --no-daemon
79
+ ```
80
+
81
+ With no `signingConfigs` in `build-profile.json5` this writes `entry/build/default/outputs/default/entry-default-unsigned.hap`. A `signingConfigs` naming key files this machine lacks (DevEco writes absolute paths under its author's `~/.ohos/config`) fails the build at `SignHap`, e.g. `Invalid storeFile value`, after that HAP is written; sign it below. Any other failed build leaves no HAP.
82
+
83
+ The emulator installs any HAP, including an unsigned one or one whose signature fails verification, so an emulator install proves nothing about signing. A phone refuses an unsigned HAP (`9568320 error: no signature file`). Sign it with a debug profile for the app's bundle name that lists the phone's UDID (`hdc -t <connectKey> shell bm get --udid`, last line; `hdc` is in `$C/sdk/default/openharmony/toolchains`). `L` below is `$C/sdk/default/openharmony/toolchains/lib`, set in the signing block.
84
+
85
+ **Test keys, no account.** `$L/OpenHarmony.p12` (password `123456`) is OpenHarmony's public test PKI; use it for development only. A HAP signed this way installs and launches on a HarmonyOS 6.0 phone.
86
+
87
+ 1. Certificate chain `app-chain.cer`, leaf first: the `bundle-info.development-certificate` from `$L/UnsgnedDebugProfileTemplate.json`, then the `OpenHarmony Application CA` and `OpenHarmony Application Root CA` certificates from `$L/OpenHarmonyProfileDebug.pem`.
88
+ 2. Profile `profile.json`: a copy of the template with your `bundle-info.bundle-name`, the phone's UDID in `debug-info.device-ids`, and a current `validity` window in epoch seconds (the template's expired in January 2024).
89
+ 3. Sign the profile, then the HAP, from the project root with DevEco's Java:
90
+
91
+ ```bash
92
+ C=/Applications/DevEco-Studio.app/Contents L=$C/sdk/default/openharmony/toolchains/lib
93
+ export PATH=$C/jbr/Contents/Home/bin:$PATH
94
+ rm -f app-signed.hap
95
+ java -jar $L/hap-sign-tool.jar sign-profile -mode localSign -signAlg SHA256withECDSA \
96
+ -keystoreFile $L/OpenHarmony.p12 -keystorePwd 123456 -keyPwd 123456 \
97
+ -keyAlias "openharmony application profile debug" -profileCertFile $L/OpenHarmonyProfileDebug.pem \
98
+ -inFile profile.json -outFile profile.p7b &&
99
+ java -jar $L/hap-sign-tool.jar sign-app -mode localSign -signAlg SHA256withECDSA -signCode 1 \
100
+ -keystoreFile $L/OpenHarmony.p12 -keystorePwd 123456 -keyPwd 123456 \
101
+ -keyAlias "openharmony application release" -appCertFile app-chain.cer -profileFile profile.p7b \
102
+ -inFile entry/build/default/outputs/default/entry-default-unsigned.hap -outFile app-signed.hap
103
+ ```
104
+
105
+ **Real keys, Huawei ID.** These need the user's Huawei account; ask before using it.
106
+
107
+ - DevEco Studio: sign in, connect the phone, and tick _Automatically generate signature_ under File > Project Structure > Project > Signing Configs. Tick _Support HarmonyOS_ too if it is offered; without it the signature is an OpenHarmony one. It writes `signingConfigs` into `build-profile.json5`, and the build above then emits `entry-default-signed.hap`.
108
+ - AppGallery Connect: create a `.p12` and CSR (DevEco: Build > Generate Key and CSR), then request a debug certificate (`.cer`) from the CSR, register the phone's UDID and the app, and request a debug profile (`.p7b`) for that app, that certificate and the device. Run the signing block without `sign-profile`, giving `sign-app` your `.p12`, key alias, passwords, `.cer` and `.p7b`; AppGallery Connect has already signed the profile.
109
+
110
+ In the signing block's shell, `java -jar $L/hap-sign-tool.jar verify-app -inFile <hap> -outCertChain c.cer -outProfile p.p7b` checks the signature on the host, but not that the profile's bundle name matches the HAP's. A phone refuses that mismatch with `9568329 verify signature failed`, so only an install proves the phone accepts a HAP. Install it with `reinstall-app` (`appPath` the HAP's absolute path, `bundleId` its bundle name), then `launch-app` it. `reinstall-app` uninstalls first, so a HAP the phone refuses also costs the installed copy and its data; to keep them, install with `hdc -t <connectKey> install <hap>` instead, which leaves the installed copy on a refusal.
111
+
69
112
  ## E2E tests
70
113
 
71
114
  The e2e runner (`e2e-execute`, skill `argent-create-e2e`) runs on HarmonyOS only when you name the device: `device: "harmony-<connectKey>"` (`--device` on the CLI). A HarmonyOS device is never auto-resolved, and `platform` / `--platform` does not accept `harmony`. HarmonyOS is not an authorable platform either: `when: { platform: harmony }` and a `harmony:` launch-map key are rejected when the YAML is parsed, so launch with a bare app id or `native:`.