我们需要在工程描述文件default.properties中,添加一句话,启用ProGuard。如下所示:
# 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 use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-8
proguardproguard.config=proguard.cfg
这样,Proguard就可以使用了。当我们正常通过Android Tools导出Application Package时,Proguard就会自动启用,优化混淆你的代码。
# 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 use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-8
proguardproguard.config=proguard.cfg
这样,Proguard就可以使用了。当我们正常通过Android Tools导出Application Package时,Proguard就会自动启用,优化混淆你的代码。