@leonxin/meetgames 0.1.11 → 0.1.13
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 +9 -9
- package/dist/cache.d.ts +44 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +101 -0
- package/dist/cache.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +43 -37
- package/dist/cli.js.map +1 -1
- package/dist/config/meetSdkDefaultConfig.d.ts +1 -1
- package/dist/config/meetSdkDefaultConfig.d.ts.map +1 -1
- package/dist/config/meetSdkDefaultConfig.js +4 -3
- package/dist/config/meetSdkDefaultConfig.js.map +1 -1
- package/dist/config/meetSdkIosConfig.d.ts.map +1 -1
- package/dist/config/meetSdkIosConfig.js +3 -1
- package/dist/config/meetSdkIosConfig.js.map +1 -1
- package/dist/config/meetSdkRemoteConfig.d.ts +1 -0
- package/dist/config/meetSdkRemoteConfig.d.ts.map +1 -1
- package/dist/config/meetSdkRemoteConfig.js +4 -1
- package/dist/config/meetSdkRemoteConfig.js.map +1 -1
- package/dist/contracts/types.d.ts +11 -0
- package/dist/contracts/types.d.ts.map +1 -1
- package/dist/core/doctor.js +7 -7
- package/dist/core/doctor.js.map +1 -1
- package/dist/core/pipeline.d.ts.map +1 -1
- package/dist/core/pipeline.js +3 -0
- package/dist/core/pipeline.js.map +1 -1
- package/dist/core/previewPatches.d.ts +1 -1
- package/dist/core/previewPatches.js +2 -2
- package/dist/core/previewPatches.js.map +1 -1
- package/dist/core/reporter.d.ts.map +1 -1
- package/dist/core/reporter.js +4 -0
- package/dist/core/reporter.js.map +1 -1
- package/dist/core/workspace.d.ts.map +1 -1
- package/dist/core/workspace.js +2 -0
- package/dist/core/workspace.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/ios/channelConfig.js +1 -1
- package/dist/ios/channelConfig.js.map +1 -1
- package/dist/ios/codeUtils.d.ts +1 -0
- package/dist/ios/codeUtils.d.ts.map +1 -1
- package/dist/ios/codeUtils.js +3 -0
- package/dist/ios/codeUtils.js.map +1 -1
- package/dist/ios/integrate.d.ts.map +1 -1
- package/dist/ios/integrate.js +97 -23
- package/dist/ios/integrate.js.map +1 -1
- package/dist/ios/pbxprojEditor.d.ts.map +1 -1
- package/dist/ios/pbxprojEditor.js +123 -6
- package/dist/ios/pbxprojEditor.js.map +1 -1
- package/dist/ios/sdkBundle.d.ts +1 -6
- package/dist/ios/sdkBundle.d.ts.map +1 -1
- package/dist/ios/sdkBundle.js +44 -16
- package/dist/ios/sdkBundle.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +12 -6
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/service.d.ts +3 -0
- package/dist/mcp/service.d.ts.map +1 -1
- package/dist/mcp/service.js +31 -8
- package/dist/mcp/service.js.map +1 -1
- package/dist/ops/handlers.d.ts.map +1 -1
- package/dist/ops/handlers.js +24 -19
- package/dist/ops/handlers.js.map +1 -1
- package/dist/remote/sdkHomeDownload.d.ts +1 -1
- package/dist/remote/sdkHomeDownload.d.ts.map +1 -1
- package/dist/remote/sdkHomeDownload.js +27 -6
- package/dist/remote/sdkHomeDownload.js.map +1 -1
- package/docs/API.md +16 -16
- package/docs/CLI.md +21 -22
- package/docs/INTEGRATION.md +30 -11
- package/docs/MCP.md +1 -1
- package/docs/README.md +0 -1
- package/docs/archive/api/downloadSDKConfig.md +2 -2
- package/docs/archive/api/getChannelConfig-meetgames.md +1 -1
- package/docs/archive/product//351/234/200/346/261/202/346/226/207/346/241/243.md +1 -1
- package/package.json +2 -5
- package/recipes/android-default.yaml +0 -5
- package/recipes/integrate-default.yaml +0 -5
- package/src/cache.ts +164 -0
- package/src/cli.ts +46 -38
- package/src/config/meetSdkDefaultConfig.ts +4 -3
- package/src/config/meetSdkIosConfig.ts +3 -1
- package/src/config/meetSdkRemoteConfig.ts +5 -1
- package/src/contracts/types.ts +11 -0
- package/src/core/doctor.ts +7 -7
- package/src/core/pipeline.ts +3 -0
- package/src/core/previewPatches.ts +2 -2
- package/src/core/reporter.ts +3 -0
- package/src/core/workspace.ts +2 -0
- package/src/index.ts +7 -0
- package/src/ios/channelConfig.ts +1 -1
- package/src/ios/codeUtils.ts +4 -0
- package/src/ios/integrate.ts +110 -27
- package/src/ios/pbxprojEditor.ts +121 -4
- package/src/ios/sdkBundle.ts +41 -18
- package/src/mcp/server.ts +12 -6
- package/src/mcp/service.ts +39 -8
- package/src/ops/handlers.ts +23 -19
- package/src/remote/sdkHomeDownload.ts +28 -7
- package/tests/doctor.test.ts +4 -2
- package/tests/{test-projects-hosts.test.ts → fixtures-hosts.test.ts} +2 -2
- package/tests/ios.sdkBundle.test.ts +10 -5
- package/tests/mcp.e2e.ts +2 -5
- package/tests/meetSdkRemoteConfig.test.ts +25 -0
- package/tests/pipeline.android.test.ts +1 -2
- package/tests/pipeline.ios.test.ts +133 -20
- package/tests/pipeline.preview.patch.test.ts +2 -2
- package/tests/sdkVersionConfig.test.ts +3 -2
- package/dist/aab-converter/aab-entry.d.ts +0 -3
- package/dist/aab-converter/aab-entry.d.ts.map +0 -1
- package/dist/aab-converter/aab-entry.js +0 -49
- package/dist/aab-converter/aab-entry.js.map +0 -1
- package/dist/aab-converter/apksExtractor.d.ts +0 -2
- package/dist/aab-converter/apksExtractor.d.ts.map +0 -1
- package/dist/aab-converter/apksExtractor.js +0 -108
- package/dist/aab-converter/apksExtractor.js.map +0 -1
- package/dist/aab-converter/bundletoolRunner.d.ts +0 -15
- package/dist/aab-converter/bundletoolRunner.d.ts.map +0 -1
- package/dist/aab-converter/bundletoolRunner.js +0 -46
- package/dist/aab-converter/bundletoolRunner.js.map +0 -1
- package/dist/aab-converter/cliArgs.d.ts +0 -27
- package/dist/aab-converter/cliArgs.d.ts.map +0 -1
- package/dist/aab-converter/cliArgs.js +0 -170
- package/dist/aab-converter/cliArgs.js.map +0 -1
- package/dist/aab-converter/convertAabToApk.d.ts +0 -7
- package/dist/aab-converter/convertAabToApk.d.ts.map +0 -1
- package/dist/aab-converter/convertAabToApk.js +0 -69
- package/dist/aab-converter/convertAabToApk.js.map +0 -1
- package/dist/aab-converter/resourcePaths.d.ts +0 -4
- package/dist/aab-converter/resourcePaths.d.ts.map +0 -1
- package/dist/aab-converter/resourcePaths.js +0 -42
- package/dist/aab-converter/resourcePaths.js.map +0 -1
- package/dist/aab-converter/signingOptions.d.ts +0 -9
- package/dist/aab-converter/signingOptions.d.ts.map +0 -1
- package/dist/aab-converter/signingOptions.js +0 -21
- package/dist/aab-converter/signingOptions.js.map +0 -1
- package/dist/aab-converter/types.d.ts +0 -24
- package/dist/aab-converter/types.d.ts.map +0 -1
- package/dist/aab-converter/types.js +0 -2
- package/dist/aab-converter/types.js.map +0 -1
- package/dist/shared/fileUtils.d.ts +0 -5
- package/dist/shared/fileUtils.d.ts.map +0 -1
- package/dist/shared/fileUtils.js +0 -35
- package/dist/shared/fileUtils.js.map +0 -1
- package/dist/shared/logger.d.ts +0 -10
- package/dist/shared/logger.d.ts.map +0 -1
- package/dist/shared/logger.js +0 -37
- package/dist/shared/logger.js.map +0 -1
- package/dist/shared/pathUtils.d.ts +0 -4
- package/dist/shared/pathUtils.d.ts.map +0 -1
- package/dist/shared/pathUtils.js +0 -22
- package/dist/shared/pathUtils.js.map +0 -1
- package/dist/shared/processRunner.d.ts +0 -12
- package/dist/shared/processRunner.d.ts.map +0 -1
- package/dist/shared/processRunner.js +0 -31
- package/dist/shared/processRunner.js.map +0 -1
- package/docs/AAB_CONVERTER_CLI_PLAN.md +0 -392
- package/logs/convert-20260622-155037.log +0 -5
- package/logs/convert-20260622-155226.log +0 -6
- package/scripts/package-aab-cli-win.mjs +0 -193
- package/src/aab-converter/aab-entry.ts +0 -48
- package/src/aab-converter/apksExtractor.ts +0 -119
- package/src/aab-converter/bundletoolRunner.ts +0 -63
- package/src/aab-converter/cliArgs.ts +0 -194
- package/src/aab-converter/convertAabToApk.ts +0 -81
- package/src/aab-converter/resourcePaths.ts +0 -43
- package/src/aab-converter/signingOptions.ts +0 -29
- package/src/aab-converter/types.ts +0 -26
- package/src/shared/fileUtils.ts +0 -41
- package/src/shared/logger.ts +0 -49
- package/src/shared/pathUtils.ts +0 -24
- package/src/shared/processRunner.ts +0 -43
- package/test-projects/README.md +0 -51
- package/test-projects/_preview/pipeline.patch +0 -281
- package/tests/aab-converter.test.ts +0 -213
- /package/{meetsdk-android.json → config/meetsdk-android.json} +0 -0
- /package/{meetsdk-ios.json → config/meetsdk-ios.json} +0 -0
|
@@ -7,14 +7,17 @@ import { loadManifestFile } from "../src/config/loadManifest.js";
|
|
|
7
7
|
import { buildWorkspaceContext } from "../src/core/workspace.js";
|
|
8
8
|
import { runPipeline } from "../src/core/pipeline.js";
|
|
9
9
|
import { detectIOS } from "../src/ios/detect.js";
|
|
10
|
-
import {
|
|
10
|
+
import { resolveIosSdkRootFromDirectory } from "../src/remote/sdkHomeDownload.js";
|
|
11
11
|
|
|
12
12
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
13
13
|
const pkgRoot = path.resolve(here, "..");
|
|
14
14
|
const iosRoot = path.join(pkgRoot, "fixtures", "ios-test-project", "tooltest");
|
|
15
|
+
const nativeSampleRoot = path.join(pkgRoot, "fixtures", "ios-test-project", "native-sample");
|
|
15
16
|
const iosRemoteConfigFixture = path.join(pkgRoot, "fixtures", "meetsdk-remote-config.ios-tooltest.json");
|
|
16
17
|
const hasIosProjectFixture = fs.existsSync(iosRoot);
|
|
18
|
+
const hasNativeSampleFixture = fs.existsSync(nativeSampleRoot);
|
|
17
19
|
const manifest = () => loadManifestFile(path.join(pkgRoot, "recipes", "ios-default.yaml"));
|
|
20
|
+
const fixtureIosSdkRoot = resolveIosSdkRootFromDirectory(path.join(pkgRoot, "fixtures", "ios-sdk", "topSDK-ios--V1.6.0.5"));
|
|
18
21
|
|
|
19
22
|
function writeOfflineRemoteConfig(projectRoot: string): void {
|
|
20
23
|
fs.copyFileSync(iosRemoteConfigFixture, path.join(projectRoot, "meetsdk-remote-config.json"));
|
|
@@ -27,6 +30,53 @@ function copyProjectToTemp(): string {
|
|
|
27
30
|
return tmp;
|
|
28
31
|
}
|
|
29
32
|
|
|
33
|
+
function copyNativeSampleToTemp(): string {
|
|
34
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "meet-ios-native-sample-"));
|
|
35
|
+
fs.cpSync(nativeSampleRoot, tmp, { recursive: true });
|
|
36
|
+
writeNativeSampleRemoteConfig(tmp);
|
|
37
|
+
return tmp;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function writeNativeSampleRemoteConfig(projectRoot: string): void {
|
|
41
|
+
const remote = {
|
|
42
|
+
packageName: "com.meetgames.topsdk.demo",
|
|
43
|
+
channel: "APPLE",
|
|
44
|
+
devicePlatform: "ios",
|
|
45
|
+
topsdk: {
|
|
46
|
+
appId: "mock-ios-native-sample-app-id",
|
|
47
|
+
appSecret: "mock-ios-native-sample-app-secret-do-not-use-in-production",
|
|
48
|
+
},
|
|
49
|
+
sdkModules: {
|
|
50
|
+
login: {
|
|
51
|
+
guest: {},
|
|
52
|
+
facebook: {
|
|
53
|
+
clientId: "883695101201170",
|
|
54
|
+
scheme: "fb883695101201170",
|
|
55
|
+
secret: "f840b8663b1351ddcb8f6a640cee18c6",
|
|
56
|
+
name: "top-demo",
|
|
57
|
+
openMessenger: "0",
|
|
58
|
+
},
|
|
59
|
+
google: {
|
|
60
|
+
clientId: "396842465987-8sg3ngohnl5f2r8no5etu401ruv6snql.apps.googleusercontent.com",
|
|
61
|
+
scheme: "com.googleusercontent.apps.396842465987-8sg3ngohnl5f2r8no5etu401ruv6snql",
|
|
62
|
+
},
|
|
63
|
+
apple: {},
|
|
64
|
+
},
|
|
65
|
+
payment: {
|
|
66
|
+
googleIap: {},
|
|
67
|
+
},
|
|
68
|
+
analytics: {
|
|
69
|
+
appsflyer: {
|
|
70
|
+
devKey: "af-dev-key",
|
|
71
|
+
appleAppId: "123456789",
|
|
72
|
+
enableDebugLog: true,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
fs.writeFileSync(path.join(projectRoot, "meetsdk-remote-config.json"), JSON.stringify(remote, null, 2), "utf8");
|
|
78
|
+
}
|
|
79
|
+
|
|
30
80
|
function pbxBuildFileRefErrors(pbx: string): string[] {
|
|
31
81
|
const fileRefs = new Set<string>();
|
|
32
82
|
for (const match of pbx.matchAll(/^\s*([A-F0-9]{24}) \/\* .* \*\/ = \{isa = PBXFileReference;/gm)) {
|
|
@@ -47,11 +97,14 @@ function plannedIosAsset(patch: string, binaryCopies: Array<{ relTo: string }>,
|
|
|
47
97
|
return patch.includes(name) || binaryCopies.some((c) => c.relTo.includes(name));
|
|
48
98
|
}
|
|
49
99
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
100
|
+
function testIosContext(projectRoot: string) {
|
|
101
|
+
return buildWorkspaceContext(projectRoot, pkgRoot, { iosSdkRoot: fixtureIosSdkRoot });
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
describe("pipeline ios fixture SDK", () => {
|
|
105
|
+
it("resolves TopSDK iOS fixture package", () => {
|
|
106
|
+
expect(fs.existsSync(path.join(fixtureIosSdkRoot, "sdk", "topsdkConfig.t.json"))).toBe(true);
|
|
107
|
+
expect(fs.existsSync(path.join(fixtureIosSdkRoot, "plugins", "GuestSignin", "config.t.json"))).toBe(true);
|
|
55
108
|
});
|
|
56
109
|
});
|
|
57
110
|
|
|
@@ -76,7 +129,7 @@ describe.skipIf(!hasIosProjectFixture)("pipeline ios fixture", () => {
|
|
|
76
129
|
});
|
|
77
130
|
|
|
78
131
|
it("builds workspace context when project root is the xcodeproj directory", () => {
|
|
79
|
-
const ctx =
|
|
132
|
+
const ctx = testIosContext(path.join(iosRoot, "tooltest.xcodeproj"));
|
|
80
133
|
expect(ctx.ios?.ok).toBe(true);
|
|
81
134
|
expect(ctx.ios?.ok && ctx.ios.xcodeprojPath).toBe(path.join(iosRoot, "tooltest.xcodeproj"));
|
|
82
135
|
});
|
|
@@ -84,7 +137,7 @@ describe.skipIf(!hasIosProjectFixture)("pipeline ios fixture", () => {
|
|
|
84
137
|
it("dry-run: plans TOPCore + GuestSignin frameworks and pbxproj edits", async () => {
|
|
85
138
|
const tmp = copyProjectToTemp();
|
|
86
139
|
try {
|
|
87
|
-
const ctx =
|
|
140
|
+
const ctx = testIosContext(tmp);
|
|
88
141
|
expect(ctx.ios?.ok).toBe(true);
|
|
89
142
|
const { report, patch, binaryCopies } = await runPipeline(ctx, manifest(), { dryRun: true });
|
|
90
143
|
expect(report.errors).toEqual([]);
|
|
@@ -101,7 +154,7 @@ describe.skipIf(!hasIosProjectFixture)("pipeline ios fixture", () => {
|
|
|
101
154
|
it("apply: copies SDK, updates pbxproj, injects AppDelegate", async () => {
|
|
102
155
|
const tmp = copyProjectToTemp();
|
|
103
156
|
try {
|
|
104
|
-
const ctx =
|
|
157
|
+
const ctx = testIosContext(tmp);
|
|
105
158
|
const { report } = await runPipeline(ctx, manifest(), { dryRun: false });
|
|
106
159
|
expect(report.errors).toEqual([]);
|
|
107
160
|
|
|
@@ -113,8 +166,12 @@ describe.skipIf(!hasIosProjectFixture)("pipeline ios fixture", () => {
|
|
|
113
166
|
const pbx = fs.readFileSync(path.join(tmp, "tooltest.xcodeproj", "project.pbxproj"), "utf8");
|
|
114
167
|
expect(pbx).toContain("TOPCore.framework");
|
|
115
168
|
expect(pbx).toContain("TOPGuestSigninPlugin.framework");
|
|
116
|
-
expect(pbx).toContain("-ObjC");
|
|
117
|
-
expect(
|
|
169
|
+
expect(pbx).toContain('"-ObjC"');
|
|
170
|
+
expect(pbx).toContain('"-lc++"');
|
|
171
|
+
expect(pbx).not.toMatch(/\n\s+-ObjC,/);
|
|
172
|
+
expect(pbx).not.toMatch(/\n\s+-lc\+\+,/);
|
|
173
|
+
expect(pbxBuildFileRefErrors(pbx).filter((e) => /TOP|FBSDK|Google|AppsFlyer|TopSDKInstall/.test(e))).toEqual([]);
|
|
174
|
+
expect(pbx).not.toMatch(/\bundefined;/);
|
|
118
175
|
|
|
119
176
|
const delegate = fs.readFileSync(path.join(tmp, "tooltest", "AppDelegate.m"), "utf8");
|
|
120
177
|
expect(delegate).toContain("#import <TOPSDK/TopSDK.h>");
|
|
@@ -143,7 +200,7 @@ describe.skipIf(!hasIosProjectFixture)("pipeline ios fixture", () => {
|
|
|
143
200
|
};
|
|
144
201
|
fs.writeFileSync(configPath, JSON.stringify(remote, null, 2), "utf8");
|
|
145
202
|
|
|
146
|
-
const ctx =
|
|
203
|
+
const ctx = testIosContext(tmp);
|
|
147
204
|
const { report } = await runPipeline(ctx, manifest(), { dryRun: false });
|
|
148
205
|
expect(report.errors).toEqual([]);
|
|
149
206
|
|
|
@@ -235,7 +292,7 @@ describe.skipIf(!hasIosProjectFixture)("pipeline ios fixture", () => {
|
|
|
235
292
|
};
|
|
236
293
|
fs.writeFileSync(configPath, JSON.stringify(remote, null, 2), "utf8");
|
|
237
294
|
|
|
238
|
-
const ctx =
|
|
295
|
+
const ctx = testIosContext(tmp);
|
|
239
296
|
const { report, patch, binaryCopies } = await runPipeline(ctx, manifest(), { dryRun: true });
|
|
240
297
|
expect(report.errors).toEqual([]);
|
|
241
298
|
expect(report.warnings.join("\n")).not.toContain("Discord");
|
|
@@ -284,13 +341,12 @@ describe.skipIf(!hasIosProjectFixture)("pipeline ios fixture", () => {
|
|
|
284
341
|
};
|
|
285
342
|
fs.writeFileSync(configPath, JSON.stringify(remote, null, 2), "utf8");
|
|
286
343
|
|
|
287
|
-
const ctx =
|
|
288
|
-
const { report, patch } = await runPipeline(ctx, manifest(), { dryRun: true });
|
|
344
|
+
const ctx = testIosContext(tmp);
|
|
345
|
+
const { report, patch, binaryCopies } = await runPipeline(ctx, manifest(), { dryRun: true });
|
|
289
346
|
|
|
290
347
|
expect(report.errors).toEqual([]);
|
|
291
348
|
expect(report.warnings.join("\n")).toContain("would download GoogleService-Info.plist to tooltest/GoogleService-Info.plist");
|
|
292
|
-
expect(patch
|
|
293
|
-
expect(patch).toContain("GoogleService-Info.plist");
|
|
349
|
+
expect(plannedIosAsset(patch, binaryCopies, "TOPDataFirebasePlugin.framework")).toBe(true);
|
|
294
350
|
} finally {
|
|
295
351
|
fs.rmSync(tmp, { recursive: true, force: true });
|
|
296
352
|
}
|
|
@@ -324,7 +380,7 @@ describe.skipIf(!hasIosProjectFixture)("pipeline ios fixture", () => {
|
|
|
324
380
|
"utf8"
|
|
325
381
|
);
|
|
326
382
|
|
|
327
|
-
const ctx =
|
|
383
|
+
const ctx = testIosContext(tmp);
|
|
328
384
|
const { report } = await runPipeline(ctx, manifest(), { dryRun: false });
|
|
329
385
|
expect(report.errors).toEqual([]);
|
|
330
386
|
|
|
@@ -351,7 +407,7 @@ describe.skipIf(!hasIosProjectFixture)("pipeline ios fixture", () => {
|
|
|
351
407
|
try {
|
|
352
408
|
fs.rmSync(path.join(tmp, "tooltest", "Info.plist"));
|
|
353
409
|
|
|
354
|
-
const ctx =
|
|
410
|
+
const ctx = testIosContext(tmp);
|
|
355
411
|
const { report } = await runPipeline(ctx, manifest(), { dryRun: true });
|
|
356
412
|
|
|
357
413
|
expect(report.errors.join("\n")).toContain("Info.plist not found for iOS target tooltest");
|
|
@@ -372,7 +428,7 @@ describe.skipIf(!hasIosProjectFixture)("pipeline ios fixture", () => {
|
|
|
372
428
|
};
|
|
373
429
|
fs.writeFileSync(configPath, JSON.stringify(remote, null, 2), "utf8");
|
|
374
430
|
|
|
375
|
-
const ctx =
|
|
431
|
+
const ctx = testIosContext(tmp);
|
|
376
432
|
const { report } = await runPipeline(ctx, manifest(), { dryRun: false });
|
|
377
433
|
expect(report.errors.join("\n")).toContain("iOS remote config missing required channel params");
|
|
378
434
|
expect(report.errors.join("\n")).toContain("GoogleSignin: GOOGLE.scheme");
|
|
@@ -383,3 +439,60 @@ describe.skipIf(!hasIosProjectFixture)("pipeline ios fixture", () => {
|
|
|
383
439
|
}
|
|
384
440
|
});
|
|
385
441
|
});
|
|
442
|
+
|
|
443
|
+
describe.skipIf(!hasNativeSampleFixture)("pipeline ios native-sample parity", () => {
|
|
444
|
+
it("apply: mirrors topsdk-tool-ios logs and integration points for native-sample", async () => {
|
|
445
|
+
const tmp = copyNativeSampleToTemp();
|
|
446
|
+
try {
|
|
447
|
+
const ctx = testIosContext(tmp);
|
|
448
|
+
const { report } = await runPipeline(ctx, manifest(), { dryRun: false });
|
|
449
|
+
expect(report.errors).toEqual([]);
|
|
450
|
+
|
|
451
|
+
const logs = (report.logs ?? []).join("\n");
|
|
452
|
+
expect(logs).toContain(`*** 项目根目录:${tmp} ***`);
|
|
453
|
+
expect(logs).toContain("- 插件:GuestSignin, 类型:1,版本:1.6.0.3");
|
|
454
|
+
expect(logs).toContain("SUCCESS: 插件UI接入完成");
|
|
455
|
+
expect(logs).toContain("SUCCESS: 导入三方依赖framework TOPFacebookSigninPlugin.framework 完成");
|
|
456
|
+
expect(logs).toContain("SUCCESS: BuildSetting设置VALIDATE_WORKSPACE为YES 完成");
|
|
457
|
+
expect(logs).toContain("SUCCESS: 未检测到Swift代码文件,自动添加TopSDKInstall.swift完成");
|
|
458
|
+
expect(logs).toContain("SUCCESS: 启用SigninWithApple完成");
|
|
459
|
+
expect(logs).toContain("检测到工程UIApplicationDelegate实现类,将自动接入对应接口");
|
|
460
|
+
expect(logs).toContain("已存在代码#import <TOPSDK/TopSDK.h>");
|
|
461
|
+
expect(logs).toContain("检测到工程存在UIWindowSceneDelegate实现类,将自动接入对应接口");
|
|
462
|
+
expect(logs).toContain("SUCCESS: info.plist配置写入完成");
|
|
463
|
+
expect(logs).toContain("!! 接入流程已全部结束 !!");
|
|
464
|
+
|
|
465
|
+
expect(fs.existsSync(path.join(tmp, "topSDK", "TOPUIPlugin.framework"))).toBe(true);
|
|
466
|
+
expect(fs.existsSync(path.join(tmp, "topSDK", "TOPFacebookSigninPlugin.framework"))).toBe(true);
|
|
467
|
+
expect(fs.existsSync(path.join(tmp, "topSDK", "TOPGoogleSigninPlugin.framework"))).toBe(true);
|
|
468
|
+
expect(fs.existsSync(path.join(tmp, "topSDK", "TOPAppleSigninPlugin.framework"))).toBe(true);
|
|
469
|
+
expect(fs.existsSync(path.join(tmp, "topSDK", "TopSDKSource.bundle"))).toBe(true);
|
|
470
|
+
expect(fs.existsSync(path.join(tmp, "native-sample", "TopSDKInstall.swift"))).toBe(true);
|
|
471
|
+
|
|
472
|
+
const pbx = fs.readFileSync(path.join(tmp, "native-sample.xcodeproj", "project.pbxproj"), "utf8");
|
|
473
|
+
expect(pbx).toContain("TOPUIPlugin.framework");
|
|
474
|
+
expect(pbx).toContain("TOPFacebookSigninPlugin.framework");
|
|
475
|
+
expect(pbx).toContain("TopSDKInstall.swift");
|
|
476
|
+
expect(pbx).toContain("VALIDATE_WORKSPACE = YES");
|
|
477
|
+
expect(pbx).toContain("ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES");
|
|
478
|
+
expect(pbx).toContain("CODE_SIGN_ENTITLEMENTS");
|
|
479
|
+
expect(pbxBuildFileRefErrors(pbx).filter((e) => /TOP|FBSDK|Google|AppsFlyer|TopSDKInstall/.test(e))).toEqual([]);
|
|
480
|
+
|
|
481
|
+
const plist = fs.readFileSync(path.join(tmp, "native-sample", "Info.plist"), "utf8");
|
|
482
|
+
expect(plist).toContain("<key>FacebookAppID</key>");
|
|
483
|
+
expect(plist).toContain("883695101201170");
|
|
484
|
+
expect(plist).toContain("<key>FacebookDisplayName</key>");
|
|
485
|
+
expect(plist).toContain("top-demo");
|
|
486
|
+
expect(plist).toContain("<key>FacebookClientToken</key>");
|
|
487
|
+
expect(plist).toContain("fbapi20130214");
|
|
488
|
+
expect(plist).toContain("com.googleusercontent.apps.396842465987-8sg3ngohnl5f2r8no5etu401ruv6snql");
|
|
489
|
+
expect(plist).toContain("<key>TOPSDK</key>");
|
|
490
|
+
|
|
491
|
+
const entitlements = fs.readFileSync(path.join(tmp, "native-sample", "native-sample.entitlements"), "utf8");
|
|
492
|
+
expect(entitlements).toContain("com.apple.developer.applesignin");
|
|
493
|
+
expect(entitlements).toContain("Default");
|
|
494
|
+
} finally {
|
|
495
|
+
fs.rmSync(tmp, { recursive: true, force: true });
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
});
|
|
@@ -13,7 +13,7 @@ const here = path.dirname(fileURLToPath(import.meta.url));
|
|
|
13
13
|
const pkgRoot = path.resolve(here, "..");
|
|
14
14
|
const fixtureRoot = path.join(pkgRoot, "fixtures", "android-test-project", "android-latest-project");
|
|
15
15
|
const recipeFixtureRoot = path.join(pkgRoot, "fixtures", "recipes");
|
|
16
|
-
const previewPatchPath = path.join(pkgRoot, "
|
|
16
|
+
const previewPatchPath = path.join(pkgRoot, "preview-patches", "pipeline.patch");
|
|
17
17
|
|
|
18
18
|
function stubSdkHomeVersion(): void {
|
|
19
19
|
vi.stubGlobal(
|
|
@@ -54,7 +54,7 @@ describe("pipeline preview patch", () => {
|
|
|
54
54
|
vi.unstubAllGlobals();
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
it("writes
|
|
57
|
+
it("writes preview-patches/pipeline.patch (yaml + integration-json)", async () => {
|
|
58
58
|
const ctx = buildWorkspaceContext(fixtureRoot, pkgRoot);
|
|
59
59
|
expect(ctx.android?.ok).toBe(true);
|
|
60
60
|
|
|
@@ -14,8 +14,9 @@ function makeTempPackageRoot(): string {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
function writeAndroidDefaults(packageRoot: string): void {
|
|
17
|
+
fs.mkdirSync(path.join(packageRoot, "config"), { recursive: true });
|
|
17
18
|
fs.writeFileSync(
|
|
18
|
-
path.join(packageRoot, "meetsdk-android.json"),
|
|
19
|
+
path.join(packageRoot, "config", "meetsdk-android.json"),
|
|
19
20
|
JSON.stringify(
|
|
20
21
|
{
|
|
21
22
|
topsdk: {
|
|
@@ -68,7 +69,7 @@ describe("SDK version package configs", () => {
|
|
|
68
69
|
packageRoot,
|
|
69
70
|
});
|
|
70
71
|
|
|
71
|
-
const stored = JSON.parse(fs.readFileSync(path.join(packageRoot, "meetsdk-android.json"), "utf8")) as {
|
|
72
|
+
const stored = JSON.parse(fs.readFileSync(path.join(packageRoot, "config", "meetsdk-android.json"), "utf8")) as {
|
|
72
73
|
topsdk: { version: string; date: string };
|
|
73
74
|
};
|
|
74
75
|
expect(defaults.topsdk.version).toBe("9.8.7");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aab-entry.d.ts","sourceRoot":"","sources":["../../src/aab-converter/aab-entry.ts"],"names":[],"mappings":";AAcA,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAuB1C"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { UserFacingError, errorMessage } from "../shared/errors.js";
|
|
4
|
-
import { createFileLogger } from "../shared/logger.js";
|
|
5
|
-
import { convertAabToApk } from "./convertAabToApk.js";
|
|
6
|
-
import { parseAabCliArgv, printAabHelp, validateConvertArgs } from "./cliArgs.js";
|
|
7
|
-
import { resolveBundletoolPath, resolveJavaPath, resolveToolRoot } from "./resourcePaths.js";
|
|
8
|
-
const EXIT = {
|
|
9
|
-
OK: 0,
|
|
10
|
-
INVALID_ARGS: 2,
|
|
11
|
-
CONVERT_FAILED: 3,
|
|
12
|
-
};
|
|
13
|
-
export async function main() {
|
|
14
|
-
const parsed = parseAabCliArgv(process.argv);
|
|
15
|
-
if (parsed.help) {
|
|
16
|
-
printAabHelp();
|
|
17
|
-
process.exit(EXIT.OK);
|
|
18
|
-
}
|
|
19
|
-
const toolRoot = resolveToolRoot(import.meta.url);
|
|
20
|
-
const convertArgs = validateConvertArgs(parsed);
|
|
21
|
-
const logger = createFileLogger(path.join(toolRoot, "logs"));
|
|
22
|
-
try {
|
|
23
|
-
const result = await convertAabToApk({
|
|
24
|
-
...convertArgs,
|
|
25
|
-
javaPath: resolveJavaPath(toolRoot),
|
|
26
|
-
bundletoolPath: resolveBundletoolPath(toolRoot),
|
|
27
|
-
logger,
|
|
28
|
-
});
|
|
29
|
-
console.log(`[aab2apk] APK: ${result.apkPath}`);
|
|
30
|
-
if (result.apksPath)
|
|
31
|
-
console.log(`[aab2apk] APKS: ${result.apksPath}`);
|
|
32
|
-
if (result.logPath)
|
|
33
|
-
console.log(`[aab2apk] Log: ${result.logPath}`);
|
|
34
|
-
}
|
|
35
|
-
finally {
|
|
36
|
-
logger.close();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
main().catch((err) => {
|
|
40
|
-
if (err instanceof UserFacingError) {
|
|
41
|
-
console.error(`[aab2apk] ERROR (${err.code}): ${err.message}`);
|
|
42
|
-
if (err.details)
|
|
43
|
-
console.error(err.details);
|
|
44
|
-
process.exit(err.code === "INVALID_ARGS" || err.code === "INVALID_COMMAND" ? EXIT.INVALID_ARGS : EXIT.CONVERT_FAILED);
|
|
45
|
-
}
|
|
46
|
-
console.error(`[aab2apk] ERROR: ${errorMessage(err)}`);
|
|
47
|
-
process.exit(EXIT.CONVERT_FAILED);
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=aab-entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aab-entry.js","sourceRoot":"","sources":["../../src/aab-converter/aab-entry.ts"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,q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AAC,CAAC,GAAY,EAAE,EAAE;IAC5B,IAAI,GAAG,YAAY,eAAe,EAAE,CAAC;QACnC,OAAO,CAAC,KAAK,CAAC,oBAAoB,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QAC/D,IAAI,GAAG,CAAC,OAAO;YAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,cAAc,IAAI,GAAG,CAAC,IAAI,KAAK,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACxH,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,oBAAoB,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACvD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AACpC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apksExtractor.d.ts","sourceRoot":"","sources":["../../src/aab-converter/apksExtractor.ts"],"names":[],"mappings":"AA6GA,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CASpH"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import zlib from "node:zlib";
|
|
4
|
-
import { UserFacingError } from "../shared/errors.js";
|
|
5
|
-
import { assertCanWriteFile } from "../shared/fileUtils.js";
|
|
6
|
-
function readAt(fd, position, length) {
|
|
7
|
-
const buf = Buffer.alloc(length);
|
|
8
|
-
const bytesRead = fs.readSync(fd, buf, 0, length, position);
|
|
9
|
-
return bytesRead === length ? buf : buf.subarray(0, bytesRead);
|
|
10
|
-
}
|
|
11
|
-
function findEndOfCentralDirectory(buf) {
|
|
12
|
-
const signature = 0x06054b50;
|
|
13
|
-
for (let i = buf.length - 22; i >= 0; i -= 1) {
|
|
14
|
-
if (buf.readUInt32LE(i) === signature)
|
|
15
|
-
return i;
|
|
16
|
-
}
|
|
17
|
-
throw new UserFacingError("APKS_INVALID", "Invalid .apks file: end of central directory not found");
|
|
18
|
-
}
|
|
19
|
-
function readZipEntries(apksPath) {
|
|
20
|
-
const fd = fs.openSync(apksPath, "r");
|
|
21
|
-
try {
|
|
22
|
-
const fileSize = fs.fstatSync(fd).size;
|
|
23
|
-
const tailSize = Math.min(fileSize, 0xffff + 22);
|
|
24
|
-
const tailStart = fileSize - tailSize;
|
|
25
|
-
const tail = readAt(fd, tailStart, tailSize);
|
|
26
|
-
const eocd = findEndOfCentralDirectory(tail);
|
|
27
|
-
const totalEntries = tail.readUInt16LE(eocd + 10);
|
|
28
|
-
const centralDirSize = tail.readUInt32LE(eocd + 12);
|
|
29
|
-
const centralDirOffset = tail.readUInt32LE(eocd + 16);
|
|
30
|
-
if (centralDirSize === 0xffffffff || centralDirOffset === 0xffffffff || totalEntries === 0xffff) {
|
|
31
|
-
throw new UserFacingError("APKS_ZIP64_UNSUPPORTED", "ZIP64 .apks files are not supported yet");
|
|
32
|
-
}
|
|
33
|
-
const buf = readAt(fd, centralDirOffset, centralDirSize);
|
|
34
|
-
return parseCentralDirectory(buf, totalEntries);
|
|
35
|
-
}
|
|
36
|
-
finally {
|
|
37
|
-
fs.closeSync(fd);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function parseCentralDirectory(buf, totalEntries) {
|
|
41
|
-
const entries = [];
|
|
42
|
-
let pos = 0;
|
|
43
|
-
for (let i = 0; i < totalEntries; i += 1) {
|
|
44
|
-
if (buf.readUInt32LE(pos) !== 0x02014b50) {
|
|
45
|
-
throw new UserFacingError("APKS_INVALID", "Invalid .apks file: central directory is corrupt");
|
|
46
|
-
}
|
|
47
|
-
const method = buf.readUInt16LE(pos + 10);
|
|
48
|
-
const compressedSize = buf.readUInt32LE(pos + 20);
|
|
49
|
-
const nameLength = buf.readUInt16LE(pos + 28);
|
|
50
|
-
const extraLength = buf.readUInt16LE(pos + 30);
|
|
51
|
-
const commentLength = buf.readUInt16LE(pos + 32);
|
|
52
|
-
const localHeaderOffset = buf.readUInt32LE(pos + 42);
|
|
53
|
-
const name = buf.subarray(pos + 46, pos + 46 + nameLength).toString("utf8");
|
|
54
|
-
entries.push({ name, method, compressedSize, localHeaderOffset });
|
|
55
|
-
pos += 46 + nameLength + extraLength + commentLength;
|
|
56
|
-
}
|
|
57
|
-
return entries;
|
|
58
|
-
}
|
|
59
|
-
async function extractEntryToFile(apksPath, entry, outputApkPath) {
|
|
60
|
-
const fd = fs.openSync(apksPath, "r");
|
|
61
|
-
let dataStart;
|
|
62
|
-
try {
|
|
63
|
-
const localHeader = readAt(fd, entry.localHeaderOffset, 30);
|
|
64
|
-
if (localHeader.readUInt32LE(0) !== 0x04034b50) {
|
|
65
|
-
throw new UserFacingError("APKS_INVALID", `Invalid .apks file: local header not found for ${entry.name}`);
|
|
66
|
-
}
|
|
67
|
-
const nameLength = localHeader.readUInt16LE(26);
|
|
68
|
-
const extraLength = localHeader.readUInt16LE(28);
|
|
69
|
-
dataStart = entry.localHeaderOffset + 30 + nameLength + extraLength;
|
|
70
|
-
}
|
|
71
|
-
finally {
|
|
72
|
-
fs.closeSync(fd);
|
|
73
|
-
}
|
|
74
|
-
await new Promise((resolve, reject) => {
|
|
75
|
-
const input = fs.createReadStream(apksPath, {
|
|
76
|
-
start: dataStart,
|
|
77
|
-
end: dataStart + entry.compressedSize - 1,
|
|
78
|
-
});
|
|
79
|
-
const output = fs.createWriteStream(outputApkPath);
|
|
80
|
-
const source = entry.method === 0
|
|
81
|
-
? input
|
|
82
|
-
: entry.method === 8
|
|
83
|
-
? input.pipe(zlib.createInflateRaw())
|
|
84
|
-
: null;
|
|
85
|
-
if (!source) {
|
|
86
|
-
input.destroy();
|
|
87
|
-
output.destroy();
|
|
88
|
-
reject(new UserFacingError("APKS_UNSUPPORTED_ZIP_METHOD", `Unsupported zip compression method ${entry.method}`));
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
input.on("error", reject);
|
|
92
|
-
source.on("error", reject);
|
|
93
|
-
output.on("error", reject);
|
|
94
|
-
output.on("finish", resolve);
|
|
95
|
-
source.pipe(output);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
export async function extractUniversalApk(apksPath, outputApkPath, overwrite) {
|
|
99
|
-
assertCanWriteFile(outputApkPath, overwrite, "Output APK");
|
|
100
|
-
const entries = readZipEntries(apksPath);
|
|
101
|
-
const universal = entries.find((entry) => entry.name === "universal.apk" || entry.name.endsWith("/universal.apk"));
|
|
102
|
-
if (!universal) {
|
|
103
|
-
throw new UserFacingError("UNIVERSAL_APK_NOT_FOUND", "universal.apk not found in .apks output");
|
|
104
|
-
}
|
|
105
|
-
fs.mkdirSync(path.dirname(outputApkPath), { recursive: true });
|
|
106
|
-
await extractEntryToFile(apksPath, universal, outputApkPath);
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=apksExtractor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apksExtractor.js","sourceRoot":"","sources":["../../src/aab-converter/apksExtractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAS5D,SAAS,MAAM,CAAC,EAAU,EAAE,QAAgB,EAAE,MAAc;IAC1D,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACjC,MAAM,SAAS,GAAG,EAAE,CAAC,QAAQ,CAAC,EAA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,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,eAAe,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACnH,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,eAAe,CAAC,yBAAyB,EAAE,yCAAyC,CAAC,CAAC;IAClG,CAAC;IACD,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/D,MAAM,kBAAkB,CAAC,QAAQ,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Logger } from "../shared/logger.js";
|
|
2
|
-
import type { SigningOptions } from "./types.js";
|
|
3
|
-
export interface BuildApksOptions {
|
|
4
|
-
javaPath: string;
|
|
5
|
-
bundletoolPath: string;
|
|
6
|
-
aabPath: string;
|
|
7
|
-
apksPath: string;
|
|
8
|
-
signing: SigningOptions;
|
|
9
|
-
overwrite: boolean;
|
|
10
|
-
logger?: Logger;
|
|
11
|
-
}
|
|
12
|
-
export declare function buildBundletoolArgs(options: Omit<BuildApksOptions, "javaPath" | "logger">): string[];
|
|
13
|
-
export declare function redactedBundletoolCommand(javaPath: string, args: string[]): string;
|
|
14
|
-
export declare function buildUniversalApks(options: BuildApksOptions): Promise<void>;
|
|
15
|
-
//# sourceMappingURL=bundletoolRunner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundletoolRunner.d.ts","sourceRoot":"","sources":["../../src/aab-converter/bundletoolRunner.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,cAAc,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,QAAQ,CAAC,GAAG,MAAM,EAAE,CAmBpG;AAQD,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAElF;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAejF"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { UserFacingError } from "../shared/errors.js";
|
|
3
|
-
import { runProcess } from "../shared/processRunner.js";
|
|
4
|
-
export function buildBundletoolArgs(options) {
|
|
5
|
-
const args = [
|
|
6
|
-
"-jar",
|
|
7
|
-
options.bundletoolPath,
|
|
8
|
-
"build-apks",
|
|
9
|
-
`--bundle=${options.aabPath}`,
|
|
10
|
-
`--output=${options.apksPath}`,
|
|
11
|
-
"--mode=universal",
|
|
12
|
-
`--ks=${options.signing.keyStorePath}`,
|
|
13
|
-
`--ks-key-alias=${options.signing.keyAlias}`,
|
|
14
|
-
`--ks-pass=pass:${options.signing.keyStorePassword}`,
|
|
15
|
-
];
|
|
16
|
-
if (options.signing.keyPassword) {
|
|
17
|
-
args.push(`--key-pass=pass:${options.signing.keyPassword}`);
|
|
18
|
-
}
|
|
19
|
-
if (options.overwrite) {
|
|
20
|
-
args.push("--overwrite");
|
|
21
|
-
}
|
|
22
|
-
return args;
|
|
23
|
-
}
|
|
24
|
-
function redactArg(arg) {
|
|
25
|
-
if (arg.startsWith("--ks-pass=pass:"))
|
|
26
|
-
return "--ks-pass=pass:******";
|
|
27
|
-
if (arg.startsWith("--key-pass=pass:"))
|
|
28
|
-
return "--key-pass=pass:******";
|
|
29
|
-
return arg;
|
|
30
|
-
}
|
|
31
|
-
export function redactedBundletoolCommand(javaPath, args) {
|
|
32
|
-
return [javaPath, ...args.map(redactArg)].map((part) => (part.includes(" ") ? `"${part}"` : part)).join(" ");
|
|
33
|
-
}
|
|
34
|
-
export async function buildUniversalApks(options) {
|
|
35
|
-
const args = buildBundletoolArgs(options);
|
|
36
|
-
options.logger?.info(`Running bundletool: ${redactedBundletoolCommand(options.javaPath, args)}`);
|
|
37
|
-
const result = await runProcess(options.javaPath, args, {
|
|
38
|
-
cwd: path.dirname(options.apksPath),
|
|
39
|
-
onStdout: (chunk) => options.logger?.info(chunk.trimEnd()),
|
|
40
|
-
onStderr: (chunk) => options.logger?.warn(chunk.trimEnd()),
|
|
41
|
-
});
|
|
42
|
-
if (result.exitCode !== 0) {
|
|
43
|
-
throw new UserFacingError("BUNDLETOOL_FAILED", "bundletool failed to build APK set", (result.stderr || result.stdout).trim());
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=bundletoolRunner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundletoolRunner.js","sourceRoot":"","sources":["../../src/aab-converter/bundletoolRunner.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAcxD,MAAM,UAAU,mBAAmB,CAAC,OAAsD;IACxF,MAAM,IAAI,GAAG;QACX,MAAM;QACN,OAAO,CAAC,cAAc;QACtB,YAAY;QACZ,YAAY,OAAO,CAAC,OAAO,EAAE;QAC7B,YAAY,OAAO,CAAC,QAAQ,EAAE;QAC9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,CAAC,EAAE,CAAC,CAAC;IACjG,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE;QACtD,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC;QACnC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QAC1D,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;KAC3D,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,eAAe,CACvB,mBAAmB,EACnB,oCAAoC,EACpC,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CACxC,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { SigningOptions } from "./types.js";
|
|
2
|
-
export interface ParsedAabCli {
|
|
3
|
-
help: boolean;
|
|
4
|
-
command: string;
|
|
5
|
-
aabPath: string;
|
|
6
|
-
outDir: string;
|
|
7
|
-
keyStorePath: string;
|
|
8
|
-
keyAlias: string;
|
|
9
|
-
keyStorePassword?: string;
|
|
10
|
-
keyPassword?: string;
|
|
11
|
-
apkName?: string;
|
|
12
|
-
keepApks: boolean;
|
|
13
|
-
overwrite: boolean;
|
|
14
|
-
verbose: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare function printAabHelp(): void;
|
|
17
|
-
export declare function parseAabCliArgv(argv: string[]): ParsedAabCli;
|
|
18
|
-
export declare function validateConvertArgs(parsed: ParsedAabCli): {
|
|
19
|
-
aabPath: string;
|
|
20
|
-
outDir: string;
|
|
21
|
-
signing: SigningOptions;
|
|
22
|
-
apkName?: string;
|
|
23
|
-
keepApks: boolean;
|
|
24
|
-
overwrite: boolean;
|
|
25
|
-
verbose: boolean;
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=cliArgs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cliArgs.d.ts","sourceRoot":"","sources":["../../src/aab-converter/cliArgs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB;AAkBD,wBAAgB,YAAY,IAAI,IAAI,CA0BnC;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,YAAY,CAmG5D;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB,CAmBA"}
|