react-native-update-cli 1.46.1 → 2.0.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 +578 -1
- package/README.zh-CN.md +576 -0
- package/cli.json +18 -0
- package/lib/api.js +5 -5
- package/lib/app.js +1 -1
- package/lib/bundle.js +43 -29
- package/lib/exports.js +65 -0
- package/lib/index.js +100 -9
- package/lib/module-manager.js +125 -0
- package/lib/modules/app-module.js +223 -0
- package/lib/modules/bundle-module.js +188 -0
- package/lib/modules/index.js +42 -0
- package/lib/modules/package-module.js +16 -0
- package/lib/modules/user-module.js +402 -0
- package/lib/modules/version-module.js +16 -0
- package/lib/package.js +16 -6
- package/lib/provider.js +340 -0
- package/lib/user.js +3 -3
- package/lib/utils/app-info-parser/apk.js +1 -1
- package/lib/utils/app-info-parser/ipa.js +2 -2
- package/lib/utils/app-info-parser/resource-finder.js +35 -35
- package/lib/utils/app-info-parser/xml-parser/manifest.js +2 -2
- package/lib/utils/app-info-parser/zip.js +3 -6
- package/lib/utils/check-plugin.js +1 -1
- package/lib/utils/git.js +1 -1
- package/lib/utils/i18n.js +3 -1
- package/lib/utils/index.js +4 -4
- package/lib/utils/latest-version/cli.js +3 -3
- package/lib/utils/latest-version/index.js +4 -4
- package/lib/versions.js +2 -2
- package/package.json +4 -4
- package/src/api.ts +7 -7
- package/src/app.ts +2 -2
- package/src/bundle.ts +57 -32
- package/src/exports.ts +30 -0
- package/src/index.ts +118 -16
- package/src/module-manager.ts +149 -0
- package/src/modules/app-module.ts +205 -0
- package/src/modules/bundle-module.ts +202 -0
- package/src/modules/index.ts +19 -0
- package/src/modules/package-module.ts +11 -0
- package/src/modules/user-module.ts +406 -0
- package/src/modules/version-module.ts +8 -0
- package/src/package.ts +29 -16
- package/src/provider.ts +341 -0
- package/src/types.ts +125 -0
- package/src/user.ts +4 -3
- package/src/utils/app-info-parser/apk.js +62 -52
- package/src/utils/app-info-parser/app.js +5 -5
- package/src/utils/app-info-parser/ipa.js +69 -57
- package/src/utils/app-info-parser/resource-finder.js +50 -54
- package/src/utils/app-info-parser/utils.js +59 -54
- package/src/utils/app-info-parser/xml-parser/binary.js +366 -354
- package/src/utils/app-info-parser/xml-parser/manifest.js +145 -137
- package/src/utils/app-info-parser/zip.js +1 -1
- package/src/utils/check-plugin.ts +4 -2
- package/src/utils/dep-versions.ts +13 -6
- package/src/utils/git.ts +1 -1
- package/src/utils/i18n.ts +3 -1
- package/src/utils/index.ts +8 -10
- package/src/utils/latest-version/cli.ts +4 -4
- package/src/utils/latest-version/index.ts +17 -17
- package/src/utils/plugin-config.ts +3 -3
- package/src/versions.ts +3 -3
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "userModule", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return userModule;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _api = require("../api");
|
|
12
|
+
const _user = require("../user");
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
14
|
+
if (typeof WeakMap !== "function") return null;
|
|
15
|
+
var cacheBabelInterop = new WeakMap();
|
|
16
|
+
var cacheNodeInterop = new WeakMap();
|
|
17
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
18
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
19
|
+
})(nodeInterop);
|
|
20
|
+
}
|
|
21
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
22
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
23
|
+
return obj;
|
|
24
|
+
}
|
|
25
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
26
|
+
return {
|
|
27
|
+
default: obj
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
31
|
+
if (cache && cache.has(obj)) {
|
|
32
|
+
return cache.get(obj);
|
|
33
|
+
}
|
|
34
|
+
var newObj = {
|
|
35
|
+
__proto__: null
|
|
36
|
+
};
|
|
37
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
38
|
+
for(var key in obj){
|
|
39
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
40
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
41
|
+
if (desc && (desc.get || desc.set)) {
|
|
42
|
+
Object.defineProperty(newObj, key, desc);
|
|
43
|
+
} else {
|
|
44
|
+
newObj[key] = obj[key];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
newObj.default = obj;
|
|
49
|
+
if (cache) {
|
|
50
|
+
cache.set(obj, newObj);
|
|
51
|
+
}
|
|
52
|
+
return newObj;
|
|
53
|
+
}
|
|
54
|
+
const userModule = {
|
|
55
|
+
name: 'user',
|
|
56
|
+
version: '1.0.0',
|
|
57
|
+
commands: [],
|
|
58
|
+
workflows: [
|
|
59
|
+
{
|
|
60
|
+
name: 'auth-check',
|
|
61
|
+
description: 'Check authentication status and user information',
|
|
62
|
+
options: {
|
|
63
|
+
autoLogin: {
|
|
64
|
+
default: false,
|
|
65
|
+
description: 'Automatically login if not authenticated'
|
|
66
|
+
},
|
|
67
|
+
showDetails: {
|
|
68
|
+
default: true,
|
|
69
|
+
description: 'Show detailed user information'
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
steps: [
|
|
73
|
+
{
|
|
74
|
+
name: 'load-session',
|
|
75
|
+
description: 'Load existing session from local storage',
|
|
76
|
+
execute: async (context)=>{
|
|
77
|
+
console.log('Loading session from local storage...');
|
|
78
|
+
try {
|
|
79
|
+
await (0, _api.loadSession)();
|
|
80
|
+
const session = (0, _api.getSession)();
|
|
81
|
+
if (session && session.token) {
|
|
82
|
+
console.log('✓ Session found in local storage');
|
|
83
|
+
return {
|
|
84
|
+
sessionLoaded: true,
|
|
85
|
+
hasToken: true,
|
|
86
|
+
session
|
|
87
|
+
};
|
|
88
|
+
} else {
|
|
89
|
+
console.log('✗ No valid session found in local storage');
|
|
90
|
+
return {
|
|
91
|
+
sessionLoaded: true,
|
|
92
|
+
hasToken: false,
|
|
93
|
+
session: null
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
} catch (error) {
|
|
97
|
+
console.log('✗ Failed to load session:', error instanceof Error ? error.message : 'Unknown error');
|
|
98
|
+
return {
|
|
99
|
+
sessionLoaded: false,
|
|
100
|
+
hasToken: false,
|
|
101
|
+
session: null,
|
|
102
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'validate-session',
|
|
109
|
+
description: 'Validate session by calling API',
|
|
110
|
+
execute: async (context, previousResult)=>{
|
|
111
|
+
if (!previousResult.hasToken) {
|
|
112
|
+
console.log('No token available, skipping validation');
|
|
113
|
+
return {
|
|
114
|
+
...previousResult,
|
|
115
|
+
validated: false,
|
|
116
|
+
reason: 'No token available'
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
console.log('Validating session with server...');
|
|
120
|
+
try {
|
|
121
|
+
await _user.userCommands.me();
|
|
122
|
+
console.log('✓ Session is valid');
|
|
123
|
+
return {
|
|
124
|
+
...previousResult,
|
|
125
|
+
validated: true,
|
|
126
|
+
reason: 'Session validated successfully'
|
|
127
|
+
};
|
|
128
|
+
} catch (error) {
|
|
129
|
+
console.log('✗ Session validation failed:', error instanceof Error ? error.message : 'Unknown error');
|
|
130
|
+
return {
|
|
131
|
+
...previousResult,
|
|
132
|
+
validated: false,
|
|
133
|
+
reason: error instanceof Error ? error.message : 'Unknown error'
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'get-user-info',
|
|
140
|
+
description: 'Get current user information',
|
|
141
|
+
execute: async (context, previousResult)=>{
|
|
142
|
+
if (!previousResult.validated) {
|
|
143
|
+
console.log('Session not valid, cannot get user info');
|
|
144
|
+
return {
|
|
145
|
+
...previousResult,
|
|
146
|
+
userInfo: null,
|
|
147
|
+
reason: 'Session not valid'
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
console.log('Getting user information...');
|
|
151
|
+
try {
|
|
152
|
+
const { get } = await Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("../api")));
|
|
153
|
+
const userInfo = await get('/user/me');
|
|
154
|
+
console.log('✓ User information retrieved successfully');
|
|
155
|
+
if (context.options.showDetails !== false) {
|
|
156
|
+
console.log('\n=== User Information ===');
|
|
157
|
+
for (const [key, value] of Object.entries(userInfo)){
|
|
158
|
+
if (key !== 'ok') {
|
|
159
|
+
console.log(`${key}: ${value}`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
console.log('========================\n');
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
...previousResult,
|
|
166
|
+
userInfo,
|
|
167
|
+
reason: 'User info retrieved successfully'
|
|
168
|
+
};
|
|
169
|
+
} catch (error) {
|
|
170
|
+
console.log('✗ Failed to get user info:', error instanceof Error ? error.message : 'Unknown error');
|
|
171
|
+
return {
|
|
172
|
+
...previousResult,
|
|
173
|
+
userInfo: null,
|
|
174
|
+
reason: error instanceof Error ? error.message : 'Unknown error'
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: 'handle-auth-failure',
|
|
181
|
+
description: 'Handle authentication failure',
|
|
182
|
+
execute: async (context, previousResult)=>{
|
|
183
|
+
if (previousResult.validated) {
|
|
184
|
+
console.log('✓ Authentication check completed successfully');
|
|
185
|
+
return {
|
|
186
|
+
...previousResult,
|
|
187
|
+
authCheckComplete: true,
|
|
188
|
+
status: 'authenticated'
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
console.log('✗ Authentication check failed');
|
|
192
|
+
if (context.options.autoLogin) {
|
|
193
|
+
console.log('Attempting automatic login...');
|
|
194
|
+
try {
|
|
195
|
+
await _user.userCommands.login({
|
|
196
|
+
args: []
|
|
197
|
+
});
|
|
198
|
+
console.log('✓ Automatic login successful');
|
|
199
|
+
return {
|
|
200
|
+
...previousResult,
|
|
201
|
+
authCheckComplete: true,
|
|
202
|
+
status: 'auto-logged-in',
|
|
203
|
+
autoLoginSuccess: true
|
|
204
|
+
};
|
|
205
|
+
} catch (error) {
|
|
206
|
+
console.log('✗ Automatic login failed:', error instanceof Error ? error.message : 'Unknown error');
|
|
207
|
+
return {
|
|
208
|
+
...previousResult,
|
|
209
|
+
authCheckComplete: true,
|
|
210
|
+
status: 'failed',
|
|
211
|
+
autoLoginSuccess: false,
|
|
212
|
+
autoLoginError: error instanceof Error ? error.message : 'Unknown error'
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
} else {
|
|
216
|
+
console.log('Please run login command to authenticate');
|
|
217
|
+
return {
|
|
218
|
+
...previousResult,
|
|
219
|
+
authCheckComplete: true,
|
|
220
|
+
status: 'unauthenticated',
|
|
221
|
+
suggestion: 'Run login command to authenticate'
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: 'login-flow',
|
|
230
|
+
description: 'Complete login flow with validation',
|
|
231
|
+
options: {
|
|
232
|
+
email: {
|
|
233
|
+
hasValue: true,
|
|
234
|
+
description: 'User email'
|
|
235
|
+
},
|
|
236
|
+
password: {
|
|
237
|
+
hasValue: true,
|
|
238
|
+
description: 'User password'
|
|
239
|
+
},
|
|
240
|
+
validateAfterLogin: {
|
|
241
|
+
default: true,
|
|
242
|
+
description: 'Validate session after login'
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
steps: [
|
|
246
|
+
{
|
|
247
|
+
name: 'check-existing-session',
|
|
248
|
+
description: 'Check if user is already logged in',
|
|
249
|
+
execute: async (context)=>{
|
|
250
|
+
console.log('Checking existing session...');
|
|
251
|
+
try {
|
|
252
|
+
await (0, _api.loadSession)();
|
|
253
|
+
const session = (0, _api.getSession)();
|
|
254
|
+
if (session && session.token) {
|
|
255
|
+
try {
|
|
256
|
+
await _user.userCommands.me();
|
|
257
|
+
console.log('✓ User is already logged in');
|
|
258
|
+
return {
|
|
259
|
+
alreadyLoggedIn: true,
|
|
260
|
+
session: session,
|
|
261
|
+
status: 'authenticated'
|
|
262
|
+
};
|
|
263
|
+
} catch (error) {
|
|
264
|
+
console.log('✗ Existing session is invalid, proceeding with login');
|
|
265
|
+
return {
|
|
266
|
+
alreadyLoggedIn: false,
|
|
267
|
+
session: null,
|
|
268
|
+
status: 'session-expired'
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
} else {
|
|
272
|
+
console.log('No existing session found');
|
|
273
|
+
return {
|
|
274
|
+
alreadyLoggedIn: false,
|
|
275
|
+
session: null,
|
|
276
|
+
status: 'no-session'
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
} catch (error) {
|
|
280
|
+
console.log('Error checking existing session:', error instanceof Error ? error.message : 'Unknown error');
|
|
281
|
+
return {
|
|
282
|
+
alreadyLoggedIn: false,
|
|
283
|
+
session: null,
|
|
284
|
+
status: 'error',
|
|
285
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: 'perform-login',
|
|
292
|
+
description: 'Perform user login',
|
|
293
|
+
execute: async (context, previousResult)=>{
|
|
294
|
+
if (previousResult.alreadyLoggedIn) {
|
|
295
|
+
console.log('Skipping login - user already authenticated');
|
|
296
|
+
return {
|
|
297
|
+
...previousResult,
|
|
298
|
+
loginPerformed: false,
|
|
299
|
+
loginSuccess: true
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
console.log('Performing login...');
|
|
303
|
+
try {
|
|
304
|
+
const loginArgs = [];
|
|
305
|
+
if (context.options.email) {
|
|
306
|
+
loginArgs.push(context.options.email);
|
|
307
|
+
}
|
|
308
|
+
if (context.options.password) {
|
|
309
|
+
loginArgs.push(context.options.password);
|
|
310
|
+
}
|
|
311
|
+
await _user.userCommands.login({
|
|
312
|
+
args: loginArgs
|
|
313
|
+
});
|
|
314
|
+
console.log('✓ Login successful');
|
|
315
|
+
return {
|
|
316
|
+
...previousResult,
|
|
317
|
+
loginPerformed: true,
|
|
318
|
+
loginSuccess: true
|
|
319
|
+
};
|
|
320
|
+
} catch (error) {
|
|
321
|
+
console.log('✗ Login failed:', error instanceof Error ? error.message : 'Unknown error');
|
|
322
|
+
return {
|
|
323
|
+
...previousResult,
|
|
324
|
+
loginPerformed: true,
|
|
325
|
+
loginSuccess: false,
|
|
326
|
+
loginError: error instanceof Error ? error.message : 'Unknown error'
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
name: 'validate-login',
|
|
333
|
+
description: 'Validate login by getting user info',
|
|
334
|
+
execute: async (context, previousResult)=>{
|
|
335
|
+
if (!previousResult.loginSuccess && !previousResult.alreadyLoggedIn) {
|
|
336
|
+
console.log('Login failed, skipping validation');
|
|
337
|
+
return {
|
|
338
|
+
...previousResult,
|
|
339
|
+
validationPerformed: false,
|
|
340
|
+
validationSuccess: false
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
if (context.options.validateAfterLogin === false) {
|
|
344
|
+
console.log('Skipping validation as requested');
|
|
345
|
+
return {
|
|
346
|
+
...previousResult,
|
|
347
|
+
validationPerformed: false,
|
|
348
|
+
validationSuccess: true
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
console.log('Validating login by getting user information...');
|
|
352
|
+
try {
|
|
353
|
+
const userInfo = await _user.userCommands.me();
|
|
354
|
+
console.log('✓ Login validation successful');
|
|
355
|
+
return {
|
|
356
|
+
...previousResult,
|
|
357
|
+
validationPerformed: true,
|
|
358
|
+
validationSuccess: true,
|
|
359
|
+
userInfo
|
|
360
|
+
};
|
|
361
|
+
} catch (error) {
|
|
362
|
+
console.log('✗ Login validation failed:', error instanceof Error ? error.message : 'Unknown error');
|
|
363
|
+
return {
|
|
364
|
+
...previousResult,
|
|
365
|
+
validationPerformed: true,
|
|
366
|
+
validationSuccess: false,
|
|
367
|
+
validationError: error instanceof Error ? error.message : 'Unknown error'
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
name: 'login-summary',
|
|
374
|
+
description: 'Provide login flow summary',
|
|
375
|
+
execute: async (context, previousResult)=>{
|
|
376
|
+
console.log('\n=== Login Flow Summary ===');
|
|
377
|
+
if (previousResult.alreadyLoggedIn) {
|
|
378
|
+
console.log('Status: Already logged in');
|
|
379
|
+
console.log('Session: Valid');
|
|
380
|
+
} else if (previousResult.loginSuccess) {
|
|
381
|
+
console.log('Status: Login successful');
|
|
382
|
+
if (previousResult.validationSuccess) {
|
|
383
|
+
console.log('Validation: Passed');
|
|
384
|
+
} else {
|
|
385
|
+
console.log('Validation: Failed');
|
|
386
|
+
}
|
|
387
|
+
} else {
|
|
388
|
+
console.log('Status: Login failed');
|
|
389
|
+
console.log('Error:', previousResult.loginError || 'Unknown error');
|
|
390
|
+
}
|
|
391
|
+
console.log('==========================\n');
|
|
392
|
+
return {
|
|
393
|
+
...previousResult,
|
|
394
|
+
flowComplete: true,
|
|
395
|
+
finalStatus: previousResult.alreadyLoggedIn || previousResult.loginSuccess ? 'success' : 'failed'
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
]
|
|
400
|
+
}
|
|
401
|
+
]
|
|
402
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "versionModule", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return versionModule;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const versionModule = {
|
|
12
|
+
name: 'version',
|
|
13
|
+
version: '1.0.0',
|
|
14
|
+
commands: [],
|
|
15
|
+
workflows: []
|
|
16
|
+
};
|
package/lib/package.js
CHANGED
|
@@ -46,9 +46,10 @@ async function listPackage(appId) {
|
|
|
46
46
|
const { version } = pkg;
|
|
47
47
|
let versionInfo = '';
|
|
48
48
|
if (version) {
|
|
49
|
+
const versionObj = version;
|
|
49
50
|
versionInfo = (0, _i18n.t)('boundTo', {
|
|
50
|
-
name:
|
|
51
|
-
id:
|
|
51
|
+
name: versionObj.name || version,
|
|
52
|
+
id: versionObj.id || version
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
let output = pkg.name;
|
|
@@ -74,7 +75,7 @@ async function choosePackage(appId) {
|
|
|
74
75
|
const list = await listPackage(appId);
|
|
75
76
|
while(true){
|
|
76
77
|
const id = await (0, _utils.question)((0, _i18n.t)('enterNativePackageId'));
|
|
77
|
-
const app = list.find((v)=>v.id ===
|
|
78
|
+
const app = list.find((v)=>v.id.toString() === id);
|
|
78
79
|
if (app) {
|
|
79
80
|
return app;
|
|
80
81
|
}
|
|
@@ -86,7 +87,10 @@ const packageCommands = {
|
|
|
86
87
|
if (!fn || !fn.endsWith('.ipa')) {
|
|
87
88
|
throw new Error((0, _i18n.t)('usageUploadIpa'));
|
|
88
89
|
}
|
|
89
|
-
const
|
|
90
|
+
const ipaInfo = await (0, _utils.getIpaInfo)(fn);
|
|
91
|
+
const { versionName, buildTime } = ipaInfo;
|
|
92
|
+
const appIdInPkg = ipaInfo.appId;
|
|
93
|
+
const appKeyInPkg = ipaInfo.appKey;
|
|
90
94
|
const { appId, appKey } = await (0, _app.getSelectedApp)('ios');
|
|
91
95
|
if (appIdInPkg && appIdInPkg != appId) {
|
|
92
96
|
throw new Error((0, _i18n.t)('appIdMismatchIpa', {
|
|
@@ -120,7 +124,10 @@ const packageCommands = {
|
|
|
120
124
|
if (!fn || !fn.endsWith('.apk')) {
|
|
121
125
|
throw new Error((0, _i18n.t)('usageUploadApk'));
|
|
122
126
|
}
|
|
123
|
-
const
|
|
127
|
+
const apkInfo = await (0, _utils.getApkInfo)(fn);
|
|
128
|
+
const { versionName, buildTime } = apkInfo;
|
|
129
|
+
const appIdInPkg = apkInfo.appId;
|
|
130
|
+
const appKeyInPkg = apkInfo.appKey;
|
|
124
131
|
const { appId, appKey } = await (0, _app.getSelectedApp)('android');
|
|
125
132
|
if (appIdInPkg && appIdInPkg != appId) {
|
|
126
133
|
throw new Error((0, _i18n.t)('appIdMismatchApk', {
|
|
@@ -154,7 +161,10 @@ const packageCommands = {
|
|
|
154
161
|
if (!fn || !fn.endsWith('.app')) {
|
|
155
162
|
throw new Error((0, _i18n.t)('usageUploadApp'));
|
|
156
163
|
}
|
|
157
|
-
const
|
|
164
|
+
const appInfo = await (0, _utils.getAppInfo)(fn);
|
|
165
|
+
const { versionName, buildTime } = appInfo;
|
|
166
|
+
const appIdInPkg = appInfo.appId;
|
|
167
|
+
const appKeyInPkg = appInfo.appKey;
|
|
158
168
|
const { appId, appKey } = await (0, _app.getSelectedApp)('harmony');
|
|
159
169
|
if (appIdInPkg && appIdInPkg != appId) {
|
|
160
170
|
throw new Error((0, _i18n.t)('appIdMismatchApp', {
|