@solana-mobile/dapp-store-cli 0.16.0 → 0.16.1
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/bin/dapp-store.js +3 -1
- package/lib/CliSetup.js +304 -505
- package/lib/CliUtils.js +6 -376
- package/lib/__tests__/CliSetupTest.js +484 -74
- package/lib/cli/__tests__/parseErrors.test.js +25 -0
- package/lib/cli/__tests__/signer.test.js +436 -0
- package/lib/cli/constants.js +23 -0
- package/lib/cli/messages.js +21 -0
- package/lib/cli/parseErrors.js +41 -0
- package/lib/{commands/publish/PublishCliSupport.js → cli/selfUpdate.js} +72 -38
- package/lib/{commands/publish/PublishCliRemove.js → cli/signer.js} +35 -56
- package/lib/index.js +96 -5
- package/lib/package.json +5 -24
- package/lib/portal/__tests__/releaseMetadata.test.js +647 -0
- package/lib/portal/__tests__/translators.test.js +76 -0
- package/lib/portal/__tests__/workflowClient.test.js +457 -0
- package/lib/portal/attestationClient.js +143 -0
- package/lib/portal/files.js +64 -0
- package/lib/portal/http.js +364 -0
- package/lib/portal/records.js +64 -0
- package/lib/portal/releaseMetadata.js +748 -0
- package/lib/portal/translators.js +460 -0
- package/lib/portal/types.js +1 -0
- package/lib/portal/workflowClient.js +704 -0
- package/lib/publication/PublicationProgressReporter.js +1051 -0
- package/lib/publication/__tests__/PublicationProgressReporter.test.js +174 -0
- package/lib/{commands/ValidateCommand.js → publication/__tests__/fundingPreflight.test.js} +90 -66
- package/lib/publication/__tests__/publicationSummary.test.js +26 -0
- package/lib/publication/cliValidation.js +482 -0
- package/lib/publication/fundingPreflight.js +246 -0
- package/lib/publication/publicationSummary.js +99 -0
- package/lib/{commands/utils.js → publication/runPublicationWorkflow.js} +16 -46
- package/package.json +5 -24
- package/src/CliSetup.ts +370 -505
- package/src/CliUtils.ts +9 -233
- package/src/__tests__/CliSetupTest.ts +272 -120
- package/src/cli/__tests__/parseErrors.test.ts +34 -0
- package/src/cli/__tests__/signer.test.ts +359 -0
- package/src/cli/constants.ts +3 -0
- package/src/cli/messages.ts +27 -0
- package/src/cli/parseErrors.ts +62 -0
- package/src/cli/selfUpdate.ts +59 -0
- package/src/cli/signer.ts +38 -0
- package/src/index.ts +31 -4
- package/src/portal/__tests__/releaseMetadata.test.ts +508 -0
- package/src/portal/__tests__/translators.test.ts +82 -0
- package/src/portal/__tests__/workflowClient.test.ts +278 -0
- package/src/portal/attestationClient.ts +19 -0
- package/src/portal/files.ts +73 -0
- package/src/portal/http.ts +170 -0
- package/src/portal/records.ts +38 -0
- package/src/portal/releaseMetadata.ts +489 -0
- package/src/portal/translators.ts +750 -0
- package/src/portal/types.ts +27 -0
- package/src/portal/workflowClient.ts +575 -0
- package/src/publication/PublicationProgressReporter.ts +1026 -0
- package/src/publication/__tests__/PublicationProgressReporter.test.ts +210 -0
- package/src/publication/__tests__/fundingPreflight.test.ts +78 -0
- package/src/publication/__tests__/publicationSummary.test.ts +30 -0
- package/src/publication/cliValidation.ts +264 -0
- package/src/publication/fundingPreflight.ts +123 -0
- package/src/publication/publicationSummary.ts +26 -0
- package/src/publication/runPublicationWorkflow.ts +46 -0
- package/lib/commands/create/CreateCliApp.js +0 -223
- package/lib/commands/create/CreateCliRelease.js +0 -290
- package/lib/commands/create/index.js +0 -40
- package/lib/commands/index.js +0 -3
- package/lib/commands/publish/PublishCliSubmit.js +0 -208
- package/lib/commands/publish/PublishCliUpdate.js +0 -211
- package/lib/commands/publish/index.js +0 -22
- package/lib/commands/scaffolding/ScaffoldInit.js +0 -15
- package/lib/commands/scaffolding/index.js +0 -1
- package/lib/config/EnvVariables.js +0 -59
- package/lib/config/PublishDetails.js +0 -915
- package/lib/config/S3StorageManager.js +0 -93
- package/lib/config/index.js +0 -2
- package/lib/generated/config_obj.json +0 -1
- package/lib/generated/config_schema.json +0 -1
- package/lib/prebuild_schema/publishing_source.yaml +0 -64
- package/lib/prebuild_schema/schemagen.js +0 -25
- package/lib/upload/CachedStorageDriver.js +0 -458
- package/lib/upload/TurboStorageDriver.js +0 -718
- package/lib/upload/__tests__/CachedStorageDriver.test.js +0 -437
- package/lib/upload/__tests__/TurboStorageDriver.test.js +0 -17
- package/lib/upload/__tests__/contentGateway.test.js +0 -17
- package/lib/upload/contentGateway.js +0 -23
- package/lib/upload/index.js +0 -2
- package/src/commands/ValidateCommand.ts +0 -82
- package/src/commands/create/CreateCliApp.ts +0 -93
- package/src/commands/create/CreateCliRelease.ts +0 -149
- package/src/commands/create/index.ts +0 -47
- package/src/commands/index.ts +0 -3
- package/src/commands/publish/PublishCliRemove.ts +0 -66
- package/src/commands/publish/PublishCliSubmit.ts +0 -93
- package/src/commands/publish/PublishCliSupport.ts +0 -66
- package/src/commands/publish/PublishCliUpdate.ts +0 -101
- package/src/commands/publish/index.ts +0 -29
- package/src/commands/scaffolding/ScaffoldInit.ts +0 -20
- package/src/commands/scaffolding/index.ts +0 -1
- package/src/commands/utils.ts +0 -33
- package/src/config/EnvVariables.ts +0 -39
- package/src/config/PublishDetails.ts +0 -456
- package/src/config/S3StorageManager.ts +0 -47
- package/src/config/index.ts +0 -2
- package/src/prebuild_schema/publishing_source.yaml +0 -64
- package/src/prebuild_schema/schemagen.js +0 -31
- package/src/upload/CachedStorageDriver.ts +0 -179
- package/src/upload/TurboStorageDriver.ts +0 -283
- package/src/upload/__tests__/CachedStorageDriver.test.ts +0 -246
- package/src/upload/__tests__/TurboStorageDriver.test.ts +0 -15
- package/src/upload/__tests__/contentGateway.test.ts +0 -31
- package/src/upload/contentGateway.ts +0 -37
- package/src/upload/index.ts +0 -2
|
@@ -1,915 +0,0 @@
|
|
|
1
|
-
function _array_like_to_array(arr, len) {
|
|
2
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
-
return arr2;
|
|
5
|
-
}
|
|
6
|
-
function _array_without_holes(arr) {
|
|
7
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
|
-
}
|
|
9
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
10
|
-
try {
|
|
11
|
-
var info = gen[key](arg);
|
|
12
|
-
var value = info.value;
|
|
13
|
-
} catch (error) {
|
|
14
|
-
reject(error);
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
if (info.done) {
|
|
18
|
-
resolve(value);
|
|
19
|
-
} else {
|
|
20
|
-
Promise.resolve(value).then(_next, _throw);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
function _async_to_generator(fn) {
|
|
24
|
-
return function() {
|
|
25
|
-
var self = this, args = arguments;
|
|
26
|
-
return new Promise(function(resolve, reject) {
|
|
27
|
-
var gen = fn.apply(self, args);
|
|
28
|
-
function _next(value) {
|
|
29
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
30
|
-
}
|
|
31
|
-
function _throw(err) {
|
|
32
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
33
|
-
}
|
|
34
|
-
_next(undefined);
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function _define_property(obj, key, value) {
|
|
39
|
-
if (key in obj) {
|
|
40
|
-
Object.defineProperty(obj, key, {
|
|
41
|
-
value: value,
|
|
42
|
-
enumerable: true,
|
|
43
|
-
configurable: true,
|
|
44
|
-
writable: true
|
|
45
|
-
});
|
|
46
|
-
} else {
|
|
47
|
-
obj[key] = value;
|
|
48
|
-
}
|
|
49
|
-
return obj;
|
|
50
|
-
}
|
|
51
|
-
function _instanceof(left, right) {
|
|
52
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
53
|
-
return !!right[Symbol.hasInstance](left);
|
|
54
|
-
} else {
|
|
55
|
-
return left instanceof right;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function _iterable_to_array(iter) {
|
|
59
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
60
|
-
}
|
|
61
|
-
function _non_iterable_spread() {
|
|
62
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
63
|
-
}
|
|
64
|
-
function _object_spread(target) {
|
|
65
|
-
for(var i = 1; i < arguments.length; i++){
|
|
66
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
67
|
-
var ownKeys = Object.keys(source);
|
|
68
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
69
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
70
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
71
|
-
}));
|
|
72
|
-
}
|
|
73
|
-
ownKeys.forEach(function(key) {
|
|
74
|
-
_define_property(target, key, source[key]);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
return target;
|
|
78
|
-
}
|
|
79
|
-
function ownKeys(object, enumerableOnly) {
|
|
80
|
-
var keys = Object.keys(object);
|
|
81
|
-
if (Object.getOwnPropertySymbols) {
|
|
82
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
83
|
-
if (enumerableOnly) {
|
|
84
|
-
symbols = symbols.filter(function(sym) {
|
|
85
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
keys.push.apply(keys, symbols);
|
|
89
|
-
}
|
|
90
|
-
return keys;
|
|
91
|
-
}
|
|
92
|
-
function _object_spread_props(target, source) {
|
|
93
|
-
source = source != null ? source : {};
|
|
94
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
95
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
96
|
-
} else {
|
|
97
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
98
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
return target;
|
|
102
|
-
}
|
|
103
|
-
function _to_consumable_array(arr) {
|
|
104
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
105
|
-
}
|
|
106
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
107
|
-
if (!o) return;
|
|
108
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
109
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
110
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
111
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
112
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
113
|
-
}
|
|
114
|
-
function _ts_generator(thisArg, body) {
|
|
115
|
-
var f, y, t, _ = {
|
|
116
|
-
label: 0,
|
|
117
|
-
sent: function() {
|
|
118
|
-
if (t[0] & 1) throw t[1];
|
|
119
|
-
return t[1];
|
|
120
|
-
},
|
|
121
|
-
trys: [],
|
|
122
|
-
ops: []
|
|
123
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
124
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
125
|
-
return this;
|
|
126
|
-
}), g;
|
|
127
|
-
function verb(n) {
|
|
128
|
-
return function(v) {
|
|
129
|
-
return step([
|
|
130
|
-
n,
|
|
131
|
-
v
|
|
132
|
-
]);
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
function step(op) {
|
|
136
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
137
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
138
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
139
|
-
if (y = 0, t) op = [
|
|
140
|
-
op[0] & 2,
|
|
141
|
-
t.value
|
|
142
|
-
];
|
|
143
|
-
switch(op[0]){
|
|
144
|
-
case 0:
|
|
145
|
-
case 1:
|
|
146
|
-
t = op;
|
|
147
|
-
break;
|
|
148
|
-
case 4:
|
|
149
|
-
_.label++;
|
|
150
|
-
return {
|
|
151
|
-
value: op[1],
|
|
152
|
-
done: false
|
|
153
|
-
};
|
|
154
|
-
case 5:
|
|
155
|
-
_.label++;
|
|
156
|
-
y = op[1];
|
|
157
|
-
op = [
|
|
158
|
-
0
|
|
159
|
-
];
|
|
160
|
-
continue;
|
|
161
|
-
case 7:
|
|
162
|
-
op = _.ops.pop();
|
|
163
|
-
_.trys.pop();
|
|
164
|
-
continue;
|
|
165
|
-
default:
|
|
166
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
167
|
-
_ = 0;
|
|
168
|
-
continue;
|
|
169
|
-
}
|
|
170
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
171
|
-
_.label = op[1];
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
175
|
-
_.label = t[1];
|
|
176
|
-
t = op;
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
if (t && _.label < t[2]) {
|
|
180
|
-
_.label = t[2];
|
|
181
|
-
_.ops.push(op);
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
if (t[2]) _.ops.pop();
|
|
185
|
-
_.trys.pop();
|
|
186
|
-
continue;
|
|
187
|
-
}
|
|
188
|
-
op = body.call(thisArg, _);
|
|
189
|
-
} catch (e) {
|
|
190
|
-
op = [
|
|
191
|
-
6,
|
|
192
|
-
e
|
|
193
|
-
];
|
|
194
|
-
y = 0;
|
|
195
|
-
} finally{
|
|
196
|
-
f = t = 0;
|
|
197
|
-
}
|
|
198
|
-
if (op[0] & 5) throw op[1];
|
|
199
|
-
return {
|
|
200
|
-
value: op[0] ? op[1] : void 0,
|
|
201
|
-
done: true
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
import { dump, load } from "js-yaml";
|
|
206
|
-
import Ajv from "ajv";
|
|
207
|
-
// eslint-disable-next-line require-extensions/require-extensions
|
|
208
|
-
import { readFile } from 'fs/promises';
|
|
209
|
-
var schemaJson = JSON.parse((await readFile(new URL("../generated/config_schema.json", import.meta.url))).toString());
|
|
210
|
-
import fs from "fs";
|
|
211
|
-
import path from "path";
|
|
212
|
-
import { toMetaplexFile } from "@metaplex-foundation/js";
|
|
213
|
-
import { Constants, showMessage } from "../CliUtils.js";
|
|
214
|
-
import util from "util";
|
|
215
|
-
import { imageSize } from "image-size";
|
|
216
|
-
import { exec } from "child_process";
|
|
217
|
-
import getVideoDimensions from "get-video-dimensions";
|
|
218
|
-
import { PublicKey } from "@solana/web3.js";
|
|
219
|
-
var runImgSize = util.promisify(imageSize);
|
|
220
|
-
var runExec = util.promisify(exec);
|
|
221
|
-
var AaptPrefixes = {
|
|
222
|
-
quoteRegex: "'(.*?)'",
|
|
223
|
-
quoteNonLazyRegex: "'(.*)'",
|
|
224
|
-
packagePrefix: "package: name=",
|
|
225
|
-
verCodePrefix: "versionCode=",
|
|
226
|
-
verNamePrefix: "versionName=",
|
|
227
|
-
sdkPrefix: "(?:minSdk|sdk)Version:",
|
|
228
|
-
debuggableApkPrefix: "application-debuggable",
|
|
229
|
-
localePrefix: "locales: "
|
|
230
|
-
};
|
|
231
|
-
var ajv = new Ajv({
|
|
232
|
-
strictTuples: false
|
|
233
|
-
});
|
|
234
|
-
var validate = ajv.compile(schemaJson);
|
|
235
|
-
export var loadPublishDetails = function(configPath) {
|
|
236
|
-
return _async_to_generator(function() {
|
|
237
|
-
var configFile, valid;
|
|
238
|
-
return _ts_generator(this, function(_state) {
|
|
239
|
-
switch(_state.label){
|
|
240
|
-
case 0:
|
|
241
|
-
return [
|
|
242
|
-
4,
|
|
243
|
-
fs.promises.readFile(configPath, "utf-8")
|
|
244
|
-
];
|
|
245
|
-
case 1:
|
|
246
|
-
configFile = _state.sent();
|
|
247
|
-
valid = validate(load(configFile));
|
|
248
|
-
if (!valid) {
|
|
249
|
-
console.error(validate.errors);
|
|
250
|
-
process.exit(1);
|
|
251
|
-
}
|
|
252
|
-
return [
|
|
253
|
-
2,
|
|
254
|
-
load(configFile)
|
|
255
|
-
];
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
})();
|
|
259
|
-
};
|
|
260
|
-
export var loadPublishDetailsWithChecks = function() {
|
|
261
|
-
var buildToolsDir = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
|
|
262
|
-
return _async_to_generator(function() {
|
|
263
|
-
var _config_release_android_details, _config_release, _config_app_media_find, _config_app_media, _config_release_media_find, _config_release_media, _config_release_media_find1, _config_release_media1, _config_release_media_find2, _config_release_media2, _config_release_media3, _config_release_media4, config, apkEntry, apkPath, developerOverridenLocales, _, appIcon, iconPath, iconBuffer, releaseIcon, iconPath1, banner, bannerPath, featureGraphic, featureGraphicPath, screenshots, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, item, mediaPath, err, videos, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, video, mediaPath1, err, googlePkg, pkgCompare, alpha_testers, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, wallet;
|
|
264
|
-
return _ts_generator(this, function(_state) {
|
|
265
|
-
switch(_state.label){
|
|
266
|
-
case 0:
|
|
267
|
-
return [
|
|
268
|
-
4,
|
|
269
|
-
loadPublishDetails(Constants.getConfigFilePath())
|
|
270
|
-
];
|
|
271
|
-
case 1:
|
|
272
|
-
config = _state.sent();
|
|
273
|
-
// We validate that the config is going to have at least one installable asset
|
|
274
|
-
apkEntry = config.release.files.find(function(asset) {
|
|
275
|
-
return asset.purpose === "install";
|
|
276
|
-
});
|
|
277
|
-
apkPath = path.join(process.cwd(), apkEntry === null || apkEntry === void 0 ? void 0 : apkEntry.uri);
|
|
278
|
-
if (!fs.existsSync(apkPath)) {
|
|
279
|
-
throw new Error("Invalid path to APK file.");
|
|
280
|
-
}
|
|
281
|
-
developerOverridenLocales = (_config_release = config.release) === null || _config_release === void 0 ? void 0 : (_config_release_android_details = _config_release.android_details) === null || _config_release_android_details === void 0 ? void 0 : _config_release_android_details.locales;
|
|
282
|
-
if (!buildToolsDir) return [
|
|
283
|
-
3,
|
|
284
|
-
3
|
|
285
|
-
];
|
|
286
|
-
_ = config.release;
|
|
287
|
-
return [
|
|
288
|
-
4,
|
|
289
|
-
getAndroidDetails(buildToolsDir, apkPath, developerOverridenLocales)
|
|
290
|
-
];
|
|
291
|
-
case 2:
|
|
292
|
-
_.android_details = _state.sent();
|
|
293
|
-
_state.label = 3;
|
|
294
|
-
case 3:
|
|
295
|
-
appIcon = (_config_app_media = config.app.media) === null || _config_app_media === void 0 ? void 0 : (_config_app_media_find = _config_app_media.find(function(asset) {
|
|
296
|
-
return asset.purpose === "icon";
|
|
297
|
-
})) === null || _config_app_media_find === void 0 ? void 0 : _config_app_media_find.uri;
|
|
298
|
-
if (!appIcon) return [
|
|
299
|
-
3,
|
|
300
|
-
6
|
|
301
|
-
];
|
|
302
|
-
iconPath = path.join(process.cwd(), appIcon);
|
|
303
|
-
return [
|
|
304
|
-
4,
|
|
305
|
-
checkIconCompatibility(iconPath, "App")
|
|
306
|
-
];
|
|
307
|
-
case 4:
|
|
308
|
-
_state.sent();
|
|
309
|
-
return [
|
|
310
|
-
4,
|
|
311
|
-
fs.promises.readFile(iconPath)
|
|
312
|
-
];
|
|
313
|
-
case 5:
|
|
314
|
-
iconBuffer = _state.sent();
|
|
315
|
-
config.app.icon = toMetaplexFile(iconBuffer, appIcon);
|
|
316
|
-
_state.label = 6;
|
|
317
|
-
case 6:
|
|
318
|
-
releaseIcon = (_config_release_media = config.release.media) === null || _config_release_media === void 0 ? void 0 : (_config_release_media_find = _config_release_media.find(function(asset) {
|
|
319
|
-
return asset.purpose === "icon";
|
|
320
|
-
})) === null || _config_release_media_find === void 0 ? void 0 : _config_release_media_find.uri;
|
|
321
|
-
if (!releaseIcon) return [
|
|
322
|
-
3,
|
|
323
|
-
8
|
|
324
|
-
];
|
|
325
|
-
iconPath1 = path.join(process.cwd(), releaseIcon);
|
|
326
|
-
return [
|
|
327
|
-
4,
|
|
328
|
-
checkIconCompatibility(iconPath1, "Release")
|
|
329
|
-
];
|
|
330
|
-
case 7:
|
|
331
|
-
_state.sent();
|
|
332
|
-
_state.label = 8;
|
|
333
|
-
case 8:
|
|
334
|
-
if (!appIcon && !releaseIcon) {
|
|
335
|
-
throw new Error("Please specify at least one media entry of type icon in your configuration file");
|
|
336
|
-
}
|
|
337
|
-
banner = (_config_release_media1 = config.release.media) === null || _config_release_media1 === void 0 ? void 0 : (_config_release_media_find1 = _config_release_media1.find(function(asset) {
|
|
338
|
-
return asset.purpose === "banner";
|
|
339
|
-
})) === null || _config_release_media_find1 === void 0 ? void 0 : _config_release_media_find1.uri;
|
|
340
|
-
if (!banner) return [
|
|
341
|
-
3,
|
|
342
|
-
10
|
|
343
|
-
];
|
|
344
|
-
bannerPath = path.join(process.cwd(), banner);
|
|
345
|
-
return [
|
|
346
|
-
4,
|
|
347
|
-
checkBannerCompatibility(bannerPath)
|
|
348
|
-
];
|
|
349
|
-
case 9:
|
|
350
|
-
_state.sent();
|
|
351
|
-
return [
|
|
352
|
-
3,
|
|
353
|
-
11
|
|
354
|
-
];
|
|
355
|
-
case 10:
|
|
356
|
-
throw new Error("Please specify banner image of size 1200x600 in your configuration file");
|
|
357
|
-
case 11:
|
|
358
|
-
featureGraphic = (_config_release_media2 = config.release.media) === null || _config_release_media2 === void 0 ? void 0 : (_config_release_media_find2 = _config_release_media2.find(function(asset) {
|
|
359
|
-
return asset.purpose === "featureGraphic";
|
|
360
|
-
})) === null || _config_release_media_find2 === void 0 ? void 0 : _config_release_media_find2.uri;
|
|
361
|
-
if (!featureGraphic) return [
|
|
362
|
-
3,
|
|
363
|
-
13
|
|
364
|
-
];
|
|
365
|
-
featureGraphicPath = path.join(process.cwd(), featureGraphic);
|
|
366
|
-
return [
|
|
367
|
-
4,
|
|
368
|
-
checkFeatureGraphicCompatibility(featureGraphicPath)
|
|
369
|
-
];
|
|
370
|
-
case 12:
|
|
371
|
-
_state.sent();
|
|
372
|
-
_state.label = 13;
|
|
373
|
-
case 13:
|
|
374
|
-
config.release.media.forEach(function(item) {
|
|
375
|
-
var mediaPath = path.join(process.cwd(), item.uri);
|
|
376
|
-
if (!fs.existsSync(mediaPath)) {
|
|
377
|
-
throw new Error("File doesnt exist: ".concat(item.uri, "."));
|
|
378
|
-
}
|
|
379
|
-
if (item.purpose == "screenshot" && !checkImageExtension(mediaPath)) {
|
|
380
|
-
throw new Error("Please ensure the file ".concat(item.uri, " is a jpeg, png, or webp file."));
|
|
381
|
-
}
|
|
382
|
-
if (item.purpose == "video" && !checkVideoExtension(mediaPath)) {
|
|
383
|
-
throw new Error("Please ensure the file ".concat(item.uri, " is a mp4."));
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
screenshots = (_config_release_media3 = config.release.media) === null || _config_release_media3 === void 0 ? void 0 : _config_release_media3.filter(function(asset) {
|
|
387
|
-
return asset.purpose === "screenshot";
|
|
388
|
-
});
|
|
389
|
-
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
390
|
-
_state.label = 14;
|
|
391
|
-
case 14:
|
|
392
|
-
_state.trys.push([
|
|
393
|
-
14,
|
|
394
|
-
19,
|
|
395
|
-
20,
|
|
396
|
-
21
|
|
397
|
-
]);
|
|
398
|
-
_iterator = screenshots[Symbol.iterator]();
|
|
399
|
-
_state.label = 15;
|
|
400
|
-
case 15:
|
|
401
|
-
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
|
|
402
|
-
3,
|
|
403
|
-
18
|
|
404
|
-
];
|
|
405
|
-
item = _step.value;
|
|
406
|
-
mediaPath = path.join(process.cwd(), item.uri);
|
|
407
|
-
return [
|
|
408
|
-
4,
|
|
409
|
-
checkScreenshotDimensions(mediaPath)
|
|
410
|
-
];
|
|
411
|
-
case 16:
|
|
412
|
-
if (_state.sent()) {
|
|
413
|
-
throw new Error("Screenshot ".concat(mediaPath, " must be at least 1080px in width and height."));
|
|
414
|
-
}
|
|
415
|
-
_state.label = 17;
|
|
416
|
-
case 17:
|
|
417
|
-
_iteratorNormalCompletion = true;
|
|
418
|
-
return [
|
|
419
|
-
3,
|
|
420
|
-
15
|
|
421
|
-
];
|
|
422
|
-
case 18:
|
|
423
|
-
return [
|
|
424
|
-
3,
|
|
425
|
-
21
|
|
426
|
-
];
|
|
427
|
-
case 19:
|
|
428
|
-
err = _state.sent();
|
|
429
|
-
_didIteratorError = true;
|
|
430
|
-
_iteratorError = err;
|
|
431
|
-
return [
|
|
432
|
-
3,
|
|
433
|
-
21
|
|
434
|
-
];
|
|
435
|
-
case 20:
|
|
436
|
-
try {
|
|
437
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
438
|
-
_iterator.return();
|
|
439
|
-
}
|
|
440
|
-
} finally{
|
|
441
|
-
if (_didIteratorError) {
|
|
442
|
-
throw _iteratorError;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
return [
|
|
446
|
-
7
|
|
447
|
-
];
|
|
448
|
-
case 21:
|
|
449
|
-
videos = (_config_release_media4 = config.release.media) === null || _config_release_media4 === void 0 ? void 0 : _config_release_media4.filter(function(asset) {
|
|
450
|
-
return asset.purpose === "video";
|
|
451
|
-
});
|
|
452
|
-
_iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
453
|
-
_state.label = 22;
|
|
454
|
-
case 22:
|
|
455
|
-
_state.trys.push([
|
|
456
|
-
22,
|
|
457
|
-
27,
|
|
458
|
-
28,
|
|
459
|
-
29
|
|
460
|
-
]);
|
|
461
|
-
_iterator1 = videos[Symbol.iterator]();
|
|
462
|
-
_state.label = 23;
|
|
463
|
-
case 23:
|
|
464
|
-
if (!!(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done)) return [
|
|
465
|
-
3,
|
|
466
|
-
26
|
|
467
|
-
];
|
|
468
|
-
video = _step1.value;
|
|
469
|
-
mediaPath1 = path.join(process.cwd(), video.uri);
|
|
470
|
-
return [
|
|
471
|
-
4,
|
|
472
|
-
checkVideoDimensions(mediaPath1)
|
|
473
|
-
];
|
|
474
|
-
case 24:
|
|
475
|
-
if (_state.sent()) {
|
|
476
|
-
throw new Error("Video ".concat(mediaPath1, " must be at least 720px in width and height."));
|
|
477
|
-
}
|
|
478
|
-
_state.label = 25;
|
|
479
|
-
case 25:
|
|
480
|
-
_iteratorNormalCompletion1 = true;
|
|
481
|
-
return [
|
|
482
|
-
3,
|
|
483
|
-
23
|
|
484
|
-
];
|
|
485
|
-
case 26:
|
|
486
|
-
return [
|
|
487
|
-
3,
|
|
488
|
-
29
|
|
489
|
-
];
|
|
490
|
-
case 27:
|
|
491
|
-
err = _state.sent();
|
|
492
|
-
_didIteratorError1 = true;
|
|
493
|
-
_iteratorError1 = err;
|
|
494
|
-
return [
|
|
495
|
-
3,
|
|
496
|
-
29
|
|
497
|
-
];
|
|
498
|
-
case 28:
|
|
499
|
-
try {
|
|
500
|
-
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
501
|
-
_iterator1.return();
|
|
502
|
-
}
|
|
503
|
-
} finally{
|
|
504
|
-
if (_didIteratorError1) {
|
|
505
|
-
throw _iteratorError1;
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
return [
|
|
509
|
-
7
|
|
510
|
-
];
|
|
511
|
-
case 29:
|
|
512
|
-
if (screenshots.length + videos.length < 4) {
|
|
513
|
-
throw new Error("At least 4 screenshots or videos are required for publishing a new release. Found only ".concat(screenshots.length + videos.length));
|
|
514
|
-
}
|
|
515
|
-
validateLocalizableResources(config);
|
|
516
|
-
googlePkg = config.solana_mobile_dapp_publisher_portal.google_store_package;
|
|
517
|
-
if (googlePkg === null || googlePkg === void 0 ? void 0 : googlePkg.length) {
|
|
518
|
-
pkgCompare = new RegExp("[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)+").exec(googlePkg);
|
|
519
|
-
if (!(pkgCompare === null || pkgCompare === void 0 ? void 0 : pkgCompare.length)) {
|
|
520
|
-
throw new Error("Please provide a valid Google store package name in the Publisher Portal section of your configuration file.");
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
alpha_testers = config.solana_mobile_dapp_publisher_portal.alpha_testers;
|
|
524
|
-
if (alpha_testers !== undefined) {
|
|
525
|
-
_iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
|
|
526
|
-
try {
|
|
527
|
-
for(_iterator2 = alpha_testers[Symbol.iterator](); !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){
|
|
528
|
-
wallet = _step2.value;
|
|
529
|
-
try {
|
|
530
|
-
void new PublicKey(wallet.address);
|
|
531
|
-
} catch (e) {
|
|
532
|
-
throw new Error("invalid alpha tester wallet address <".concat(wallet, ">"));
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
} catch (err) {
|
|
536
|
-
_didIteratorError2 = true;
|
|
537
|
-
_iteratorError2 = err;
|
|
538
|
-
} finally{
|
|
539
|
-
try {
|
|
540
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
541
|
-
_iterator2.return();
|
|
542
|
-
}
|
|
543
|
-
} finally{
|
|
544
|
-
if (_didIteratorError2) {
|
|
545
|
-
throw _iteratorError2;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
if (alpha_testers.size > 10) {
|
|
550
|
-
throw new Error("Alpha testers are limited to 10 per app submission");
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
return [
|
|
554
|
-
2,
|
|
555
|
-
config
|
|
556
|
-
];
|
|
557
|
-
}
|
|
558
|
-
});
|
|
559
|
-
})();
|
|
560
|
-
};
|
|
561
|
-
var checkIconCompatibility = function(path, typeString) {
|
|
562
|
-
return _async_to_generator(function() {
|
|
563
|
-
return _ts_generator(this, function(_state) {
|
|
564
|
-
switch(_state.label){
|
|
565
|
-
case 0:
|
|
566
|
-
if (!fs.existsSync(path) || !checkImageExtension(path)) {
|
|
567
|
-
throw new Error("Please check the path to your ".concat(typeString, " icon and ensure the file is a jpeg, png, or webp file."));
|
|
568
|
-
}
|
|
569
|
-
return [
|
|
570
|
-
4,
|
|
571
|
-
checkIconDimensions(path)
|
|
572
|
-
];
|
|
573
|
-
case 1:
|
|
574
|
-
if (_state.sent()) {
|
|
575
|
-
throw new Error("Icons must be 512px by 512px.");
|
|
576
|
-
}
|
|
577
|
-
return [
|
|
578
|
-
2
|
|
579
|
-
];
|
|
580
|
-
}
|
|
581
|
-
});
|
|
582
|
-
})();
|
|
583
|
-
};
|
|
584
|
-
var checkBannerCompatibility = function(path) {
|
|
585
|
-
return _async_to_generator(function() {
|
|
586
|
-
return _ts_generator(this, function(_state) {
|
|
587
|
-
switch(_state.label){
|
|
588
|
-
case 0:
|
|
589
|
-
if (!fs.existsSync(path) || !checkImageExtension(path)) {
|
|
590
|
-
throw new Error("Please check the path to your banner image and ensure the file is a jpeg, png, or webp file.");
|
|
591
|
-
}
|
|
592
|
-
return [
|
|
593
|
-
4,
|
|
594
|
-
checkBannerDimensions(path)
|
|
595
|
-
];
|
|
596
|
-
case 1:
|
|
597
|
-
if (_state.sent()) {
|
|
598
|
-
throw new Error("Banner must be 1200px by 600px.");
|
|
599
|
-
}
|
|
600
|
-
return [
|
|
601
|
-
2
|
|
602
|
-
];
|
|
603
|
-
}
|
|
604
|
-
});
|
|
605
|
-
})();
|
|
606
|
-
};
|
|
607
|
-
var checkFeatureGraphicCompatibility = function(path) {
|
|
608
|
-
return _async_to_generator(function() {
|
|
609
|
-
return _ts_generator(this, function(_state) {
|
|
610
|
-
switch(_state.label){
|
|
611
|
-
case 0:
|
|
612
|
-
if (!fs.existsSync(path) || !checkImageExtension(path)) {
|
|
613
|
-
throw new Error("Please check the path to your featureGraphic image and ensure the file is a jpeg, png, or webp file.");
|
|
614
|
-
}
|
|
615
|
-
return [
|
|
616
|
-
4,
|
|
617
|
-
checkFeatureGraphicDimensions(path)
|
|
618
|
-
];
|
|
619
|
-
case 1:
|
|
620
|
-
if (_state.sent()) {
|
|
621
|
-
throw new Error("Feature Graphic must be 1200px by 1200px.");
|
|
622
|
-
}
|
|
623
|
-
return [
|
|
624
|
-
2
|
|
625
|
-
];
|
|
626
|
-
}
|
|
627
|
-
});
|
|
628
|
-
})();
|
|
629
|
-
};
|
|
630
|
-
var checkImageExtension = function(uri) {
|
|
631
|
-
var fileExt = path.extname(uri).toLowerCase();
|
|
632
|
-
return fileExt == ".png" || fileExt == ".jpg" || fileExt == ".jpeg" || fileExt == ".webp";
|
|
633
|
-
};
|
|
634
|
-
var checkVideoExtension = function(uri) {
|
|
635
|
-
var fileExt = path.extname(uri).toLowerCase();
|
|
636
|
-
return fileExt == ".mp4";
|
|
637
|
-
};
|
|
638
|
-
/**
|
|
639
|
-
* We need to pre-check some things in the localized resources before we move forward
|
|
640
|
-
*/ var validateLocalizableResources = function(config) {
|
|
641
|
-
if (!config.release.catalog["en-US"]) {
|
|
642
|
-
throw new Error("Please ensure you have the en-US locale strings in your configuration file.");
|
|
643
|
-
}
|
|
644
|
-
var baselineSize = Object.keys(config.release.catalog["en-US"]).length;
|
|
645
|
-
Object.keys(config.release.catalog).forEach(function(locale) {
|
|
646
|
-
var size = Object.keys(config.release.catalog[locale]).length;
|
|
647
|
-
if (size != baselineSize) {
|
|
648
|
-
throw new Error("Please ensure you have included all localized strings for all locales in your configuration file.");
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
var descsWrongLength = Object.values(config.release.catalog).map(function(x) {
|
|
652
|
-
return x.short_description;
|
|
653
|
-
}).filter(function(desc) {
|
|
654
|
-
return !(desc === null || desc === void 0 ? void 0 : desc.length) || desc.length > 30;
|
|
655
|
-
});
|
|
656
|
-
if (descsWrongLength.length > 0) {
|
|
657
|
-
throw new Error("Please ensure all translations of short_description are between 0 and 30 characters");
|
|
658
|
-
}
|
|
659
|
-
};
|
|
660
|
-
var checkIconDimensions = function(iconPath) {
|
|
661
|
-
return _async_to_generator(function() {
|
|
662
|
-
var size, _size_width;
|
|
663
|
-
return _ts_generator(this, function(_state) {
|
|
664
|
-
switch(_state.label){
|
|
665
|
-
case 0:
|
|
666
|
-
return [
|
|
667
|
-
4,
|
|
668
|
-
runImgSize(iconPath)
|
|
669
|
-
];
|
|
670
|
-
case 1:
|
|
671
|
-
size = _state.sent();
|
|
672
|
-
return [
|
|
673
|
-
2,
|
|
674
|
-
(size === null || size === void 0 ? void 0 : size.width) != (size === null || size === void 0 ? void 0 : size.height) || ((_size_width = size === null || size === void 0 ? void 0 : size.width) !== null && _size_width !== void 0 ? _size_width : 0) != 512
|
|
675
|
-
];
|
|
676
|
-
}
|
|
677
|
-
});
|
|
678
|
-
})();
|
|
679
|
-
};
|
|
680
|
-
var checkScreenshotDimensions = function(imagePath) {
|
|
681
|
-
return _async_to_generator(function() {
|
|
682
|
-
var size, _size_width, _size_height;
|
|
683
|
-
return _ts_generator(this, function(_state) {
|
|
684
|
-
switch(_state.label){
|
|
685
|
-
case 0:
|
|
686
|
-
return [
|
|
687
|
-
4,
|
|
688
|
-
runImgSize(imagePath)
|
|
689
|
-
];
|
|
690
|
-
case 1:
|
|
691
|
-
size = _state.sent();
|
|
692
|
-
return [
|
|
693
|
-
2,
|
|
694
|
-
((_size_width = size === null || size === void 0 ? void 0 : size.width) !== null && _size_width !== void 0 ? _size_width : 0) < 1080 || ((_size_height = size === null || size === void 0 ? void 0 : size.height) !== null && _size_height !== void 0 ? _size_height : 0) < 1080
|
|
695
|
-
];
|
|
696
|
-
}
|
|
697
|
-
});
|
|
698
|
-
})();
|
|
699
|
-
};
|
|
700
|
-
var checkBannerDimensions = function(imagePath) {
|
|
701
|
-
return _async_to_generator(function() {
|
|
702
|
-
var size, _size_width, _size_height;
|
|
703
|
-
return _ts_generator(this, function(_state) {
|
|
704
|
-
switch(_state.label){
|
|
705
|
-
case 0:
|
|
706
|
-
return [
|
|
707
|
-
4,
|
|
708
|
-
runImgSize(imagePath)
|
|
709
|
-
];
|
|
710
|
-
case 1:
|
|
711
|
-
size = _state.sent();
|
|
712
|
-
return [
|
|
713
|
-
2,
|
|
714
|
-
((_size_width = size === null || size === void 0 ? void 0 : size.width) !== null && _size_width !== void 0 ? _size_width : 0) != 1200 || ((_size_height = size === null || size === void 0 ? void 0 : size.height) !== null && _size_height !== void 0 ? _size_height : 0) != 600
|
|
715
|
-
];
|
|
716
|
-
}
|
|
717
|
-
});
|
|
718
|
-
})();
|
|
719
|
-
};
|
|
720
|
-
var checkFeatureGraphicDimensions = function(imagePath) {
|
|
721
|
-
return _async_to_generator(function() {
|
|
722
|
-
var size, _size_width, _size_height;
|
|
723
|
-
return _ts_generator(this, function(_state) {
|
|
724
|
-
switch(_state.label){
|
|
725
|
-
case 0:
|
|
726
|
-
return [
|
|
727
|
-
4,
|
|
728
|
-
runImgSize(imagePath)
|
|
729
|
-
];
|
|
730
|
-
case 1:
|
|
731
|
-
size = _state.sent();
|
|
732
|
-
return [
|
|
733
|
-
2,
|
|
734
|
-
((_size_width = size === null || size === void 0 ? void 0 : size.width) !== null && _size_width !== void 0 ? _size_width : 0) != 1200 || ((_size_height = size === null || size === void 0 ? void 0 : size.height) !== null && _size_height !== void 0 ? _size_height : 0) != 1200
|
|
735
|
-
];
|
|
736
|
-
}
|
|
737
|
-
});
|
|
738
|
-
})();
|
|
739
|
-
};
|
|
740
|
-
var checkVideoDimensions = function(imagePath) {
|
|
741
|
-
return _async_to_generator(function() {
|
|
742
|
-
var size, _size_width, _size_height;
|
|
743
|
-
return _ts_generator(this, function(_state) {
|
|
744
|
-
switch(_state.label){
|
|
745
|
-
case 0:
|
|
746
|
-
return [
|
|
747
|
-
4,
|
|
748
|
-
getVideoDimensions(imagePath)
|
|
749
|
-
];
|
|
750
|
-
case 1:
|
|
751
|
-
size = _state.sent();
|
|
752
|
-
return [
|
|
753
|
-
2,
|
|
754
|
-
((_size_width = size === null || size === void 0 ? void 0 : size.width) !== null && _size_width !== void 0 ? _size_width : 0) < 720 || ((_size_height = size === null || size === void 0 ? void 0 : size.height) !== null && _size_height !== void 0 ? _size_height : 0) < 720
|
|
755
|
-
];
|
|
756
|
-
}
|
|
757
|
-
});
|
|
758
|
-
})();
|
|
759
|
-
};
|
|
760
|
-
var getAndroidDetails = function(aaptDir, apkPath, developerOverridenLocales) {
|
|
761
|
-
return _async_to_generator(function() {
|
|
762
|
-
var stdout, appPackage, versionCode, versionName, minSdk, permissions, locales, isDebuggable, _locales_values, localeArray, localesSrc, _appPackage_, _minSdk_, _versionCode_, _versionName_, _tmp, e;
|
|
763
|
-
return _ts_generator(this, function(_state) {
|
|
764
|
-
switch(_state.label){
|
|
765
|
-
case 0:
|
|
766
|
-
_state.trys.push([
|
|
767
|
-
0,
|
|
768
|
-
3,
|
|
769
|
-
,
|
|
770
|
-
4
|
|
771
|
-
]);
|
|
772
|
-
return [
|
|
773
|
-
4,
|
|
774
|
-
runExec("".concat(aaptDir, '/aapt2 dump badging "').concat(apkPath, '"'))
|
|
775
|
-
];
|
|
776
|
-
case 1:
|
|
777
|
-
stdout = _state.sent().stdout;
|
|
778
|
-
appPackage = new RegExp(AaptPrefixes.packagePrefix + AaptPrefixes.quoteRegex).exec(stdout);
|
|
779
|
-
versionCode = new RegExp(AaptPrefixes.verCodePrefix + AaptPrefixes.quoteRegex).exec(stdout);
|
|
780
|
-
versionName = new RegExp(AaptPrefixes.verNamePrefix + AaptPrefixes.quoteRegex).exec(stdout);
|
|
781
|
-
minSdk = new RegExp(AaptPrefixes.sdkPrefix + AaptPrefixes.quoteRegex).exec(stdout);
|
|
782
|
-
permissions = _to_consumable_array(stdout.matchAll(/(?:uses-permission|uses-permission-sdk-23): name='([^']*)'/g)).flatMap(function(permission) {
|
|
783
|
-
return permission[1];
|
|
784
|
-
});
|
|
785
|
-
locales = new RegExp(AaptPrefixes.localePrefix + AaptPrefixes.quoteNonLazyRegex).exec(stdout);
|
|
786
|
-
isDebuggable = new RegExp(AaptPrefixes.debuggableApkPrefix).exec(stdout);
|
|
787
|
-
if (isDebuggable != null) {
|
|
788
|
-
throw new TypeError("Debug apks are not supported on Solana dApp store.\nSubmit a signed release apk");
|
|
789
|
-
}
|
|
790
|
-
localeArray = Array.from((_locales_values = locales === null || locales === void 0 ? void 0 : locales.values()) !== null && _locales_values !== void 0 ? _locales_values : []);
|
|
791
|
-
if (localeArray.length == 2) {
|
|
792
|
-
localesSrc = localeArray[1];
|
|
793
|
-
localeArray = [
|
|
794
|
-
"en-US"
|
|
795
|
-
].concat(localesSrc.split("' '").slice(1));
|
|
796
|
-
}
|
|
797
|
-
if (permissions.includes("android.permission.INSTALL_PACKAGES") || permissions.includes("android.permission.DELETE_PACKAGES")) {
|
|
798
|
-
showMessage("App requests system app install/delete permission", "Your app requests system install/delete permission which is managed by Solana dApp Store.\nThis app will be not approved for listing on Solana dApp Store.", "error");
|
|
799
|
-
}
|
|
800
|
-
if (permissions.includes("android.permission.REQUEST_INSTALL_PACKAGES") || permissions.includes("android.permission.REQUEST_DELETE_PACKAGES")) {
|
|
801
|
-
showMessage("App requests install or delete permission", "App will be subject to additional security reviews for listing on Solana dApp Store and processing time may be beyond regular review time", "warning");
|
|
802
|
-
}
|
|
803
|
-
if (permissions.includes("com.solanamobile.seedvault.ACCESS_SEED_VAULT") || permissions.includes("com.solanamobile.seedvault.ACCESS_SEED_VAULT_PRIVILEGED")) {
|
|
804
|
-
showMessage("App requests Seed Vault permission", "If this is not a wallet application, your app maybe rejected from listing on Solana dApp Store.", "warning");
|
|
805
|
-
}
|
|
806
|
-
if (developerOverridenLocales == null && localeArray.length >= 60 || (developerOverridenLocales === null || developerOverridenLocales === void 0 ? void 0 : developerOverridenLocales.length) >= 60) {
|
|
807
|
-
showMessage("Excessive language support detected", "The bundle apk claims supports for following locales \n" + localeArray + "\nYou config.yaml claims support for following locales\n" + developerOverridenLocales + "\nIf this release does not support all these locales the release may be rejected\n." + "You can override this list of supported locales in config.yaml" + "\nSee details at https://developer.android.com/guide/topics/resources/multilingual-support#design for configuring the supported locales in your apk file", "warning");
|
|
808
|
-
}
|
|
809
|
-
_tmp = {
|
|
810
|
-
android_package: (_appPackage_ = appPackage === null || appPackage === void 0 ? void 0 : appPackage[1]) !== null && _appPackage_ !== void 0 ? _appPackage_ : "",
|
|
811
|
-
min_sdk: parseInt((_minSdk_ = minSdk === null || minSdk === void 0 ? void 0 : minSdk[1]) !== null && _minSdk_ !== void 0 ? _minSdk_ : "0", 10),
|
|
812
|
-
version_code: parseInt((_versionCode_ = versionCode === null || versionCode === void 0 ? void 0 : versionCode[1]) !== null && _versionCode_ !== void 0 ? _versionCode_ : "0", 10),
|
|
813
|
-
version: (_versionName_ = versionName === null || versionName === void 0 ? void 0 : versionName[1]) !== null && _versionName_ !== void 0 ? _versionName_ : "0"
|
|
814
|
-
};
|
|
815
|
-
return [
|
|
816
|
-
4,
|
|
817
|
-
extractCertFingerprint(aaptDir, apkPath)
|
|
818
|
-
];
|
|
819
|
-
case 2:
|
|
820
|
-
return [
|
|
821
|
-
2,
|
|
822
|
-
(_tmp.cert_fingerprint = _state.sent(), _tmp.permissions = permissions, _tmp.locales = developerOverridenLocales !== null && developerOverridenLocales !== void 0 ? developerOverridenLocales : localeArray, _tmp)
|
|
823
|
-
];
|
|
824
|
-
case 3:
|
|
825
|
-
e = _state.sent();
|
|
826
|
-
if (_instanceof(e, TypeError)) {
|
|
827
|
-
throw e;
|
|
828
|
-
} else {
|
|
829
|
-
throw new Error("There was an error parsing your APK. Please ensure you have installed Java and provided a valid Android tools directory containing AAPT2.\n" + e);
|
|
830
|
-
}
|
|
831
|
-
return [
|
|
832
|
-
3,
|
|
833
|
-
4
|
|
834
|
-
];
|
|
835
|
-
case 4:
|
|
836
|
-
return [
|
|
837
|
-
2
|
|
838
|
-
];
|
|
839
|
-
}
|
|
840
|
-
});
|
|
841
|
-
})();
|
|
842
|
-
};
|
|
843
|
-
export var extractCertFingerprint = function(aaptDir, apkPath) {
|
|
844
|
-
return _async_to_generator(function() {
|
|
845
|
-
var stdout, regex, match;
|
|
846
|
-
return _ts_generator(this, function(_state) {
|
|
847
|
-
switch(_state.label){
|
|
848
|
-
case 0:
|
|
849
|
-
return [
|
|
850
|
-
4,
|
|
851
|
-
runExec("".concat(aaptDir, '/apksigner verify --print-certs -v "').concat(apkPath, '"'))
|
|
852
|
-
];
|
|
853
|
-
case 1:
|
|
854
|
-
stdout = _state.sent().stdout;
|
|
855
|
-
regex = /Signer #1 certificate SHA-256 digest:\s*([a-fA-F0-9]+)/;
|
|
856
|
-
match = stdout.match(regex);
|
|
857
|
-
if (match && match[1]) {
|
|
858
|
-
return [
|
|
859
|
-
2,
|
|
860
|
-
match[1]
|
|
861
|
-
];
|
|
862
|
-
} else {
|
|
863
|
-
throw new Error("Could not obtain cert fingerprint");
|
|
864
|
-
}
|
|
865
|
-
return [
|
|
866
|
-
2
|
|
867
|
-
];
|
|
868
|
-
}
|
|
869
|
-
});
|
|
870
|
-
})();
|
|
871
|
-
};
|
|
872
|
-
export var writeToPublishDetails = function(param) {
|
|
873
|
-
var app = param.app, release = param.release, lastSubmittedVersionOnChain = param.lastSubmittedVersionOnChain, lastUpdatedVersionOnStore = param.lastUpdatedVersionOnStore;
|
|
874
|
-
return _async_to_generator(function() {
|
|
875
|
-
var _release_android_details, _currentConfig_release_android_details, _release_android_details1, _currentConfig_release_android_details1, _release_android_details2, _currentConfig_release_android_details2, _release_android_details3, _currentConfig_release_android_details3, _release_android_details4, _currentConfig_release_android_details4, currentConfig, _app_address, _release_address, _release_android_details_cert_fingerprint, _release_android_details_min_sdk, _release_android_details_version, _release_android_details_version_code, _release_android_details_locales, newConfig;
|
|
876
|
-
return _ts_generator(this, function(_state) {
|
|
877
|
-
switch(_state.label){
|
|
878
|
-
case 0:
|
|
879
|
-
return [
|
|
880
|
-
4,
|
|
881
|
-
loadPublishDetailsWithChecks()
|
|
882
|
-
];
|
|
883
|
-
case 1:
|
|
884
|
-
currentConfig = _state.sent();
|
|
885
|
-
delete currentConfig.publisher.icon;
|
|
886
|
-
delete currentConfig.app.icon;
|
|
887
|
-
newConfig = {
|
|
888
|
-
publisher: _object_spread({}, currentConfig.publisher),
|
|
889
|
-
app: _object_spread_props(_object_spread({}, currentConfig.app), {
|
|
890
|
-
address: (_app_address = app === null || app === void 0 ? void 0 : app.address) !== null && _app_address !== void 0 ? _app_address : currentConfig.app.address
|
|
891
|
-
}),
|
|
892
|
-
release: _object_spread_props(_object_spread({}, currentConfig.release), {
|
|
893
|
-
address: (_release_address = release === null || release === void 0 ? void 0 : release.address) !== null && _release_address !== void 0 ? _release_address : currentConfig.release.address,
|
|
894
|
-
android_details: {
|
|
895
|
-
cert_fingerprint: (_release_android_details_cert_fingerprint = release === null || release === void 0 ? void 0 : (_release_android_details = release.android_details) === null || _release_android_details === void 0 ? void 0 : _release_android_details.cert_fingerprint) !== null && _release_android_details_cert_fingerprint !== void 0 ? _release_android_details_cert_fingerprint : (_currentConfig_release_android_details = currentConfig.release.android_details) === null || _currentConfig_release_android_details === void 0 ? void 0 : _currentConfig_release_android_details.cert_fingerprint,
|
|
896
|
-
min_sdk: (_release_android_details_min_sdk = release === null || release === void 0 ? void 0 : (_release_android_details1 = release.android_details) === null || _release_android_details1 === void 0 ? void 0 : _release_android_details1.min_sdk) !== null && _release_android_details_min_sdk !== void 0 ? _release_android_details_min_sdk : (_currentConfig_release_android_details1 = currentConfig.release.android_details) === null || _currentConfig_release_android_details1 === void 0 ? void 0 : _currentConfig_release_android_details1.min_sdk,
|
|
897
|
-
version: (_release_android_details_version = release === null || release === void 0 ? void 0 : (_release_android_details2 = release.android_details) === null || _release_android_details2 === void 0 ? void 0 : _release_android_details2.version) !== null && _release_android_details_version !== void 0 ? _release_android_details_version : (_currentConfig_release_android_details2 = currentConfig.release.android_details) === null || _currentConfig_release_android_details2 === void 0 ? void 0 : _currentConfig_release_android_details2.version,
|
|
898
|
-
version_code: (_release_android_details_version_code = release === null || release === void 0 ? void 0 : (_release_android_details3 = release.android_details) === null || _release_android_details3 === void 0 ? void 0 : _release_android_details3.version_code) !== null && _release_android_details_version_code !== void 0 ? _release_android_details_version_code : (_currentConfig_release_android_details3 = currentConfig.release.android_details) === null || _currentConfig_release_android_details3 === void 0 ? void 0 : _currentConfig_release_android_details3.version_code,
|
|
899
|
-
locales: (_release_android_details_locales = release === null || release === void 0 ? void 0 : (_release_android_details4 = release.android_details) === null || _release_android_details4 === void 0 ? void 0 : _release_android_details4.locales) !== null && _release_android_details_locales !== void 0 ? _release_android_details_locales : (_currentConfig_release_android_details4 = currentConfig.release.android_details) === null || _currentConfig_release_android_details4 === void 0 ? void 0 : _currentConfig_release_android_details4.locales
|
|
900
|
-
}
|
|
901
|
-
}),
|
|
902
|
-
solana_mobile_dapp_publisher_portal: currentConfig.solana_mobile_dapp_publisher_portal,
|
|
903
|
-
lastSubmittedVersionOnChain: lastSubmittedVersionOnChain !== null && lastSubmittedVersionOnChain !== void 0 ? lastSubmittedVersionOnChain : currentConfig.lastSubmittedVersionOnChain,
|
|
904
|
-
lastUpdatedVersionOnStore: lastUpdatedVersionOnStore !== null && lastUpdatedVersionOnStore !== void 0 ? lastUpdatedVersionOnStore : currentConfig.lastUpdatedVersionOnStore
|
|
905
|
-
};
|
|
906
|
-
fs.writeFileSync(Constants.getConfigFilePath(), dump(newConfig, {
|
|
907
|
-
lineWidth: -1
|
|
908
|
-
}));
|
|
909
|
-
return [
|
|
910
|
-
2
|
|
911
|
-
];
|
|
912
|
-
}
|
|
913
|
-
});
|
|
914
|
-
})();
|
|
915
|
-
};
|