ms-vite-plugin 1.5.9 → 1.5.11

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.
@@ -59,12 +59,9 @@ logi(`剩余存储: ${storage.free}${storage.unit}`);
59
59
 
60
60
  ## 设备标识信息
61
61
 
62
- ### getDeviceID - 获取设备的唯一标识符(ID)。
62
+ ### getDeviceID - 获取设备 ID。
63
63
 
64
- **注意事项:**
65
-
66
- - 这个 ID 卸载重装 APP 后会改变。
67
- - 更新 APP 后,不会改变。
64
+ 越狱包返回芯片生成的固定 ID,卸载重装不变;免越狱包返回 IDFV,卸载重装会改变。
68
65
 
69
66
  ```typescript
70
67
  function getDeviceID(): string;
@@ -72,14 +69,13 @@ function getDeviceID(): string;
72
69
 
73
70
  **返回值:**
74
71
 
75
- | 类型 | 描述 |
76
- | ------ | ---------------- |
77
- | string | 设备的唯一标识符 |
72
+ | 类型 | 描述 |
73
+ | ------ | ------- |
74
+ | string | 设备 ID |
78
75
 
79
76
  **示例:**
80
77
 
81
78
  ```typescript
82
- // 获取设备ID
83
79
  const uuid = device.getDeviceID();
84
80
  logi(`设备ID: ${uuid}`);
85
81
  ```
@@ -66,10 +66,10 @@ logi(`运行状态: ${__isRunning__}`);
66
66
 
67
67
  #### **platform**
68
68
 
69
- 平台信息,标识当前应用运行的平台,例如 "ios"、"android" 等。
69
+ 免越狱包为 `"ios"`,越狱包为 `"ios_jb"`。
70
70
 
71
71
  ```typescript
72
- declare const __platform__: "ios" | "android";
72
+ declare const __platform__: "ios" | "ios_jb";
73
73
  ```
74
74
 
75
75
  **示例:**
@@ -0,0 +1,291 @@
1
+ # 清理模块 (JBClear)
2
+
3
+ 仅越狱包可用。免越狱包没有 `jbclear`。
4
+
5
+ ## API 参考
6
+
7
+ ### keychain - 按关联名清理钥匙串。
8
+
9
+ 空串返回 `false`。
10
+
11
+ ```typescript
12
+ function keychain(identifier: string): boolean;
13
+ ```
14
+
15
+ **参数:**
16
+
17
+ | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
18
+ | ------------ | ------ | -------- | ------ | -------------------------------------- |
19
+ | `identifier` | string | 是 | - | 钥匙串关联名,例如 `"demo.sample.app"` |
20
+
21
+ **返回值:**
22
+
23
+ | 类型 | 描述 |
24
+ | --------- | ------------- |
25
+ | `boolean` | 成功为 `true` |
26
+
27
+ **示例:**
28
+
29
+ ```javascript
30
+ jbclear.keychain("demo.sample.app");
31
+ ```
32
+
33
+ ### allKeychain - 清理第三方应用钥匙串。
34
+
35
+ 不清理本 App。
36
+
37
+ ```typescript
38
+ function allKeychain(): boolean;
39
+ ```
40
+
41
+ **返回值:**
42
+
43
+ | 类型 | 描述 |
44
+ | --------- | ------------- |
45
+ | `boolean` | 成功为 `true` |
46
+
47
+ **示例:**
48
+
49
+ ```javascript
50
+ jbclear.allKeychain();
51
+ ```
52
+
53
+ ### cookies - 清理 Safari Cookies。
54
+
55
+ ```typescript
56
+ function cookies(): boolean;
57
+ ```
58
+
59
+ **返回值:**
60
+
61
+ | 类型 | 描述 |
62
+ | --------- | ------------- |
63
+ | `boolean` | 成功为 `true` |
64
+
65
+ **示例:**
66
+
67
+ ```javascript
68
+ jbclear.cookies();
69
+ ```
70
+
71
+ ### caches - 清理系统缓存。
72
+
73
+ 默认会重建图标缓存。传 `{ noUicache: true }` 跳过。
74
+
75
+ ```typescript
76
+ function caches(options?: { noUicache?: boolean }): boolean;
77
+ ```
78
+
79
+ **参数:**
80
+
81
+ | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
82
+ | --------- | ------ | -------- | ------ | ---------------------------------------- |
83
+ | `options` | object | 否 | - | `{ noUicache: true }` 时跳过重建图标缓存 |
84
+
85
+ **返回值:**
86
+
87
+ | 类型 | 描述 |
88
+ | --------- | ------------- |
89
+ | `boolean` | 成功为 `true` |
90
+
91
+ **示例:**
92
+
93
+ ```javascript
94
+ jbclear.caches();
95
+ jbclear.caches({ noUicache: true });
96
+ ```
97
+
98
+ ### photos - 删除本机相册里的本地照片。
99
+
100
+ 不影响 iCloud 照片。
101
+
102
+ ```typescript
103
+ function photos(): boolean;
104
+ ```
105
+
106
+ **返回值:**
107
+
108
+ | 类型 | 描述 |
109
+ | --------- | ------------- |
110
+ | `boolean` | 成功为 `true` |
111
+
112
+ **示例:**
113
+
114
+ ```javascript
115
+ jbclear.photos();
116
+ ```
117
+
118
+ ### appData - 清理指定应用的本地数据,不卸载应用。
119
+
120
+ 先结束该应用进程,再清数据容器、App Group、扩展数据容器,以及该应用钥匙串。不卸载。空包名或本 App 及其扩展返回 `false`。
121
+
122
+ ```typescript
123
+ function appData(bundleId: string): boolean;
124
+ ```
125
+
126
+ **参数:**
127
+
128
+ | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
129
+ | ---------- | ------ | -------- | ------ | -------------------------------------- |
130
+ | `bundleId` | string | 是 | - | 应用包标识符,例如 `"demo.sample.app"` |
131
+
132
+ **返回值:**
133
+
134
+ | 类型 | 描述 |
135
+ | --------- | ------------- |
136
+ | `boolean` | 成功为 `true` |
137
+
138
+ **示例:**
139
+
140
+ ```javascript
141
+ jbclear.appData("demo.sample.app");
142
+ ```
143
+
144
+ ### getIdfa - 读取整机广告标识(IDFA)。
145
+
146
+ ```typescript
147
+ function getIdfa(): string | null;
148
+ ```
149
+
150
+ **返回值:**
151
+
152
+ | 类型 | 描述 |
153
+ | ---------------- | ------------------------------ |
154
+ | `string \| null` | UUID 字符串;读不到返回 `null` |
155
+
156
+ **示例:**
157
+
158
+ ```javascript
159
+ const idfa = jbclear.getIdfa();
160
+ ```
161
+
162
+ ### resetIdfa - 重置整机广告标识(IDFA)。
163
+
164
+ 之后所有 App 读到的 IDFA 都会变。
165
+
166
+ ```typescript
167
+ function resetIdfa(): string | null;
168
+ ```
169
+
170
+ **返回值:**
171
+
172
+ | 类型 | 描述 |
173
+ | ---------------- | ------------------------------ |
174
+ | `string \| null` | 重置前的 UUID;失败返回 `null` |
175
+
176
+ **示例:**
177
+
178
+ ```javascript
179
+ const old = jbclear.resetIdfa();
180
+ if (old) {
181
+ file.writeFile("idfa.txt", old);
182
+ }
183
+ ```
184
+
185
+ ### setIdfa - 写入整机广告标识(IDFA)。
186
+
187
+ ```typescript
188
+ function setIdfa(value: string): string | null;
189
+ ```
190
+
191
+ **参数:**
192
+
193
+ | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
194
+ | ------- | ------ | -------- | ------ | ----------------------------------- |
195
+ | `value` | string | 是 | - | `getIdfa` / `resetIdfa` 返回的 UUID |
196
+
197
+ **返回值:**
198
+
199
+ | 类型 | 描述 |
200
+ | ---------------- | ------------------------------ |
201
+ | `string \| null` | 写入前的 UUID;失败返回 `null` |
202
+
203
+ **示例:**
204
+
205
+ ```javascript
206
+ const old = file.readFile("idfa.txt");
207
+ if (old) {
208
+ jbclear.setIdfa(old);
209
+ }
210
+ ```
211
+
212
+ ### getIdfv - 读取指定应用所属开发商的 IDFV。
213
+
214
+ ```typescript
215
+ function getIdfv(bundleId: string): string | null;
216
+ ```
217
+
218
+ **参数:**
219
+
220
+ | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
221
+ | ---------- | ------ | -------- | ------ | -------------------------------------- |
222
+ | `bundleId` | string | 是 | - | 应用包标识符,例如 `"demo.sample.app"` |
223
+
224
+ **返回值:**
225
+
226
+ | 类型 | 描述 |
227
+ | ---------------- | ------------------------------ |
228
+ | `string \| null` | UUID 字符串;读不到返回 `null` |
229
+
230
+ **示例:**
231
+
232
+ ```javascript
233
+ const idfv = jbclear.getIdfv("demo.sample.app");
234
+ ```
235
+
236
+ ### resetIdfv - 重置指定应用所属开发商的 IDFV。
237
+
238
+ 同一开发商的 App 会一起变。
239
+
240
+ ```typescript
241
+ function resetIdfv(bundleId: string): string | null;
242
+ ```
243
+
244
+ **参数:**
245
+
246
+ | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
247
+ | ---------- | ------ | -------- | ------ | -------------------------------------- |
248
+ | `bundleId` | string | 是 | - | 应用包标识符,例如 `"demo.sample.app"` |
249
+
250
+ **返回值:**
251
+
252
+ | 类型 | 描述 |
253
+ | ---------------- | ------------------------------ |
254
+ | `string \| null` | 重置前的 UUID;失败返回 `null` |
255
+
256
+ **示例:**
257
+
258
+ ```javascript
259
+ const old = jbclear.resetIdfv("demo.sample.app");
260
+ if (old) {
261
+ file.writeFile("idfv.txt", old);
262
+ }
263
+ ```
264
+
265
+ ### setIdfv - 写入指定应用所属开发商的 IDFV。
266
+
267
+ ```typescript
268
+ function setIdfv(bundleId: string, value: string): string | null;
269
+ ```
270
+
271
+ **参数:**
272
+
273
+ | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
274
+ | ---------- | ------ | -------- | ------ | -------------------------------------- |
275
+ | `bundleId` | string | 是 | - | 应用包标识符,例如 `"demo.sample.app"` |
276
+ | `value` | string | 是 | - | `getIdfv` / `resetIdfv` 返回的 UUID |
277
+
278
+ **返回值:**
279
+
280
+ | 类型 | 描述 |
281
+ | ---------------- | ------------------------------ |
282
+ | `string \| null` | 写入前的 UUID;失败返回 `null` |
283
+
284
+ **示例:**
285
+
286
+ ```javascript
287
+ const old = file.readFile("idfv.txt");
288
+ if (old) {
289
+ jbclear.setIdfv("demo.sample.app", old);
290
+ }
291
+ ```