反编译 APK 上的 .smali 文件 [英] Decompile .smali files on an APK
问题描述
我下载了 APK 管理器,它可以让我解压 APK 文件.
I downloaded APK Manager that lets me unpack APK files.
但它只是解压,不会将 .smali 文件反编译为 .java.
But it only unpacks it and doesn't decompile the .smali file to .java.
是否可以将 .smali 反编译为 .java?
Is it possible to decompile the .smali to .java?
推荐答案
不,APK 管理器反编译 .dex
文件到 .smali
和二进制 .xml
到人类可读的 xml.
No, APK Manager decompiles the .dex
file into .smali
and binary .xml
to human readable xml.
顺序(基于APK Manager 4.9)是22选择包,然后9反编译.如果您按 1 而不是 9,那么您只需解压缩它(仅当您想交换 .png 图像时才有用).
The sequence (based on APK Manager 4.9) is 22 to select the package, and then 9 to decompile it. If you press 1 instead of 9, then you will just unpack it (useful only if you want to exchange .png images).
没有可用于反编译回 .java
文件的工具,而且很可能不会有任何工具.还有一种替代方法,就是使用dex2jar 将dex 文件转换为.class
文件,然后使用jar 反编译器(例如免费的jd-gui) 到纯文本 java.然而,这个过程远非最佳,它不会生成工作代码,但它足够体面,能够阅读它.
There is no tool available to decompile back to .java
files and most probably it won't be any. There is an alternative, which is using dex2jar to transform the dex file in to a .class
file, and then use a jar decompiler (such as the free jd-gui) to plain text java. The process is far from optimal, though, and it won't generate working code, but it's decent enough to be able to read it.
dex2jar:https://github.com/pxb1988/dex2jar
jd-gui:http://jd.benow.ca/
我知道这里有一个问题的答案非常相似...... 将 DEX 反编译成 Java 源代码
I knew there was somewhere here in SO a question with very similar answers... decompiling DEX into Java sourcecode
这篇关于反编译 APK 上的 .smali 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!