Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Core] Jadx does not decompile layout and menu files and does not recognize the file extension for PNG files, layout files, and menu files #2421

Closed
Beast833 opened this issue Feb 24, 2025 · 19 comments
Labels
bug Core Issues in jadx-core module

Comments

@Beast833
Copy link

Issue details

JADX does not decompile the layout and menu files, and it does not recognize their file extensions. In other resource files where PNG files are used, JADX cannot recognize that they are PNG files and, accordingly, cannot name these files with the .png extension.

apk.zip

Relevant log output or stacktrace

Provide sample and class/method full name

No response

Jadx version

latest nightly version

@Beast833 Beast833 added bug Core Issues in jadx-core module labels Feb 24, 2025
@Beast833 Beast833 changed the title [Core] Jadx does decompile layout and menu files and does not recognize the file extension for PNG files, layout files, and menu files [Core] Jadx does not decompile layout and menu files and does not recognize the file extension for PNG files, layout files, and menu files Feb 24, 2025
@jpstotz
Copy link
Collaborator

jpstotz commented Feb 24, 2025

An APK with 74 class files - impressive...

The original error is the following one, which shows that this issue is closely related to #2420 and #2171:

ERROR: Failed to process zip file: APK Manager.apk.zip:assets/dialog.zip
jadx.core.utils.exceptions.JadxRuntimeException: Failed to process zip file: jadx-temp-11852842577211456062.zip
	at jadx.api.plugins.utils.ZipSecurity.visitZipEntries(ZipSecurity.java:148)
	at jadx.api.plugins.utils.ZipSecurity.readZipEntries(ZipSecurity.java:154)
	at jadx.plugins.input.java.JavaInputLoader.collectFromZip(JavaInputLoader.java:91)
	at jadx.plugins.input.java.JavaInputLoader.loadReader(JavaInputLoader.java:74)
	at jadx.plugins.input.java.JavaInputLoader.lambda$collectFromZip$1(JavaInputLoader.java:98)
	at jadx.api.plugins.utils.ZipSecurity.lambda$readZipEntries$0(ZipSecurity.java:157)
	at jadx.api.plugins.utils.ZipSecurity.visitZipEntries(ZipSecurity.java:136)
	at jadx.api.plugins.utils.ZipSecurity.readZipEntries(ZipSecurity.java:154)
	at jadx.plugins.input.java.JavaInputLoader.collectFromZip(JavaInputLoader.java:91)
	at jadx.plugins.input.java.JavaInputLoader.loadReader(JavaInputLoader.java:71)
	at jadx.plugins.input.java.JavaInputLoader.loadFromFile(JavaInputLoader.java:50)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at jadx.plugins.input.java.JavaInputLoader.collectFiles(JavaInputLoader.java:37)
	at jadx.plugins.input.java.JavaInputPlugin.loadClassFiles(JavaInputPlugin.java:36)
	at jadx.plugins.input.java.JavaInputPlugin.loadClassFiles(JavaInputPlugin.java:32)
	at jadx.api.JadxDecompiler.loadInputFiles(JadxDecompiler.java:156)
	at jadx.api.JadxDecompiler.load(JadxDecompiler.java:120)
	at jadx.gui.JadxWrapper.open(JadxWrapper.java:75)
	at jadx.gui.ui.MainWindow.lambda$loadFiles$3(MainWindow.java:562)
	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.util.zip.ZipException: invalid CEN header (encrypted entry)
	at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1762)
	at java.base/java.util.zip.ZipFile$Source.checkAndAddEntry(ZipFile.java:1212)
	at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1701)
	at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1479)
	at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1441)
	at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:718)
	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:252)
	at jadx.core.utils.files.ZipFile.<init>(ZipFile.java:30)
	at jadx.core.utils.files.ZipFile.<init>(ZipFile.java:18)
	at jadx.core.utils.files.ZipFile.<init>(ZipFile.java:14)
	at jadx.api.plugins.utils.ZipSecurity.visitZipEntries(ZipSecurity.java:130)
	... 30 common frames omitted
``´

@Beast833
Copy link
Author

Beast833 commented Feb 24, 2025

An APK with 74 class files - impressive...

The original error is the following one, which shows that this issue is closely related to #2420 and #2171:

Click to show error message
ERROR: Failed to process zip file: APK Manager.apk.zip:assets/dialog.zip
jadx.core.utils.exceptions.JadxRuntimeException: Failed to process zip file: jadx-temp-11852842577211456062.zip
	at jadx.api.plugins.utils.ZipSecurity.visitZipEntries(ZipSecurity.java:148)
	at jadx.api.plugins.utils.ZipSecurity.readZipEntries(ZipSecurity.java:154)
	at jadx.plugins.input.java.JavaInputLoader.collectFromZip(JavaInputLoader.java:91)
	at jadx.plugins.input.java.JavaInputLoader.loadReader(JavaInputLoader.java:74)
	at jadx.plugins.input.java.JavaInputLoader.lambda$collectFromZip$1(JavaInputLoader.java:98)
	at jadx.api.plugins.utils.ZipSecurity.lambda$readZipEntries$0(ZipSecurity.java:157)
	at jadx.api.plugins.utils.ZipSecurity.visitZipEntries(ZipSecurity.java:136)
	at jadx.api.plugins.utils.ZipSecurity.readZipEntries(ZipSecurity.java:154)
	at jadx.plugins.input.java.JavaInputLoader.collectFromZip(JavaInputLoader.java:91)
	at jadx.plugins.input.java.JavaInputLoader.loadReader(JavaInputLoader.java:71)
	at jadx.plugins.input.java.JavaInputLoader.loadFromFile(JavaInputLoader.java:50)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at jadx.plugins.input.java.JavaInputLoader.collectFiles(JavaInputLoader.java:37)
	at jadx.plugins.input.java.JavaInputPlugin.loadClassFiles(JavaInputPlugin.java:36)
	at jadx.plugins.input.java.JavaInputPlugin.loadClassFiles(JavaInputPlugin.java:32)
	at jadx.api.JadxDecompiler.loadInputFiles(JadxDecompiler.java:156)
	at jadx.api.JadxDecompiler.load(JadxDecompiler.java:120)
	at jadx.gui.JadxWrapper.open(JadxWrapper.java:75)
	at jadx.gui.ui.MainWindow.lambda$loadFiles$3(MainWindow.java:562)
	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.util.zip.ZipException: invalid CEN header (encrypted entry)
	at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1762)
	at java.base/java.util.zip.ZipFile$Source.checkAndAddEntry(ZipFile.java:1212)
	at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1701)
	at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1479)
	at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1441)
	at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:718)
	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:252)
	at jadx.core.utils.files.ZipFile.<init>(ZipFile.java:30)
	at jadx.core.utils.files.ZipFile.<init>(ZipFile.java:18)
	at jadx.core.utils.files.ZipFile.<init>(ZipFile.java:14)
	at jadx.api.plugins.utils.ZipSecurity.visitZipEntries(ZipSecurity.java:130)
	... 30 common frames omitted

I found out why this error occurred while unzipping assets/dialog.zip in APK Manager. The dialog.zip file is password-protected, and the password is 1. When JADX tried to unzip that file, this error occurred.

Screenshot_2025-02-24-19-38-10-690_bin.mt.plus.canary.jpg

@jpstotz
Copy link
Collaborator

jpstotz commented Feb 24, 2025

JADX cannot recognize that they are PNG files and, accordingly, cannot name these files with the .png extension.

Can you please provide the path of the png files within your original APK file that can not be displayed correctly?

@Beast833
Copy link
Author

Beast833 commented Feb 24, 2025

JADX cannot recognize that they are PNG files and, accordingly, cannot name these files with the .png extension.

Can you please provide the path of the png files within your original APK file that can not be displayed correctly?

res/drawable/*.png

res/drawable-*/*.png

@jpstotz
Copy link
Collaborator

jpstotz commented Feb 25, 2025

Sorry I am not able to reproduce your problem. All png files I have looked at were shown as expected. Please provide a screenshot of Jadx with the problem.

@Beast833
Copy link
Author

Use command line interface to reproduce this issue

@Beast833
Copy link
Author

Beast833 commented Mar 3, 2025

@jpstotz Any update???

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 3, 2025

Can you please post the command-line you use for decompiling? I don't use the non-UI version very often.

@Beast833
Copy link
Author

Beast833 commented Mar 3, 2025

I used windows cli

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 3, 2025

I wasn't asking for the used terminal, but for the full Jadx command-line including all arguments you have executed, so I can execute the same detect what is going wrong.

@Beast833
Copy link
Author

Beast833 commented Mar 4, 2025

bin/jadx APK_Manager.apk

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 4, 2025

I can not reproduce your problem using latest version from GIT, the posted APK decompiles fine. I don't see any problem regarding layout and png files.

Please try again using Jadx unstable version..

If you still encounter problems please post the full path of single APK entries and the content you get of this files after decompiling.

@Beast833
Copy link
Author

Beast833 commented Mar 4, 2025

bin/jadx APK_Manager.apk

@jpstotz am using latest unstable version where I first discovered this issue

Here is the decompiled code: APK_Manager.zip

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 8, 2025

@Beast833 Your uploaded file link is broken.

Please also mention the file names of the files inside the ZIP which are not as they should be.

@Beast833
Copy link
Author

Beast833 commented Mar 8, 2025

@Beast833 Your uploaded file link is broken.

Please also mention the file names of the files inside the ZIP which are not as they should be.

No, the link is not broken it works fine for me

JADX does not decompile the layout and menu files, and it does not recognize their file extensions. In other resource files where PNG files are used, JADX cannot recognize that they are PNG files and, accordingly, cannot name these files with the .png extension.

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 8, 2025

Tried it on different systems with multiple web browsers. Only a page "Not found" comes. That file is most likely only accessible for your GitHub account

@Beast833
Copy link
Author

Beast833 commented Mar 8, 2025

Tried it on different systems with multiple web browsers. Only a page "Not found" comes. That file is most likely only accessible for your GitHub account

Okay, try this google drive link: https://drive.google.com/file/d/1hxHgwAnrdkjC2FpRpqpHRMhCHoXULNuD/view?usp=drivesdk

Or GitHub link: APK_Manager.zip

@jpstotz
Copy link
Collaborator

jpstotz commented Mar 9, 2025

Now I understand your problem. If you would have included a screenshot of the decompiled files in your initial post this would have saved us a lot of time. because the problem is simply that the PNG files are not saved with the .png file extension:

Image

The reason seems to be that the command-line Jadx version does not apply deobfuscation by default. Thus if you want Jadx to recover the file names you have to execute bin/jadx --deobf APK_Manager.apk.

@jpstotz jpstotz closed this as completed Mar 9, 2025
@Beast833
Copy link
Author

Beast833 commented Mar 9, 2025

@jpstotz please take a look at its layout files where you will see the layout files are not decompiled and not having any .XML extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core Issues in jadx-core module
Projects
None yet
Development

No branches or pull requests

2 participants