Skip to content

fix(apktool): name host requirements in configuration refusals - #1946

Merged
morluto merged 1 commit into
mainfrom
fix/issue-1945
Oct 11, 2026
Merged

morluto merged 1 commit into
mainfrom
fix/issue-1945

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Fixes #1945

Behavior

  • Without an apktool launcher (or with REA_APKTOOL_COMMAND=/nonexistent/apktool), inspect-apktool-client and decode-android-resources used to return the generic "This analysis is unavailable for the current target. Choose another analysis or target." message and remediation. The real reason appeared only in details.reason. The refusal now passes that reason as userMessage, as JADX and the adapters fixed in fix: name host and tool requirements in optional adapter refusals #1224 already do: "The selected apktool launcher was not found: apktool. Set REA_APKTOOL_COMMAND to an absolute apktool launcher (…)."
  • A relative REA_APKTOOL_COMMAND used to escape as {"code":"UNKNOWN"}, because this.selection() ran before the try that maps ApktoolConfigurationFailure. Selection now runs inside that try in both #execute and #inspectAvailability, so it returns capability_unavailable with "REA_APKTOOL_COMMAND must be an absolute path to the apktool launcher."
  • The Windows batch-launcher refusal also carries its reason as userMessage.

The error code, category and details fields are unchanged. details.reason now has sentence punctuation between the failure and its remediation.

Validation

  • tests/boundary/cli/apktoolCli.test.ts: the old case only checked that REA_APKTOOL_COMMAND appeared somewhere in stdout, which details.reason already satisfied. It now checks the message and remediation for both commands, plus the relative-path case. 3 of the 6 cases fail on main and all pass here. All 41 apktool tests (module, CLI, MCP) pass.
  • npm run lint, npm run typecheck, npm run format:check: pass.
  • npm test: 8,271 passed, 12 failed. These are the same 12 that fail on a clean origin/main worktree on this Mac: ibtool NIB tests, the hdiutil verify refusal, and JS runtime discovery paths under /private/var.
  • Not verified against a real apktool installation, or on Windows for the batch-launcher message; these are refusal paths only.

🤖 Generated with Claude Code

A missing apktool launcher projected the generic "unavailable for the
current target" message and remediation, leaving the actual reason only
in details.reason. A relative REA_APKTOOL_COMMAND escaped as UNKNOWN
because command selection ran before the try that maps configuration
failures.

Resolve the selection inside that try for both execution and
availability, and pass the refusal reason as userMessage, as JADX and
the adapters fixed in #1224 do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T19:50:18.926003Z 9655845 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@morluto
morluto merged commit 7cdb798 into main Oct 11, 2026
30 checks passed
@morluto
morluto deleted the fix/issue-1945 branch October 11, 2026 20:13
@github-actions github-actions Bot mentioned this pull request Oct 11, 2026
3 tasks done
return err(
new AnalysisCapabilityUnavailableError(
APKTOOL_PROVIDER_IDENTITY.id,
operation,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take out

{ cause },
reason,
{ cause, userMessage: reason },
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use new coms net

@morluto morluto added the bug Something isn't working label Oct 14, 2026
@morluto morluto added area: setup Setup, packaging, upgrade, install, Doctor, and client registration provider: apktool Analysis provider / engine: apktool labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working provider: apktool Analysis provider / engine: apktool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

apktool refusals show generic target advice, and a relative REA_APKTOOL_COMMAND escapes as UNKNOWN

3 participants