如何在 Android 2.1/2.2 中混淆 APK
我们知道在 SDK 2.3 中我们可以使用 Proguard 来混淆 APK。
问题是:如何在Andorid 2.1/2.2 SDK中混淆APK?
We know in SDK 2.3 we can obfuscate APK with Proguard.
The question is: How to obfuscate APK in Andorid 2.1/2.2 SDK?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编辑文件(在项目根目录中)project.properties 并添加行
And it did。当您尝试生成应用程序的签名 apk 时,会花费更长的时间,并且会被混淆。
如果您在生成 apk 时收到“转换为 dalvik 错误”,则需要更新 sdk 的 proguard。为此,您需要转到 ProGuard 页面 的下载部分。下载最新的稳定版本并将其内容放入
之前删除现有内容中。
您可以在其页面(链接位于上方)和 Android 的 Proguard 页面查看 Proguard 手册 有关 ProGuard 的更多信息
Edit the file (in the project root) project.propierties and add the line
And its done. When you try to generate the signed apk of your app it will take a little longer and it will be obfuscated.
If you receive the "Conversion to dalvik error" when generating the apk you need to update the proguard of your sdk. For doing it you need to go to the ProGuard page to the download section. Download the last stable version and put it content in
Deleting the existing content before of course.
You can check the Proguard manual at their page (link is above) and the Android's Proguard page for more info about ProGuard
如果你想验证代码是否被混淆,请执行以下操作:
下载:
1.
dex 翻译工具 - http://code.google.com/p/dex2jar/
然后这个查看类的工具:
JDGUI- http://java.decompiler.free.fr/?q=jdgui
2.
安装 dex2jar 后,将其解压缩并记住其所在的文件夹。
使用 winzip 或 winrar 打开 apk 文件。你会在那里看到一个名为classes.dex的文件
将该文件复制到 dex2jar 所在的同一文件夹中(您刚刚下载的 dex 翻译工具)。
3.
在同一文件夹中单击 setclasspath.bat
打开命令提示符并遍历到 dex 转换器所在的同一文件夹并运行:
dex2jar classes.dex
- 现在显示另一个文件。打开JDGUI并打开生成的文件classes_dex2jar.jar ....
4.
您现在可以观察反编译的代码是否被混淆(可读)。
if you want to verify if the code was obfuscated do this:
download:
1.
dex translator tool - http://code.google.com/p/dex2jar/
then this tool to view the classes:
JDGUI- http://java.decompiler.free.fr/?q=jdgui
2.
after you install dex2jar unzip it etc and remember the folder its in.
open up the apk file using winzip or winrar. You'll see a file there called classes.dex
copy that file into the same folder that dex2jar is in (the dex translator tool you just downloaded).
3.
In the same folder click on setclasspath.bat
Open up a command prompt and traverse to the same folder that dex translator is in and run:
dex2jar classes.dex
-another file shows up now. Open up JDGUI and open up the file that got generated its called classes_dex2jar.jar ....
4.
you can observe if the decompiled code is obfuscated(readable) now.