Skip to content

[gui] Slow check for zip entrynames #2429

@eybisi

Description

@eybisi

Issue details

In Windows, loading apk files with many resource files takes additional time because of the getCanonicalFile function

File canonical = new File(currentPath, entryName).getCanonicalFile();

Following image shows the time that getCanonicalFile took (7sec)
Image
After replacing it with getAbsoluteFile (which doesn't use IO) it took (1sec)
Image

Total load time was 20 sec. 7 seconds makes huge difference.

getCanonicalFile resolves "..", "." and symlinks. In isValidZipEntryName, getCanonicalFile's return value is used to check if entry will be in sub directory of the CWD. Before this ".." is checked. So if we replace it with "getAbsoluteFile" we will be missing only symlinks. If there are no security implications I can create a PR.

Jadx version

dev

Java version

21.0.5

OS

  • Windows
  • Linux
  • macOS

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions