proguard-rules.pro 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Add project specific ProGuard rules here.
  2. # You can control the set of applied configuration files using the
  3. # proguardFiles setting in build.gradle.
  4. #
  5. # For more details, see
  6. # http://developer.android.com/guide/developing/tools/proguard.html
  7. # If your project uses WebView with JS, uncomment the following
  8. # and specify the fully qualified class name to the JavaScript interface
  9. # class:
  10. #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  11. # public *;
  12. #}
  13. # Uncomment this to preserve the line number information for
  14. # debugging stack traces.
  15. #-keepattributes SourceFile,LineNumberTable
  16. # If you keep the line number information, uncomment this to
  17. # hide the original source file name.
  18. #-renamesourcefileattribute SourceFile
  19. # 代码混淆压缩比,在0~7之间,默认为5,一般不做修改
  20. -optimizationpasses 5
  21. # 混合时不使用大小写混合,混合后的类名为小写
  22. -dontusemixedcaseclassnames
  23. # 指定不去忽略非公共库的类
  24. -dontskipnonpubliclibraryclasses
  25. # 这句话能够使我们的项目混淆后产生映射文件
  26. # 包含有类名->混淆后类名的映射关系
  27. -verbose
  28. # 指定不去忽略非公共库的类成员
  29. -dontskipnonpubliclibraryclassmembers
  30. # 不做预校验,preverify是proguard的四个步骤之一,Android不需要preverify,去掉这一步能够加快混淆速度。
  31. -dontpreverify
  32. # 保留Annotation不混淆
  33. -keepattributes *Annotation*,InnerClasses
  34. # 避免混淆泛型
  35. -keepattributes Signature
  36. # 抛出异常时保留代码行号
  37. -keepattributes SourceFile,LineNumberTable
  38. # 指定混淆是采用的算法,后面的参数是一个过滤器
  39. # 这个过滤器是谷歌推荐的算法,一般不做更改
  40. -optimizations !code/simplification/cast,!field/*,!class/merging/*
  41. -keep class com.composition.android.ad.admob.** {*;}
  42. -keep interface com.composition.android.ad.admob.**{*;}