proguard-project.txt 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. # To enable ProGuard in your project, edit project.properties
  2. # to define the proguard.config property as described in that file.
  3. #
  4. # Add project specific ProGuard rules here.
  5. # By default, the flags in this file are appended to flags specified
  6. # in ${sdk.dir}/tools/proguard/proguard-android.txt
  7. # You can edit the include path and order by changing the ProGuard
  8. # include property in project.properties.
  9. #
  10. # For more details, see
  11. # http://developer.android.com/guide/developing/tools/proguard.html
  12. # Add any project specific keep options here:
  13. # If your project uses WebView with JS, uncomment the following
  14. # and specify the fully qualified class name to the JavaScript interface
  15. # class:
  16. #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  17. # public *;
  18. #}
  19. -dontoptimize
  20. -dontobfuscate
  21. -verbose
  22. -keepattributes EnclosingMethod,InnerClasses,Exceptions,*Annotation*,SourceFile,LineNumberTable,Signature
  23. -keeppackagenames ch.threema.**
  24. -keeppackagenames org.saltyrtc.**
  25. -dontnote android.net.http.*
  26. -dontnote org.apache.commons.codec.**
  27. -dontnote org.apache.http.**
  28. # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
  29. -keepclasseswithmembernames class * {
  30. native <methods>;
  31. }
  32. -keepclasseswithmembers class * {
  33. public <init>(android.content.Context, android.util.AttributeSet);
  34. }
  35. -keepclasseswithmembers class * {
  36. public <init>(android.content.Context, android.util.AttributeSet, int);
  37. }
  38. # We want to keep methods in Activity that could be used in the XML attribute onClick
  39. -keepclassmembers class * extends android.app.Activity {
  40. public void *(android.view.View);
  41. }
  42. # For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
  43. -keepclassmembers enum * {
  44. public static **[] values();
  45. public static ** valueOf(java.lang.String);
  46. }
  47. # for google play services
  48. -keep class * extends java.util.ListResourceBundle {
  49. protected java.lang.Object[][] getContents();
  50. }
  51. # Keep SafeParcelable value, needed for reflection. This is required to support backwards
  52. # compatibility of some classes.
  53. -keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
  54. public static final *** NULL;
  55. }
  56. # Keep the names of classes/members we need for client functionality.
  57. -keepnames @com.google.android.gms.common.annotation.KeepName class *
  58. -keepclassmembernames class * {
  59. @com.google.android.gms.common.annotation.KeepName *;
  60. }
  61. # config needed for sqlcipher
  62. -keep class * implements android.os.Parcelable {
  63. public static final android.os.Parcelable$Creator *;
  64. }
  65. -keepclassmembers class **.R$* {
  66. public static <fields>;
  67. }
  68. # SQLCipher
  69. -keep,includedescriptorclasses class net.zetetic.database.sqlcipher.** { *; }
  70. -keep,includedescriptorclasses interface net.zetetic.database.sqlcipher.** { *; }
  71. # for zxing
  72. -keep class com.google.zxing.client.android.camera.open.**
  73. -keep class com.google.zxing.client.android.camera.exposure.**
  74. -keep class com.google.zxing.client.android.common.executor.**
  75. # As described in tools/proguard/examples/android.pro - ignore all warnings.
  76. #-dontwarn android.support.v4.**
  77. # Missing annotations are harmless.
  78. -dontwarn sun.misc.Unsafe
  79. -dontwarn javax.annotation.**
  80. # Ignore invalid constant ref. See
  81. # https://groups.google.com/d/topic/guava-discuss/YCZzeCiIVoI/discussion
  82. -dontwarn com.google.common.collect.MinMaxPriorityQueue
  83. # threema-specific
  84. -dontwarn org.mockito.**
  85. -dontwarn sun.reflect.**
  86. -dontwarn android.test.**
  87. -dontwarn class.org.junit.**
  88. -dontwarn android.app.**
  89. -dontwarn android.support.**
  90. -dontwarn android.view.**
  91. -dontwarn android.widget.**
  92. -dontwarn com.google.common.primitives.**
  93. -dontwarn **CompatHoneycomb
  94. -dontwarn **CompatHoneycombMR2
  95. -dontwarn **CompatCreatorHoneycombMR2
  96. -dontwarn java.beans.**
  97. # WebRTC fails to build due to missing dependencies
  98. # "Warning: org.webrtc.SoftwareVideoDecoderFactory: can't find referenced class org.webrtc.LibvpxVp8Decoder"
  99. -dontwarn org.webrtc.**
  100. # hms requirements
  101. -ignorewarnings
  102. -keep class com.huawei.updatesdk.**{*;}
  103. -keep class com.huawei.hms.**{*;}
  104. -keep class com.huawei.android.sdk.drm.**{*;}
  105. # remove android log calls below error
  106. -assumenosideeffects class android.util.Log {
  107. public static *** v(...);
  108. public static *** d(...);
  109. public static *** i(...);
  110. public static *** w(...);
  111. }
  112. # remaining options from proguard-android-optimize.txt
  113. -renamesourcefileattribute SourceFile
  114. -keep public class com.google.android.vending.licensing.ILicensingService
  115. # keep setters in Views so that animations can still work.
  116. # see http://proguard.sourceforge.net/manual/examples.html#beans
  117. -keepclassmembers public class * extends android.view.View {
  118. void set*(***);
  119. *** get*();
  120. }
  121. -keepnames class com.fasterxml.jackson.** { *; }
  122. -keepnames interface com.fasterxml.jackson.** { *; }
  123. -keep class org.codehaus.** { *; }
  124. -dontwarn org.w3c.dom.**
  125. -dontwarn de.tavendo.autobahn.**
  126. -dontwarn com.fasterxml.jackson.databind.ext.PathDeserializer**
  127. # Msgpack
  128. -keep class org.msgpack.core.** { *; }
  129. -keep class org.msgpack.value.** { *; }
  130. # SLF4J
  131. -keep class org.slf4j.**
  132. -dontwarn org.slf4j.impl.StaticMDCBinder
  133. -dontwarn org.slf4j.impl.StaticMarkerBinder
  134. -dontwarn org.slf4j.impl.StaticLoggerBinder
  135. # WebRTC
  136. -keep class org.webrtc.** { *; }
  137. # Messages are serialized using reflection
  138. -keep class ch.threema.app.webclient.messages.** { *; }
  139. # Keep our own searchview visible
  140. -keep public class * extends androidx.appcompat.widget.SearchView {*;}
  141. # https://stackoverflow.com/questions/44145786/thousands-of-strange-crashes-in-new-google-play-console-version
  142. -keep class * extends android.app.Application {*;}
  143. # from https://github.com/ohmae/preference-activity-compat
  144. -keep public class * extends androidx.preference.PreferenceFragmentCompat
  145. # https://stackoverflow.com/questions/51006967/androidx-build-fails-in-release-mode-regarding-appcomponentfactory
  146. -keep class androidx.core.app.CoreComponentFactory { *; }
  147. # Firebase analytics removal
  148. -dontwarn com.google.firebase.analytics.connector.AnalyticsConnector
  149. # keep camera classes - 1.0.0-alpha03 causes VerifyError in Android 4.4
  150. -keep class androidx.camera.** { *; }
  151. # protobuf uses reflection
  152. -keepclassmembers class * extends com.google.protobuf.GeneratedMessageLite {
  153. <fields>;
  154. }
  155. # glide image loading
  156. -keep public class * implements com.bumptech.glide.module.GlideModule
  157. -keep class * extends com.bumptech.glide.module.AppGlideModule {
  158. <init>(...);
  159. }
  160. -keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  161. **[] $VALUES;
  162. public *;
  163. }
  164. -keep class com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder {
  165. *** rewind();
  166. }
  167. # For reasons unknown to us, starting with the 4.5 release branch, a release build
  168. # would throw an exception on app start:
  169. #
  170. # java.lang.VerifyError: Verifier rejected class ch.threema.client.f1:
  171. # void ch.threema.client.f1.d(ch.threema.client.x0) failed to verify: void ch.threema.client.f1.d(ch.threema.client.x0):
  172. # [0x1A3] expected to be within a catch-all for an instruction where a monitor is held (declaration of 'ch.threema.client.f1' appears in base.apk)
  173. #
  174. # Adding this line fixes the problem. It's most probably a bug in the R8 optimizer
  175. # that's triggered by this file, the NonceFactory wasn't modified since 2017...
  176. # Maybe we can remove this again with a future build toolchain.
  177. -keep class ch.threema.base.crypto.NonceFactory { *; }
  178. -dontwarn build.IgnoreJava8API
  179. -dontwarn sun.security.x509.X509Key
  180. # https://issuetracker.google.com/issues/159595260
  181. -keep class * extends androidx.startup.Initializer {
  182. <init>();
  183. }
  184. -keep class java8.util.ImmutableCollections { *; }
  185. # https://stackoverflow.com/questions/73748946/proguard-r8-warnings
  186. -dontwarn org.conscrypt.**
  187. -dontwarn org.bouncycastle.**
  188. -dontwarn org.openjsse.**