skylot / jadx

Dex to Java decompiler
Apache License 2.0
41.91k stars 4.89k forks source link

[gui] Unable to load available plugins #2312

Closed eybisi closed 1 month ago

eybisi commented 1 month ago

Issue details

When File->Preferences is clicked, close function is triggered for JadxDecompiler.java. Which triggers deleteTempRootDir function introduced in commit and deletes folder /tmp/jadx-temp-xx/jadx-instance-yy. Since available plugin list is downloaded to a location such as "/tmp/jadx-temp-xx/jadx-instance-yy/jadx-temp-zzlist.zip" it fails to create a zip file at that location.

WARN  - Failed to load available plugins list
jadx.core.utils.exceptions.JadxRuntimeException: Failed to create temp file with suffix: list.zip
        at jadx.core.utils.files.FileUtils.createTempFile(FileUtils.java:197)
        at jadx.plugins.tools.JadxPluginsList.fetchBundle(JadxPluginsList.java:123)
        at jadx.plugins.tools.JadxPluginsList.get(JadxPluginsList.java:73)
        at jadx.gui.settings.ui.plugins.PluginSettingsGroup.lambda$loadAvailablePlugins$9(PluginSettingsGroup.java:156)
        at jadx.core.utils.tasks.TaskExecutor.wrapTask(TaskExecutor.java:166)
        at jadx.core.utils.tasks.TaskExecutor.runStages(TaskExecutor.java:142)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.nio.file.NoSuchFileException: /tmp/jadx-temp-16673789307012868507/jadx-instance-17924315190417497755/jadx-tmp-11799294419799672437list.zip
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
        at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
        at java.base/java.nio.file.Files.createFile(Files.java:658)
        at java.base/java.nio.file.TempFileHelper.create(TempFileHelper.java:136)
        at java.base/java.nio.file.TempFileHelper.createTempFile(TempFileHelper.java:159)
        at java.base/java.nio.file.Files.createTempFile(Files.java:878)
        at jadx.core.utils.files.FileUtils.createTempFile(FileUtils.java:193

Removing the FileUtils.deleteTempRootDir(); line works but probably not a correct solution. I think close should not trigger when Preferences is clicked.

Jadx version

dev

Java version

17.0.11

OS

skylot commented 1 month ago

Fixed. Now temp directory will be cleared on decompiler close instead of complete deletion.