@capgo/cli 8.77.0 → 8.79.0
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 +2 -1
- package/dist/index.js +737 -737
- package/dist/notify-app-ready-worker.js +1 -1
- package/dist/onboarding-worker.js +1 -1
- package/dist/package.json +3 -2
- package/dist/src/api/crypto.d.ts +23 -0
- package/dist/src/build/prescan/checks/ios-plist-checks.d.ts +7 -0
- package/dist/src/bundle/decrypt.d.ts +2 -0
- package/dist/src/channel/set.d.ts +5 -0
- package/dist/src/key/capgoAppIdPrompt.d.ts +22 -0
- package/dist/src/key.d.ts +1 -0
- package/dist/src/sdk.js +357 -357
- package/dist/updater-installed-worker.js +1 -1
- package/package.json +3 -2
- package/skills/native-builds/SKILL.md +1 -1
package/dist/src/api/crypto.d.ts
CHANGED
|
@@ -5,10 +5,33 @@ export declare function generateSessionKey(key: string): {
|
|
|
5
5
|
};
|
|
6
6
|
export declare function encryptSource(source: Buffer, sessionKey: Buffer, ivSessionKey: string): Buffer;
|
|
7
7
|
export declare function decryptSource(source: Buffer, ivSessionKey: string, key: string): Buffer;
|
|
8
|
+
/**
|
|
9
|
+
* Encrypt a checksum with V2 RSA (legacy: treats the digest argument as base64 bytes, not hex).
|
|
10
|
+
* Prefer encryptChecksumV3 for current plugin versions.
|
|
11
|
+
*/
|
|
8
12
|
export declare function encryptChecksum(checksum: string, key: string): string;
|
|
13
|
+
/** Encrypt a SHA-256 hex digest with V3 RSA; ciphertext is hex-encoded. */
|
|
9
14
|
export declare function encryptChecksumV3(checksum: string, key: string): string;
|
|
15
|
+
/** Decrypt a V2 bundle checksum ciphertext (canonical base64) to its plaintext digest string. */
|
|
10
16
|
export declare function decryptChecksum(checksum: string, key: string): string;
|
|
17
|
+
/** Decrypt a V3 bundle checksum ciphertext (hex) to its plaintext digest string. */
|
|
11
18
|
export declare function decryptChecksumV3(checksum: string, key: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Compare a computed SHA-256 hex digest with decrypted checksum plaintext from RSA.
|
|
21
|
+
* V2 plugins expose the digest as base64; V3 uses hex. Both encode the same 32 bytes.
|
|
22
|
+
*/
|
|
23
|
+
export declare function sha256DigestMatchesComputed(computedSha256Hex: string, decryptedPlaintext: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Decrypt a bundle checksum with V3 and V2 RSA encodings. Returns unique plaintext candidates.
|
|
26
|
+
*/
|
|
27
|
+
export declare function decryptChecksumPlaintexts(encryptedChecksum: string, key: string): string[];
|
|
28
|
+
/** Try V2 and V3 RSA checksum decryption and compare each plaintext digest to the zip SHA-256 hex. */
|
|
29
|
+
export declare function verifyDecryptedBundleChecksum(computedSha256Hex: string, encryptedChecksum: string, publicKey: string): {
|
|
30
|
+
matches: boolean;
|
|
31
|
+
decryptedPlaintexts: string[];
|
|
32
|
+
};
|
|
33
|
+
/** Format decrypted checksum plaintext for CLI mismatch errors (hex as-is, base64 with derived hex). */
|
|
34
|
+
export declare function formatDecryptedChecksumForError(decryptedPlaintext: string): string;
|
|
12
35
|
interface RSAKeys {
|
|
13
36
|
publicKey: string;
|
|
14
37
|
privateKey: string;
|
|
@@ -10,3 +10,10 @@ export declare const plistOrientationsPresent: PrescanCheck;
|
|
|
10
10
|
export declare const plistDisplayName: PrescanCheck;
|
|
11
11
|
export declare const plistBackgroundModesSanity: PrescanCheck;
|
|
12
12
|
export declare const plistRequiredDeviceArm64: PrescanCheck;
|
|
13
|
+
/**
|
|
14
|
+
* Apps linked with the iOS 27 SDK (Xcode 27) must adopt the UIScene lifecycle: UIKit stops an
|
|
15
|
+
* app without a scene manifest at launch (EXC_BREAKPOINT in
|
|
16
|
+
* `_UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption`). Only judged when the build
|
|
17
|
+
* explicitly asks for Xcode 27+, since builds on older Xcode are not affected.
|
|
18
|
+
*/
|
|
19
|
+
export declare const plistSceneLifecycleXcode27: PrescanCheck;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { BundleDecryptOptions, DecryptResult } from '../schemas/bundle';
|
|
2
2
|
export type { DecryptResult } from '../schemas/bundle';
|
|
3
|
+
/** Decrypt a Capgo bundle zip and verify its RSA-encrypted checksum against the payload SHA-256. */
|
|
3
4
|
export declare function decryptZipInternal(zipPath: string, ivsessionKey: string, options: BundleDecryptOptions, silent?: boolean): Promise<DecryptResult>;
|
|
5
|
+
/** CLI entry point for bundle zip decryption with interactive logging. */
|
|
4
6
|
export declare function decryptZip(zipPath: string, ivsessionKey: string, options: BundleDecryptOptions): Promise<void>;
|
|
@@ -14,5 +14,10 @@ export declare function rejectOrAcceptIncompatibleChannelBundle(params: {
|
|
|
14
14
|
heading: string;
|
|
15
15
|
errorMessage: string;
|
|
16
16
|
}): void;
|
|
17
|
+
/**
|
|
18
|
+
* A permission denial is a user outcome (CliUserError). Network failures and
|
|
19
|
+
* other API errors stay plain errors so error tracking still captures them.
|
|
20
|
+
*/
|
|
21
|
+
export declare function throwChannelWriteError(error: Error, silent: boolean): Promise<never>;
|
|
17
22
|
export declare function setChannelInternal(channel: string, appId: string, options: OptionsSetChannel, silent?: boolean, showFrame?: boolean): Promise<boolean>;
|
|
18
23
|
export declare function setChannel(channel: string, appId: string, options: OptionsSetChannel): Promise<boolean>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ExtConfigPairs } from '../config';
|
|
2
|
+
export declare const CAPGO_APP_ID_OPT_IN_MESSAGE = "Create a Capgo app with a random app ID and save it as CapacitorUpdater.appId?";
|
|
3
|
+
export interface CapgoAppIdPromptDeps {
|
|
4
|
+
confirm: (message: string) => Promise<boolean | symbol>;
|
|
5
|
+
logSuccess: (message: string) => void;
|
|
6
|
+
logWarn: (message: string) => void;
|
|
7
|
+
loadConfig: () => Promise<ExtConfigPairs>;
|
|
8
|
+
writeConfig: (config: ExtConfigPairs) => Promise<void>;
|
|
9
|
+
findApiKey: () => string | undefined;
|
|
10
|
+
createApp: (appId: string, apikey: string) => Promise<void>;
|
|
11
|
+
generateRandomAppId: () => string;
|
|
12
|
+
}
|
|
13
|
+
export declare function generateRandomCapgoAppId(): string;
|
|
14
|
+
export declare function persistCapgoAppIdToCapacitorConfig(appId: string, deps?: Pick<CapgoAppIdPromptDeps, 'loadConfig' | 'writeConfig' | 'logWarn'>): Promise<boolean>;
|
|
15
|
+
export type OfferCapgoAppIdPromptOutcome = 'skipped' | 'declined' | 'failed' | 'saved';
|
|
16
|
+
export interface OfferCapgoAppIdPromptOptions {
|
|
17
|
+
skip?: boolean;
|
|
18
|
+
silent?: boolean;
|
|
19
|
+
interactive?: boolean;
|
|
20
|
+
deps?: Partial<CapgoAppIdPromptDeps>;
|
|
21
|
+
}
|
|
22
|
+
export declare function offerCapgoAppIdPrompt(options?: OfferCapgoAppIdPromptOptions): Promise<OfferCapgoAppIdPromptOutcome>;
|
package/dist/src/key.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ interface Options {
|
|
|
8
8
|
force?: boolean;
|
|
9
9
|
setupChannel?: boolean;
|
|
10
10
|
keyDir?: string;
|
|
11
|
+
skipCapgoAppIdPrompt?: boolean;
|
|
11
12
|
}
|
|
12
13
|
export declare function saveKeyInternal(options: SaveOptions, silent?: boolean): Promise<boolean>;
|
|
13
14
|
export declare function deleteOldPrivateKeyInternal(options: Options, silent?: boolean): Promise<boolean>;
|