From 08d3d0d3a0e816a2a73fd8224ede86a62e60ed34 Mon Sep 17 00:00:00 2001 From: Peter <304086198+peter-research@users.noreply.github.com> Date: Wed, 14 Oct 2026 13:45:35 +0200 Subject: [PATCH] fix(apktool): report the selected APK in decode refusals --- src/apktool/ApktoolProvider.test.ts | 1 + src/apktool/ApktoolProvider.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/apktool/ApktoolProvider.test.ts b/src/apktool/ApktoolProvider.test.ts index 2796c933be..b61cf7c67f 100644 --- a/src/apktool/ApktoolProvider.test.ts +++ b/src/apktool/ApktoolProvider.test.ts @@ -333,6 +333,7 @@ it("reports apktool's own refusal for undecodable targets", async () => { }); expect(projected).toMatchObject({ code: "unsupported_target" }); expect(projected.message).toContain("Could not decode"); + expect(projected.message).toContain("probe.apk"); }); it("reports a missing launcher as a capability gap with recovery", async () => { diff --git a/src/apktool/ApktoolProvider.ts b/src/apktool/ApktoolProvider.ts index eec08fe433..db693aeea1 100644 --- a/src/apktool/ApktoolProvider.ts +++ b/src/apktool/ApktoolProvider.ts @@ -150,6 +150,7 @@ interface DecodeLimits { const runApktool = async ( operation: string, + targetPath: string, selection: ApktoolCommandSelection, arguments_: readonly string[], limits: DecodeLimits, @@ -249,7 +250,7 @@ const runApktool = async ( return err( new AnalysisUnsupportedTargetError( operation, - selection.command, + targetPath, output?.stderr.text.trim().slice(0, STDERR_EXCERPT_BYTES) || `apktool exited with code ${String(output?.exitCode ?? "unknown")} for ${operation}`, { @@ -641,6 +642,7 @@ export class ApktoolProvider { await mkdir(framework); const decoded = await runApktool( operation, + input.path, selection, [ "d",