[PR #1946] [MERGED] fix(apktool): name host requirements in configuration refusals #4926

Closed
opened 2026-10-31 00:56:58 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1946
Author: @kaoru0822-kitauji
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @morluto

Base: main ← Head: fix/issue-1945


📝 Commits (1)

  • 9655845 fix(apktool): name host requirements in configuration refusals

📊 Changes

2 files changed (+46 additions, -16 deletions)

View changed files

📝 src/apktool/ApktoolProvider.ts (+15 -9)
📝 tests/boundary/cli/apktoolCli.test.ts (+31 -7)

📄 Description

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 #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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1946 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/11/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/issue-1945` --- ### 📝 Commits (1) - [`9655845`](https://github.com/morluto/rea/commit/9655845bbcbb854565dec04ee878de75ee7ba728) fix(apktool): name host requirements in configuration refusals ### 📊 Changes **2 files changed** (+46 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `src/apktool/ApktoolProvider.ts` (+15 -9) 📝 `tests/boundary/cli/apktoolCli.test.ts` (+31 -7) </details> ### 📄 Description 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 #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](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:56:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#4926
No description provided.