fix(cli): align local paths and SQLite selection validation (#9882)

fix(cli): batch of small fixes for #9714, #9718, #9759, #9856 and #9809

#9714: replace bare z.string().min(1) local paths in ADB CLI commands with localPathStringSchema so NUL bytes are rejected at the CLI boundary.
#9718: decode-android-resources path uses localPathStringSchema, matching apktoolInputSchemas.
#9759: inspect-sqlite-database CLI options now reject an empty column array and reject rowLimit/rowOffset/column/schemaScope=selected_table without --table via superRefine, mirroring inspectSqliteDatabaseInputSchema.
#9856 and #9809: shared snapshotSelectionOption is now localPathStringSchema.optional(), so every analyze/inspect/decompile/xrefs/trace/function/instructions/search --snapshot rejects NUL bytes.

Tests: tests/boundary/cli/overnightBatch1CliSchemas.test.ts (15 tests) proves empty/NUL input returns VALIDATION_ERROR before any provider runs and valid input is admitted.

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
Phonandmorluto authored and GitHub committed 2026-11-11 23:40:01 +08:00
1 parent dcdae13543
commit 2fe0c9eb6a
6 files changed
+411 -70

No files matched your search

+4 -7
View File
@@ -9,6 +9,7 @@ import {
cliDecimalField,
directAnalysisOptionsFromCli,
nativeOpenOptionFields,
snapshotSelectionOption,
} from "./options.js";
import { decompileDirectoryInputSchema } from "../contracts/decompileDirectory.js";
import type { CliInstance } from "./types.js";
@@ -72,13 +73,9 @@ export const registerDecompileDirectoryCommand = (
).describe(
"Maximum functions to attempt after skipping verified files and recorded external functions",
),
snapshot: z
.string()
.min(1)
.optional()
.describe(
"Load a local analysis snapshot. decompile-all does not update it.",
),
snapshot: snapshotSelectionOption.describe(
"Load a local analysis snapshot. decompile-all does not update it.",
),
...nativeOpenOptionFields,
}),
run: ({ args, options }) =>