@solidnative-dev/cli 0.0.0-stage → 0.1.0-alpha.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/LICENSE +21 -0
- package/README.md +841 -2
- package/dist/android-apk-signing.d.ts +36 -0
- package/dist/android-apk-signing.d.ts.map +1 -0
- package/dist/android-apk-signing.js +292 -0
- package/dist/android-apk-signing.js.map +1 -0
- package/dist/android-bundle-signing.d.ts +34 -0
- package/dist/android-bundle-signing.d.ts.map +1 -0
- package/dist/android-bundle-signing.js +167 -0
- package/dist/android-bundle-signing.js.map +1 -0
- package/dist/android-causal-debug.d.ts +38 -0
- package/dist/android-causal-debug.d.ts.map +1 -0
- package/dist/android-causal-debug.js +239 -0
- package/dist/android-causal-debug.js.map +1 -0
- package/dist/android-device-proof.d.ts +58 -0
- package/dist/android-device-proof.d.ts.map +1 -0
- package/dist/android-device-proof.js +554 -0
- package/dist/android-device-proof.js.map +1 -0
- package/dist/android-logs.d.ts +50 -0
- package/dist/android-logs.d.ts.map +1 -0
- package/dist/android-logs.js +253 -0
- package/dist/android-logs.js.map +1 -0
- package/dist/android-release-signing.d.ts +12 -0
- package/dist/android-release-signing.d.ts.map +1 -0
- package/dist/android-release-signing.js +165 -0
- package/dist/android-release-signing.js.map +1 -0
- package/dist/android-run-lease.d.ts +15 -0
- package/dist/android-run-lease.d.ts.map +1 -0
- package/dist/android-run-lease.js +333 -0
- package/dist/android-run-lease.js.map +1 -0
- package/dist/android-run-preflight.d.ts +45 -0
- package/dist/android-run-preflight.d.ts.map +1 -0
- package/dist/android-run-preflight.js +183 -0
- package/dist/android-run-preflight.js.map +1 -0
- package/dist/android-signing-shared.d.ts +38 -0
- package/dist/android-signing-shared.d.ts.map +1 -0
- package/dist/android-signing-shared.js +210 -0
- package/dist/android-signing-shared.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +4530 -0
- package/dist/bin.js.map +1 -0
- package/dist/bundle-artifacts.d.ts +48 -0
- package/dist/bundle-artifacts.d.ts.map +1 -0
- package/dist/bundle-artifacts.js +427 -0
- package/dist/bundle-artifacts.js.map +1 -0
- package/dist/causal-debug-compare.d.ts +81 -0
- package/dist/causal-debug-compare.d.ts.map +1 -0
- package/dist/causal-debug-compare.js +238 -0
- package/dist/causal-debug-compare.js.map +1 -0
- package/dist/causal-debug-report.d.ts +33 -0
- package/dist/causal-debug-report.d.ts.map +1 -0
- package/dist/causal-debug-report.js +979 -0
- package/dist/causal-debug-report.js.map +1 -0
- package/dist/causal-debug-watch.d.ts +33 -0
- package/dist/causal-debug-watch.d.ts.map +1 -0
- package/dist/causal-debug-watch.js +92 -0
- package/dist/causal-debug-watch.js.map +1 -0
- package/dist/causal-debug.d.ts +131 -0
- package/dist/causal-debug.d.ts.map +1 -0
- package/dist/causal-debug.js +503 -0
- package/dist/causal-debug.js.map +1 -0
- package/dist/compatibility-catalog.d.ts +88 -0
- package/dist/compatibility-catalog.d.ts.map +1 -0
- package/dist/compatibility-catalog.js +344 -0
- package/dist/compatibility-catalog.js.map +1 -0
- package/dist/deep-link.d.ts +90 -0
- package/dist/deep-link.d.ts.map +1 -0
- package/dist/deep-link.js +346 -0
- package/dist/deep-link.js.map +1 -0
- package/dist/device-proof-signatures.d.ts +307 -0
- package/dist/device-proof-signatures.d.ts.map +1 -0
- package/dist/device-proof-signatures.js +1024 -0
- package/dist/device-proof-signatures.js.map +1 -0
- package/dist/fingerprint.d.ts +35 -0
- package/dist/fingerprint.d.ts.map +1 -0
- package/dist/fingerprint.js +454 -0
- package/dist/fingerprint.js.map +1 -0
- package/dist/index.d.ts +388 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2996 -0
- package/dist/index.js.map +1 -0
- package/dist/ios-causal-debug.d.ts +39 -0
- package/dist/ios-causal-debug.d.ts.map +1 -0
- package/dist/ios-causal-debug.js +318 -0
- package/dist/ios-causal-debug.js.map +1 -0
- package/dist/ios-logs.d.ts +58 -0
- package/dist/ios-logs.d.ts.map +1 -0
- package/dist/ios-logs.js +269 -0
- package/dist/ios-logs.js.map +1 -0
- package/dist/ios-process.d.ts +69 -0
- package/dist/ios-process.d.ts.map +1 -0
- package/dist/ios-process.js +389 -0
- package/dist/ios-process.js.map +1 -0
- package/dist/ios-run-preflight.d.ts +35 -0
- package/dist/ios-run-preflight.d.ts.map +1 -0
- package/dist/ios-run-preflight.js +172 -0
- package/dist/ios-run-preflight.js.map +1 -0
- package/dist/live-causal-debug-report.d.ts +49 -0
- package/dist/live-causal-debug-report.d.ts.map +1 -0
- package/dist/live-causal-debug-report.js +123 -0
- package/dist/live-causal-debug-report.js.map +1 -0
- package/dist/local-symbolication.d.ts +35 -0
- package/dist/local-symbolication.d.ts.map +1 -0
- package/dist/local-symbolication.js +89 -0
- package/dist/local-symbolication.js.map +1 -0
- package/dist/native-archive.d.ts +15 -0
- package/dist/native-archive.d.ts.map +1 -0
- package/dist/native-archive.js +441 -0
- package/dist/native-archive.js.map +1 -0
- package/dist/native-test.d.ts +43 -0
- package/dist/native-test.d.ts.map +1 -0
- package/dist/native-test.js +209 -0
- package/dist/native-test.js.map +1 -0
- package/dist/package-add.d.ts +56 -0
- package/dist/package-add.d.ts.map +1 -0
- package/dist/package-add.js +764 -0
- package/dist/package-add.js.map +1 -0
- package/dist/react-native-upgrade.d.ts +96 -0
- package/dist/react-native-upgrade.d.ts.map +1 -0
- package/dist/react-native-upgrade.js +882 -0
- package/dist/react-native-upgrade.js.map +1 -0
- package/dist/release-device-correlation.d.ts +40 -0
- package/dist/release-device-correlation.d.ts.map +1 -0
- package/dist/release-device-correlation.js +113 -0
- package/dist/release-device-correlation.js.map +1 -0
- package/dist/release-signatures.d.ts +168 -0
- package/dist/release-signatures.d.ts.map +1 -0
- package/dist/release-signatures.js +677 -0
- package/dist/release-signatures.js.map +1 -0
- package/dist/release.d.ts +88 -0
- package/dist/release.d.ts.map +1 -0
- package/dist/release.js +771 -0
- package/dist/release.js.map +1 -0
- package/dist/signature-utilities.d.ts +16 -0
- package/dist/signature-utilities.d.ts.map +1 -0
- package/dist/signature-utilities.js +114 -0
- package/dist/signature-utilities.js.map +1 -0
- package/dist/solid-diagnostics-correlation.d.ts +11 -0
- package/dist/solid-diagnostics-correlation.d.ts.map +1 -0
- package/dist/solid-diagnostics-correlation.js +78 -0
- package/dist/solid-diagnostics-correlation.js.map +1 -0
- package/dist/solid-diagnostics-debug.d.ts +15 -0
- package/dist/solid-diagnostics-debug.d.ts.map +1 -0
- package/dist/solid-diagnostics-debug.js +93 -0
- package/dist/solid-diagnostics-debug.js.map +1 -0
- package/dist/solid-diagnostics-inspection.d.ts +41 -0
- package/dist/solid-diagnostics-inspection.d.ts.map +1 -0
- package/dist/solid-diagnostics-inspection.js +196 -0
- package/dist/solid-diagnostics-inspection.js.map +1 -0
- package/dist/source-map.d.ts +36 -0
- package/dist/source-map.d.ts.map +1 -0
- package/dist/source-map.js +488 -0
- package/dist/source-map.js.map +1 -0
- package/dist/stack-symbolication.d.ts +56 -0
- package/dist/stack-symbolication.d.ts.map +1 -0
- package/dist/stack-symbolication.js +310 -0
- package/dist/stack-symbolication.js.map +1 -0
- package/dist/symbolication.d.ts +27 -0
- package/dist/symbolication.d.ts.map +1 -0
- package/dist/symbolication.js +75 -0
- package/dist/symbolication.js.map +1 -0
- package/dist/tree-debug.d.ts +53 -0
- package/dist/tree-debug.d.ts.map +1 -0
- package/dist/tree-debug.js +283 -0
- package/dist/tree-debug.js.map +1 -0
- package/dist/versions.d.ts +13 -0
- package/dist/versions.d.ts.map +1 -0
- package/dist/versions.js +14 -0
- package/dist/versions.js.map +1 -0
- package/package.json +46 -3
- package/templates/react-native-0.88/README.md +328 -0
- package/templates/react-native-0.88/android/CMakeLists.txt +27 -0
- package/templates/react-native-0.88/android/MainActivity.kt +123 -0
- package/templates/react-native-0.88/android/MainApplication.kt +43 -0
- package/templates/react-native-0.88/android/OnLoad.cpp +60 -0
- package/templates/react-native-0.88/index.js +1 -0
- package/templates/react-native-0.88/ios/AppDelegate.swift +190 -0
- package/templates/react-native-0.88/metro.config.js +16 -0
- package/templates/react-native-0.88/specs/NativeSolidNativeDebug.ts +16 -0
- package/templates/react-native-0.88/specs/NativeSolidNativePlatformAndroid.ts +14 -0
- package/templates/react-native-0.88/src/App.tsx +161 -0
- package/templates/react-native-0.88/src/main.tsx +88 -0
- package/templates/react-native-0.88/test/App.test.tsx +152 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { readFile, mkdtemp, rm } from "node:fs/promises";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { defaultNativeAndroidLogCommandRunner, parseAndroidPackageUid, parseAuthorizedAndroidDevices, } from "./android-logs.js";
|
|
5
|
+
import { parseNativeIosInstalledApplication, } from "./ios-logs.js";
|
|
6
|
+
const COMMAND_TIMEOUT_MS = 20_000;
|
|
7
|
+
const DISCOVERY_TIMEOUT_MS = 12_000;
|
|
8
|
+
const CORE_DEVICE_TIMEOUT_SECONDS = 15;
|
|
9
|
+
const MAX_CORE_DEVICE_RESULT_BYTES = 1024 * 1024;
|
|
10
|
+
const CORE_DEVICE_RESULT_PLACEHOLDER = "<temporary-coredevice-result.json>";
|
|
11
|
+
const ANDROID_PACKAGE_NAME = /^[A-Za-z][A-Za-z0-9_]*(?:\.[A-Za-z][A-Za-z0-9_]*)+$/u;
|
|
12
|
+
const IOS_BUNDLE_IDENTIFIER = /^[A-Za-z0-9][A-Za-z0-9-]*(?:\.[A-Za-z0-9][A-Za-z0-9-]*)+$/u;
|
|
13
|
+
const ABSOLUTE_URL_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*:/u;
|
|
14
|
+
function isRecord(value) {
|
|
15
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
16
|
+
}
|
|
17
|
+
function assertApplicationIdentifier(identifier, platform) {
|
|
18
|
+
const pattern = platform === "android" ? ANDROID_PACKAGE_NAME : IOS_BUNDLE_IDENTIFIER;
|
|
19
|
+
if (identifier.length > 255 || !pattern.test(identifier)) {
|
|
20
|
+
throw new TypeError(`${platform === "android" ? "Android" : "iOS"} deep links require a valid dotted application identifier, received ${JSON.stringify(identifier)}.`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function assertDeviceIdentifier(identifier, platform) {
|
|
24
|
+
if (identifier.length === 0 ||
|
|
25
|
+
identifier.length > 256 ||
|
|
26
|
+
/[\s\0]/u.test(identifier)) {
|
|
27
|
+
throw new TypeError(`${platform === "android" ? "Android" : "iOS"} device identifiers must be 1-256 non-whitespace characters.`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function assertDeepLink(url) {
|
|
31
|
+
if (Buffer.byteLength(url, "utf8") > 4_096 ||
|
|
32
|
+
url.length === 0 ||
|
|
33
|
+
!ABSOLUTE_URL_SCHEME.test(url) ||
|
|
34
|
+
/[\0-\x20\x7f]/u.test(url)) {
|
|
35
|
+
throw new TypeError("Deep links must be absolute URLs of at most 4096 UTF-8 bytes without whitespace or control characters.");
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
new URL(url);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
throw new TypeError("Deep links must be valid absolute URLs.");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function commandFailure(operation, result, timeoutMs) {
|
|
45
|
+
if (result.timedOut) {
|
|
46
|
+
return new TypeError(`${operation} did not finish within ${String(timeoutMs / 1_000)} seconds. Confirm the device is wired, unlocked, and authorized.`);
|
|
47
|
+
}
|
|
48
|
+
if (result.errorCode === "ENOENT") {
|
|
49
|
+
return new TypeError(`${operation} could not start its platform tool. Install Android platform-tools or Xcode and put the selected tool on PATH.`);
|
|
50
|
+
}
|
|
51
|
+
const detail = `${result.stderr}\n${result.stdout}`
|
|
52
|
+
.split(/\r?\n/u)
|
|
53
|
+
.map((line) => line.trim())
|
|
54
|
+
.find((line) => line.length > 0);
|
|
55
|
+
return new TypeError(detail === undefined
|
|
56
|
+
? `${operation} failed without diagnostic output.`
|
|
57
|
+
: `${operation} failed: ${detail}`);
|
|
58
|
+
}
|
|
59
|
+
async function runCommand(runner, cwd, env, command, args, operation, timeoutMs = DISCOVERY_TIMEOUT_MS) {
|
|
60
|
+
const result = await runner(command, args, { cwd, env, timeoutMs });
|
|
61
|
+
if (result.exitCode !== 0 || result.timedOut) {
|
|
62
|
+
throw commandFailure(operation, result, timeoutMs);
|
|
63
|
+
}
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
async function createAndroidPlan(options, cwd, env, runner) {
|
|
67
|
+
assertApplicationIdentifier(options.packageName, "android");
|
|
68
|
+
let serial = options.serial;
|
|
69
|
+
if (serial === undefined) {
|
|
70
|
+
const result = await runCommand(runner, cwd, env, "adb", ["devices"], "Android device discovery");
|
|
71
|
+
const devices = parseAuthorizedAndroidDevices(result.stdout);
|
|
72
|
+
if (devices.length !== 1) {
|
|
73
|
+
throw new TypeError(`Expected exactly one authorized Android device; found ${String(devices.length)}. Pass --serial ID when more than one device is attached.`);
|
|
74
|
+
}
|
|
75
|
+
serial = devices[0];
|
|
76
|
+
}
|
|
77
|
+
if (serial === undefined) {
|
|
78
|
+
throw new TypeError("Android device discovery returned no serial.");
|
|
79
|
+
}
|
|
80
|
+
assertDeviceIdentifier(serial, "android");
|
|
81
|
+
const state = await runCommand(runner, cwd, env, "adb", ["-s", serial, "get-state"], `Android device ${serial}`);
|
|
82
|
+
if (state.stdout.trim() !== "device") {
|
|
83
|
+
throw new TypeError(`Android device ${serial} is unavailable or not authorized.`);
|
|
84
|
+
}
|
|
85
|
+
const packageResult = await runCommand(runner, cwd, env, "adb", [
|
|
86
|
+
"-s",
|
|
87
|
+
serial,
|
|
88
|
+
"shell",
|
|
89
|
+
"cmd",
|
|
90
|
+
"package",
|
|
91
|
+
"list",
|
|
92
|
+
"packages",
|
|
93
|
+
"-U",
|
|
94
|
+
options.packageName,
|
|
95
|
+
], `Android package lookup for ${options.packageName}`);
|
|
96
|
+
const uid = parseAndroidPackageUid(packageResult.stdout, options.packageName);
|
|
97
|
+
if (uid === undefined) {
|
|
98
|
+
throw new TypeError(`Android package ${options.packageName} is not installed exactly once on ${serial}.`);
|
|
99
|
+
}
|
|
100
|
+
const cold = options.cold === true;
|
|
101
|
+
return {
|
|
102
|
+
schemaVersion: 0,
|
|
103
|
+
operation: "open-deep-link",
|
|
104
|
+
platform: "android",
|
|
105
|
+
packageName: options.packageName,
|
|
106
|
+
serial,
|
|
107
|
+
uid,
|
|
108
|
+
url: options.url,
|
|
109
|
+
mode: cold ? "cold" : "preserve",
|
|
110
|
+
terminatesExistingApplication: cold,
|
|
111
|
+
cwd,
|
|
112
|
+
command: "adb",
|
|
113
|
+
args: [
|
|
114
|
+
"-s",
|
|
115
|
+
serial,
|
|
116
|
+
"shell",
|
|
117
|
+
"am",
|
|
118
|
+
"start-activity",
|
|
119
|
+
"-W",
|
|
120
|
+
"--user",
|
|
121
|
+
"current",
|
|
122
|
+
...(cold ? ["-S"] : []),
|
|
123
|
+
"-a",
|
|
124
|
+
"android.intent.action.VIEW",
|
|
125
|
+
"-c",
|
|
126
|
+
"android.intent.category.BROWSABLE",
|
|
127
|
+
"-d",
|
|
128
|
+
options.url,
|
|
129
|
+
"-p",
|
|
130
|
+
options.packageName,
|
|
131
|
+
],
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
async function createIosPlan(options, cwd, env, runner) {
|
|
135
|
+
assertApplicationIdentifier(options.bundleIdentifier, "ios");
|
|
136
|
+
assertDeviceIdentifier(options.device, "ios");
|
|
137
|
+
const hostPlatform = options.dependencies?.hostPlatform ?? process.platform;
|
|
138
|
+
if (hostPlatform !== "darwin") {
|
|
139
|
+
throw new TypeError(`iOS deep links require macOS and Xcode; received ${hostPlatform}.`);
|
|
140
|
+
}
|
|
141
|
+
const directory = await mkdtemp(path.join(tmpdir(), "solid-native-ios-deep-link-plan-"));
|
|
142
|
+
const resultPath = path.join(directory, "applications.json");
|
|
143
|
+
try {
|
|
144
|
+
await runCommand(runner, cwd, env, "xcrun", [
|
|
145
|
+
"devicectl",
|
|
146
|
+
"device",
|
|
147
|
+
"info",
|
|
148
|
+
"apps",
|
|
149
|
+
"--device",
|
|
150
|
+
options.device,
|
|
151
|
+
"--bundle-id",
|
|
152
|
+
options.bundleIdentifier,
|
|
153
|
+
"--quiet",
|
|
154
|
+
"--timeout",
|
|
155
|
+
"10",
|
|
156
|
+
"--json-output",
|
|
157
|
+
resultPath,
|
|
158
|
+
], `CoreDevice application lookup for ${options.bundleIdentifier}`);
|
|
159
|
+
let source;
|
|
160
|
+
try {
|
|
161
|
+
source = await readFile(resultPath, "utf8");
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
throw new TypeError("CoreDevice application lookup succeeded without writing its required JSON result.");
|
|
165
|
+
}
|
|
166
|
+
const application = parseNativeIosInstalledApplication(source, options.bundleIdentifier);
|
|
167
|
+
const cold = options.cold === true;
|
|
168
|
+
return {
|
|
169
|
+
schemaVersion: 0,
|
|
170
|
+
operation: "open-deep-link",
|
|
171
|
+
platform: "ios",
|
|
172
|
+
bundleIdentifier: options.bundleIdentifier,
|
|
173
|
+
device: options.device,
|
|
174
|
+
application,
|
|
175
|
+
url: options.url,
|
|
176
|
+
mode: cold ? "cold" : "preserve",
|
|
177
|
+
terminatesExistingApplication: cold,
|
|
178
|
+
cwd,
|
|
179
|
+
command: "xcrun",
|
|
180
|
+
args: [
|
|
181
|
+
"devicectl",
|
|
182
|
+
"device",
|
|
183
|
+
"process",
|
|
184
|
+
"launch",
|
|
185
|
+
"--device",
|
|
186
|
+
options.device,
|
|
187
|
+
...(cold ? ["--terminate-existing"] : []),
|
|
188
|
+
"--payload-url",
|
|
189
|
+
options.url,
|
|
190
|
+
"--quiet",
|
|
191
|
+
"--timeout",
|
|
192
|
+
String(CORE_DEVICE_TIMEOUT_SECONDS),
|
|
193
|
+
"--json-output",
|
|
194
|
+
CORE_DEVICE_RESULT_PLACEHOLDER,
|
|
195
|
+
options.bundleIdentifier,
|
|
196
|
+
],
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
finally {
|
|
200
|
+
await rm(directory, { recursive: true });
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
export async function createNativeDeepLinkPlan(options) {
|
|
204
|
+
if (!isRecord(options)) {
|
|
205
|
+
throw new TypeError("Deep-link plan options must be an object.");
|
|
206
|
+
}
|
|
207
|
+
if (options.platform !== "android" && options.platform !== "ios") {
|
|
208
|
+
throw new TypeError("Deep-link plans require an ios or android platform.");
|
|
209
|
+
}
|
|
210
|
+
if (options.cold !== undefined && typeof options.cold !== "boolean") {
|
|
211
|
+
throw new TypeError("Deep-link cold mode must be a boolean when supplied.");
|
|
212
|
+
}
|
|
213
|
+
assertDeepLink(options.url);
|
|
214
|
+
const cwd = path.resolve(options.cwd ?? process.cwd());
|
|
215
|
+
const env = options.env ?? process.env;
|
|
216
|
+
const dependencyRunner = options.dependencies?.runCommand;
|
|
217
|
+
if (dependencyRunner !== undefined &&
|
|
218
|
+
typeof dependencyRunner !== "function") {
|
|
219
|
+
throw new TypeError("The deep-link command runner is invalid.");
|
|
220
|
+
}
|
|
221
|
+
const runner = dependencyRunner ?? defaultNativeAndroidLogCommandRunner;
|
|
222
|
+
return options.platform === "android"
|
|
223
|
+
? createAndroidPlan(options, cwd, env, runner)
|
|
224
|
+
: createIosPlan(options, cwd, env, runner);
|
|
225
|
+
}
|
|
226
|
+
export function parseNativeAndroidDeepLinkExecution(source, plan) {
|
|
227
|
+
const statuses = [];
|
|
228
|
+
const activities = [];
|
|
229
|
+
const launchStates = [];
|
|
230
|
+
for (const line of source.split(/\r?\n/u)) {
|
|
231
|
+
const trimmed = line.trim();
|
|
232
|
+
const status = /^Status:\s*(\S+)$/u.exec(trimmed)?.[1];
|
|
233
|
+
if (status !== undefined)
|
|
234
|
+
statuses.push(status);
|
|
235
|
+
const activity = /^Activity:\s*(\S+)$/u.exec(trimmed)?.[1];
|
|
236
|
+
if (activity !== undefined)
|
|
237
|
+
activities.push(activity);
|
|
238
|
+
const launchState = /^LaunchState:\s*([A-Z][A-Z0-9_]{0,23}(?: \([0-9]{1,6}\))?)$/u.exec(trimmed)?.[1];
|
|
239
|
+
if (launchState !== undefined)
|
|
240
|
+
launchStates.push(launchState);
|
|
241
|
+
}
|
|
242
|
+
const activity = activities[0];
|
|
243
|
+
const launchState = launchStates[0];
|
|
244
|
+
if (statuses.length !== 1 ||
|
|
245
|
+
statuses[0] !== "ok" ||
|
|
246
|
+
activities.length !== 1 ||
|
|
247
|
+
activity === undefined ||
|
|
248
|
+
!activity.startsWith(`${plan.packageName}/`) ||
|
|
249
|
+
launchStates.length !== 1 ||
|
|
250
|
+
launchState === undefined) {
|
|
251
|
+
throw new TypeError(`Android did not confirm that ${plan.packageName} handled the deep link.`);
|
|
252
|
+
}
|
|
253
|
+
return {
|
|
254
|
+
schemaVersion: 0,
|
|
255
|
+
operation: "open-deep-link",
|
|
256
|
+
platform: "android",
|
|
257
|
+
packageName: plan.packageName,
|
|
258
|
+
serial: plan.serial,
|
|
259
|
+
url: plan.url,
|
|
260
|
+
mode: plan.mode,
|
|
261
|
+
terminatesExistingApplication: plan.terminatesExistingApplication,
|
|
262
|
+
activity,
|
|
263
|
+
launchState,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
export function parseNativeIosDeepLinkExecution(source, plan) {
|
|
267
|
+
if (Buffer.byteLength(source, "utf8") > MAX_CORE_DEVICE_RESULT_BYTES) {
|
|
268
|
+
throw new RangeError(`CoreDevice launch result exceeds ${String(MAX_CORE_DEVICE_RESULT_BYTES)} bytes.`);
|
|
269
|
+
}
|
|
270
|
+
let document;
|
|
271
|
+
try {
|
|
272
|
+
document = JSON.parse(source);
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
throw new TypeError("CoreDevice returned invalid launch JSON.");
|
|
276
|
+
}
|
|
277
|
+
if (!isRecord(document) ||
|
|
278
|
+
!isRecord(document.info) ||
|
|
279
|
+
document.info.outcome !== "success" ||
|
|
280
|
+
"error" in document ||
|
|
281
|
+
!isRecord(document.result) ||
|
|
282
|
+
!isRecord(document.result.process) ||
|
|
283
|
+
!Number.isSafeInteger(document.result.process.processIdentifier) ||
|
|
284
|
+
Number(document.result.process.processIdentifier) <= 0 ||
|
|
285
|
+
!isRecord(document.result.launchOptions) ||
|
|
286
|
+
document.result.launchOptions.terminateExistingInstances !==
|
|
287
|
+
plan.terminatesExistingApplication) {
|
|
288
|
+
throw new TypeError(`CoreDevice did not confirm the requested ${plan.mode} deep-link launch for ${plan.bundleIdentifier}.`);
|
|
289
|
+
}
|
|
290
|
+
return {
|
|
291
|
+
schemaVersion: 0,
|
|
292
|
+
operation: "open-deep-link",
|
|
293
|
+
platform: "ios",
|
|
294
|
+
bundleIdentifier: plan.bundleIdentifier,
|
|
295
|
+
device: plan.device,
|
|
296
|
+
url: plan.url,
|
|
297
|
+
mode: plan.mode,
|
|
298
|
+
terminatesExistingApplication: plan.terminatesExistingApplication,
|
|
299
|
+
processIdentifier: Number(document.result.process.processIdentifier),
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
export const defaultNativeDeepLinkExecutor = async (plan, context) => {
|
|
303
|
+
if (plan.platform === "android") {
|
|
304
|
+
const result = await runCommand(context.runCommand, plan.cwd, context.env, plan.command, plan.args, `Android deep-link delivery to ${plan.packageName}`, COMMAND_TIMEOUT_MS);
|
|
305
|
+
return parseNativeAndroidDeepLinkExecution(result.stdout, plan);
|
|
306
|
+
}
|
|
307
|
+
const directory = await mkdtemp(path.join(tmpdir(), "solid-native-ios-deep-link-run-"));
|
|
308
|
+
const resultPath = path.join(directory, "launch.json");
|
|
309
|
+
try {
|
|
310
|
+
const placeholderIndex = plan.args.indexOf(CORE_DEVICE_RESULT_PLACEHOLDER);
|
|
311
|
+
if (placeholderIndex < 0 ||
|
|
312
|
+
plan.args.lastIndexOf(CORE_DEVICE_RESULT_PLACEHOLDER) !== placeholderIndex) {
|
|
313
|
+
throw new TypeError("The iOS deep-link plan has no unique CoreDevice result placeholder.");
|
|
314
|
+
}
|
|
315
|
+
const args = [...plan.args];
|
|
316
|
+
args[placeholderIndex] = resultPath;
|
|
317
|
+
await runCommand(context.runCommand, plan.cwd, context.env, plan.command, args, `iOS deep-link delivery to ${plan.bundleIdentifier}`, COMMAND_TIMEOUT_MS);
|
|
318
|
+
let source;
|
|
319
|
+
try {
|
|
320
|
+
source = await readFile(resultPath, "utf8");
|
|
321
|
+
}
|
|
322
|
+
catch {
|
|
323
|
+
throw new TypeError("CoreDevice launch succeeded without writing its required JSON result.");
|
|
324
|
+
}
|
|
325
|
+
return parseNativeIosDeepLinkExecution(source, plan);
|
|
326
|
+
}
|
|
327
|
+
finally {
|
|
328
|
+
await rm(directory, { recursive: true });
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
export function executeNativeDeepLinkPlan(plan, options = {}) {
|
|
332
|
+
const executor = options.executor ?? defaultNativeDeepLinkExecutor;
|
|
333
|
+
return executor(plan, {
|
|
334
|
+
env: options.env ?? process.env,
|
|
335
|
+
runCommand: options.runCommand ?? defaultNativeAndroidLogCommandRunner,
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
function quoteArgument(argument) {
|
|
339
|
+
return /^[A-Za-z0-9_./:@%+=,<>-]+$/u.test(argument)
|
|
340
|
+
? argument
|
|
341
|
+
: `'${argument.replaceAll("'", `'\\''`)}'`;
|
|
342
|
+
}
|
|
343
|
+
export function formatNativeDeepLinkPlan(plan) {
|
|
344
|
+
return [plan.command, ...plan.args].map(quoteArgument).join(" ");
|
|
345
|
+
}
|
|
346
|
+
//# sourceMappingURL=deep-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deep-link.js","sourceRoot":"","sources":["../src/deep-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB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CAAC;AAEF,MAAM,UAAU,yBAAyB,CACvC,IAAwB,EACxB,UAII,EAAE;IAEN,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,6BAA6B,CAAC;IACnE,OAAO,QAAQ,CAAC,IAAI,EAAE;QACpB,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG;QAC/B,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,oCAAoC;KACvE,CAAC,CAAC;AACL,CAAC;AAED,SAAS,aAAa,CAAC,QAAgB;IACrC,OAAO,6BAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC;QACjD,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,IAAwB;IAC/D,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
export interface NativeDeviceProofSourcePolicyCheck {
|
|
2
|
+
readonly kind: "required-source" | "forbidden-fragment";
|
|
3
|
+
readonly matches: number;
|
|
4
|
+
readonly pattern: string;
|
|
5
|
+
}
|
|
6
|
+
export interface NativeDeviceProofFileFact {
|
|
7
|
+
readonly bytes: number;
|
|
8
|
+
readonly sha256: string;
|
|
9
|
+
}
|
|
10
|
+
interface NativeAndroidDeviceProofReceiptBase {
|
|
11
|
+
readonly proof: "solid-native-android-release-device";
|
|
12
|
+
readonly status: "passed";
|
|
13
|
+
readonly measuredAt: string;
|
|
14
|
+
readonly source: Readonly<{
|
|
15
|
+
revision: string;
|
|
16
|
+
dirty: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
readonly device: Readonly<{
|
|
19
|
+
kind: "physical";
|
|
20
|
+
serialSha256: string;
|
|
21
|
+
manufacturer: string;
|
|
22
|
+
model: string;
|
|
23
|
+
product: string;
|
|
24
|
+
abi: string;
|
|
25
|
+
osVersion: string;
|
|
26
|
+
sdkLevel: number;
|
|
27
|
+
buildFingerprintSha256: string;
|
|
28
|
+
batteryLevel: number;
|
|
29
|
+
batteryTemperatureCelsius: number;
|
|
30
|
+
lowPowerMode: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
readonly nativeCompatibility: Readonly<{
|
|
33
|
+
fingerprint: string;
|
|
34
|
+
inputCount: number;
|
|
35
|
+
}>;
|
|
36
|
+
readonly generatedBindings: Readonly<{
|
|
37
|
+
bytes: number;
|
|
38
|
+
fileSha256: string;
|
|
39
|
+
manifestSha256: string;
|
|
40
|
+
}>;
|
|
41
|
+
readonly artifacts: Readonly<{
|
|
42
|
+
applicationApk: NativeDeviceProofFileFact;
|
|
43
|
+
instrumentationApk: NativeDeviceProofFileFact;
|
|
44
|
+
}>;
|
|
45
|
+
readonly instrumentation: Readonly<{
|
|
46
|
+
className: string;
|
|
47
|
+
durationSeconds: number;
|
|
48
|
+
reportedAt: string;
|
|
49
|
+
testName: string;
|
|
50
|
+
resultBytes: number;
|
|
51
|
+
resultSha256: string;
|
|
52
|
+
exitCodeSha256: string;
|
|
53
|
+
}>;
|
|
54
|
+
}
|
|
55
|
+
export interface NativeDeviceProofSourceMapFact {
|
|
56
|
+
readonly bytes: number;
|
|
57
|
+
readonly sha256: string;
|
|
58
|
+
readonly sourceCount: number;
|
|
59
|
+
readonly checks: readonly NativeDeviceProofSourcePolicyCheck[];
|
|
60
|
+
}
|
|
61
|
+
/** Legacy receipt whose `bundle` field contains source-map, not bundle, bytes. */
|
|
62
|
+
export interface NativeAndroidDeviceProofReceiptV0 extends NativeAndroidDeviceProofReceiptBase {
|
|
63
|
+
readonly schemaVersion: 0;
|
|
64
|
+
readonly bundle: NativeDeviceProofSourceMapFact;
|
|
65
|
+
}
|
|
66
|
+
/** Portable receipt with distinct JavaScript-bundle and source-map identities. */
|
|
67
|
+
export interface NativeAndroidDeviceProofReceiptV1 extends NativeAndroidDeviceProofReceiptBase {
|
|
68
|
+
readonly schemaVersion: 1;
|
|
69
|
+
readonly bundle: NativeDeviceProofFileFact;
|
|
70
|
+
readonly sourceMap: NativeDeviceProofSourceMapFact;
|
|
71
|
+
}
|
|
72
|
+
export type NativeAndroidDeviceProofReceipt = NativeAndroidDeviceProofReceiptV0 | NativeAndroidDeviceProofReceiptV1;
|
|
73
|
+
export interface NativeDeviceProofSignature {
|
|
74
|
+
readonly schemaVersion: 0;
|
|
75
|
+
readonly algorithm: "ed25519";
|
|
76
|
+
readonly keyId: string;
|
|
77
|
+
readonly projectName: string;
|
|
78
|
+
readonly proofSha256: string;
|
|
79
|
+
readonly signature: string;
|
|
80
|
+
}
|
|
81
|
+
export interface CreateNativeDeviceProofSignatureOptions {
|
|
82
|
+
readonly cwd?: string;
|
|
83
|
+
readonly proofPath: string;
|
|
84
|
+
readonly privateKeyPath: string;
|
|
85
|
+
readonly keyId: string;
|
|
86
|
+
/** Separately governed application identity included in the signed payload. */
|
|
87
|
+
readonly projectName: string;
|
|
88
|
+
readonly outputPath?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface CreateNativeDeviceProofSignatureResult {
|
|
91
|
+
readonly proofPath: string;
|
|
92
|
+
readonly signaturePath: string;
|
|
93
|
+
readonly signature: NativeDeviceProofSignature;
|
|
94
|
+
readonly receipt: NativeAndroidDeviceProofReceipt;
|
|
95
|
+
}
|
|
96
|
+
export interface NativeDeviceProofSigningRequest {
|
|
97
|
+
readonly schemaVersion: 0;
|
|
98
|
+
readonly algorithm: "ed25519";
|
|
99
|
+
readonly keyId: string;
|
|
100
|
+
readonly projectName: string;
|
|
101
|
+
readonly proofSha256: string;
|
|
102
|
+
/** Canonical contextual signing payload as unpadded base64url. */
|
|
103
|
+
readonly payloadBase64url: string;
|
|
104
|
+
/** Lowercase hexadecimal SHA-256 of the decoded signing payload. */
|
|
105
|
+
readonly payloadSha256: string;
|
|
106
|
+
}
|
|
107
|
+
export interface CreateNativeDeviceProofSigningRequestOptions {
|
|
108
|
+
readonly cwd?: string;
|
|
109
|
+
readonly proofPath: string;
|
|
110
|
+
readonly keyId: string;
|
|
111
|
+
readonly projectName: string;
|
|
112
|
+
readonly outputPath?: string;
|
|
113
|
+
}
|
|
114
|
+
export interface CreateNativeDeviceProofSigningRequestResult {
|
|
115
|
+
readonly proofPath: string;
|
|
116
|
+
readonly requestPath: string;
|
|
117
|
+
readonly request: NativeDeviceProofSigningRequest;
|
|
118
|
+
readonly receipt: NativeAndroidDeviceProofReceipt;
|
|
119
|
+
}
|
|
120
|
+
export interface AssembleNativeDeviceProofSignatureOptions {
|
|
121
|
+
readonly cwd?: string;
|
|
122
|
+
readonly requestPath: string;
|
|
123
|
+
readonly detachedSignaturePath: string;
|
|
124
|
+
readonly publicKeyPath: string;
|
|
125
|
+
readonly outputPath?: string;
|
|
126
|
+
}
|
|
127
|
+
export interface AssembleNativeDeviceProofSignatureResult {
|
|
128
|
+
readonly requestPath: string;
|
|
129
|
+
readonly signaturePath: string;
|
|
130
|
+
readonly signature: NativeDeviceProofSignature;
|
|
131
|
+
}
|
|
132
|
+
interface VerifyNativeDeviceProofSignatureBaseOptions {
|
|
133
|
+
readonly cwd?: string;
|
|
134
|
+
readonly proofPath: string;
|
|
135
|
+
readonly signaturePath: string;
|
|
136
|
+
/** Optional exact digest of the receipt bytes, including the sha256: prefix. */
|
|
137
|
+
readonly expectedProofSha256?: string;
|
|
138
|
+
readonly expectedSourceRevision?: string;
|
|
139
|
+
readonly expectedNativeCompatibilityFingerprint?: string;
|
|
140
|
+
/** Optional lowercase SHA-256 of the application APK. */
|
|
141
|
+
readonly expectedApplicationArtifactSha256?: string;
|
|
142
|
+
/** Exact verified instrumentation/source-policy profile. Required for portable schema 1. */
|
|
143
|
+
readonly expectedProfileFingerprint?: string;
|
|
144
|
+
/** Inclusive canonical UTC lower bound for the signed measurement time. */
|
|
145
|
+
readonly minimumMeasuredAt?: string;
|
|
146
|
+
/** Inclusive canonical UTC upper bound for the signed measurement time. */
|
|
147
|
+
readonly maximumMeasuredAt?: string;
|
|
148
|
+
}
|
|
149
|
+
export interface VerifyNativeDeviceProofSignatureWithPinnedKeyOptions extends VerifyNativeDeviceProofSignatureBaseOptions {
|
|
150
|
+
readonly publicKeyPath: string;
|
|
151
|
+
readonly expectedKeyId: string;
|
|
152
|
+
/** Separately trusted application identity expected in the signed payload. */
|
|
153
|
+
readonly projectName: string;
|
|
154
|
+
readonly trustPolicyPath?: never;
|
|
155
|
+
readonly minimumTrustPolicySequence?: never;
|
|
156
|
+
}
|
|
157
|
+
export interface VerifyNativeDeviceProofSignatureWithTrustPolicyOptions extends VerifyNativeDeviceProofSignatureBaseOptions {
|
|
158
|
+
readonly trustPolicyPath: string;
|
|
159
|
+
readonly minimumTrustPolicySequence?: number;
|
|
160
|
+
readonly publicKeyPath?: never;
|
|
161
|
+
readonly expectedKeyId?: never;
|
|
162
|
+
readonly projectName?: never;
|
|
163
|
+
}
|
|
164
|
+
export type VerifyNativeDeviceProofSignatureOptions = VerifyNativeDeviceProofSignatureWithPinnedKeyOptions | VerifyNativeDeviceProofSignatureWithTrustPolicyOptions;
|
|
165
|
+
export interface NativeDeviceProofTrustedKey {
|
|
166
|
+
readonly keyId: string;
|
|
167
|
+
readonly algorithm: "ed25519";
|
|
168
|
+
readonly publicKeySpki: string;
|
|
169
|
+
readonly status: "active" | "revoked";
|
|
170
|
+
}
|
|
171
|
+
interface NativeDeviceProofTrustPolicyBase {
|
|
172
|
+
readonly policySequence: number;
|
|
173
|
+
readonly projectName: string;
|
|
174
|
+
readonly proof: "solid-native-android-release-device";
|
|
175
|
+
readonly keys: readonly NativeDeviceProofTrustedKey[];
|
|
176
|
+
}
|
|
177
|
+
export interface NativeDeviceProofTrustPolicyV0 extends NativeDeviceProofTrustPolicyBase {
|
|
178
|
+
readonly schemaVersion: 0;
|
|
179
|
+
}
|
|
180
|
+
export interface NativeDeviceProofTrustPolicyV1 extends NativeDeviceProofTrustPolicyBase {
|
|
181
|
+
readonly schemaVersion: 1;
|
|
182
|
+
readonly profileFingerprint: string;
|
|
183
|
+
}
|
|
184
|
+
export type NativeDeviceProofTrustPolicy = NativeDeviceProofTrustPolicyV0 | NativeDeviceProofTrustPolicyV1;
|
|
185
|
+
export interface NativeDeviceProofVerificationPolicy {
|
|
186
|
+
readonly projectName: string;
|
|
187
|
+
readonly expectedProofSha256?: string;
|
|
188
|
+
readonly expectedSourceRevision?: string;
|
|
189
|
+
readonly expectedNativeCompatibilityFingerprint?: string;
|
|
190
|
+
readonly expectedApplicationArtifactSha256?: string;
|
|
191
|
+
readonly expectedProfileFingerprint?: string;
|
|
192
|
+
readonly minimumMeasuredAt?: string;
|
|
193
|
+
readonly maximumMeasuredAt?: string;
|
|
194
|
+
}
|
|
195
|
+
export interface NativeDeviceProofProfile {
|
|
196
|
+
readonly schemaVersion: 0;
|
|
197
|
+
readonly kind: "solid-native.android-device-proof-profile";
|
|
198
|
+
readonly proof: "solid-native-android-release-device";
|
|
199
|
+
readonly receiptSchemaVersion: 0 | 1;
|
|
200
|
+
readonly profileFingerprint: string;
|
|
201
|
+
readonly instrumentation: Readonly<{
|
|
202
|
+
readonly className: string;
|
|
203
|
+
readonly testName: string;
|
|
204
|
+
}>;
|
|
205
|
+
readonly sourcePolicy: readonly NativeDeviceProofSourcePolicyCheck[];
|
|
206
|
+
}
|
|
207
|
+
export interface NativeAuthenticatedDeviceProof {
|
|
208
|
+
readonly schemaVersion: 0;
|
|
209
|
+
readonly projectName: string;
|
|
210
|
+
readonly proof: "solid-native-android-release-device";
|
|
211
|
+
readonly proofSha256: string;
|
|
212
|
+
readonly receiptSchemaVersion: 0 | 1;
|
|
213
|
+
readonly profileFingerprint: string;
|
|
214
|
+
readonly sourceRevision: string;
|
|
215
|
+
readonly measuredAt: string;
|
|
216
|
+
readonly nativeCompatibilityFingerprint: string;
|
|
217
|
+
readonly applicationArtifactSha256: string;
|
|
218
|
+
readonly deviceModel: string;
|
|
219
|
+
readonly authenticatedKeyId: string;
|
|
220
|
+
readonly trustPolicyFingerprint?: string;
|
|
221
|
+
readonly trustPolicySequence?: number;
|
|
222
|
+
}
|
|
223
|
+
export interface NativeDeviceProofSignatureVerificationCheck {
|
|
224
|
+
readonly id: "proof" | "trust-policy" | "key" | "signature" | "policy" | "profile" | "lineage" | "time-policy";
|
|
225
|
+
readonly status: "pass" | "fail";
|
|
226
|
+
readonly message: string;
|
|
227
|
+
}
|
|
228
|
+
interface NativeDeviceProofSignatureVerificationReportBase {
|
|
229
|
+
readonly schemaVersion: 0;
|
|
230
|
+
readonly proofPath: string;
|
|
231
|
+
readonly signaturePath: string;
|
|
232
|
+
readonly proofSha256: string;
|
|
233
|
+
readonly keyId: string;
|
|
234
|
+
readonly projectName: string;
|
|
235
|
+
readonly policy: NativeDeviceProofVerificationPolicy;
|
|
236
|
+
readonly trustPolicyPath?: string;
|
|
237
|
+
readonly trustPolicyFingerprint?: string;
|
|
238
|
+
readonly trustPolicySequence?: number;
|
|
239
|
+
readonly checks: readonly NativeDeviceProofSignatureVerificationCheck[];
|
|
240
|
+
}
|
|
241
|
+
export type NativeDeviceProofSignatureVerificationReport = NativeDeviceProofSignatureVerificationReportBase & ({
|
|
242
|
+
readonly ok: true;
|
|
243
|
+
readonly authenticatedProof: NativeAuthenticatedDeviceProof;
|
|
244
|
+
} | {
|
|
245
|
+
readonly ok: false;
|
|
246
|
+
readonly authenticatedProof?: never;
|
|
247
|
+
});
|
|
248
|
+
export type CreateNativeDeviceProofIngestionOptions = VerifyNativeDeviceProofSignatureOptions;
|
|
249
|
+
export interface NativeDeviceProofIngestion {
|
|
250
|
+
readonly schemaVersion: 0;
|
|
251
|
+
readonly kind: "solid-native.device-proof-ingestion";
|
|
252
|
+
/** Exact successful verifier lineage; never interchangeable with a release. */
|
|
253
|
+
readonly authenticatedProof: NativeAuthenticatedDeviceProof;
|
|
254
|
+
readonly verificationPolicy: NativeDeviceProofVerificationPolicy;
|
|
255
|
+
readonly environment: Readonly<{
|
|
256
|
+
readonly platform: "android";
|
|
257
|
+
readonly device: Readonly<{
|
|
258
|
+
readonly kind: "physical";
|
|
259
|
+
readonly manufacturer: string;
|
|
260
|
+
readonly model: string;
|
|
261
|
+
readonly product: string;
|
|
262
|
+
readonly abi: string;
|
|
263
|
+
readonly osVersion: string;
|
|
264
|
+
readonly sdkLevel: number;
|
|
265
|
+
readonly buildFingerprintSha256: string;
|
|
266
|
+
readonly batteryLevel: number;
|
|
267
|
+
readonly batteryTemperatureCelsius: number;
|
|
268
|
+
readonly lowPowerMode: boolean;
|
|
269
|
+
}>;
|
|
270
|
+
}>;
|
|
271
|
+
readonly inputs: Readonly<{
|
|
272
|
+
readonly nativeCompatibility: NativeAndroidDeviceProofReceipt["nativeCompatibility"];
|
|
273
|
+
readonly generatedBindings: NativeAndroidDeviceProofReceipt["generatedBindings"];
|
|
274
|
+
/** Present only when the receipt independently identified JavaScript bytes. */
|
|
275
|
+
readonly bundle?: NativeDeviceProofFileFact;
|
|
276
|
+
readonly sourceMap: Readonly<{
|
|
277
|
+
readonly bytes: number;
|
|
278
|
+
readonly sha256: string;
|
|
279
|
+
readonly sourceCount: number;
|
|
280
|
+
}>;
|
|
281
|
+
readonly artifacts: NativeAndroidDeviceProofReceipt["artifacts"];
|
|
282
|
+
}>;
|
|
283
|
+
readonly execution: NativeAndroidDeviceProofReceipt["instrumentation"];
|
|
284
|
+
}
|
|
285
|
+
export declare function nativeDeviceProofTrustPolicyFingerprint(policy: NativeDeviceProofTrustPolicy): string;
|
|
286
|
+
export declare function readNativeDeviceProofTrustPolicy(policyPath: string): Promise<NativeDeviceProofTrustPolicy>;
|
|
287
|
+
export declare function parseNativeDeviceProofReceipt(value: unknown): NativeAndroidDeviceProofReceipt;
|
|
288
|
+
export declare function inspectNativeDeviceProofProfile(receipt: NativeAndroidDeviceProofReceipt): NativeDeviceProofProfile;
|
|
289
|
+
export declare function nativeDeviceProofProfileFingerprint(receipt: NativeAndroidDeviceProofReceipt): string;
|
|
290
|
+
export declare function readNativeDeviceProofReceipt(proofPath: string): Promise<NativeAndroidDeviceProofReceipt>;
|
|
291
|
+
export declare function readNativeDeviceProofSigningRequest(requestPath: string): Promise<NativeDeviceProofSigningRequest>;
|
|
292
|
+
export declare function readNativeDeviceProofSignature(signaturePath: string): Promise<NativeDeviceProofSignature>;
|
|
293
|
+
export declare function createNativeDeviceProofSigningRequest(options: CreateNativeDeviceProofSigningRequestOptions): Promise<CreateNativeDeviceProofSigningRequestResult>;
|
|
294
|
+
export declare function createNativeDeviceProofSignature(options: CreateNativeDeviceProofSignatureOptions): Promise<CreateNativeDeviceProofSignatureResult>;
|
|
295
|
+
export declare function assembleNativeDeviceProofSignature(options: AssembleNativeDeviceProofSignatureOptions): Promise<AssembleNativeDeviceProofSignatureResult>;
|
|
296
|
+
export declare function verifyNativeDeviceProofSignature(options: VerifyNativeDeviceProofSignatureOptions): Promise<NativeDeviceProofSignatureVerificationReport>;
|
|
297
|
+
/**
|
|
298
|
+
* Repeats device-proof authentication and returns a path-free, uploader-neutral
|
|
299
|
+
* descriptor derived only from the exact receipt snapshot that stayed present
|
|
300
|
+
* after verification. The result is execution evidence, never release
|
|
301
|
+
* authorization.
|
|
302
|
+
*/
|
|
303
|
+
export declare function createNativeDeviceProofIngestion(options: CreateNativeDeviceProofIngestionOptions): Promise<NativeDeviceProofIngestion>;
|
|
304
|
+
export declare function formatNativeDeviceProofIngestion(ingestion: NativeDeviceProofIngestion): string;
|
|
305
|
+
export declare function formatNativeDeviceProofSignatureVerification(report: NativeDeviceProofSignatureVerificationReport): string;
|
|
306
|
+
export {};
|
|
307
|
+
//# sourceMappingURL=device-proof-signatures.d.ts.map
|