我正在试图保护我的apk文件,通过使用保护程序来防止黑客轻松地解压缩我的代码。我已经在网上学习了很多关于如何做到这一点的教程,但是我的应用程序在我遵循这个建议的时候会崩溃。我所学习的教程是:
Enabling ProGuard in Eclipse for Android
http://proguard.sourceforge.net/manual/examples.html#androidapplication
http://dominoc925.blogspot.com/2013/12/how-to-obfuscate-android-apk-file-using.html
我的源目录中的project.properties文件如下所示:
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-18
android.library.reference.1=..\\appcompat_v7
android.library.reference.2=../../adt-bundle-windows-x86_64-20140702/sdk/extras/google /google_play_services/libproject/google-play-services_lib当我试图导出签名的apk时,控制台中会显示以下错误:
[2014-11-14 12:41:18 - SMART calculator] Proguard returned with error code 1. See console
[2014-11-14 12:41:18 - SMART calculator] proguard.ParseException: Unknown option '(' in argument number 14
[2014-11-14 12:41:18 - SMART calculator] at proguard.ConfigurationParser.parse(ConfigurationParser.java:191)
[2014-11-14 12:41:18 - SMART calculator] at proguard.ProGuard.main(ProGuard.java:484)
[2014-11-14 12:41:29 - SMART calculator] Proguard returned with error code 1. See console第14行是project.properties文件中的line target=Androd-18。
有人能帮我解决这个错误吗?*D
发布于 2014-11-20 11:21:04
我找到了一个快速的解决办法。不要评论这句话
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt在project.properties文件中;清理项目;在测试设备上编译和运行/加载项目约10次。过了一段时间,一个名为Proguard的文件夹将出现在您的主目录中,其中将有4个文本文件。不要用这个文件夹发脾气。当您现在要导出apk时,请注释上面的行&您的apk将被导出,而不会遇到任何错误。我试图对导出的apk进行反编译,但是代码似乎受到Proguard的阻碍,很难进行反向工程。
这是一个非常奇怪的解决方案,但它对我的项目有效。
发布于 2014-11-14 12:21:53
proguard.config=proguard-project.txt用这个代替
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txthttps://stackoverflow.com/questions/26928426
复制相似问题