Files
reverse-engineering-anything/src/cli/apkSignatureCommands.ts
T
morluto fa53f7070a refactor(cli): project view-delivery inspectors from their contracts (#10600)
* refactor(cli): project view-delivery inspectors from their contracts

* refactor(cli): project APK signature, desktop application and EVM inspectors from contracts (#10603)
2026-11-15 15:00:24 +08:00

49 lines
1.6 KiB
TypeScript

import type { Logger } from "pino";
import { APK_SIGNATURE_PROVIDER_IDENTITY } from "../apkSignature/ApkSignatureRelease.js";
import { apkSignatureModule } from "../composition/apkSignature.js";
import {
deliverWithService,
registerContractCommand,
} from "./contractCommand.js";
import type { CliInstance } from "./types.js";
/** CLI shares selected delivery and complete-Evidence publication with other artifact tools. */
export const registerApkSignatureCommands = (
cli: CliInstance,
logger: Logger,
environment: Readonly<NodeJS.ProcessEnv>,
): void => {
const deliver = deliverWithService(
() => apkSignatureModule.create(environment),
APK_SIGNATURE_PROVIDER_IDENTITY.id,
);
registerContractCommand(
cli,
logger,
apkSignatureModule.contract,
{
command: apkSignatureModule.cliCommand,
description:
"Inspect declared APK signing schemes, signers and content digests",
positionals: ["path"],
callerPaths: ["path"],
evidenceDelivery: true,
viewDelivery: {
invalidJson: "view must be a JSON APK signature selection",
kind: "apk-signature",
},
fields: {
path: { description: "Selected local APK/ZIP/AAB" },
view: {
description:
"JSON signer/digest/lineage selection; requires --detail summary and --evidence_output",
},
},
},
// The CLI delivers the summary itself, so the service returns complete
// Evidence; the contract's own default would retain a summary instead.
(input, context) => deliver({ ...input, detail: "complete" }, context),
);
};