Skip to content

Commit

Permalink
Block debuggable apks in CLI tooling.
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur2136 committed Feb 26, 2024
1 parent d4f3c50 commit 2f825cb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/cli/src/config/PublishDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const AaptPrefixes = {
verCodePrefix: "versionCode=",
verNamePrefix: "versionName=",
sdkPrefix: "sdkVersion:",
debuggableApkPrefix: "application-debuggable",
localePrefix: "locales: ",
};

Expand Down Expand Up @@ -214,6 +215,13 @@ const getAndroidDetails = async (
const locales = new RegExp(
AaptPrefixes.localePrefix + AaptPrefixes.quoteNonLazyRegex
).exec(stdout);
const isDebuggable = new RegExp(
AaptPrefixes.debuggableApkPrefix
).exec(stdout);

if (isDebuggable != null) {
throw new TypeError("Debug apks are not supported on Solana dApp store.\nSubmit a signed release apk")
}

let localeArray = Array.from(locales?.values() ?? []);
if (localeArray.length == 2) {
Expand Down Expand Up @@ -242,7 +250,11 @@ const getAndroidDetails = async (
locales: localeArray
};
} catch (e) {
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);
if (e instanceof TypeError) {
throw e
} else {
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);
}
}
};

Expand Down

0 comments on commit 2f825cb

Please sign in to comment.