Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[gui] Opening apk with added blank space to its filename lead to crash #2244

Closed
1 of 3 tasks
de-served opened this issue Aug 9, 2024 · 4 comments
Closed
1 of 3 tasks
Labels
bug GUI Issues in jadx-gui module

Comments

@de-served
Copy link

Issue details

  1. Copy filepath & filename with ... terminal? file manager? grab more than needed - with additional space after "filename.apk" so buffer will contain "Drive:\Path\filename.apk "
  2. Start jadx-...exe
  3. Insert filename from buffer to open file dialog
  4. Try to execute "open"

java.nio.file.InvalidPathException: Trailing char < > at index 80: D:\Projects\Android\e9ac2df792ef.apk
at java.base/sun.nio.fs.WindowsPathParser.normalize(Unknown Source)
at java.base/sun.nio.fs.WindowsPathParser.parse(Unknown Source)
at java.base/sun.nio.fs.WindowsPathParser.parse(Unknown Source)
at java.base/sun.nio.fs.WindowsPath.parse(Unknown Source)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(Unknown Source)

Jadx version

1.5.0

Java version

22.0.1, 21.x etc

OS

  • Windows
  • Linux
  • macOS
@de-served de-served added bug GUI Issues in jadx-gui module labels Aug 9, 2024
@skylot
Copy link
Owner

skylot commented Aug 9, 2024

This is not a crash, just provide a correct file path.

@skylot skylot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 9, 2024
@de-served
Copy link
Author

Maybe just add a trim?
I use Far manager 20+ years
If everyone using it insert filename to commandline with Ctrl-Enter it will add a space at the end awaiting to add any options to commandline.
jadx is the first app for... IDK... 5 years maybe... maybe more... that will react to path with spaces after/before (not inside, of course) as it acts.

@de-served de-served changed the title [gui] Opening apk with added blank space to its filename lead to crahs [gui] Opening apk with added blank space to its filename lead to crash Aug 9, 2024
@skylot
Copy link
Owner

skylot commented Aug 9, 2024

Maybe just add a trim?

Done.
@de-served please check latest unstable build.
In fix, trailing spaces removed only for files opened with file dialog.
This issue is only appearing in Windows. Linux implementation of File.toPath() do not check for trailing spaces.
Although, all systems allow having files with trailing spaces.
So jadx now made changes to input paths that can be considered an issue like this 🤣

@de-served
Copy link
Author

So jadx now made changes to input paths that can be considered an issue like this

Yep... This is crazy enough (when files/dirs have trailing spaces that is hard to observe if it is at the end)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug GUI Issues in jadx-gui module
Projects
None yet
Development

No branches or pull requests

2 participants