Skip to content

Refactor file path handling and improve output retrieval in JadxDecompiler#16

Open
5y3b wants to merge 1 commit into
only52607:masterfrom
5y3b:fix-file-renames
Open

Refactor file path handling and improve output retrieval in JadxDecompiler#16
5y3b wants to merge 1 commit into
only52607:masterfrom
5y3b:fix-file-renames

Conversation

@5y3b

@5y3b 5y3b commented Jun 10, 2026

Copy link
Copy Markdown

This pull request improves the robustness and reliability of the decompilation process in the JadxDecompiler implementation, particularly around locating the correct output Java file after decompilation. It also fixes a bug in reading file content in the JavaCodeProvider. The most important changes are as follows:

Decompilation Output File Handling:

  • Added a new method findGeneratedOutputFilePath to JadxDecompiler that attempts to locate the generated Java file using several heuristics if the expected file path does not exist, increasing resilience to naming or directory structure changes in Jadx output.
  • Introduced a recursive helper method collectJavaFiles to gather all .java files under the output directory, supporting the new output file search logic.
  • Updated the main decompilation flow to use findGeneratedOutputFilePath instead of directly constructing the output file path, reducing errors when file names or locations are non-standard.
  • Normalized the output file path to use forward slashes on Windows, ensuring compatibility with downstream consumers.

Bug Fixes:

  • Fixed a bug in JavaCodeProvider where file content was being read using uri.path instead of uri.fsPath, which could cause issues on some platforms.
    (if class name is changed because of a bad name, jadx change it and the file name changes so it cant find it, but this fixes it)

…le retrieval in JadxDecompiler

(if class file is changed because if bad name, jadx change it and the file name changes so it cant find it, but this fixes it)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant