ms-vite-plugin 1.4.72 → 1.4.74
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/luaObfuscator/addVararg.js +1 -1
- package/dist/luaObfuscator/flatten.js +1 -1
- package/dist/luaObfuscator/rename.js +1 -1
- package/dist/luaObfuscator/scope.js +1 -1
- package/docs/api/device.md +0 -25
- package/docs/api/opencv.md +9 -2
- package/docs/api/ui.md +29 -0
- package/docs/apicn/device.md +0 -25
- package/docs/apicn/ui.md +29 -0
- package/docs/apilua/device.md +0 -26
- package/docs/apilua/opencv.md +8 -1
- package/docs/apilua/ui.md +29 -0
- package/docs/apipython/device.md +0 -23
- package/docs/apipython/ui.md +29 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addVararg=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addVararg=o;function c(t){t.vararg=!0,s(t.body.body)}function a(t){switch(t.type){case"FuncExpr":c(t);break;case"UnaryExpr":a(t.arg);break;case"BinaryExpr":a(t.left),a(t.right);break;case"TableExpr":for(const e of t.fields)e.kind==="index"&&a(e.key),a(e.value);break;case"IndexExpr":a(t.object),a(t.index);break;case"MemberExpr":a(t.object);break;case"CallExpr":a(t.callee);for(const e of t.args)a(e);break;case"MethodCallExpr":a(t.object);for(const e of t.args)a(e);break;case"ParenExpr":a(t.exp);break;default:break}}function s(t){for(const e of t)switch(e.type){case"DoStat":case"WhileStat":case"RepeatStat":case"ForNumStat":case"ForInStat":if(e.type==="WhileStat"&&a(e.cond),e.type==="RepeatStat"&&a(e.cond),e.type==="ForNumStat"&&(a(e.start),a(e.end),e.step&&a(e.step)),e.type==="ForInStat")for(const r of e.exps)a(r);s(e.body.body);break;case"IfStat":for(const r of e.clauses)a(r.cond),s(r.body.body);e.elseBody&&s(e.elseBody.body);break;case"FuncStat":case"LocalFuncStat":c(e.func);break;case"LocalStat":if(e.exps)for(const r of e.exps)a(r);break;case"AssignStat":for(const r of e.vars)a(r);for(const r of e.exps)a(r);break;case"CallStat":a(e.exp);break;case"ReturnStat":for(const r of e.exps)a(r);break;default:break}}function o(t){s(t.body)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.flattenControlFlow=C;function m(e){return{type:"NumberLiteral",raw:String(e),value:e}}function y(e){return{type:"NameExpr",name:e}}function b(e,t){return{type:"AssignStat",vars:e.map(a=>y(a)),exps:t}}function u(e,t){return b([e.stateName],[typeof t=="number"?m(t):t])}function k(e,t,a){return{type:"BinaryExpr",op:"or",left:{type:"BinaryExpr",op:"and",left:y(e),right:m(t)},right:m(a)}}function E(e,t,a){return{type:"BinaryExpr",op:e,left:t,right:a}}function S(e){const t=`__t${e.nextTemp}`;return e.nextTemp+=1,e.temps.push(t),t}function x(e){const t=e.nextState;return e.nextState+=1,e.states.set(t,[]),t}function r(e,t,a){e.states.get(t).push(a)}function L(e,t){for(const a of e)if(a.type==="LocalStat")for(const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.flattenControlFlow=C;function m(e){return{type:"NumberLiteral",raw:String(e),value:e}}function y(e){return{type:"NameExpr",name:e}}function b(e,t){return{type:"AssignStat",vars:e.map(a=>y(a)),exps:t}}function u(e,t){return b([e.stateName],[typeof t=="number"?m(t):t])}function k(e,t,a){return{type:"BinaryExpr",op:"or",left:{type:"BinaryExpr",op:"and",left:y(e),right:m(t)},right:m(a)}}function E(e,t,a){return{type:"BinaryExpr",op:e,left:t,right:a}}function S(e){const t=`__t${e.nextTemp}`;return e.nextTemp+=1,e.temps.push(t),t}function x(e){const t=e.nextState;return e.nextState+=1,e.states.set(t,[]),t}function r(e,t,a){e.states.get(t).push(a)}function L(e,t){for(const a of e)if(a.type==="LocalStat")for(const s of a.names)t.push(s.name);else if(a.type==="LocalFuncStat")t.push(a.name);else if(a.type==="ForNumStat")t.push(a.name),L(a.body.body,t);else if(a.type==="ForInStat")t.push(...a.names),L(a.body.body,t);else if(a.type==="DoStat"||a.type==="WhileStat"||a.type==="RepeatStat")L(a.body.body,t);else if(a.type==="IfStat"){for(const s of a.clauses)L(s.body.body,t);a.elseBody&&L(a.elseBody.body,t)}}function h(e,t,a,s){if(e.length===0)return t;const p=e.map(()=>x(a));for(let o=0;o<e.length;o+=1){const c=e[o];c.type==="LabelStat"&&a.userLabels.set(c.name,p[o])}for(let o=0;o<e.length;o+=1){const c=o+1<e.length?p[o+1]:t;I(a,p[o],e[o],c,s)}return p[0]}function I(e,t,a,s,p){switch(a.type){case"EmptyStat":case"LabelStat":r(e,t,u(e,s));return;case"AssignStat":case"CallStat":case"FuncStat":r(e,t,a),r(e,t,u(e,s));return;case"LocalStat":a.exps&&a.exps.length>0&&r(e,t,b(a.names.map(o=>o.name),a.exps)),r(e,t,u(e,s));return;case"LocalFuncStat":r(e,t,b([a.name],[a.func])),r(e,t,u(e,s));return;case"ReturnStat":r(e,t,a);return;case"BreakStat":r(e,t,u(e,p));return;case"GotoStat":{const o=e.userLabels.get(a.name);if(o===void 0)throw new Error(`goto \u672A\u5B9A\u4E49\u6807\u7B7E ::${a.name}::`);r(e,t,u(e,o));return}case"DoStat":r(e,t,u(e,h(a.body.body,s,e,p)));return;case"IfStat":{const o=S(e);let c=t;for(let l=0;l<a.clauses.length;l+=1){const f=l===a.clauses.length-1,d=h(a.clauses[l].body.body,s,e,p);let i=s;f?a.elseBody&&(i=h(a.elseBody.body,s,e,p)):i=x(e),r(e,c,b([o],[a.clauses[l].cond])),r(e,c,u(e,k(o,d,i))),f||(c=i)}a.clauses.length===0&&r(e,t,u(e,s));return}case"WhileStat":{const o=S(e),c=h(a.body.body,t,e,s);r(e,t,b([o],[a.cond])),r(e,t,u(e,k(o,c,s)));return}case"RepeatStat":{const o=S(e),c=x(e),l=h(a.body.body,c,e,s);r(e,t,u(e,l)),r(e,c,b([o],[a.cond])),r(e,c,u(e,k(o,s,l)));return}case"ForNumStat":{const o=a.name,c=S(e),l=S(e),f=S(e),d=x(e),i=x(e),F=x(e),g=x(e),N=h(a.body.body,g,e,s);r(e,t,b([o],[a.start])),r(e,t,b([c],[a.end])),r(e,t,b([l],[a.step??m(1)])),r(e,t,u(e,d)),r(e,d,b([f],[E(">=",y(l),m(0))])),r(e,d,u(e,k(f,i,F))),r(e,i,b([f],[E("<=",y(o),y(c))])),r(e,i,u(e,k(f,N,s))),r(e,F,b([f],[E(">=",y(o),y(c))])),r(e,F,u(e,k(f,N,s))),r(e,g,b([o],[E("+",y(o),y(l))])),r(e,g,u(e,d));return}case"ForInStat":{const o=S(e),c=S(e),l=S(e),f=S(e),d=x(e),i=[b([l],[y(a.names[0])]),...a.body.body],F=h(i,d,e,s),g=a.exps.slice();for(;g.length<3;)g.push({type:"NilLiteral"});r(e,t,b([o,c,l],g.slice(0,3))),r(e,t,u(e,d)),r(e,d,{type:"AssignStat",vars:a.names.map(N=>y(N)),exps:[{type:"CallExpr",callee:y(o),args:[y(c),y(l)]}]}),r(e,d,b([f],[E("~=",y(a.names[0]),{type:"NilLiteral"})])),r(e,d,u(e,k(f,F,s)));return}default:r(e,t,u(e,s))}}function v(e,t){const a=e.slice();let s=t>>>0||1;for(let p=a.length-1;p>0;p-=1){s=Math.imul(s,1664525)+1013904223>>>0;const o=s%(p+1),c=a[p];a[p]=a[o],a[o]=c}return a}function w(e,t){if(e.length===0)return e;const a={states:new Map,temps:[],nextState:1,nextTemp:1,stateName:"__s",userLabels:new Map},s=[];L(e,s);const p=h(e,0,a,0),o=[...new Set([...s,...a.temps,a.stateName])],c=v([...a.states.keys()],t).map(l=>({cond:E("==",y(a.stateName),m(l)),body:{type:"Block",body:a.states.get(l)}}));return[{type:"LocalStat",names:o.map(l=>({name:l}))},b([a.stateName],[m(p)]),{type:"WhileStat",cond:E("~=",y(a.stateName),m(0)),body:{type:"Block",body:[{type:"IfStat",clauses:c}]}}]}function n(e,t){switch(e.type){case"FuncExpr":B(e.body.body,t),e.body.body=w(e.body.body,t);break;case"UnaryExpr":n(e.arg,t);break;case"BinaryExpr":n(e.left,t),n(e.right,t);break;case"TableExpr":for(const a of e.fields)a.kind==="index"&&n(a.key,t),n(a.value,t);break;case"IndexExpr":n(e.object,t),n(e.index,t);break;case"MemberExpr":n(e.object,t);break;case"CallExpr":n(e.callee,t);for(const a of e.args)n(a,t);break;case"MethodCallExpr":n(e.object,t);for(const a of e.args)n(a,t);break;case"ParenExpr":n(e.exp,t);break;default:break}}function B(e,t){for(const a of e)switch(a.type){case"DoStat":case"WhileStat":case"RepeatStat":case"ForNumStat":case"ForInStat":if((a.type==="WhileStat"||a.type==="RepeatStat")&&n(a.cond,t),a.type==="ForNumStat"&&(n(a.start,t),n(a.end,t),a.step&&n(a.step,t)),a.type==="ForInStat")for(const s of a.exps)n(s,t);B(a.body.body,t);break;case"IfStat":for(const s of a.clauses)n(s.cond,t),B(s.body.body,t);a.elseBody&&B(a.elseBody.body,t);break;case"FuncStat":case"LocalFuncStat":B(a.func.body.body,t),a.func.body.body=w(a.func.body.body,t);break;case"LocalStat":if(a.exps)for(const s of a.exps)n(s,t);break;case"AssignStat":for(const s of a.vars)n(s,t);for(const s of a.exps)n(s,t);break;case"CallStat":n(a.exp,t);break;case"ReturnStat":for(const s of a.exps)n(s,t);break;default:break}}function C(e,t){B(e.body,t),e.body=w(e.body,t)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shortName=o,exports.renameLocals=c;const u=require("./reserved"),d=require("./scope"),l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function o(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shortName=o,exports.renameLocals=c;const u=require("./reserved"),d=require("./scope"),l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function o(r){let e=r,t="";do t=l[e%l.length]+t,e=Math.floor(e/l.length)-1;while(e>=0);return u.luaKeywords.has(t)?`_${t}`:t}function c(r){let e=0;const t=new Set;(0,d.collectAndRename)(r,(a,s)=>{if(a.newName!==a.original)return;let n=o(e);for(e+=1;s.has(n)||t.has(n)||u.luaKeywords.has(n);)n=o(e),e+=1;a.newName=n,t.add(n),s.add(n)})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.resolveLocal=i,exports.collectAndRename=x;function i(e,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.resolveLocal=i,exports.collectAndRename=x;function i(e,s){let n=e;for(;n;){const a=n.locals.get(s);if(a)return a;n=n.parent}}function c(e){return{parent:e,locals:new Map}}function f(e,s){const n=e.locals.get(s);if(n)return n;const a={original:s,newName:s};return e.locals.set(s,a),a}function x(e,s){const n=new Set,a={locals:new Map};d(e.body,a,n,s)}function u(e,s,n,a){d(e.body,s,n,a)}function d(e,s,n,a){for(const o of e)b(o,s,n,a)}function m(e,s,n,a){const o=c(s),r=e.params.slice();for(let l=0;l<r.length;l+=1){const p=f(o,r[l]);a(p,n),e.params[l]=p.newName}u(e.body,o,n,a)}function b(e,s,n,a){switch(e.type){case"EmptyStat":case"BreakStat":case"GotoStat":case"LabelStat":return;case"DoStat":u(e.body,c(s),n,a);return;case"WhileStat":t(e.cond,s,n,a),u(e.body,c(s),n,a);return;case"RepeatStat":{const o=c(s);u(e.body,o,n,a),t(e.cond,o,n,a);return}case"IfStat":for(const o of e.clauses)t(o.cond,s,n,a),u(o.body,c(s),n,a);e.elseBody&&u(e.elseBody,c(s),n,a);return;case"ForNumStat":{t(e.start,s,n,a),t(e.end,s,n,a),e.step&&t(e.step,s,n,a);const o=c(s),r=f(o,e.name);a(r,n),e.name=r.newName,u(e.body,o,n,a);return}case"ForInStat":{for(const r of e.exps)t(r,s,n,a);const o=c(s);for(let r=0;r<e.names.length;r+=1){const l=f(o,e.names[r]);a(l,n),e.names[r]=l.newName}u(e.body,o,n,a);return}case"FuncStat":{const o=i(s,e.name.base);o&&(e.name.base=o.newName),m(e.func,s,n,a);return}case"LocalFuncStat":{const o=f(s,e.name);a(o,n),e.name=o.newName,m(e.func,s,n,a);return}case"LocalStat":if(e.exps)for(const o of e.exps)t(o,s,n,a);for(let o=0;o<e.names.length;o+=1){const r=f(s,e.names[o].name);a(r,n),e.names[o].name=r.newName}return;case"AssignStat":for(const o of e.vars)t(o,s,n,a);for(const o of e.exps)t(o,s,n,a);return;case"CallStat":t(e.exp,s,n,a);return;case"ReturnStat":for(const o of e.exps)t(o,s,n,a);return}}function t(e,s,n,a){switch(e.type){case"NilLiteral":case"BoolLiteral":case"NumberLiteral":case"StringLiteral":case"VarargExpr":return;case"NameExpr":{const o=i(s,e.name);o&&(e.name=o.newName);return}case"UnaryExpr":t(e.arg,s,n,a);return;case"BinaryExpr":t(e.left,s,n,a),t(e.right,s,n,a);return;case"FuncExpr":m(e,s,n,a);return;case"TableExpr":for(const o of e.fields)o.kind==="index"&&t(o.key,s,n,a),t(o.value,s,n,a);return;case"IndexExpr":t(e.object,s,n,a),t(e.index,s,n,a);return;case"MemberExpr":t(e.object,s,n,a);return;case"CallExpr":t(e.callee,s,n,a);for(const o of e.args)t(o,s,n,a);return;case"MethodCallExpr":t(e.object,s,n,a);for(const o of e.args)t(o,s,n,a);return;case"ParenExpr":t(e.exp,s,n,a);return}}
|
package/docs/api/device.md
CHANGED
|
@@ -84,31 +84,6 @@ const uuid = device.getDeviceID();
|
|
|
84
84
|
logi(`设备ID: ${uuid}`);
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
### getServerDeviceId - 获取服务器设备 ID。
|
|
88
|
-
|
|
89
|
-
**注意事项:**
|
|
90
|
-
|
|
91
|
-
- 这个 ID 卸载重装后,只要签名没变,就不会改变。
|
|
92
|
-
- 如果要取唯一 ID 建议使用这个。
|
|
93
|
-
|
|
94
|
-
```typescript
|
|
95
|
-
function getServerDeviceId(): string;
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
**返回值:**
|
|
99
|
-
|
|
100
|
-
| 类型 | 描述 |
|
|
101
|
-
| -------- | ------------------- |
|
|
102
|
-
| `string` | 服务器分配的设备 ID |
|
|
103
|
-
|
|
104
|
-
**示例:**
|
|
105
|
-
|
|
106
|
-
```typescript
|
|
107
|
-
// 获取服务器设备ID
|
|
108
|
-
const serverDeviceId = device.getServerDeviceId();
|
|
109
|
-
logi(`服务器设备ID: ${serverDeviceId}`);
|
|
110
|
-
```
|
|
111
|
-
|
|
112
87
|
### getECID - 获取设备 ECID。
|
|
113
88
|
|
|
114
89
|
```typescript
|
package/docs/api/opencv.md
CHANGED
|
@@ -186,6 +186,8 @@ function imwrite(path: string, mat: Mat): boolean;
|
|
|
186
186
|
| `path` | string | 是 | - | 本地绝对路径(写入磁盘,不是 msbundle) |
|
|
187
187
|
| `mat` | Mat | 是 | - | Mat 句柄 |
|
|
188
188
|
|
|
189
|
+
**说明:** 格式由 `path` 的扩展名决定,可用 `png` / `apng` / `jpg` / `jpeg` / `jpe` / `bmp` / `dib` / `webp` / `ppm` / `pgm` / `pbm` / `pnm` / `pam` / `sr` / `ras`;其它扩展名(如 `tiff`)或通道数不是 1 / 3 / 4 的 Mat 会直接返回 `false`。
|
|
190
|
+
|
|
189
191
|
**返回值:** 成功 `true`,失败 `false`。
|
|
190
192
|
|
|
191
193
|
**示例:**
|
|
@@ -208,14 +210,16 @@ function imencode(ext: string, mat: Mat, quality?: number): string | null;
|
|
|
208
210
|
| --- | --- | --- | --- | --- |
|
|
209
211
|
| `ext` | string | 是 | - | 如 `.png` / `.jpg` / `png` |
|
|
210
212
|
| `mat` | Mat | 是 | - | Mat 句柄 |
|
|
211
|
-
| `quality` | number | 否 | 90 | JPEG
|
|
213
|
+
| `quality` | number | 否 | 90 | JPEG 质量,取值 1–100(仅 jpg 有效) |
|
|
214
|
+
|
|
215
|
+
**说明:** 可用扩展名与通道限制同 `imwrite`,不支持的格式返回 `null`。
|
|
212
216
|
|
|
213
217
|
**返回值:** 纯 base64 字符串(无 data URI 前缀);失败 `null`。
|
|
214
218
|
|
|
215
219
|
**示例:**
|
|
216
220
|
|
|
217
221
|
```javascript
|
|
218
|
-
const b64 = cv.imencode(".jpg", mat,
|
|
222
|
+
const b64 = cv.imencode(".jpg", mat, 85);
|
|
219
223
|
```
|
|
220
224
|
|
|
221
225
|
### fromImageId / toImageId - 与 image 互通
|
|
@@ -567,6 +571,9 @@ cv.release(out);
|
|
|
567
571
|
|
|
568
572
|
就地修改并返回**同一句柄**。`color` 为 BGR 数组或 `#RRGGBB`。
|
|
569
573
|
|
|
574
|
+
`thickness` 上限为 32767。`rectangle` / `circle` 的负值表示填充;`line` / `putText` / `polylines` /
|
|
575
|
+
`arrowedLine` / `drawMarker` 只能描边,传 0 或负值按 1 处理。
|
|
576
|
+
|
|
570
577
|
```typescript
|
|
571
578
|
function rectangle(mat: Mat, options: RectangleOptions): Mat | null;
|
|
572
579
|
function circle(mat: Mat, options: CircleOptions): Mat | null;
|
package/docs/api/ui.md
CHANGED
|
@@ -627,6 +627,35 @@ setInterval(checkAgentStatus, 5000);
|
|
|
627
627
|
|
|
628
628
|
### 系统功能
|
|
629
629
|
|
|
630
|
+
#### getDeviceID - 获取设备 ID
|
|
631
|
+
|
|
632
|
+
```typescript
|
|
633
|
+
declare function getDeviceID(): Promise<string>;
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
**返回值:**
|
|
637
|
+
|
|
638
|
+
| 类型 | 描述 |
|
|
639
|
+
| ----------------- | ---------------- |
|
|
640
|
+
| `Promise<string>` | 设备的唯一标识符 |
|
|
641
|
+
|
|
642
|
+
**说明:**
|
|
643
|
+
|
|
644
|
+
获取当前设备的唯一标识符。卸载重装 APP 后会改变,更新 APP 后不会改变。
|
|
645
|
+
|
|
646
|
+
**网页端示例:**
|
|
647
|
+
|
|
648
|
+
```javascript
|
|
649
|
+
// 获取设备ID
|
|
650
|
+
ms.getDeviceID()
|
|
651
|
+
.then((deviceId) => {
|
|
652
|
+
console.log("当前设备ID:", deviceId);
|
|
653
|
+
})
|
|
654
|
+
.catch((error) => {
|
|
655
|
+
console.error("获取设备ID出错:", error);
|
|
656
|
+
});
|
|
657
|
+
```
|
|
658
|
+
|
|
630
659
|
#### getServerDeviceId - 获取服务器设备 ID
|
|
631
660
|
|
|
632
661
|
```typescript
|
package/docs/apicn/device.md
CHANGED
|
@@ -84,31 +84,6 @@ const uuid = $设备.获取设备ID();
|
|
|
84
84
|
$打印信息日志(`设备ID: ${uuid}`);
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
### 获取服务器设备 ID
|
|
88
|
-
|
|
89
|
-
**注意事项:**
|
|
90
|
-
|
|
91
|
-
- 这个 ID 卸载重装后,只要签名没变,就不会改变。
|
|
92
|
-
- 如果要取唯一 ID 建议使用这个。
|
|
93
|
-
|
|
94
|
-
```typescript
|
|
95
|
-
function 获取服务器设备ID(): 字符串;
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
**返回值:**
|
|
99
|
-
|
|
100
|
-
| 类型 | 描述 |
|
|
101
|
-
| -------- | ------------------- |
|
|
102
|
-
| `字符串` | 服务器分配的设备 ID |
|
|
103
|
-
|
|
104
|
-
**示例:**
|
|
105
|
-
|
|
106
|
-
```typescript
|
|
107
|
-
// 获取服务器设备ID
|
|
108
|
-
const serverDeviceId = $设备.获取服务器设备ID();
|
|
109
|
-
$打印信息日志(`服务器设备ID: ${serverDeviceId}`);
|
|
110
|
-
```
|
|
111
|
-
|
|
112
87
|
### 获取 ECID
|
|
113
88
|
|
|
114
89
|
```typescript
|
package/docs/apicn/ui.md
CHANGED
|
@@ -615,6 +615,35 @@ setInterval(checkAgentStatus, 5000);
|
|
|
615
615
|
|
|
616
616
|
### 系统功能
|
|
617
617
|
|
|
618
|
+
#### getDeviceID() - 获取设备 ID
|
|
619
|
+
|
|
620
|
+
```typescript
|
|
621
|
+
declare function getDeviceID(): Promise<string>;
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
**返回值:**
|
|
625
|
+
|
|
626
|
+
| 类型 | 描述 |
|
|
627
|
+
| ----------------- | ---------------- |
|
|
628
|
+
| `Promise<string>` | 设备的唯一标识符 |
|
|
629
|
+
|
|
630
|
+
**说明:**
|
|
631
|
+
|
|
632
|
+
获取当前设备的唯一标识符。卸载重装 APP 后会改变,更新 APP 后不会改变。
|
|
633
|
+
|
|
634
|
+
**网页端示例:**
|
|
635
|
+
|
|
636
|
+
```javascript
|
|
637
|
+
// 获取设备ID
|
|
638
|
+
ms.getDeviceID()
|
|
639
|
+
.then((deviceId) => {
|
|
640
|
+
console.log("当前设备ID:", deviceId);
|
|
641
|
+
})
|
|
642
|
+
.catch((error) => {
|
|
643
|
+
console.error("获取设备ID出错:", error);
|
|
644
|
+
});
|
|
645
|
+
```
|
|
646
|
+
|
|
618
647
|
#### getServerDeviceId() - 获取服务器设备 ID
|
|
619
648
|
|
|
620
649
|
```typescript
|
package/docs/apilua/device.md
CHANGED
|
@@ -82,32 +82,6 @@ local uuid = device.getDeviceID()
|
|
|
82
82
|
print("设备ID = " .. tostring(uuid))
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
### getServerDeviceId - 获取服务器设备 ID。
|
|
86
|
-
|
|
87
|
-
**注意事项:**
|
|
88
|
-
|
|
89
|
-
- 这个 ID 卸载重装后,只要签名没变,就不会改变。
|
|
90
|
-
- 如果要取唯一 ID 建议使用这个。
|
|
91
|
-
|
|
92
|
-
```lua
|
|
93
|
-
---@return string
|
|
94
|
-
function getServerDeviceId() end
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
**返回值:**
|
|
98
|
-
|
|
99
|
-
| 类型 | 描述 |
|
|
100
|
-
| -------- | ------------------- |
|
|
101
|
-
| `string` | 服务器分配的设备 ID |
|
|
102
|
-
|
|
103
|
-
**示例:**
|
|
104
|
-
|
|
105
|
-
```lua
|
|
106
|
-
-- 获取服务器设备ID
|
|
107
|
-
local serverDeviceId = device.getServerDeviceId()
|
|
108
|
-
print("服务器设备ID = " .. tostring(serverDeviceId))
|
|
109
|
-
```
|
|
110
|
-
|
|
111
85
|
### getECID - 获取设备 ECID。
|
|
112
86
|
|
|
113
87
|
```lua
|
package/docs/apilua/opencv.md
CHANGED
|
@@ -194,6 +194,8 @@ function imwrite(path, mat) end
|
|
|
194
194
|
| `path` | string | 是 | - | 本地绝对路径(写入磁盘,不是 msbundle) |
|
|
195
195
|
| `mat` | Mat | 是 | - | Mat 句柄 |
|
|
196
196
|
|
|
197
|
+
**说明:** 格式由 `path` 的扩展名决定,可用 `png` / `apng` / `jpg` / `jpeg` / `jpe` / `bmp` / `dib` / `webp` / `ppm` / `pgm` / `pbm` / `pnm` / `pam` / `sr` / `ras`;其它扩展名(如 `tiff`)或通道数不是 1 / 3 / 4 的 Mat 会直接返回 `false`。
|
|
198
|
+
|
|
197
199
|
**返回值:** 成功 `true`,失败 `false`。
|
|
198
200
|
|
|
199
201
|
**示例:**
|
|
@@ -220,7 +222,9 @@ function imencode(ext, mat, quality) end
|
|
|
220
222
|
| --- | --- | --- | --- | --- |
|
|
221
223
|
| `ext` | string | 是 | - | 如 `.png` / `.jpg` / `png` |
|
|
222
224
|
| `mat` | Mat | 是 | - | Mat 句柄 |
|
|
223
|
-
| `quality` | number | 否 | 90 | JPEG
|
|
225
|
+
| `quality` | number | 否 | 90 | JPEG 质量,取值 1–100(仅 jpg 有效) |
|
|
226
|
+
|
|
227
|
+
**说明:** 可用扩展名与通道限制同 `imwrite`,不支持的格式返回 `nil`。
|
|
224
228
|
|
|
225
229
|
**返回值:** 纯 base64 字符串(无 data URI 前缀);失败 `nil`。
|
|
226
230
|
|
|
@@ -541,6 +545,9 @@ function rectangle(mat, options) end
|
|
|
541
545
|
|
|
542
546
|
就地修改并返回**同一句柄**。`color` 为 BGR 数组或 `#RRGGBB`。
|
|
543
547
|
|
|
548
|
+
`thickness` 上限为 32767。`rectangle` / `circle` 的负值表示填充;`line` / `putText` / `polylines` /
|
|
549
|
+
`arrowedLine` / `drawMarker` 只能描边,传 0 或负值按 1 处理。
|
|
550
|
+
|
|
544
551
|
**rectangle 参数:** `pt1`+`pt2`,或 `rect`;以及 `color`、`thickness`。
|
|
545
552
|
|
|
546
553
|
**示例:**
|
package/docs/apilua/ui.md
CHANGED
|
@@ -679,6 +679,35 @@ setInterval(checkAgentStatus, 5000);
|
|
|
679
679
|
|
|
680
680
|
### 系统功能
|
|
681
681
|
|
|
682
|
+
#### getDeviceID - 获取设备 ID
|
|
683
|
+
|
|
684
|
+
```typescript
|
|
685
|
+
declare function getDeviceID(): Promise<string>;
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
**返回值:**
|
|
689
|
+
|
|
690
|
+
| 类型 | 描述 |
|
|
691
|
+
| ----------------- | ---------------- |
|
|
692
|
+
| `Promise<string>` | 设备的唯一标识符 |
|
|
693
|
+
|
|
694
|
+
**说明:**
|
|
695
|
+
|
|
696
|
+
获取当前设备的唯一标识符。卸载重装 APP 后会改变,更新 APP 后不会改变。
|
|
697
|
+
|
|
698
|
+
**网页端示例:**
|
|
699
|
+
|
|
700
|
+
```javascript
|
|
701
|
+
// 获取设备ID
|
|
702
|
+
ms.getDeviceID()
|
|
703
|
+
.then((deviceId) => {
|
|
704
|
+
console.log("当前设备ID:", deviceId);
|
|
705
|
+
})
|
|
706
|
+
.catch((error) => {
|
|
707
|
+
console.error("获取设备ID出错:", error);
|
|
708
|
+
});
|
|
709
|
+
```
|
|
710
|
+
|
|
682
711
|
#### getServerDeviceId - 获取服务器设备 ID
|
|
683
712
|
|
|
684
713
|
```typescript
|
package/docs/apipython/device.md
CHANGED
|
@@ -92,29 +92,6 @@ from kuaijs import device
|
|
|
92
92
|
print(device.getDeviceID())
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
### getServerDeviceId - 获取服务器设备 ID。
|
|
96
|
-
|
|
97
|
-
```python
|
|
98
|
-
def getServerDeviceId() -> str
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
**注意事项:**
|
|
102
|
-
|
|
103
|
-
- 卸载重装后只要签名不变,该 ID 不变;如需唯一 ID 推荐使用此方法
|
|
104
|
-
|
|
105
|
-
**返回值:**
|
|
106
|
-
|
|
107
|
-
| 类型 | 描述 |
|
|
108
|
-
| ----- | ----------------- |
|
|
109
|
-
| `str` | 服务器分配设备 ID |
|
|
110
|
-
|
|
111
|
-
**示例:**
|
|
112
|
-
|
|
113
|
-
```python
|
|
114
|
-
from kuaijs import device
|
|
115
|
-
print(device.getServerDeviceId())
|
|
116
|
-
```
|
|
117
|
-
|
|
118
95
|
### getECID - 获取设备 ECID。
|
|
119
96
|
|
|
120
97
|
```python
|
package/docs/apipython/ui.md
CHANGED
|
@@ -640,6 +640,35 @@ setInterval(checkAgentStatus, 5000);
|
|
|
640
640
|
|
|
641
641
|
### 系统功能
|
|
642
642
|
|
|
643
|
+
#### getDeviceID - 获取设备 ID
|
|
644
|
+
|
|
645
|
+
```typescript
|
|
646
|
+
declare function getDeviceID(): Promise<string>;
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
**返回值:**
|
|
650
|
+
|
|
651
|
+
| 类型 | 描述 |
|
|
652
|
+
| ----------------- | ---------------- |
|
|
653
|
+
| `Promise<string>` | 设备的唯一标识符 |
|
|
654
|
+
|
|
655
|
+
**说明:**
|
|
656
|
+
|
|
657
|
+
获取当前设备的唯一标识符。卸载重装 APP 后会改变,更新 APP 后不会改变。
|
|
658
|
+
|
|
659
|
+
**网页端示例:**
|
|
660
|
+
|
|
661
|
+
```javascript
|
|
662
|
+
// 获取设备ID
|
|
663
|
+
ms.getDeviceID()
|
|
664
|
+
.then((deviceId) => {
|
|
665
|
+
console.log("当前设备ID:", deviceId);
|
|
666
|
+
})
|
|
667
|
+
.catch((error) => {
|
|
668
|
+
console.error("获取设备ID出错:", error);
|
|
669
|
+
});
|
|
670
|
+
```
|
|
671
|
+
|
|
643
672
|
#### getServerDeviceId - 获取服务器设备 ID
|
|
644
673
|
|
|
645
674
|
```typescript
|