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

关于对 dex 文件扫描出现 "无结果" 或 "Decompilation failed" 的解决方法 #44

Open
ghost opened this issue Jan 18, 2024 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 18, 2024

问题原因:
无结果的原因是,反编译后的文件保存路径与扫描时的文件路径不一致;当使用其他反编译工具对 dex 文件可以正常反编译时,出现 "Decompilation failed" 的原因是,反编译过程中会出现一些方法或类的依赖项扫描错误等情况,导致 "os.system(cmd_str)" 结果返回非 0 而出现 "Decompilation failed" (其中此处的“正常反编译”指的是:使用反编译工具可以反编译出smali等文件,而不是无其他错误出现!)

解决方法:
1、确保dex文件可以正常反编译
1)使用反编译工具进行检查,如jadx、GDA等,也可以使用"..\AppInfoScanner_V1.0.9_Releases\tools\baksmali.jar"工具进行反编译。(一般来说,脱壳后的dex可能存在CheckSum错误的情况,需要计算正确的CheckSum值并修改dex)
2)忽略除反编译失败的其他错误,确保可以正常反编译
2、修改代码
1)修改 "..\AppInfoScanner_V1.0.9_Releases\libs\task\android_task.py" 文件中的 "decode_dex()" 方法,将该方法的所有代码注释
2)将以下三行代码写入 "decode_dex()" 方法
cmd_str = ('java -jar "%s" d "%s" -o "%s"') % (str(backsmali_path), str(file_path), str(output_path))
os.system(cmd_str)
self.__get_scanner_file__(output_path)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants