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
|
@@ -8,13 +8,15 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
return _default;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
11
|
+
const _aab = require("./aab");
|
|
12
|
+
const _apk = require("./apk");
|
|
13
|
+
const _app = require("./app");
|
|
14
|
+
const _ipa = require("./ipa");
|
|
14
15
|
const supportFileTypes = [
|
|
15
16
|
'ipa',
|
|
16
17
|
'apk',
|
|
17
|
-
'app'
|
|
18
|
+
'app',
|
|
19
|
+
'aab'
|
|
18
20
|
];
|
|
19
21
|
class AppInfoParser {
|
|
20
22
|
parse() {
|
|
@@ -30,18 +32,21 @@ class AppInfoParser {
|
|
|
30
32
|
const splits = (typeof file === 'string' ? file : file.name).split('.');
|
|
31
33
|
const fileType = splits[splits.length - 1].toLowerCase();
|
|
32
34
|
if (!supportFileTypes.includes(fileType)) {
|
|
33
|
-
throw new Error('Unsupported file type, only support .ipa
|
|
35
|
+
throw new Error('Unsupported file type, only support .ipa, .apk, .app, or .aab file.');
|
|
34
36
|
}
|
|
35
37
|
this.file = file;
|
|
36
38
|
switch(fileType){
|
|
37
39
|
case 'ipa':
|
|
38
|
-
this.parser = new IpaParser(this.file);
|
|
40
|
+
this.parser = new _ipa.IpaParser(this.file);
|
|
39
41
|
break;
|
|
40
42
|
case 'apk':
|
|
41
|
-
this.parser = new ApkParser(this.file);
|
|
43
|
+
this.parser = new _apk.ApkParser(this.file);
|
|
42
44
|
break;
|
|
43
45
|
case 'app':
|
|
44
|
-
this.parser = new AppParser(this.file);
|
|
46
|
+
this.parser = new _app.AppParser(this.file);
|
|
47
|
+
break;
|
|
48
|
+
case 'aab':
|
|
49
|
+
this.parser = new _aab.AabParser(this.file);
|
|
45
50
|
break;
|
|
46
51
|
}
|
|
47
52
|
}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "IpaParser", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return IpaParser;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _utils = require("./utils");
|
|
12
|
+
const _zip = require("./zip");
|
|
2
13
|
const parsePlist = require('plist').parse;
|
|
3
14
|
const parseBplist = require('bplist-parser').parseBuffer;
|
|
4
15
|
const cgbiToPng = require('cgbi-to-png');
|
|
5
|
-
const Zip = require('./zip');
|
|
6
|
-
const { findIpaIconPath, getBase64FromBuffer, isBrowser } = require('./utils');
|
|
7
16
|
const PlistName = /payload\/[^\/]+?.app\/info.plist$/i;
|
|
8
17
|
const ProvisionName = /payload\/.+?\.app\/embedded.mobileprovision/;
|
|
9
|
-
class IpaParser extends Zip {
|
|
18
|
+
class IpaParser extends _zip.Zip {
|
|
10
19
|
parse() {
|
|
11
20
|
return new Promise((resolve, reject)=>{
|
|
12
21
|
this.getEntries([
|
|
@@ -17,19 +26,15 @@ class IpaParser extends Zip {
|
|
|
17
26
|
throw new Error("Info.plist can't be found.");
|
|
18
27
|
}
|
|
19
28
|
const plistInfo = this._parsePlist(buffers[PlistName]);
|
|
20
|
-
// parse mobile provision
|
|
21
29
|
const provisionInfo = this._parseProvision(buffers[ProvisionName]);
|
|
22
30
|
plistInfo.mobileProvision = provisionInfo;
|
|
23
|
-
|
|
24
|
-
const iconRegex = new RegExp(findIpaIconPath(plistInfo).toLowerCase());
|
|
31
|
+
const iconRegex = new RegExp((0, _utils.findIpaIconPath)(plistInfo).toLowerCase());
|
|
25
32
|
this.getEntry(iconRegex).then((iconBuffer)=>{
|
|
26
33
|
try {
|
|
27
|
-
|
|
28
|
-
plistInfo.icon = iconBuffer ? getBase64FromBuffer(cgbiToPng.revert(iconBuffer)) : null;
|
|
34
|
+
plistInfo.icon = iconBuffer ? (0, _utils.getBase64FromBuffer)(cgbiToPng.revert(iconBuffer)) : null;
|
|
29
35
|
} catch (err) {
|
|
30
|
-
if (isBrowser()) {
|
|
31
|
-
|
|
32
|
-
plistInfo.icon = iconBuffer ? getBase64FromBuffer(window.btoa(String.fromCharCode(...iconBuffer))) : null;
|
|
36
|
+
if ((0, _utils.isBrowser)()) {
|
|
37
|
+
plistInfo.icon = iconBuffer ? (0, _utils.getBase64FromBuffer)(window.btoa(String.fromCharCode(...iconBuffer))) : null;
|
|
33
38
|
} else {
|
|
34
39
|
plistInfo.icon = null;
|
|
35
40
|
console.warn('[Warning] failed to parse icon: ', err);
|
|
@@ -75,14 +80,4 @@ class IpaParser extends Zip {
|
|
|
75
80
|
}
|
|
76
81
|
return info;
|
|
77
82
|
}
|
|
78
|
-
/**
|
|
79
|
-
* parser for parsing .ipa file
|
|
80
|
-
* @param {String | File | Blob} file // file's path in Node, instance of File or Blob in Browser
|
|
81
|
-
*/ constructor(file){
|
|
82
|
-
super(file);
|
|
83
|
-
if (!(this instanceof IpaParser)) {
|
|
84
|
-
return new IpaParser(file);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
83
|
}
|
|
88
|
-
module.exports = IpaParser;
|