pakstr 0.8.1 → 0.8.3

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.
@@ -37,13 +37,31 @@ class LocalGradleRunner {
37
37
  streamOutput: true,
38
38
  });
39
39
  const artifactPath = requireApk(androidRoot, "release");
40
- const executor = createLocalVerificationExecutor(signing);
41
- const verification = (0, releaseVerification_1.verifyReleaseApk)({
42
- artifactPath,
43
- expectedMetadata: request.expectedMetadata,
44
- signing,
45
- executor,
46
- });
40
+ let verification;
41
+ try {
42
+ const executor = createLocalVerificationExecutor(signing);
43
+ verification = (0, releaseVerification_1.verifyReleaseApk)({
44
+ artifactPath,
45
+ expectedMetadata: request.expectedMetadata,
46
+ signing,
47
+ executor,
48
+ });
49
+ }
50
+ catch (error) {
51
+ const localToolErrors = [
52
+ "Required Android verification tool not found",
53
+ "Android cmdline-tools directory not found",
54
+ "Android build-tools directory not found",
55
+ ];
56
+ if (error instanceof Error &&
57
+ localToolErrors.some(message => error.message.startsWith(message))) {
58
+ console.warn("⚠️ Local release verification skipped: Android verification tools are unavailable.");
59
+ console.warn("ℹ️ Full release verification will still run in Docker/CI.");
60
+ }
61
+ else {
62
+ throw error;
63
+ }
64
+ }
47
65
  return { artifactPath, verification };
48
66
  }
49
67
  }
@@ -67,9 +85,18 @@ function resolveTool(tool, androidHome) {
67
85
  if (tool === "keytool")
68
86
  return "keytool";
69
87
  if (tool === "apkanalyzer") {
70
- const analyzer = path_1.default.join(androidHome, "cmdline-tools", "latest", "bin", "apkanalyzer");
71
- if (!fs_1.default.existsSync(analyzer)) {
72
- throw new Error(`Required Android verification tool not found: ${analyzer}`);
88
+ const cmdlineTools = path_1.default.join(androidHome, "cmdline-tools");
89
+ if (!fs_1.default.existsSync(cmdlineTools)) {
90
+ throw new Error(`Android cmdline-tools directory not found: ${cmdlineTools}`);
91
+ }
92
+ const versions = fs_1.default
93
+ .readdirSync(cmdlineTools)
94
+ .sort((a, b) => b.localeCompare(a, undefined, { numeric: true }));
95
+ const analyzer = versions
96
+ .map(version => path_1.default.join(cmdlineTools, version, "bin", "apkanalyzer"))
97
+ .find(candidate => fs_1.default.existsSync(candidate));
98
+ if (!analyzer) {
99
+ throw new Error(`Required Android verification tool not found under ${cmdlineTools}`);
73
100
  }
74
101
  return analyzer;
75
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pakstr",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "CLI for packaging Nostr web apps into Android APKs",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",