title: Android: What are the recommended configurations for Proguard?
body: <p>I'm developing apps for Android and using Proguard to obfuscate the code.</p>
  
  <p>Currently i'm using ProGuard configurations:</p>
  
  <pre><code>-optimizationpasses 5
  -dontusemixedcaseclassnames
  -dontskipnonpubliclibraryclasses
  -dontpreverify
  -verbose
  -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
  
  -keep public class * extends android.app.Activity
  -keep public class * extends android.app.Application
  -keep public class * extends android.app.Service
  -keep public class * extends android.content.BroadcastReceiver
  -keep public class * extends android.content.ContentProvider
  -keep public class com.android.vending.licensing.ILicensingService
  </code></pre>
  
  <p>To maintain custom components names that are used on layouts XML:</p>
  
  <pre><code>-keep public class custom.components.**
  </code></pre>
  
  <p>To remove debug logs:</p>
  
  <pre><code>-assumenosideeffects class android.util.Log {
      public static *** d(...);
      public static *** v(...);
  }
  </code></pre>
  
  <p>To avoid changing names of methods invoked on layout's onClick:</p>
  
  <pre><code>-keepclassmembers class * {
   public void onClickButton1(android.view.View);
   public void onClickButton2(android.view.View);
   public void onClickButton3(android.view.View);
  }
  
  -keepclasseswithmembernames class * {
      native &lt;methods&gt;;
  }
  
  -keepclasseswithmembernames class * {
      public &lt;init&gt;(android.content.Context, android.util.AttributeSet);
  }
  
  -keepclasseswithmembernames class * {
      public &lt;init&gt;(android.content.Context, android.util.AttributeSet, int);
  }
  
  -keepclassmembers enum * {
      public static **[] values();
      public static ** valueOf(java.lang.String);
  }
  
  -keep class * implements android.os.Parcelable {
    public static final android.os.Parcelable$Creator *;
  }
  </code></pre>
  
  <p>The question is (are): </p>
  
  <p>Are any other tags recommended? Why and what for?</p>
  
  <p>It's possible to make a comment on a proguard.cfg file? I would like to have it with comments for what some lines are doing so that other developers don't have doubts about why i added.</p>
  
  <p>Also in proguard, is it possible to maintain the comment header of a file (with the copyright)? If it's not, or it's not a good policy where should i add the copyright? </p>