only52607 / smali2java

vscode extension which allows you to decompile a single smali file into java code
MIT License
48 stars 3 forks source link

error of "Decompile failed: The compiled file is not found" #9

Closed cutelotus closed 2 years ago

cutelotus commented 2 years ago

Hi:

When I use this VS Code extension to convert smali to Java, I find some cases OK, but some cases with a failure "Decompile failed: The compiled file is not found" Does anyone meet the same problem? Does anyone know how to solve it?

Thanks!

only52607 commented 2 years ago

That means that after decompiling with jadx, the decompiled file cannot be found in the output directory.

Could you please upload the smali file with that failing message?

cutelotus commented 2 years ago

Many thanks for the prompt feedback! It happens with files with the names has a "$", for instance, A$b.smali or A$c$1.smali, although there is no such inner class of b or c in Class A. Is it because of this? Sorry I am not able to upload the problematic file. Thanks!

only52607 commented 2 years ago

I tried to decompile smali files like the one below with "$" in the class name and they work fine on my device. The problem doesn't seem to be caused by this. example.zip

cutelotus commented 2 years ago

Thanks! I checked to decompile the smali file you posted, but still in vain. Then it must be problem with my environment. Is there any other setting besides Jadx Path? Also I am not able to see anything in the "OUTPUT" place. Could it be related? But I am able to convert main smali files to Java very much conveniently. Thanks for the cool tool! Thanks!

only52607 commented 2 years ago

There are no other settings. Maybe the problem is related to the version of jadx, are you using the latest version of jadx?

cutelotus commented 2 years ago

Hi: Thanks for the help. I am using the latest version. I found that the problem relates to the MacOS restriction of truncate the "$" in file name so the jadx tool will not find the correct file to convert. You words reminded me that maybe it is because of the folder permission setting, and I changed the folder permission of the jadx tool but not useful. Then I used jadx tool for the smali file conversion then I found that the error message also comes with the file not found and the full file name has been truncated.So I renamed the file and then a successful result. Many thanks for the following-up help. And many thanks for the cool tool too!