react-native-update-cli 2.4.2 → 2.6.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/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/cli.json +40 -0
- package/lib/api.js +1 -1
- package/lib/locales/en.js +16 -1
- package/lib/locales/zh.js +16 -1
- package/lib/package.js +60 -6
- package/lib/provider.js +3 -0
- package/lib/utils/app-info-parser/aab.js +230 -0
- package/lib/utils/app-info-parser/apk.js +25 -27
- package/lib/utils/app-info-parser/app.js +10 -11
- package/lib/utils/app-info-parser/index.js +13 -8
- package/lib/utils/app-info-parser/ipa.js +16 -21
- package/lib/utils/app-info-parser/resource-finder.js +365 -305
- package/lib/utils/app-info-parser/utils.js +78 -63
- package/lib/utils/app-info-parser/xml-parser/binary.js +57 -51
- package/lib/utils/app-info-parser/xml-parser/manifest.js +47 -39
- package/lib/utils/app-info-parser/zip.js +21 -11
- package/lib/utils/http-helper.js +1 -1
- package/lib/utils/index.js +137 -0
- package/lib/versions.js +22 -0
- package/package.json +3 -2
- package/proto/Configuration.proto +183 -0
- package/proto/Resources.proto +569 -0
- package/src/api.ts +2 -6
- package/src/locales/en.ts +20 -0
- package/src/locales/zh.ts +18 -0
- package/src/modules/version-module.ts +1 -1
- package/src/package.ts +112 -12
- package/src/provider.ts +3 -0
- package/src/utils/app-info-parser/aab.ts +240 -0
- package/src/utils/app-info-parser/{apk.js → apk.ts} +30 -41
- package/src/utils/app-info-parser/app.ts +3 -0
- package/src/utils/app-info-parser/index.ts +9 -5
- package/src/utils/app-info-parser/{ipa.js → ipa.ts} +17 -31
- package/src/utils/app-info-parser/resource-finder.ts +508 -0
- package/src/utils/app-info-parser/utils.ts +162 -0
- package/src/utils/app-info-parser/xml-parser/{binary.js → binary.ts} +69 -61
- package/src/utils/app-info-parser/xml-parser/{manifest.js → manifest.ts} +50 -51
- package/src/utils/app-info-parser/zip.ts +86 -0
- package/src/utils/dep-versions.ts +7 -4
- package/src/utils/http-helper.ts +1 -1
- package/src/utils/index.ts +154 -0
- package/src/utils/latest-version/index.ts +2 -1
- package/src/versions.ts +27 -2
- package/src/utils/app-info-parser/app.js +0 -16
- package/src/utils/app-info-parser/resource-finder.js +0 -495
- package/src/utils/app-info-parser/utils.js +0 -172
- package/src/utils/app-info-parser/zip.js +0 -66
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package aapt.pb;
|
|
4
|
+
|
|
5
|
+
option java_package = "com.android.aapt";
|
|
6
|
+
|
|
7
|
+
import "Configuration.proto";
|
|
8
|
+
|
|
9
|
+
// A string pool that wraps the binary form of the C++ class android::ResStringPool.
|
|
10
|
+
message StringPool {
|
|
11
|
+
bytes data = 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// The position of a declared entity in a file.
|
|
15
|
+
message SourcePosition {
|
|
16
|
+
uint32 line_number = 1;
|
|
17
|
+
uint32 column_number = 2;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Developer friendly source file information for an entity in the resource table.
|
|
21
|
+
message Source {
|
|
22
|
+
// The index of the string path within the source StringPool.
|
|
23
|
+
uint32 path_idx = 1;
|
|
24
|
+
|
|
25
|
+
SourcePosition position = 2;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Top level message representing a resource table.
|
|
29
|
+
message ResourceTable {
|
|
30
|
+
// The string pool containing source paths referenced by Source messages.
|
|
31
|
+
StringPool source_pool = 1;
|
|
32
|
+
|
|
33
|
+
// The packages declared in this resource table.
|
|
34
|
+
repeated Package package = 2;
|
|
35
|
+
|
|
36
|
+
// The overlayable declarations in this resource table.
|
|
37
|
+
repeated Overlayable overlayable = 3;
|
|
38
|
+
|
|
39
|
+
// The tool fingerprints of the tools that built this resource table.
|
|
40
|
+
repeated ToolFingerprint tool_fingerprint = 4;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// A package declaration.
|
|
44
|
+
message Package {
|
|
45
|
+
// The package ID of this package.
|
|
46
|
+
// This is the first byte of a resource ID (0xPPTTEEEE).
|
|
47
|
+
// This is optional, and if not set, the package ID is assigned by the runtime.
|
|
48
|
+
// For the framework, this is 0x01. For the application, this is 0x7f.
|
|
49
|
+
uint32 package_id = 1;
|
|
50
|
+
|
|
51
|
+
// The Java compatible package name.
|
|
52
|
+
string package_name = 2;
|
|
53
|
+
|
|
54
|
+
// The types declared in this package.
|
|
55
|
+
repeated Type type = 3;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// A set of resources grouped under a common type (string, layout, xml, etc).
|
|
59
|
+
// This maps to the second byte of a resource ID (0xPPTTEEEE).
|
|
60
|
+
message Type {
|
|
61
|
+
// The type ID of this type.
|
|
62
|
+
// This is optional, and if not set, the type ID is assigned by the runtime.
|
|
63
|
+
uint32 type_id = 1;
|
|
64
|
+
|
|
65
|
+
// The name of this type.
|
|
66
|
+
string name = 2;
|
|
67
|
+
|
|
68
|
+
// The entries declared in this type.
|
|
69
|
+
repeated Entry entry = 3;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// A resource entry declaration.
|
|
73
|
+
// This maps to the last two bytes of a resource ID (0xPPTTEEEE).
|
|
74
|
+
message Entry {
|
|
75
|
+
// The entry ID of this entry.
|
|
76
|
+
// This is optional, and if not set, the entry ID is assigned by the runtime.
|
|
77
|
+
uint32 entry_id = 1;
|
|
78
|
+
|
|
79
|
+
// The name of this entry.
|
|
80
|
+
string name = 2;
|
|
81
|
+
|
|
82
|
+
// The visibility of this entry.
|
|
83
|
+
Visibility visibility = 3;
|
|
84
|
+
|
|
85
|
+
// The allow-new state of this entry.
|
|
86
|
+
AllowNew allow_new = 4;
|
|
87
|
+
|
|
88
|
+
// The overlayable state of this entry.
|
|
89
|
+
OverlayableItem overlayable_item = 5;
|
|
90
|
+
|
|
91
|
+
// The set of values defined for this entry, each with a different configuration.
|
|
92
|
+
repeated ConfigValue config_value = 6;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// The visibility of a resource entry.
|
|
96
|
+
message Visibility {
|
|
97
|
+
enum Level {
|
|
98
|
+
UNKNOWN = 0;
|
|
99
|
+
PRIVATE = 1;
|
|
100
|
+
PUBLIC = 2;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// The visibility level.
|
|
104
|
+
Level level = 1;
|
|
105
|
+
|
|
106
|
+
// The source of the visibility declaration.
|
|
107
|
+
Source source = 2;
|
|
108
|
+
|
|
109
|
+
// The comment associated with the visibility declaration.
|
|
110
|
+
string comment = 3;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// The allow-new state of a resource entry.
|
|
114
|
+
message AllowNew {
|
|
115
|
+
// The source of the allow-new declaration.
|
|
116
|
+
Source source = 1;
|
|
117
|
+
|
|
118
|
+
// The comment associated with the allow-new declaration.
|
|
119
|
+
string comment = 2;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// The overlayable state of a resource entry.
|
|
123
|
+
message OverlayableItem {
|
|
124
|
+
enum Policy {
|
|
125
|
+
NONE = 0;
|
|
126
|
+
PUBLIC = 1;
|
|
127
|
+
SYSTEM = 2;
|
|
128
|
+
VENDOR = 3;
|
|
129
|
+
PRODUCT = 4;
|
|
130
|
+
SIGNATURE = 5;
|
|
131
|
+
ODM = 6;
|
|
132
|
+
OEM = 7;
|
|
133
|
+
ACTOR = 8;
|
|
134
|
+
CONFIG_SIGNATURE = 9;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// The source of the overlayable declaration.
|
|
138
|
+
Source source = 1;
|
|
139
|
+
|
|
140
|
+
// The comment associated with the overlayable declaration.
|
|
141
|
+
string comment = 2;
|
|
142
|
+
|
|
143
|
+
// The policy of the overlayable declaration.
|
|
144
|
+
repeated Policy policy = 3;
|
|
145
|
+
|
|
146
|
+
// The index of the overlayable declaration in the overlayable list.
|
|
147
|
+
uint32 overlayable_idx = 4;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// A value defined for a resource entry with a specific configuration.
|
|
151
|
+
message ConfigValue {
|
|
152
|
+
// The configuration for which this value is defined.
|
|
153
|
+
Configuration config = 1;
|
|
154
|
+
|
|
155
|
+
// The value of the resource.
|
|
156
|
+
Value value = 2;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// A generic value of a resource.
|
|
160
|
+
message Value {
|
|
161
|
+
// The source of the value declaration.
|
|
162
|
+
Source source = 1;
|
|
163
|
+
|
|
164
|
+
// The comment associated with the value declaration.
|
|
165
|
+
string comment = 2;
|
|
166
|
+
|
|
167
|
+
// The value is a weak reference to another resource.
|
|
168
|
+
bool weak = 3;
|
|
169
|
+
|
|
170
|
+
// The value is a raw string.
|
|
171
|
+
Item item = 4;
|
|
172
|
+
|
|
173
|
+
// The value is a compound value.
|
|
174
|
+
CompoundValue compound_value = 5;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// A value that is a single item.
|
|
178
|
+
message Item {
|
|
179
|
+
// The value is a reference to another resource.
|
|
180
|
+
Reference ref = 1;
|
|
181
|
+
|
|
182
|
+
// The value is a string.
|
|
183
|
+
String str = 2;
|
|
184
|
+
|
|
185
|
+
// The value is a raw string.
|
|
186
|
+
RawString raw_str = 3;
|
|
187
|
+
|
|
188
|
+
// The value is a styled string.
|
|
189
|
+
StyledString styled_str = 4;
|
|
190
|
+
|
|
191
|
+
// The value is a file.
|
|
192
|
+
File file = 5;
|
|
193
|
+
|
|
194
|
+
// The value is an integer.
|
|
195
|
+
Id id = 6;
|
|
196
|
+
|
|
197
|
+
// The value is a primitive.
|
|
198
|
+
Primitive prim = 7;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// A value that is a compound value.
|
|
202
|
+
message CompoundValue {
|
|
203
|
+
// The value is an attribute.
|
|
204
|
+
Attribute attr = 1;
|
|
205
|
+
|
|
206
|
+
// The value is a style.
|
|
207
|
+
Style style = 2;
|
|
208
|
+
|
|
209
|
+
// The value is a styleable.
|
|
210
|
+
Styleable styleable = 3;
|
|
211
|
+
|
|
212
|
+
// The value is an array.
|
|
213
|
+
Array array = 4;
|
|
214
|
+
|
|
215
|
+
// The value is a plural.
|
|
216
|
+
Plural plural = 5;
|
|
217
|
+
|
|
218
|
+
// The value is a macro.
|
|
219
|
+
MacroBody macro = 6;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// A reference to another resource.
|
|
223
|
+
message Reference {
|
|
224
|
+
enum Type {
|
|
225
|
+
REFERENCE = 0;
|
|
226
|
+
ATTRIBUTE = 1;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// The type of reference.
|
|
230
|
+
Type type = 1;
|
|
231
|
+
|
|
232
|
+
// The resource ID being referenced.
|
|
233
|
+
uint32 id = 2;
|
|
234
|
+
|
|
235
|
+
// The name of the resource being referenced.
|
|
236
|
+
string name = 3;
|
|
237
|
+
|
|
238
|
+
// The private state of the reference.
|
|
239
|
+
bool private = 4;
|
|
240
|
+
|
|
241
|
+
// The dynamic reference state of the reference.
|
|
242
|
+
bool is_dynamic = 5;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// A string value.
|
|
246
|
+
message String {
|
|
247
|
+
// The string value.
|
|
248
|
+
string value = 1;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// A raw string value.
|
|
252
|
+
message RawString {
|
|
253
|
+
// The raw string value.
|
|
254
|
+
string value = 1;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// A styled string value.
|
|
258
|
+
message StyledString {
|
|
259
|
+
// The raw string value.
|
|
260
|
+
string value = 1;
|
|
261
|
+
|
|
262
|
+
// The spans of the styled string.
|
|
263
|
+
repeated Span span = 2;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// A span of a styled string.
|
|
267
|
+
message Span {
|
|
268
|
+
// The tag of the span.
|
|
269
|
+
string tag = 1;
|
|
270
|
+
|
|
271
|
+
// The first character index of the span.
|
|
272
|
+
uint32 first_char = 2;
|
|
273
|
+
|
|
274
|
+
// The last character index of the span.
|
|
275
|
+
uint32 last_char = 3;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// A file value.
|
|
279
|
+
message File {
|
|
280
|
+
// The path to the file.
|
|
281
|
+
string path = 1;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// An ID value.
|
|
285
|
+
message Id {
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// A primitive value.
|
|
289
|
+
message Primitive {
|
|
290
|
+
// The null value.
|
|
291
|
+
message NullType {}
|
|
292
|
+
// The empty value.
|
|
293
|
+
message EmptyType {}
|
|
294
|
+
|
|
295
|
+
oneof oneof_value {
|
|
296
|
+
NullType null_value = 1;
|
|
297
|
+
EmptyType empty_value = 2;
|
|
298
|
+
float float_value = 3;
|
|
299
|
+
uint32 dimension_value = 4;
|
|
300
|
+
uint32 fraction_value = 5;
|
|
301
|
+
int32 int_decimal_value = 6;
|
|
302
|
+
uint32 int_hexadecimal_value = 7;
|
|
303
|
+
bool boolean_value = 8;
|
|
304
|
+
uint32 color_argb8_value = 9;
|
|
305
|
+
uint32 color_rgb8_value = 10;
|
|
306
|
+
uint32 color_argb4_value = 11;
|
|
307
|
+
uint32 color_rgb4_value = 12;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// An attribute value.
|
|
312
|
+
message Attribute {
|
|
313
|
+
enum FormatFlags {
|
|
314
|
+
NONE = 0x0;
|
|
315
|
+
REFERENCE = 0x1;
|
|
316
|
+
STRING = 0x2;
|
|
317
|
+
INTEGER = 0x4;
|
|
318
|
+
BOOLEAN = 0x8;
|
|
319
|
+
COLOR = 0x10;
|
|
320
|
+
FLOAT = 0x20;
|
|
321
|
+
DIMENSION = 0x40;
|
|
322
|
+
FRACTION = 0x80;
|
|
323
|
+
ENUM = 0x10000;
|
|
324
|
+
FLAGS = 0x20000;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// The format flags of the attribute.
|
|
328
|
+
uint32 format_flags = 1;
|
|
329
|
+
|
|
330
|
+
// The minimum value of the attribute.
|
|
331
|
+
int32 min_int = 2;
|
|
332
|
+
|
|
333
|
+
// The maximum value of the attribute.
|
|
334
|
+
int32 max_int = 3;
|
|
335
|
+
|
|
336
|
+
// The symbols of the attribute.
|
|
337
|
+
repeated Symbol symbol = 4;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// A symbol of an attribute.
|
|
341
|
+
message Symbol {
|
|
342
|
+
// The source of the symbol declaration.
|
|
343
|
+
Source source = 1;
|
|
344
|
+
|
|
345
|
+
// The comment associated with the symbol declaration.
|
|
346
|
+
string comment = 2;
|
|
347
|
+
|
|
348
|
+
// The name of the symbol.
|
|
349
|
+
Reference name = 3;
|
|
350
|
+
|
|
351
|
+
// The value of the symbol.
|
|
352
|
+
uint32 value = 4;
|
|
353
|
+
|
|
354
|
+
// The type of the symbol.
|
|
355
|
+
uint32 type = 5;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// A style value.
|
|
359
|
+
message Style {
|
|
360
|
+
// The parent of the style.
|
|
361
|
+
Reference parent = 1;
|
|
362
|
+
|
|
363
|
+
// The source of the parent declaration.
|
|
364
|
+
Source parent_source = 2;
|
|
365
|
+
|
|
366
|
+
// The entries of the style.
|
|
367
|
+
repeated Entry entry = 3;
|
|
368
|
+
|
|
369
|
+
// An entry of a style.
|
|
370
|
+
message Entry {
|
|
371
|
+
// The source of the entry declaration.
|
|
372
|
+
Source source = 1;
|
|
373
|
+
|
|
374
|
+
// The comment associated with the entry declaration.
|
|
375
|
+
string comment = 2;
|
|
376
|
+
|
|
377
|
+
// The key of the entry.
|
|
378
|
+
Reference key = 3;
|
|
379
|
+
|
|
380
|
+
// The item of the entry.
|
|
381
|
+
Item item = 4;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// A styleable value.
|
|
386
|
+
message Styleable {
|
|
387
|
+
// The entries of the styleable.
|
|
388
|
+
repeated Entry entry = 1;
|
|
389
|
+
|
|
390
|
+
// An entry of a styleable.
|
|
391
|
+
message Entry {
|
|
392
|
+
// The source of the entry declaration.
|
|
393
|
+
Source source = 1;
|
|
394
|
+
|
|
395
|
+
// The comment associated with the entry declaration.
|
|
396
|
+
string comment = 2;
|
|
397
|
+
|
|
398
|
+
// The attribute of the entry.
|
|
399
|
+
Reference attr = 3;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// An array value.
|
|
404
|
+
message Array {
|
|
405
|
+
// The elements of the array.
|
|
406
|
+
repeated Element element = 1;
|
|
407
|
+
|
|
408
|
+
// An element of an array.
|
|
409
|
+
message Element {
|
|
410
|
+
// The source of the element declaration.
|
|
411
|
+
Source source = 1;
|
|
412
|
+
|
|
413
|
+
// The comment associated with the element declaration.
|
|
414
|
+
string comment = 2;
|
|
415
|
+
|
|
416
|
+
// The item of the element.
|
|
417
|
+
Item item = 3;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// A plural value.
|
|
422
|
+
message Plural {
|
|
423
|
+
enum Arity {
|
|
424
|
+
ZERO = 0;
|
|
425
|
+
ONE = 1;
|
|
426
|
+
TWO = 2;
|
|
427
|
+
FEW = 3;
|
|
428
|
+
MANY = 4;
|
|
429
|
+
OTHER = 5;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// The entries of the plural.
|
|
433
|
+
repeated Entry entry = 1;
|
|
434
|
+
|
|
435
|
+
// An entry of a plural.
|
|
436
|
+
message Entry {
|
|
437
|
+
// The source of the entry declaration.
|
|
438
|
+
Source source = 1;
|
|
439
|
+
|
|
440
|
+
// The comment associated with the entry declaration.
|
|
441
|
+
string comment = 2;
|
|
442
|
+
|
|
443
|
+
// The arity of the entry.
|
|
444
|
+
Arity arity = 3;
|
|
445
|
+
|
|
446
|
+
// The item of the entry.
|
|
447
|
+
Item item = 4;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// A macro body value.
|
|
452
|
+
message MacroBody {
|
|
453
|
+
// The raw string value.
|
|
454
|
+
string raw_string = 1;
|
|
455
|
+
|
|
456
|
+
// The style string value.
|
|
457
|
+
StyleString style_string = 2;
|
|
458
|
+
|
|
459
|
+
// The untranslatable sections of the macro.
|
|
460
|
+
repeated UntranslatableSection untranslatable_section = 3;
|
|
461
|
+
|
|
462
|
+
// The namespace declarations of the macro.
|
|
463
|
+
repeated NamespaceDeclaration namespace_declaration = 4;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
message StyleString {
|
|
467
|
+
string str = 1;
|
|
468
|
+
repeated Span spans = 2;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
message UntranslatableSection {
|
|
472
|
+
uint64 start_index = 1;
|
|
473
|
+
uint64 end_index = 2;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
message NamespaceDeclaration {
|
|
477
|
+
string prefix = 1;
|
|
478
|
+
string uri = 2;
|
|
479
|
+
Source source = 3;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// An overlayable declaration.
|
|
483
|
+
message Overlayable {
|
|
484
|
+
// The name of the overlayable.
|
|
485
|
+
string name = 1;
|
|
486
|
+
|
|
487
|
+
// The source of the overlayable declaration.
|
|
488
|
+
Source source = 2;
|
|
489
|
+
|
|
490
|
+
// The actor of the overlayable declaration.
|
|
491
|
+
string actor = 3;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// A tool fingerprint.
|
|
495
|
+
message ToolFingerprint {
|
|
496
|
+
// The tool name.
|
|
497
|
+
string tool = 1;
|
|
498
|
+
|
|
499
|
+
// The version of the tool.
|
|
500
|
+
string version = 2;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// A dynamic reference table.
|
|
504
|
+
message DynamicRefTable {
|
|
505
|
+
// The package ID to package name mapping.
|
|
506
|
+
repeated PackageId packageName = 1;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
message PackageId {
|
|
510
|
+
uint32 id = 1;
|
|
511
|
+
string name = 2;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
// A generic XML node.
|
|
515
|
+
message XmlNode {
|
|
516
|
+
// The element node.
|
|
517
|
+
XmlElement element = 1;
|
|
518
|
+
|
|
519
|
+
// The text node.
|
|
520
|
+
string text = 2;
|
|
521
|
+
|
|
522
|
+
// The source of the node.
|
|
523
|
+
SourcePosition source = 3;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
message XmlNamespace {
|
|
527
|
+
string prefix = 1;
|
|
528
|
+
string uri = 2;
|
|
529
|
+
SourcePosition source = 3;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// An XML element.
|
|
533
|
+
message XmlElement {
|
|
534
|
+
// The namespace declarations of the element.
|
|
535
|
+
repeated XmlNamespace namespace_declaration = 1;
|
|
536
|
+
|
|
537
|
+
// The namespace URI of the element.
|
|
538
|
+
string namespace_uri = 2;
|
|
539
|
+
|
|
540
|
+
// The name of the element.
|
|
541
|
+
string name = 3;
|
|
542
|
+
|
|
543
|
+
// The attributes of the element.
|
|
544
|
+
repeated XmlAttribute attribute = 4;
|
|
545
|
+
|
|
546
|
+
// The children of the element.
|
|
547
|
+
repeated XmlNode child = 5;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
// An XML attribute.
|
|
551
|
+
message XmlAttribute {
|
|
552
|
+
// The namespace URI of the attribute.
|
|
553
|
+
string namespace_uri = 1;
|
|
554
|
+
|
|
555
|
+
// The name of the attribute.
|
|
556
|
+
string name = 2;
|
|
557
|
+
|
|
558
|
+
// The value of the attribute.
|
|
559
|
+
string value = 3;
|
|
560
|
+
|
|
561
|
+
// The source of the attribute.
|
|
562
|
+
SourcePosition source = 4;
|
|
563
|
+
|
|
564
|
+
// The resource ID of the attribute.
|
|
565
|
+
uint32 resource_id = 5;
|
|
566
|
+
|
|
567
|
+
// The compiled item of the attribute.
|
|
568
|
+
Item compiled_item = 6;
|
|
569
|
+
}
|
package/src/api.ts
CHANGED
|
@@ -6,21 +6,17 @@ import FormData from 'form-data';
|
|
|
6
6
|
import fetch from 'node-fetch';
|
|
7
7
|
import ProgressBar from 'progress';
|
|
8
8
|
import tcpp from 'tcp-ping';
|
|
9
|
+
import { getBaseUrl } from 'utils/http-helper';
|
|
9
10
|
import packageJson from '../package.json';
|
|
10
11
|
import type { Package, Session } from './types';
|
|
11
|
-
import {
|
|
12
|
-
credentialFile,
|
|
13
|
-
pricingPageUrl,
|
|
14
|
-
} from './utils/constants';
|
|
12
|
+
import { credentialFile, pricingPageUrl } from './utils/constants';
|
|
15
13
|
import { t } from './utils/i18n';
|
|
16
|
-
import { getBaseUrl } from 'utils/http-helper';
|
|
17
14
|
|
|
18
15
|
const tcpPing = util.promisify(tcpp.ping);
|
|
19
16
|
|
|
20
17
|
let session: Session | undefined;
|
|
21
18
|
let savedSession: Session | undefined;
|
|
22
19
|
|
|
23
|
-
|
|
24
20
|
const userAgent = `react-native-update-cli/${packageJson.version}`;
|
|
25
21
|
|
|
26
22
|
export const getSession = () => session;
|
package/src/locales/en.ts
CHANGED
|
@@ -2,6 +2,18 @@ export default {
|
|
|
2
2
|
addedToGitignore: 'Added {{line}} to .gitignore',
|
|
3
3
|
androidCrunchPngsWarning:
|
|
4
4
|
'The crunchPngs option of android seems not disabled (Please ignore this warning if already disabled), which may cause abnormal consumption of mobile network traffic. Please refer to https://cresc.dev/docs/getting-started#disable-crunchpngs-on-android \n',
|
|
5
|
+
aabOpenApksFailed: 'Failed to open generated .apks file',
|
|
6
|
+
aabReadUniversalApkFailed: 'Failed to read universal.apk',
|
|
7
|
+
aabUniversalApkNotFound: 'universal.apk not found in generated .apks',
|
|
8
|
+
aabBundletoolDownloadHint:
|
|
9
|
+
'bundletool not found. Downloading node-bundletool via npx (first run may take a while).',
|
|
10
|
+
aabManifestNotFound:
|
|
11
|
+
"AndroidManifest.xml can't be found in AAB base/manifest/",
|
|
12
|
+
aabParseResourcesWarning:
|
|
13
|
+
'[Warning] Failed to parse resources.arsc: {{error}}',
|
|
14
|
+
aabParseFailed: 'Failed to parse AAB: {{error}}',
|
|
15
|
+
aabParseManifestError: 'Parse AndroidManifest.xml error: {{error}}',
|
|
16
|
+
aabParseResourcesError: 'Parser resources.arsc error: {{error}}',
|
|
5
17
|
appId: 'App ID',
|
|
6
18
|
appIdMismatchApk:
|
|
7
19
|
'App ID mismatch! Current APK: {{appIdInPkg}}, current update.json: {{appId}}',
|
|
@@ -115,10 +127,15 @@ This can reduce the risk of inconsistent dependencies and supply chain attacks.
|
|
|
115
127
|
uploadingSourcemap: 'Uploading sourcemap',
|
|
116
128
|
usageDiff: 'Usage: cresc {{command}} <origin> <next>',
|
|
117
129
|
usageParseApk: 'Usage: cresc parseApk <apk file>',
|
|
130
|
+
usageParseAab: 'Usage: cresc parseAab <aab file>',
|
|
131
|
+
usageExtractApk:
|
|
132
|
+
'Usage: cresc extractApk <aab file> [--output <apk file>] [--includeAllSplits] [--splits <split names>]',
|
|
118
133
|
usageParseApp: 'Usage: cresc parseApp <app file>',
|
|
119
134
|
usageParseIpa: 'Usage: cresc parseIpa <ipa file>',
|
|
120
135
|
usageUnderDevelopment: 'Usage is under development now.',
|
|
121
136
|
usageUploadApk: 'Usage: cresc uploadApk <apk file>',
|
|
137
|
+
usageUploadAab:
|
|
138
|
+
'Usage: cresc uploadAab <aab file> [--includeAllSplits] [--splits <split names>]',
|
|
122
139
|
usageUploadApp: 'Usage: cresc uploadApp <app file>',
|
|
123
140
|
usageUploadIpa: 'Usage: cresc uploadIpa <ipa file>',
|
|
124
141
|
versionBind:
|
|
@@ -137,6 +154,8 @@ This can reduce the risk of inconsistent dependencies and supply chain attacks.
|
|
|
137
154
|
deletePackageError:
|
|
138
155
|
'Failed to delete native package {{packageId}}: {{error}}',
|
|
139
156
|
usageDeletePackage: 'Usage: cresc deletePackage [packageId] --appId [appId]',
|
|
157
|
+
deleteVersionSuccess: 'Version {{versionId}} deleted successfully',
|
|
158
|
+
deleteVersionError: 'Failed to delete version {{versionId}}: {{error}}',
|
|
140
159
|
bundleFileNotFound:
|
|
141
160
|
'Bundle file not found! Please use default bundle file name and path.',
|
|
142
161
|
diffPackageGenerated: '{{- output}} generated.',
|
|
@@ -144,4 +163,5 @@ This can reduce the risk of inconsistent dependencies and supply chain attacks.
|
|
|
144
163
|
'This function needs "node-bsdiff". Please run "{{scriptName}} install node-bsdiff" to install',
|
|
145
164
|
nodeHdiffpatchRequired:
|
|
146
165
|
'This function needs "node-hdiffpatch". Please run "{{scriptName}} install node-hdiffpatch" to install',
|
|
166
|
+
apkExtracted: 'APK extracted to {{output}}',
|
|
147
167
|
};
|
package/src/locales/zh.ts
CHANGED
|
@@ -2,6 +2,16 @@ export default {
|
|
|
2
2
|
addedToGitignore: '已将 {{line}} 添加到 .gitignore',
|
|
3
3
|
androidCrunchPngsWarning:
|
|
4
4
|
'android 的 crunchPngs 选项似乎尚未禁用(如已禁用则请忽略此提示),这可能导致热更包体积异常增大,具体请参考 https://pushy.reactnative.cn/docs/getting-started.html#%E7%A6%81%E7%94%A8-android-%E7%9A%84-crunch-%E4%BC%98%E5%8C%96 \n',
|
|
5
|
+
aabOpenApksFailed: '无法打开生成的 .apks 文件',
|
|
6
|
+
aabReadUniversalApkFailed: '无法读取 universal.apk',
|
|
7
|
+
aabUniversalApkNotFound: '在生成的 .apks 中未找到 universal.apk',
|
|
8
|
+
aabBundletoolDownloadHint:
|
|
9
|
+
'未找到 bundletool,正在通过 npx 下载 node-bundletool(首次下载可能需要一些时间)。',
|
|
10
|
+
aabManifestNotFound: '在 AAB 的 base/manifest/ 中找不到 AndroidManifest.xml',
|
|
11
|
+
aabParseResourcesWarning: '[警告] 解析 resources.arsc 失败:{{error}}',
|
|
12
|
+
aabParseFailed: '解析 AAB 失败:{{error}}',
|
|
13
|
+
aabParseManifestError: '解析 AndroidManifest.xml 出错:{{error}}',
|
|
14
|
+
aabParseResourcesError: '解析 resources.arsc 出错:{{error}}',
|
|
5
15
|
appId: '应用 id',
|
|
6
16
|
appIdMismatchApk:
|
|
7
17
|
'appId不匹配!当前apk: {{appIdInPkg}}, 当前update.json: {{appId}}',
|
|
@@ -109,9 +119,14 @@ export default {
|
|
|
109
119
|
uploadingSourcemap: '正在上传 sourcemap',
|
|
110
120
|
usageDiff: '用法:pushy {{command}} <origin> <next>',
|
|
111
121
|
usageParseApk: '使用方法: pushy parseApk apk后缀文件',
|
|
122
|
+
usageParseAab: '使用方法: pushy parseAab aab后缀文件',
|
|
123
|
+
usageExtractApk:
|
|
124
|
+
'使用方法: pushy extractApk aab后缀文件 [--output apk文件] [--includeAllSplits] [--splits 分包名列表]',
|
|
112
125
|
usageParseApp: '使用方法: pushy parseApp app后缀文件',
|
|
113
126
|
usageParseIpa: '使用方法: pushy parseIpa ipa后缀文件',
|
|
114
127
|
usageUploadApk: '使用方法: pushy uploadApk apk后缀文件',
|
|
128
|
+
usageUploadAab:
|
|
129
|
+
'使用方法: pushy uploadAab aab后缀文件 [--includeAllSplits] [--splits 分包名列表]',
|
|
115
130
|
usageUploadApp: '使用方法: pushy uploadApp app后缀文件',
|
|
116
131
|
usageUploadIpa: '使用方法: pushy uploadIpa ipa后缀文件',
|
|
117
132
|
versionBind:
|
|
@@ -129,10 +144,13 @@ export default {
|
|
|
129
144
|
deletePackageError: '删除原生包 {{packageId}} 失败: {{error}}',
|
|
130
145
|
usageDeletePackage:
|
|
131
146
|
'使用方法: pushy deletePackage [packageId] --appId [appId]',
|
|
147
|
+
deleteVersionSuccess: '热更包 {{versionId}} 删除成功',
|
|
148
|
+
deleteVersionError: '删除热更包 {{versionId}} 失败: {{error}}',
|
|
132
149
|
bundleFileNotFound: '未找到 bundle 文件!请使用默认的 bundle 文件名和路径。',
|
|
133
150
|
diffPackageGenerated: '{{- output}} 已生成。',
|
|
134
151
|
nodeBsdiffRequired:
|
|
135
152
|
'此功能需要 "node-bsdiff"。请运行 "{{scriptName}} install node-bsdiff" 来安装',
|
|
136
153
|
nodeHdiffpatchRequired:
|
|
137
154
|
'此功能需要 "node-hdiffpatch"。请运行 "{{scriptName}} install node-hdiffpatch" 来安装',
|
|
155
|
+
apkExtracted: 'APK 已提取到 {{output}}',
|
|
138
156
|
};
|