@aixnn/aixautots 0.6.13 → 0.6.20
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/{automation-queue-BFWqw32O.d.ts → automation-queue-GhfQtZLm.d.ts} +2 -2
- package/dist/{chunk-S5N4EOCP.js → chunk-3OBCSW2J.js} +1 -1
- package/dist/{chunk-SKI7TINK.js → chunk-4NRIEM5Z.js} +269 -53
- package/dist/{chunk-VMA3QOYR.js → chunk-7RQTSTR6.js} +1 -1
- package/dist/{chunk-HMDUSVQ3.js → chunk-DAU3FVCV.js} +4 -4
- package/dist/chunk-DTXXQPOU.js +693 -0
- package/dist/{chunk-7BJPVSEZ.js → chunk-ED6CB3B4.js} +222 -12
- package/dist/{chunk-Q5I63UYT.js → chunk-FJKMRWYC.js} +97 -75
- package/dist/{chunk-U4QW45MB.js → chunk-H7KZUU67.js} +14 -7
- package/dist/{chunk-QRIWTPN3.js → chunk-HQ2L4NQ2.js} +270 -12
- package/dist/{chunk-QFGMQLRB.js → chunk-JQBSGFAR.js} +31 -14
- package/dist/{chunk-2KPZSPV6.js → chunk-OJK35AQD.js} +105 -17
- package/dist/chunk-QISBQ532.js +1665 -0
- package/dist/{chunk-T6X6TWHK.js → chunk-RFOJSDYI.js} +3 -3
- package/dist/{chunk-QEK25NUA.js → chunk-UEZVXYGP.js} +12 -5
- package/dist/{config-UmU2_q5M.d.ts → config-C79rcedl.d.ts} +53 -11
- package/dist/core/index.d.ts +13 -9
- package/dist/core/index.js +2 -2
- package/dist/core/network-adb-node.d.ts +23 -0
- package/dist/core/network-adb-node.js +171 -0
- package/dist/{script-debugger-F5UGUq5t.d.ts → device-channel-OiZwAqNQ.d.ts} +41 -55
- package/dist/{device-normalize-CWJFr_sf.d.ts → device-normalize-ODrxJb-a.d.ts} +1 -1
- package/dist/device-session-PVHD6PNR.js +1 -0
- package/dist/i18n/index.js +1 -1
- package/dist/{mirror-session-Cy20lIHP.d.ts → mirror-session-DifANocH.d.ts} +2 -2
- package/dist/react/index.d.ts +19 -12
- package/dist/react/index.js +3 -3
- package/dist/script-debugger-DjxpvdaN.d.ts +56 -0
- package/dist/{task-agent-runner-Cj_u-3DS.d.ts → task-agent-runner-CAt-z8gr.d.ts} +3 -3
- package/dist/{types-BvrppNIZ.d.ts → types-CBI5SIH5.d.ts} +103 -5
- package/dist/ui/billing.d.ts +43 -6
- package/dist/ui/billing.js +190 -309
- package/dist/ui/device-create.d.ts +5 -2
- package/dist/ui/device-create.js +8 -8
- package/dist/ui/device-mirror.js +6 -6
- package/dist/ui/devices.d.ts +5 -5
- package/dist/ui/devices.js +11 -11
- package/dist/ui/editor.d.ts +2 -2
- package/dist/ui/editor.js +7 -7
- package/dist/ui/index.d.ts +6 -4
- package/dist/ui/index.js +13 -492
- package/dist/ui/inspector.js +5 -5
- package/dist/ui/ip-commerce.d.ts +4 -2
- package/dist/ui/ip-commerce.js +6 -6
- package/dist/ui/market.js +4 -4
- package/dist/ui/mirror.d.ts +3 -3
- package/dist/ui/primitives/index.js +1 -1
- package/dist/ui/script-studio.js +6 -6
- package/dist/ui/scripts.d.ts +1 -1
- package/dist/ui/scripts.js +5 -5
- package/dist/ui/settings.d.ts +164 -0
- package/dist/ui/settings.js +10 -0
- package/dist/ui/tasks.js +11 -11
- package/package.json +9 -1
- package/dist/device-session-3XK2SZDF.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { IpCommercePanel } from './chunk-JQBSGFAR.js';
|
|
2
|
+
import { IosDeviceDiagnostics } from './chunk-RFOJSDYI.js';
|
|
3
3
|
import { canConnectPhysicalDevice } from './chunk-ZB5ET67B.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useNodes, useClient, useDevices } from './chunk-
|
|
4
|
+
import { cn, Select, Dialog, Button, Input, Badge } from './chunk-7RQTSTR6.js';
|
|
5
|
+
import { useAixT } from './chunk-HQ2L4NQ2.js';
|
|
6
|
+
import { useNodes, useClient, useDevices } from './chunk-UEZVXYGP.js';
|
|
7
7
|
import { useState, useEffect, useMemo, useCallback, useRef } from 'react';
|
|
8
8
|
import { Server, RefreshCw, Smartphone, Usb, Wifi, Info } from 'lucide-react';
|
|
9
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -23,6 +23,15 @@ function availableVirtualImages(node, catalog, platform) {
|
|
|
23
23
|
function availableVirtualPlatforms(node, catalog) {
|
|
24
24
|
return ["android", "ios"].filter((platform) => availableVirtualImages(node, catalog, platform).length > 0);
|
|
25
25
|
}
|
|
26
|
+
function availableVirtualVersions(node, catalog, platform) {
|
|
27
|
+
const versions = /* @__PURE__ */ new Map();
|
|
28
|
+
for (const image of availableVirtualImages(node, catalog, platform)) {
|
|
29
|
+
const key = JSON.stringify([image.platform, image.version, image.rooted]);
|
|
30
|
+
const previous = versions.get(key);
|
|
31
|
+
if (!previous || previous.image_tag.endsWith(":latest") && !image.image_tag.endsWith(":latest")) versions.set(key, image);
|
|
32
|
+
}
|
|
33
|
+
return [...versions.values()];
|
|
34
|
+
}
|
|
26
35
|
var SCOPE_META = {
|
|
27
36
|
platform: { label: "\u5E73\u53F0", order: 0 },
|
|
28
37
|
project: { label: "\u9879\u76EE", order: 1 },
|
|
@@ -199,9 +208,9 @@ function VirtualSpecStep({ spec, onChange, nodeId, onValidityChange }) {
|
|
|
199
208
|
os_version: void 0,
|
|
200
209
|
android_version: void 0,
|
|
201
210
|
model: void 0,
|
|
202
|
-
// Android
|
|
203
|
-
frida: next === "android" ?
|
|
204
|
-
kernelsu: next === "android" ?
|
|
211
|
+
// Only Android virtual devices offer these optional development capabilities.
|
|
212
|
+
frida: next === "android" ? false : void 0,
|
|
213
|
+
kernelsu: next === "android" ? false : void 0
|
|
205
214
|
});
|
|
206
215
|
};
|
|
207
216
|
const setImage = (id) => {
|
|
@@ -266,7 +275,7 @@ function VirtualSpecStep({ spec, onChange, nodeId, onValidityChange }) {
|
|
|
266
275
|
alive = false;
|
|
267
276
|
};
|
|
268
277
|
}, [client]);
|
|
269
|
-
const availableVersions =
|
|
278
|
+
const availableVersions = availableVirtualVersions(selectedNode, versions, platform);
|
|
270
279
|
const allowedPlatforms = availableVirtualPlatforms(selectedNode, versions);
|
|
271
280
|
const platformOptions = PLATFORM_OPTIONS.filter((option) => allowedPlatforms.includes(option.value));
|
|
272
281
|
const versionOptions = availableVersions.map((o) => ({ value: o.id, label: o.label }));
|
|
@@ -311,11 +320,6 @@ function VirtualSpecStep({ spec, onChange, nodeId, onValidityChange }) {
|
|
|
311
320
|
if (!brand) return;
|
|
312
321
|
patch({ model: pickModel(brand) });
|
|
313
322
|
}, [brand, av, catalog]);
|
|
314
|
-
useEffect(() => {
|
|
315
|
-
if (platform === "android" && (spec.frida === void 0 || spec.kernelsu === void 0)) {
|
|
316
|
-
patch({ frida: spec.frida ?? true, kernelsu: spec.kernelsu ?? true });
|
|
317
|
-
}
|
|
318
|
-
}, [platform]);
|
|
319
323
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
320
324
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
321
325
|
/* @__PURE__ */ jsx("label", { className: "text-[11px] text-muted-foreground", children: "\u5E73\u53F0 platform" }),
|
|
@@ -394,7 +398,34 @@ function VirtualSpecStep({ spec, onChange, nodeId, onValidityChange }) {
|
|
|
394
398
|
),
|
|
395
399
|
/* @__PURE__ */ jsx("p", { className: "mt-0.5 text-[10px] text-muted-foreground/60", children: "auto:\u8282\u70B9\u6709 GPU \u81EA\u52A8\u786C\u4EF6\u52A0\u901F,\u65E0 GPU \u81EA\u52A8\u8F6F\u4EF6\u6E32\u67D3\u3002\u4E00\u955C\u50CF\u901A\u5403,\u65E0\u9700\u4E3A GPU \u5355\u72EC\u51FA\u955C\u50CF\u3002" })
|
|
396
400
|
] }),
|
|
397
|
-
platform === "android" && /* @__PURE__ */
|
|
401
|
+
platform === "android" && /* @__PURE__ */ jsxs("fieldset", { className: "space-y-2 rounded-md border border-border p-3", children: [
|
|
402
|
+
/* @__PURE__ */ jsx("legend", { className: "px-1 text-xs font-medium text-foreground", children: "\u5F00\u53D1\u8C03\u8BD5\u9009\u9879\uFF08\u9ED8\u8BA4\u4E0D\u989D\u5916\u8BF7\u6C42\uFF09" }),
|
|
403
|
+
/* @__PURE__ */ jsxs("label", { className: "flex min-h-11 cursor-pointer items-center gap-3 text-sm text-foreground", children: [
|
|
404
|
+
/* @__PURE__ */ jsx(
|
|
405
|
+
"input",
|
|
406
|
+
{
|
|
407
|
+
type: "checkbox",
|
|
408
|
+
checked: spec.kernelsu === true,
|
|
409
|
+
onChange: (e) => patch({ kernelsu: e.target.checked }),
|
|
410
|
+
className: "h-4 w-4 shrink-0 accent-primary"
|
|
411
|
+
}
|
|
412
|
+
),
|
|
413
|
+
"\u542F\u7528 Root\uFF08KernelSU\uFF09"
|
|
414
|
+
] }),
|
|
415
|
+
/* @__PURE__ */ jsxs("label", { className: "flex min-h-11 cursor-pointer items-center gap-3 text-sm text-foreground", children: [
|
|
416
|
+
/* @__PURE__ */ jsx(
|
|
417
|
+
"input",
|
|
418
|
+
{
|
|
419
|
+
type: "checkbox",
|
|
420
|
+
checked: spec.frida === true,
|
|
421
|
+
onChange: (e) => patch({ frida: e.target.checked }),
|
|
422
|
+
className: "h-4 w-4 shrink-0 accent-primary"
|
|
423
|
+
}
|
|
424
|
+
),
|
|
425
|
+
"\u542F\u7528 Frida \u52A8\u6001\u8C03\u8BD5"
|
|
426
|
+
] }),
|
|
427
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "\u9ED8\u8BA4\u4E0D\u8BF7\u6C42\u989D\u5916 Root \u6216 Frida \u914D\u7F6E\uFF0C\u4E0D\u8868\u793A\u6240\u9009\u955C\u50CF\u672C\u8EAB\u5DF2\u5173\u95ED\u8FD9\u4E9B\u80FD\u529B\uFF1B\u5B9E\u9645\u53EF\u7528\u6027\u53D6\u51B3\u4E8E\u955C\u50CF\u4E0E\u8282\u70B9\u652F\u6301\u3002\u4EC5\u65B0\u5EFA\u8BBE\u5907\u65F6\u914D\u7F6E\uFF0C\u4FEE\u6539\u73B0\u6709\u8BBE\u5907\u53EF\u80FD\u9700\u8981\u91CD\u5EFA\u3002" })
|
|
428
|
+
] })
|
|
398
429
|
] });
|
|
399
430
|
}
|
|
400
431
|
function AddWirelessDeviceDialog({ open, onClose, nodeId: initialNode, platform: initialPlatform }) {
|
|
@@ -801,11 +832,14 @@ function RealDiscoverStep({ nodeId, picked, onPick }) {
|
|
|
801
832
|
}
|
|
802
833
|
|
|
803
834
|
// src/ui/devices/proxy.ts
|
|
804
|
-
function
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
835
|
+
function customProxyAddress(value) {
|
|
836
|
+
if (!isSupportedProxyUrl(value) || !value) return null;
|
|
837
|
+
const url = new URL(value);
|
|
838
|
+
return `${url.hostname}:${Number(value.slice(value.lastIndexOf(":") + 1))}`;
|
|
839
|
+
}
|
|
840
|
+
function safeCustomProxyAddress(value) {
|
|
841
|
+
if (typeof value !== "string" || !/^[A-Za-z0-9._-]+:[0-9]{1,5}$/.test(value)) return null;
|
|
842
|
+
return customProxyAddress(`http://${value}`) === value ? value : null;
|
|
809
843
|
}
|
|
810
844
|
function isRedactedProxyUrl(value) {
|
|
811
845
|
return value.includes(":***@");
|
|
@@ -826,6 +860,11 @@ function isSupportedProxyUrl(value) {
|
|
|
826
860
|
return false;
|
|
827
861
|
}
|
|
828
862
|
}
|
|
863
|
+
function normalizeManualProxyUrl(value) {
|
|
864
|
+
const trimmed = value.trim();
|
|
865
|
+
const candidate = /^[A-Za-z0-9.-]+:[0-9]{1,5}$/.test(trimmed) ? `http://${trimmed}` : /^http:\/\/[A-Za-z0-9.-]+:[0-9]{1,5}\/$/.test(trimmed) ? trimmed.slice(0, -1) : trimmed;
|
|
866
|
+
return candidate !== trimmed && isSupportedProxyUrl(candidate) ? candidate : trimmed;
|
|
867
|
+
}
|
|
829
868
|
function proxySummaryFromDevice(device) {
|
|
830
869
|
const value = device?.meta && typeof device.meta.proxy_summary === "object" ? device.meta.proxy_summary : null;
|
|
831
870
|
if (!value || Array.isArray(value)) return null;
|
|
@@ -850,14 +889,18 @@ function deviceProxyCapabilities(device, node) {
|
|
|
850
889
|
const custom = redroid && !!nodeId && node?.id === nodeId && cap?.supported === true;
|
|
851
890
|
return { custom, managed: custom && cap?.revision_fencing === true };
|
|
852
891
|
}
|
|
892
|
+
function usesAndroidSystemProxy(node) {
|
|
893
|
+
const cap = node?.reported_caps?.egress_proxy;
|
|
894
|
+
return cap?.supported === true && (cap.mode === "android_system" || cap.enforcement === "android_system");
|
|
895
|
+
}
|
|
853
896
|
function proxyCapabilityReason(device) {
|
|
854
897
|
if (device.platform !== "android" || device.meta?.provisioned !== true) {
|
|
855
|
-
return "Per-device
|
|
898
|
+
return "Per-device proxy requires a provisioned virtual Android Redroid device.";
|
|
856
899
|
}
|
|
857
900
|
if (typeof device.meta?.node_id !== "string" || !device.meta.node_id) {
|
|
858
901
|
return "The owning node is unknown, so per-device proxy is unavailable.";
|
|
859
902
|
}
|
|
860
|
-
return "The owning node does not report per-device
|
|
903
|
+
return "The owning node does not report per-device proxy capability.";
|
|
861
904
|
}
|
|
862
905
|
function proxyProbeMessage(result) {
|
|
863
906
|
const message = result.message ?? result.error;
|
|
@@ -896,10 +939,10 @@ var LOCALE_OPTIONS = [
|
|
|
896
939
|
{ value: "ja-JP", label: "\u65E5\u672C\u8A9E (ja-JP)" },
|
|
897
940
|
{ value: "ko-KR", label: "\uD55C\uAD6D\uC5B4 (ko-KR)" }
|
|
898
941
|
];
|
|
899
|
-
function ProxySpoofStep({ spec, onChange, isReal, showProxy = !isReal }) {
|
|
942
|
+
function ProxySpoofStep({ spec, onChange, isReal, showProxy = !isReal, proxyDisabled = false, proxyAction }) {
|
|
900
943
|
const proxy = spec.proxy ?? "";
|
|
901
944
|
const locale = spec.config?.locale ?? "";
|
|
902
|
-
const proxyInvalid = proxy.trim().length > 0 && !isSupportedProxyUrl(proxy
|
|
945
|
+
const proxyInvalid = proxy.trim().length > 0 && !isSupportedProxyUrl(normalizeManualProxyUrl(proxy));
|
|
903
946
|
const setProxy = (url) => {
|
|
904
947
|
const trimmed = url.trim();
|
|
905
948
|
if (!trimmed) {
|
|
@@ -920,26 +963,22 @@ function ProxySpoofStep({ spec, onChange, isReal, showProxy = !isReal }) {
|
|
|
920
963
|
showProxy && /* @__PURE__ */ jsxs("section", { className: "space-y-3", children: [
|
|
921
964
|
/* @__PURE__ */ jsx("p", { className: "text-label-caps text-muted-foreground", children: "\u4EE3\u7406 proxy" }),
|
|
922
965
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
923
|
-
/* @__PURE__ */ jsx("label", { className: "text-
|
|
966
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "creation-proxy-url", className: "text-sm text-muted-foreground", children: "\u4EE3\u7406\u5730\u5740 URL" }),
|
|
924
967
|
/* @__PURE__ */ jsx(
|
|
925
968
|
Input,
|
|
926
969
|
{
|
|
970
|
+
id: "creation-proxy-url",
|
|
971
|
+
disabled: proxyDisabled,
|
|
927
972
|
value: proxy,
|
|
928
973
|
onChange: (e) => setProxy(e.target.value),
|
|
974
|
+
onBlur: () => setProxy(normalizeManualProxyUrl(proxy)),
|
|
929
975
|
placeholder: "http://host:8080 \u6216 http://user:password@host:8080",
|
|
930
976
|
className: proxyInvalid ? "border-destructive" : void 0
|
|
931
977
|
}
|
|
932
978
|
),
|
|
933
|
-
/* @__PURE__ */
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
"\u3002 \u5BC6\u7801\u4E2D\u7684 ",
|
|
937
|
-
/* @__PURE__ */ jsx("code", { children: "@" }),
|
|
938
|
-
"\u3001",
|
|
939
|
-
/* @__PURE__ */ jsx("code", { children: ":" }),
|
|
940
|
-
" \u7B49\u7279\u6B8A\u5B57\u7B26\u5FC5\u987B\u505A URL \u767E\u5206\u53F7\u7F16\u7801\uFF1BUDP/QUIC/DNS \u4E0D\u7ECF\u8FC7\u6B64\u4EE3\u7406\uFF0C\u4FDD\u6301\u76F4\u8FDE\u3002 \u7528\u6237\u540D\u548C\u5BC6\u7801\u53EF\u4E0D\u586B\uFF1B\u7559\u7A7A\u8868\u793A\u4E0D\u4F7F\u7528\u4EE3\u7406\u3002"
|
|
941
|
-
] }),
|
|
942
|
-
proxyInvalid && /* @__PURE__ */ jsx("p", { className: "mt-1 text-[11px] text-destructive", children: "\u8BF7\u8F93\u5165 http://\u4E3B\u673A:\u7AEF\u53E3 \u6216 http://\u7528\u6237\u540D:\u5BC6\u7801@\u4E3B\u673A:\u7AEF\u53E3\uFF1B\u4E0D\u652F\u6301 socks/https\u3002" })
|
|
979
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: proxyDisabled ? "\u5F53\u524D\u8282\u70B9\u6682\u4E0D\u652F\u6301\u4EE3\u7406\uFF0C\u8BBE\u5907\u5C06\u4F7F\u7528\u8282\u70B9\u7F51\u7EDC\u3002" : "\u586B\u5199 HTTP \u4EE3\u7406\u5730\u5740\uFF08\u5982 http://proxy.example.com:7890\uFF09\uFF1B\u7528\u6237\u540D\u548C\u5BC6\u7801\u53EF\u9009\u3002\u4EC5\u5728\u652F\u6301\u7684 Windows/WSL \u8282\u70B9\uFF0C127.0.0.1 \u624D\u6620\u5C04\u5230\u5BBF\u4E3B\u673A WSL \u7F51\u5173\uFF1B\u4EE3\u7406\u987B\u76D1\u542C\u53EF\u4ECE\u8BE5\u7F51\u5173\u8BBF\u95EE\u7684\u5730\u5740\uFF0C\u4E0D\u80FD\u53EA\u7ED1\u5B9A\u56DE\u73AF\u5730\u5740\u3002\u7559\u7A7A\u5219\u4F7F\u7528\u8282\u70B9\u7F51\u7EDC\u3002" }),
|
|
980
|
+
proxyInvalid && /* @__PURE__ */ jsx("p", { className: "mt-1 text-[11px] text-destructive", children: "\u8BF7\u8F93\u5165 http://\u4E3B\u673A:\u7AEF\u53E3 \u6216 http://\u7528\u6237\u540D:\u5BC6\u7801@\u4E3B\u673A:\u7AEF\u53E3\uFF1B\u4E0D\u652F\u6301 socks/https\u3002" }),
|
|
981
|
+
proxyAction
|
|
943
982
|
] })
|
|
944
983
|
] }),
|
|
945
984
|
!isReal && /* @__PURE__ */ jsxs("section", { className: "space-y-2", children: [
|
|
@@ -958,7 +997,7 @@ function ProxySpoofStep({ spec, onChange, isReal, showProxy = !isReal }) {
|
|
|
958
997
|
)
|
|
959
998
|
] })
|
|
960
999
|
] }),
|
|
961
|
-
/* @__PURE__ */ jsxs("div", { className: "flex gap-2 rounded-md border border-border bg-secondary px-3 py-2", children: [
|
|
1000
|
+
isReal && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 rounded-md border border-border bg-secondary px-3 py-2", children: [
|
|
962
1001
|
/* @__PURE__ */ jsx(Info, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
963
1002
|
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-muted-foreground", children: isReal ? "\u6B64\u6B65\u9AA4\u4EC5\u767B\u8BB0\u771F\u673A\uFF0C\u4E0D\u4F1A\u5E94\u7528\u7CFB\u7EDF\u4EE3\u7406\u6216\u6307\u7EB9\u8BBE\u7F6E\u3002" : "\u4EE3\u7406\u4EC5\u7528\u4E8E\u5DF2\u62A5\u544A\u652F\u6301\u7684 Redroid \u8282\u70B9\u3002\u81EA\u5B9A\u4E49\u4EE3\u7406\u53EA\u63A5\u7BA1\u652F\u6301\u7684 TCP \u6D41\u91CF\uFF0CUDP/QUIC/DNS \u4E0D\u7ECF\u8FC7\u6B64\u4EE3\u7406\u3002" })
|
|
964
1003
|
] })
|
|
@@ -972,7 +1011,7 @@ function createProxyCapabilities(kind, spec, node) {
|
|
|
972
1011
|
const custom = android && cap?.supported === true;
|
|
973
1012
|
return { custom, managed: custom && cap?.revision_fencing === true && node?.reported_caps?.device_provision_v2 === true };
|
|
974
1013
|
}
|
|
975
|
-
var emptySpec = { platform: "android" };
|
|
1014
|
+
var emptySpec = { platform: "android", frida: false, kernelsu: false };
|
|
976
1015
|
function DeviceCreate({ open, onClose, onCreated }) {
|
|
977
1016
|
const client = useClient();
|
|
978
1017
|
const t = useAixT();
|
|
@@ -987,9 +1026,10 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
987
1026
|
const [busy, setBusy] = useState(false);
|
|
988
1027
|
const [error, setError] = useState("");
|
|
989
1028
|
const [quantity, setQuantity] = useState(1);
|
|
990
|
-
const [
|
|
1029
|
+
const [aixipsOpen, setAixipsOpen] = useState(false);
|
|
991
1030
|
const [managedPending, setManagedPending] = useState(false);
|
|
992
|
-
const
|
|
1031
|
+
const selectedNode = nodes?.find((node) => node.id === nodeId);
|
|
1032
|
+
const proxyCapabilities = createProxyCapabilities(kind, spec, selectedNode);
|
|
993
1033
|
useEffect(() => {
|
|
994
1034
|
if (!open) return;
|
|
995
1035
|
setStep(0);
|
|
@@ -1001,10 +1041,10 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
1001
1041
|
setBusy(false);
|
|
1002
1042
|
setError("");
|
|
1003
1043
|
setQuantity(1);
|
|
1004
|
-
|
|
1044
|
+
setAixipsOpen(false);
|
|
1005
1045
|
setManagedPending(false);
|
|
1006
1046
|
}, [open]);
|
|
1007
|
-
const proxyOk =
|
|
1047
|
+
const proxyOk = kind !== "virtual" || !spec.proxy?.trim() || proxyCapabilities.custom && isSupportedProxyUrl(normalizeManualProxyUrl(spec.proxy));
|
|
1008
1048
|
const canNext = (() => {
|
|
1009
1049
|
if (step === 0) return true;
|
|
1010
1050
|
if (step === 1) return !!nodeId;
|
|
@@ -1027,13 +1067,14 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
1027
1067
|
setError("\u8BF7\u9009\u62E9\u8BE5\u8282\u70B9\u5DF2\u5B89\u88C5\u7684\u7CFB\u7EDF\u7248\u672C\u540E\u518D\u521B\u5EFA\u3002");
|
|
1028
1068
|
return;
|
|
1029
1069
|
}
|
|
1030
|
-
if (managedPending
|
|
1031
|
-
if (
|
|
1070
|
+
if (managedPending) return;
|
|
1071
|
+
if (kind === "virtual" && spec.proxy?.trim() && !proxyCapabilities.custom) {
|
|
1032
1072
|
setError(t("creation.unsupported"));
|
|
1033
1073
|
return;
|
|
1034
1074
|
}
|
|
1035
1075
|
const provisionSpec = { ...spec, node_id: nodeId };
|
|
1036
|
-
if (
|
|
1076
|
+
if (kind !== "virtual" || !provisionSpec.proxy?.trim()) delete provisionSpec.proxy;
|
|
1077
|
+
else provisionSpec.proxy = normalizeManualProxyUrl(provisionSpec.proxy);
|
|
1037
1078
|
setBusy(true);
|
|
1038
1079
|
setError("");
|
|
1039
1080
|
try {
|
|
@@ -1095,10 +1136,7 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
1095
1136
|
active: kind === "virtual",
|
|
1096
1137
|
title: "\u865A\u62DF\u8BBE\u5907",
|
|
1097
1138
|
desc: "Android / iOS \u4E91\u8BBE\u5907\uFF0C\u6309\u89C4\u683C\u65B0\u5EFA",
|
|
1098
|
-
onClick: () =>
|
|
1099
|
-
setKind("virtual");
|
|
1100
|
-
setNetworkMode("managed");
|
|
1101
|
-
}
|
|
1139
|
+
onClick: () => setKind("virtual")
|
|
1102
1140
|
}
|
|
1103
1141
|
),
|
|
1104
1142
|
/* @__PURE__ */ jsx(
|
|
@@ -1107,10 +1145,7 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
1107
1145
|
active: kind === "real",
|
|
1108
1146
|
title: "\u771F\u673A",
|
|
1109
1147
|
desc: "\u4ECE\u8282\u70B9\u5DF2\u4E0A\u62A5\u7684\u771F\u673A\u4E2D\u9009\u53D6",
|
|
1110
|
-
onClick: () =>
|
|
1111
|
-
setKind("real");
|
|
1112
|
-
setNetworkMode("none");
|
|
1113
|
-
}
|
|
1148
|
+
onClick: () => setKind("real")
|
|
1114
1149
|
}
|
|
1115
1150
|
)
|
|
1116
1151
|
] }),
|
|
@@ -1119,36 +1154,23 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
1119
1154
|
setVirtualSpecValid(false);
|
|
1120
1155
|
}, hidePlatform: kind === "real", virtualOnly: kind === "virtual" }),
|
|
1121
1156
|
step === 2 && (kind === "virtual" ? /* @__PURE__ */ jsx(VirtualSpecStep, { spec, onChange: setSpec, nodeId, onValidityChange: setVirtualSpecValid }) : /* @__PURE__ */ jsx(RealDiscoverStep, { nodeId, picked, onPick: setPicked })),
|
|
1122
|
-
step === 3 && !managedPending &&
|
|
1123
|
-
|
|
1124
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2", children: [
|
|
1125
|
-
/* @__PURE__ */ jsx("button", { type: "button", className: "py-2 text-xs font-medium text-primary hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary", "aria-pressed": networkMode === "managed", disabled: busy, onClick: () => setNetworkMode("managed"), children: t("creation.managed") }),
|
|
1126
|
-
/* @__PURE__ */ jsx("button", { type: "button", className: "py-2 text-xs text-primary hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary disabled:opacity-50", "aria-pressed": networkMode === "custom", disabled: busy || !proxyCapabilities.custom, onClick: () => setNetworkMode("custom"), children: t("proxy.manualInput") }),
|
|
1127
|
-
/* @__PURE__ */ jsx("button", { type: "button", className: "py-2 text-xs text-muted-foreground hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary", "aria-pressed": networkMode === "none", disabled: busy, onClick: () => setNetworkMode("none"), children: t("creation.none") })
|
|
1128
|
-
] }),
|
|
1129
|
-
networkMode === "none" && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("proxy.directHint") })
|
|
1130
|
-
] }) }),
|
|
1131
|
-
open && /* @__PURE__ */ jsx(
|
|
1157
|
+
step === 3 && !managedPending && proxyCapabilities.custom && usesAndroidSystemProxy(selectedNode) && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("proxy.androidSystemHint") }),
|
|
1158
|
+
/* @__PURE__ */ jsx(Dialog, { open: aixipsOpen, onClose: () => setAixipsOpen(false), title: t("creation.chooseManaged"), description: t("proxy.regionPurchaseHint"), maxWidth: "max-w-lg", children: aixipsOpen && (quantity === 1 ? /* @__PURE__ */ jsx(
|
|
1132
1159
|
IpCommercePanel,
|
|
1133
1160
|
{
|
|
1134
|
-
|
|
1135
|
-
supported: proxyCapabilities.managed
|
|
1161
|
+
regionOnly: true,
|
|
1162
|
+
supported: proxyCapabilities.managed,
|
|
1136
1163
|
creationSpec: { ...spec, proxy: void 0, node_id: nodeId },
|
|
1137
|
-
onPendingChange:
|
|
1138
|
-
setManagedPending(pending);
|
|
1139
|
-
if (pending) {
|
|
1140
|
-
setNetworkMode("managed");
|
|
1141
|
-
setStep(3);
|
|
1142
|
-
}
|
|
1143
|
-
},
|
|
1164
|
+
onPendingChange: setManagedPending,
|
|
1144
1165
|
onCreated: () => {
|
|
1145
1166
|
void fetchDevices();
|
|
1146
1167
|
onCreated?.(null);
|
|
1147
1168
|
onClose();
|
|
1148
1169
|
}
|
|
1149
1170
|
}
|
|
1150
|
-
),
|
|
1151
|
-
step === 3 && !managedPending && /* @__PURE__ */ jsx(ProxySpoofStep, { spec, onChange: setSpec, isReal: kind === "real", showProxy:
|
|
1171
|
+
) : /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("creation.singleOnly") })) }),
|
|
1172
|
+
step === 3 && !managedPending && /* @__PURE__ */ jsx(ProxySpoofStep, { spec, onChange: setSpec, isReal: kind === "real", showProxy: kind === "virtual", proxyDisabled: !proxyCapabilities.custom, proxyAction: kind === "virtual" ? /* @__PURE__ */ jsx("button", { type: "button", className: "mt-2 min-h-11 text-sm text-primary underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:opacity-50", disabled: busy, onClick: () => setAixipsOpen(true), children: t("creation.chooseManaged") }) : void 0 }),
|
|
1173
|
+
step === 3 && kind === "virtual" && managedPending && /* @__PURE__ */ jsx("button", { type: "button", className: "min-h-11 text-sm text-primary underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary", onClick: () => setAixipsOpen(true), children: t("creation.chooseManaged") }),
|
|
1152
1174
|
step === 3 && kind === "virtual" && !managedPending && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1153
1175
|
/* @__PURE__ */ jsx("label", { className: "text-[11px] text-muted-foreground", children: "\u521B\u5EFA\u6570\u91CF" }),
|
|
1154
1176
|
/* @__PURE__ */ jsx(
|
|
@@ -1166,7 +1188,7 @@ function DeviceCreate({ open, onClose, onCreated }) {
|
|
|
1166
1188
|
] }),
|
|
1167
1189
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-t border-border pt-3", children: [
|
|
1168
1190
|
/* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", disabled: step === 0 || busy || managedPending, onClick: back, children: "\u4E0A\u4E00\u6B65" }),
|
|
1169
|
-
step < 3 ? /* @__PURE__ */ jsx(Button, { size: "sm", disabled: !canNext || managedPending, onClick: next, children: "\u4E0B\u4E00\u6B65" }) :
|
|
1191
|
+
step < 3 ? /* @__PURE__ */ jsx(Button, { size: "sm", disabled: !canNext || managedPending, onClick: next, children: "\u4E0B\u4E00\u6B65" }) : managedPending ? null : /* @__PURE__ */ jsx(
|
|
1170
1192
|
Button,
|
|
1171
1193
|
{
|
|
1172
1194
|
size: "sm",
|
|
@@ -1228,4 +1250,4 @@ function TypeCard({
|
|
|
1228
1250
|
);
|
|
1229
1251
|
}
|
|
1230
1252
|
|
|
1231
|
-
export { AddWirelessDeviceDialog, DeviceCreate, NodePicker, ProxySpoofStep, RealDiscoverStep, VirtualSpecStep, createProxyProbeGuard, deviceProxyCapabilities, isProxyApplyStatus, isProxyProbeUnsupported, isRedactedProxyUrl, isSupportedProxyUrl, proxyCapabilityReason, proxyProbeExitIp, proxyProbeMessage, proxySummaryFromDevice,
|
|
1253
|
+
export { AddWirelessDeviceDialog, DeviceCreate, NodePicker, ProxySpoofStep, RealDiscoverStep, VirtualSpecStep, createProxyProbeGuard, customProxyAddress, deviceProxyCapabilities, isProxyApplyStatus, isProxyProbeUnsupported, isRedactedProxyUrl, isSupportedProxyUrl, normalizeManualProxyUrl, proxyCapabilityReason, proxyProbeExitIp, proxyProbeMessage, proxySummaryFromDevice, safeCustomProxyAddress, usesAndroidSystemProxy };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ControlBar, MirrorView } from './chunk-MBBVYSPD.js';
|
|
2
2
|
import { canConnectPhysicalDevice } from './chunk-ZB5ET67B.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useClient, useDevices, useMirror, createAgentTaskRunner, useTaskAgentRun } from './chunk-
|
|
3
|
+
import { Dialog, Select, Button, useToast, ToastViewport, Popover } from './chunk-7RQTSTR6.js';
|
|
4
|
+
import { useAixT } from './chunk-HQ2L4NQ2.js';
|
|
5
|
+
import { useClient, useDevices, useMirror, createAgentTaskRunner, useTaskAgentRun } from './chunk-UEZVXYGP.js';
|
|
6
6
|
import { useState, useRef, useEffect, useId, useCallback, useMemo } from 'react';
|
|
7
7
|
import { ClipboardPaste, Wrench, Check, Settings2, VolumeX, Volume2, RotateCw, X, PanelsTopLeft, Minimize2, Maximize2, Rocket, Loader2, Square, Video, Download } from 'lucide-react';
|
|
8
8
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -1013,6 +1013,9 @@ var PROFILE_LABELS = {
|
|
|
1013
1013
|
low_latency: "\u4F4E\u5EF6\u8FDF",
|
|
1014
1014
|
high_quality: "\u9AD8\u753B\u8D28"
|
|
1015
1015
|
};
|
|
1016
|
+
function clipboardToastMessage(message) {
|
|
1017
|
+
return message.replace(/^(?:GET|POST|PUT|PATCH|DELETE)\s+\S+\s+\d{3}:\s*/, "");
|
|
1018
|
+
}
|
|
1016
1019
|
var DEFAULT_SIZE = { width: 1080, height: 2340 };
|
|
1017
1020
|
var AUTO_QUALITY_FIRST_CHECK_MS = 2e3;
|
|
1018
1021
|
var AUTO_QUALITY_INTERVAL_MS = 8e3;
|
|
@@ -1111,6 +1114,13 @@ function WebRtcMirrorSurface({ deviceId, platform = "android", onSize, videoAspe
|
|
|
1111
1114
|
panelButton.current?.focus();
|
|
1112
1115
|
};
|
|
1113
1116
|
const { error: clipboardError, conflict: clipboardConflict, resolveConflict } = useClipboardSync(deviceId, !!stream);
|
|
1117
|
+
const { toasts, toast, dismiss } = useToast();
|
|
1118
|
+
const toastRef = useRef(toast);
|
|
1119
|
+
toastRef.current = toast;
|
|
1120
|
+
useEffect(() => {
|
|
1121
|
+
if (!clipboardError) return;
|
|
1122
|
+
toastRef.current.error(clipboardToastMessage(clipboardError));
|
|
1123
|
+
}, [clipboardError]);
|
|
1114
1124
|
const [size, setSize] = useState(DEFAULT_SIZE);
|
|
1115
1125
|
const [hasFrame, setHasFrame] = useState(false);
|
|
1116
1126
|
useEffect(() => {
|
|
@@ -1211,6 +1221,7 @@ function WebRtcMirrorSurface({ deviceId, platform = "android", onSize, videoAspe
|
|
|
1211
1221
|
[reportSize]
|
|
1212
1222
|
);
|
|
1213
1223
|
return /* @__PURE__ */ jsxs("div", { className: `flex min-h-0 flex-col items-center gap-2 ${className ?? ""}`, children: [
|
|
1224
|
+
/* @__PURE__ */ jsx(ToastViewport, { toasts, onDismiss: dismiss }),
|
|
1214
1225
|
/* @__PURE__ */ jsxs("div", { className: `flex min-h-0 max-w-[96vw] flex-1 items-stretch justify-center gap-2 ${videoAspect ? "w-max" : "w-full"}`, children: [
|
|
1215
1226
|
/* @__PURE__ */ jsxs("aside", { "aria-label": "\u8BBE\u5907\u5DE5\u5177\u680F", className: "flex shrink-0 flex-col items-center gap-1 rounded-lg border border-border bg-background p-1 text-foreground", children: [
|
|
1216
1227
|
/* @__PURE__ */ jsx("button", { type: "button", "aria-label": "\u7C98\u8D34\u6587\u672C", title: "\u7C98\u8D34\u6587\u672C", onClick: () => setPasteOpen(true), className: "flex h-11 w-11 items-center justify-center rounded-md hover:bg-secondary", children: /* @__PURE__ */ jsx(ClipboardPaste, { className: "h-4 w-4" }) }),
|
|
@@ -1284,10 +1295,6 @@ function WebRtcMirrorSurface({ deviceId, platform = "android", onSize, videoAspe
|
|
|
1284
1295
|
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => resolveConflict("local"), className: "text-xs underline", children: "\u4FDD\u7559\u672C\u673A\u526A\u8D34\u677F" }),
|
|
1285
1296
|
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => resolveConflict("device"), className: "text-xs underline", children: "\u4FDD\u7559\u8BBE\u5907\u526A\u8D34\u677F" })
|
|
1286
1297
|
] }),
|
|
1287
|
-
clipboardError && /* @__PURE__ */ jsxs("span", { role: "status", className: "text-xs text-destructive", children: [
|
|
1288
|
-
"\u526A\u8D34\u677F\u540C\u6B65\u5931\u8D25\uFF1A",
|
|
1289
|
-
clipboardError
|
|
1290
|
-
] }),
|
|
1291
1298
|
platform === "android" && /* @__PURE__ */ jsx(
|
|
1292
1299
|
"button",
|
|
1293
1300
|
{
|