Android Proguard是否从Java源代码中删除注释

Android Proguard是否从Java源代码中删除注释,android,proguard,Android,Proguard,我正在使用下面的proguard android.txt文件中的代码 # This is a configuration file for ProGuard. # http://proguard.sourceforge.net/index.html#manual/usage.html -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -verbose # Optimization is turned off by def

我正在使用下面的proguard android.txt文件中的代码

# This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html

-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose

# Optimization is turned off by default. Dex does not like code run
# through the ProGuard optimize and preverify steps (and performs some
# of these optimizations on its own).
-dontoptimize
-dontpreverify
# Note that if you want to enable optimization, you cannot just
# include optimization flags in your own project configuration file;
# instead you will need to point to the
# "proguard-android-optimize.txt" file instead of this one from your
# project.properties file.

-keepattributes *Annotation*
-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService

# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
    native <methods>;
}

# keep setters in Views so that animations can still work.
# see http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers public class * extends android.view.View {
   void set*(***);
   *** get*();
}

# We want to keep methods in Activity that could be used in the XML attribute onClick
-keepclassmembers class * extends android.app.Activity {
   public void *(android.view.View);
}

# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

-keepclassmembers class **.R$* {
    public static <fields>;
}

# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version.  We know about them, and they are safe.
-dontwarn android.support.**
#这是ProGuard的配置文件。
# http://proguard.sourceforge.net/index.html#manual/usage.html
-dontusemixedcaseclassnames
-DontskipnonPublicLibraryClass
-冗长的
#默认情况下,优化处于关闭状态。Dex不喜欢代码运行
#通过ProGuard优化和预验证步骤(并执行一些
#这些优化的一部分)。
-dontoptimize
-不要翻转
#请注意,如果要启用优化,则不能
#在您自己的项目配置文件中包含优化标志;
#相反,您需要指向
#“proguard android optimize.txt”文件,而不是您的
#project.properties文件。
-keepattributes*注释*
-保持公共类com.google.vending.licensing.ILicensingService
-保持公共类com.android.vending.licensing.ILicensingService
#有关本机方法,请参见http://proguard.sourceforge.net/manual/examples.html#native
-KeepClassSwithMemberNames类*{
本地人;
}
#在视图中保留setter,以便动画仍然可以工作。
#看http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers公共类*扩展了android.view.view{
无效集*(***);
***得到*();
}
#我们希望在活动中保留可以在XML属性onClick中使用的方法
-keepclassmembers类*扩展了android.app.Activity{
public void*(android.view.view);
}
#有关枚举类,请参见http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers枚举*{
公共静态**[]值();
公共静态**valueOf(java.lang.String);
}
-keep class*实现android.os.Parcelable{
公开静态最终android.os.Parcelable$Creator*;
}
-keepclassmembers类**.R$*{
公共静态;
}
#支持库包含对较新平台版本的引用。
#如果此应用程序链接的是较旧的应用程序,请不要警告这些问题
#平台版本。我们知道他们,他们是安全的。
-dontwarn android.support**
混淆Android代码


我的问题当我们在Proguard中使用上述设置时,Proguard是否会删除Java源文件中的所有注释

无论设置如何,ProGuard都不会从源文件中删除任何内容。ProGuard确保编译的文件具有模糊的方法/类名,并尽可能完全剥离适当的方法/类


无论您是否使用ProGuard,编译的Java二进制文件都不包含常规的代码注释。

好吧,有一个半例外用于生成HTML API文档(可以在JAR中分发)。我很确定ProGuard不会做任何想删除或删减JavaDoc HTML的事情。@kabuko在我的例子中,所有
JavaDoc
注释都是从源代码中删除的。我想避免这种情况。你知道怎么做吗?