@solana-mobile/dapp-store-cli 0.6.1 → 0.7.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/lib/CliUtils.js CHANGED
@@ -159,7 +159,7 @@ export var Constants = function Constants() {
159
159
  "use strict";
160
160
  _class_call_check(this, Constants);
161
161
  };
162
- _define_property(Constants, "CLI_VERSION", "0.6.1");
162
+ _define_property(Constants, "CLI_VERSION", "0.7.1");
163
163
  _define_property(Constants, "CONFIG_FILE_NAME", "config.yaml");
164
164
  _define_property(Constants, "DEFAULT_RPC_DEVNET", "https://api.devnet.solana.com");
165
165
  _define_property(Constants, "getConfigFilePath", function() {
@@ -125,7 +125,7 @@ function _ts_generator(thisArg, body) {
125
125
  import { Connection } from "@solana/web3.js";
126
126
  import { publishSubmit } from "@solana-mobile/dapp-store-publishing-tools";
127
127
  import nacl from "tweetnacl";
128
- import { checkMintedStatus } from "../../CliUtils.js";
128
+ import { checkMintedStatus, showMessage } from "../../CliUtils.js";
129
129
  import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
130
130
  export var publishSubmitCommand = function() {
131
131
  var _ref = _async_to_generator(function(param) {
@@ -134,6 +134,7 @@ export var publishSubmitCommand = function() {
134
134
  switch(_state.label){
135
135
  case 0:
136
136
  appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, signer = param.signer, url = param.url, _param_dryRun = param.dryRun, dryRun = _param_dryRun === void 0 ? false : _param_dryRun, _param_compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, compliesWithSolanaDappStorePolicies = _param_compliesWithSolanaDappStorePolicies === void 0 ? false : _param_compliesWithSolanaDappStorePolicies, _param_requestorIsAuthorized = param.requestorIsAuthorized, requestorIsAuthorized = _param_requestorIsAuthorized === void 0 ? false : _param_requestorIsAuthorized;
137
+ showMessage("Publishing Estimates", "New app submissions take around 3-4 business days for review.", "warning");
137
138
  if (!compliesWithSolanaDappStorePolicies) {
138
139
  console.error("ERROR: Cannot submit a request for which the requestor does not attest that it complies with Solana dApp Store policies");
139
140
  return [
@@ -124,7 +124,7 @@ function _ts_generator(thisArg, body) {
124
124
  }
125
125
  import { Connection } from "@solana/web3.js";
126
126
  import { publishUpdate } from "@solana-mobile/dapp-store-publishing-tools";
127
- import { checkMintedStatus } from "../../CliUtils.js";
127
+ import { checkMintedStatus, showMessage } from "../../CliUtils.js";
128
128
  import nacl from "tweetnacl";
129
129
  import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
130
130
  export var publishUpdateCommand = function() {
@@ -134,6 +134,7 @@ export var publishUpdateCommand = function() {
134
134
  switch(_state.label){
135
135
  case 0:
136
136
  appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, signer = param.signer, url = param.url, _param_dryRun = param.dryRun, dryRun = _param_dryRun === void 0 ? false : _param_dryRun, _param_compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, compliesWithSolanaDappStorePolicies = _param_compliesWithSolanaDappStorePolicies === void 0 ? false : _param_compliesWithSolanaDappStorePolicies, _param_requestorIsAuthorized = param.requestorIsAuthorized, requestorIsAuthorized = _param_requestorIsAuthorized === void 0 ? false : _param_requestorIsAuthorized, _param_critical = param.critical, critical = _param_critical === void 0 ? false : _param_critical;
137
+ showMessage("Publishing Estimates", "App update approvals take around 1-2 business days for review.", "warning");
137
138
  if (!compliesWithSolanaDappStorePolicies) {
138
139
  console.error("ERROR: Cannot submit a request for which the requestor does not attest that it complies with Solana dApp Store policies");
139
140
  return [
@@ -48,6 +48,13 @@ function _define_property(obj, key, value) {
48
48
  }
49
49
  return obj;
50
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
+ }
51
58
  function _iterable_to_array(iter) {
52
59
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
53
60
  }
@@ -221,6 +228,7 @@ var AaptPrefixes = {
221
228
  verCodePrefix: "versionCode=",
222
229
  verNamePrefix: "versionName=",
223
230
  sdkPrefix: "sdkVersion:",
231
+ debuggableApkPrefix: "application-debuggable",
224
232
  localePrefix: "locales: "
225
233
  };
226
234
  var ajv = new Ajv({
@@ -456,7 +464,7 @@ var checkIconDimensions = function() {
456
464
  }();
457
465
  var getAndroidDetails = function() {
458
466
  var _ref = _async_to_generator(function(aaptDir, apkPath) {
459
- var stdout, appPackage, versionCode, versionName, minSdk, permissions, locales, _locales_values, localeArray, localesSrc, _appPackage_, _minSdk_, _versionCode_, _versionName_, _tmp, e;
467
+ var stdout, appPackage, versionCode, versionName, minSdk, permissions, locales, isDebuggable, _locales_values, localeArray, localesSrc, _appPackage_, _minSdk_, _versionCode_, _versionName_, _tmp, e;
460
468
  return _ts_generator(this, function(_state) {
461
469
  switch(_state.label){
462
470
  case 0:
@@ -478,6 +486,10 @@ var getAndroidDetails = function() {
478
486
  minSdk = new RegExp(AaptPrefixes.sdkPrefix + AaptPrefixes.quoteRegex).exec(stdout);
479
487
  permissions = _to_consumable_array(stdout.matchAll(/uses-permission: name='(.*)'/g));
480
488
  locales = new RegExp(AaptPrefixes.localePrefix + AaptPrefixes.quoteNonLazyRegex).exec(stdout);
489
+ isDebuggable = new RegExp(AaptPrefixes.debuggableApkPrefix).exec(stdout);
490
+ if (isDebuggable != null) {
491
+ throw new TypeError("Debug apks are not supported on Solana dApp store.\nSubmit a signed release apk");
492
+ }
481
493
  localeArray = Array.from((_locales_values = locales === null || locales === void 0 ? void 0 : locales.values()) !== null && _locales_values !== void 0 ? _locales_values : []);
482
494
  if (localeArray.length == 2) {
483
495
  localesSrc = localeArray[1];
@@ -507,7 +519,15 @@ var getAndroidDetails = function() {
507
519
  ];
508
520
  case 3:
509
521
  e = _state.sent();
510
- 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);
522
+ if (_instanceof(e, TypeError)) {
523
+ throw e;
524
+ } else {
525
+ 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);
526
+ }
527
+ return [
528
+ 3,
529
+ 4
530
+ ];
511
531
  case 4:
512
532
  return [
513
533
  2
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana-mobile/dapp-store-cli",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -53,7 +53,7 @@
53
53
  "dependencies": {
54
54
  "@aws-sdk/client-s3": "^3.321.1",
55
55
  "@metaplex-foundation/js-plugin-aws": "^0.18.3",
56
- "@solana-mobile/dapp-store-publishing-tools": "workspace:0.6.1",
56
+ "@solana-mobile/dapp-store-publishing-tools": "workspace:0.7.1",
57
57
  "@solana/web3.js": "1.68.0",
58
58
  "@types/semver": "^7.3.13",
59
59
  "ajv": "^8.11.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana-mobile/dapp-store-cli",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -46,7 +46,7 @@
46
46
  "dependencies": {
47
47
  "@aws-sdk/client-s3": "^3.321.1",
48
48
  "@metaplex-foundation/js-plugin-aws": "^0.18.3",
49
- "@solana-mobile/dapp-store-publishing-tools": "0.6.1",
49
+ "@solana-mobile/dapp-store-publishing-tools": "0.7.1",
50
50
  "@solana/web3.js": "1.68.0",
51
51
  "@types/semver": "^7.3.13",
52
52
  "ajv": "^8.11.0",
package/src/CliUtils.ts CHANGED
@@ -18,7 +18,7 @@ import { awsStorage } from "@metaplex-foundation/js-plugin-aws";
18
18
  import { S3StorageManager } from "./config/index.js";
19
19
 
20
20
  export class Constants {
21
- static CLI_VERSION = "0.6.1";
21
+ static CLI_VERSION = "0.7.1";
22
22
  static CONFIG_FILE_NAME = "config.yaml";
23
23
  static DEFAULT_RPC_DEVNET = "https://api.devnet.solana.com";
24
24
 
@@ -2,7 +2,7 @@ import { AccountInfo, Connection, Keypair, PublicKey } from "@solana/web3.js";
2
2
  import type { SignWithPublisherKeypair } from "@solana-mobile/dapp-store-publishing-tools";
3
3
  import { publishSubmit } from "@solana-mobile/dapp-store-publishing-tools";
4
4
  import nacl from "tweetnacl";
5
- import { checkMintedStatus } from "../../CliUtils.js";
5
+ import { checkMintedStatus, showMessage } from "../../CliUtils.js";
6
6
  import { Buffer } from "buffer";
7
7
  import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
8
8
 
@@ -25,6 +25,12 @@ export const publishSubmitCommand = async ({
25
25
  compliesWithSolanaDappStorePolicies = false,
26
26
  requestorIsAuthorized = false,
27
27
  }: PublishSubmitCommandInput) => {
28
+ showMessage(
29
+ `Publishing Estimates`,
30
+ "New app submissions take around 3-4 business days for review.",
31
+ "warning"
32
+ );
33
+
28
34
  if (!compliesWithSolanaDappStorePolicies) {
29
35
  console.error(
30
36
  "ERROR: Cannot submit a request for which the requestor does not attest that it complies with Solana dApp Store policies"
@@ -1,7 +1,7 @@
1
1
  import { Connection, Keypair } from "@solana/web3.js";
2
2
  import type { SignWithPublisherKeypair } from "@solana-mobile/dapp-store-publishing-tools";
3
3
  import { publishUpdate } from "@solana-mobile/dapp-store-publishing-tools";
4
- import { checkMintedStatus } from "../../CliUtils.js";
4
+ import { checkMintedStatus, showMessage } from "../../CliUtils.js";
5
5
  import nacl from "tweetnacl";
6
6
  import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
7
7
 
@@ -26,6 +26,13 @@ export const publishUpdateCommand = async ({
26
26
  requestorIsAuthorized = false,
27
27
  critical = false,
28
28
  }: PublishUpdateCommandInput) => {
29
+
30
+ showMessage(
31
+ `Publishing Estimates`,
32
+ "App update approvals take around 1-2 business days for review.",
33
+ "warning"
34
+ );
35
+
29
36
  if (!compliesWithSolanaDappStorePolicies) {
30
37
  console.error(
31
38
  "ERROR: Cannot submit a request for which the requestor does not attest that it complies with Solana dApp Store policies"
@@ -34,6 +34,7 @@ const AaptPrefixes = {
34
34
  verCodePrefix: "versionCode=",
35
35
  verNamePrefix: "versionName=",
36
36
  sdkPrefix: "sdkVersion:",
37
+ debuggableApkPrefix: "application-debuggable",
37
38
  localePrefix: "locales: ",
38
39
  };
39
40
 
@@ -214,6 +215,13 @@ const getAndroidDetails = async (
214
215
  const locales = new RegExp(
215
216
  AaptPrefixes.localePrefix + AaptPrefixes.quoteNonLazyRegex
216
217
  ).exec(stdout);
218
+ const isDebuggable = new RegExp(
219
+ AaptPrefixes.debuggableApkPrefix
220
+ ).exec(stdout);
221
+
222
+ if (isDebuggable != null) {
223
+ throw new TypeError("Debug apks are not supported on Solana dApp store.\nSubmit a signed release apk")
224
+ }
217
225
 
218
226
  let localeArray = Array.from(locales?.values() ?? []);
219
227
  if (localeArray.length == 2) {
@@ -242,7 +250,11 @@ const getAndroidDetails = async (
242
250
  locales: localeArray
243
251
  };
244
252
  } catch (e) {
245
- 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);
253
+ if (e instanceof TypeError) {
254
+ throw e
255
+ } else {
256
+ 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);
257
+ }
246
258
  }
247
259
  };
248
260