| 1 | -dontobfuscate |
| 2 | |
| 3 | -keep class tel.xmpp.jabjab.** |
| 4 | -keep class im.conversations.** |
| 5 | |
| 6 | -keep class org.whispersystems.** |
| 7 | |
| 8 | -keep class com.kyleduo.switchbutton.Configuration |
| 9 | |
| 10 | -keep class com.soundcloud.android.crop.** |
| 11 | |
| 12 | -keep class com.google.android.gms.** |
| 13 | |
| 14 | -keep class org.openintents.openpgp.* |
| 15 | -keep class org.webrtc.** { *; } |
| 16 | |
| 17 | -keep class net.fellbaum.jemoji.** { *; } |
| 18 | -keeppackagenames net.fellbaum.jemoji.** |
| 19 | -keepdirectories jemoji |
| 20 | |
| 21 | -dontwarn javax.mail.internet.MimeMessage |
| 22 | -dontwarn javax.mail.internet.MimeBodyPart |
| 23 | -dontwarn javax.mail.internet.SharedInputStream |
| 24 | -dontwarn javax.activation.DataContentHandler |
| 25 | -dontwarn org.bouncycastle.mail.** |
| 26 | -dontwarn org.bouncycastle.x509.util.LDAPStoreHelper |
| 27 | -dontwarn org.bouncycastle.jce.provider.X509LDAPCertStoreSpi |
| 28 | -dontwarn org.bouncycastle.cert.dane.** |
| 29 | -dontwarn rocks.xmpp.addr.** |
| 30 | -dontwarn com.google.firebase.analytics.connector.AnalyticsConnector |
| 31 | -dontwarn java.lang.** |
| 32 | -dontwarn com.google.auto.service.AutoService |
| 33 | -dontwarn javax.lang.** |
| 34 | |
| 35 | -dontwarn com.android.org.conscrypt.SSLParametersImpl |
| 36 | -dontwarn org.apache.harmony.xnet.provider.jsse.SSLParametersImpl |
| 37 | -dontwarn org.bouncycastle.jsse.BCSSLParameters |
| 38 | -dontwarn org.bouncycastle.jsse.BCSSLSocket |
| 39 | -dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider |
| 40 | -dontwarn org.openjsse.javax.net.ssl.SSLParameters |
| 41 | -dontwarn org.openjsse.javax.net.ssl.SSLSocket |
| 42 | -dontwarn org.openjsse.net.ssl.OpenJSSE |
| 43 | -dontwarn org.jetbrains.annotations.** |
| 44 | |
| 45 | -keepclassmembers class tel.xmpp.jabjab.http.services.** { |
| 46 | !transient <fields>; |
| 47 | } |
| 48 | |
| 49 | # Needed for proper GSON deserialization |
| 50 | -keep class com.google.gson.reflect.TypeToken |
| 51 | -keep class * extends com.google.gson.reflect.TypeToken |
| 52 | -keep public class * implements java.lang.reflect.Type |
| 53 | |
| 54 | # Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and |
| 55 | # EnclosingMethod is required to use InnerClasses. |
| 56 | -keepattributes Signature, InnerClasses, EnclosingMethod |
| 57 | |
| 58 | # Retrofit does reflection on method and parameter annotations. |
| 59 | -keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations |
| 60 | |
| 61 | # Retain service method parameters when optimizing. |
| 62 | -keepclassmembers,allowshrinking,allowobfuscation interface * { |
| 63 | @retrofit2.http.* <methods>; |
| 64 | } |
| 65 | |
| 66 | # Ignore annotation used for build tooling. |
| 67 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement |
| 68 | |
| 69 | # Ignore JSR 305 annotations for embedding nullability information. |
| 70 | -dontwarn javax.annotation.** |
| 71 | |
| 72 | # Guarded by a NoClassDefFoundError try/catch and only used when on the classpath. |
| 73 | -dontwarn kotlin.Unit |
| 74 | |
| 75 | # Top-level functions that can only be used by Kotlin. |
| 76 | -dontwarn retrofit2.KotlinExtensions |
| 77 | -dontwarn retrofit2.KotlinExtensions$* |
| 78 | |
| 79 | |
| 80 | # With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy |
| 81 | # and replaces all potential values with null. Explicitly keeping the interfaces prevents this. |
| 82 | -if interface * { @retrofit2.http.* <methods>; } |
| 83 | -keep,allowobfuscation interface <1> |
| 84 | |
| 85 | # Keep inherited services. |
| 86 | -if interface * { @retrofit2.http.* <methods>; } |
| 87 | -keep,allowobfuscation interface * extends <1> |
| 88 | |
| 89 | # With R8 full mode generic signatures are stripped for classes that are not |
| 90 | # kept. Suspend functions are wrapped in continuations where the type argument |
| 91 | # is used. |
| 92 | -keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation |
| 93 | |
| 94 | # R8 full mode strips generic signatures from return types if not kept. |
| 95 | -if interface * { @retrofit2.http.* public *** *(...); } |
| 96 | -keep,allowoptimization,allowshrinking,allowobfuscation class <3> |
| 97 | |
| 98 | # Guava doesn’s ship a complete file - base.pro |
| 99 | |
| 100 | # Throwables uses internal APIs for lazy stack trace resolution |
| 101 | -dontnote sun.misc.SharedSecrets |
| 102 | -keep class sun.misc.SharedSecrets { |
| 103 | *** getJavaLangAccess(...); |
| 104 | } |
| 105 | -dontnote sun.misc.JavaLangAccess |
| 106 | -keep class sun.misc.JavaLangAccess { |
| 107 | *** getStackTraceElement(...); |
| 108 | *** getStackTraceDepth(...); |
| 109 | } |
| 110 | |
| 111 | # FinalizableReferenceQueue calls this reflectively |
| 112 | # Proguard is intelligent enough to spot the use of reflection onto this, so we |
| 113 | # only need to keep the names, and allow it to be stripped out if |
| 114 | # FinalizableReferenceQueue is unused. |
| 115 | # |
| 116 | # (Under Android, we end up using Finalzier non-reflectively, so we could |
| 117 | # likely rework all this configuration.) |
| 118 | -keepclassmembernames class com.google.common.base.internal.Finalizer { |
| 119 | *** startFinalizer(...); |
| 120 | } |
| 121 | # However, it cannot "spot" that this method needs to be kept IF the class is. |
| 122 | -keepclassmembers class com.google.common.base.internal.Finalizer { |
| 123 | *** startFinalizer(...); |
| 124 | } |
| 125 | |
| 126 | -keepclassmembernames class com.google.common.base.FinalizableReference { |
| 127 | void finalizeReferent(); |
| 128 | } |
| 129 | -keepclassmembers class com.google.common.base.FinalizableReference { |
| 130 | void finalizeReferent(); |
| 131 | } |
| 132 | |
| 133 | # Guava - cache.pro |
| 134 | |
| 135 | # Striped64 uses this |
| 136 | -dontwarn sun.misc.Unsafe |
| 137 | |
| 138 | # Striped64 appears to make some assumptions about object layout that |
| 139 | # really might not be safe. This should be investigated. |
| 140 | -keepclassmembers class com.google.common.cache.Striped64 { |
| 141 | *** base; |
| 142 | *** busy; |
| 143 | } |
| 144 | -keepclassmembers class com.google.common.cache.Striped64$Cell { |
| 145 | <fields>; |
| 146 | } |
| 147 | |
| 148 | |
| 149 | # random shit from https://github.com/google/guava/issues/8345 |
| 150 | |
| 151 | -keep class com.google.common.cache.** { *; } |
| 152 | -keepclassmembers class com.google.common.cache.LocalCache$Strength { |
| 153 | public static **[] values(); |
| 154 | public static ** valueOf(java.lang.String); |
| 155 | } |
| 156 | |
| 157 | |
| 158 | # Guava collect pro |
| 159 | |
| 160 | # The nested FieldSettersHolder class looks these up. |
| 161 | # |
| 162 | # We use -keepclassmembernames because we want for ImmutableMultimap and its |
| 163 | # fields to be stripped if it's unused: -keepclassmembernames says that, *if* |
| 164 | # you're keeping the fields, you need to leave their names untouched. (Anyone |
| 165 | # who is using ImmutableMultimap will certainly be using its fields. So we |
| 166 | # don't need to worry that an ImmutableMultimap user will have the fields |
| 167 | # optimized away.) |
| 168 | # |
| 169 | # This configuration is untested.... |
| 170 | |
| 171 | -keepclassmembernames class com.google.common.collect.ImmutableMultimap { |
| 172 | *** map; |
| 173 | *** size; |
| 174 | } |
| 175 | # similarly: |
| 176 | -keepclassmembernames class com.google.common.collect.ConcurrentHashMultiset { |
| 177 | *** countMap; |
| 178 | } |
| 179 | # similarly: |
| 180 | -keepclassmembernames class com.google.common.collect.ImmutableSetMultimap { |
| 181 | *** emptySet; |
| 182 | } |
| 183 | # similarly: |
| 184 | -keepclassmembernames class com.google.common.collect.AbstractSortedMultiset { |
| 185 | *** comparator; |
| 186 | } |
| 187 | # similarly: |
| 188 | -keepclassmembernames class com.google.common.collect.TreeMultiset { |
| 189 | *** range; |
| 190 | *** rootReference; |
| 191 | *** header; |
| 192 | } |
| 193 | |
| 194 | # concurrent |
| 195 | |
| 196 | # Futures.getChecked, in both of its variants, is incompatible with proguard. |
| 197 | |
| 198 | # Used by AtomicReferenceFieldUpdater, sun.misc.Unsafe, and VarHandle. |
| 199 | # We could be more precise about which classes these are defined in, but that feels error-prone. |
| 200 | -keepclassmembers class com.google.common.util.concurrent.AbstractFuture** { |
| 201 | *** waitersField; |
| 202 | *** valueField; |
| 203 | *** listenersField; |
| 204 | *** thread; |
| 205 | *** next; |
| 206 | } |
| 207 | -keepclassmembers class com.google.common.util.concurrent.AbstractFutureState** { |
| 208 | *** waitersField; |
| 209 | *** valueField; |
| 210 | *** listenersField; |
| 211 | *** thread; |
| 212 | *** next; |
| 213 | } |
| 214 | -keepclassmembers class com.google.common.util.concurrent.AtomicDouble { |
| 215 | *** value; |
| 216 | } |
| 217 | -keepclassmembers class com.google.common.util.concurrent.AggregateFutureState { |
| 218 | *** remainingField; |
| 219 | *** seenExceptionsField; |
| 220 | } |
| 221 | |
| 222 | # Since Unsafe is using the field offsets of these inner classes, we don't want |
| 223 | # to have class merging or similar tricks applied to these classes and their |
| 224 | # fields. It's safe to allow obfuscation, since the by-name references are |
| 225 | # already preserved in the -keep statement above. |
| 226 | -keep,allowshrinking,allowobfuscation class com.google.common.util.concurrent.AbstractFuture** { |
| 227 | <fields>; |
| 228 | } |
| 229 | -keep,allowshrinking,allowobfuscation class com.google.common.util.concurrent.AbstractFutureState** { |
| 230 | <fields>; |
| 231 | } |
| 232 | |
| 233 | # AbstractFuture uses this |
| 234 | -dontwarn sun.misc.Unsafe |
| 235 | |
| 236 | # MoreExecutors references AppEngine |
| 237 | -dontnote com.google.appengine.api.ThreadManager |
| 238 | -keep class com.google.appengine.api.ThreadManager { |
| 239 | static *** currentRequestThreadFactory(...); |
| 240 | } |
| 241 | -dontnote com.google.apphosting.api.ApiProxy |
| 242 | -keep class com.google.apphosting.api.ApiProxy { |
| 243 | static *** getCurrentEnvironment (...); |
| 244 | } |
| 245 | |
| 246 | # guava - hash.pro |
| 247 | |
| 248 | # LittleEndianByteArray uses this |
| 249 | -dontwarn sun.misc.Unsafe |
| 250 | |
| 251 | # Striped64 appears to make some assumptions about object layout that |
| 252 | # really might not be safe. This should be investigated. |
| 253 | -keepclassmembers class com.google.common.hash.Striped64 { |
| 254 | *** base; |
| 255 | *** busy; |
| 256 | } |
| 257 | -keepclassmembers class com.google.common.hash.Striped64$Cell { |
| 258 | <fields>; |
| 259 | } |
| 260 | |
| 261 | # UnsignedBytes uses this |
| 262 | -dontwarn sun.misc.Unsafe |
Built with passion for open-source software, XMPP, privacy, and security —
the belief that people deserve communication tools that serve them, not surveil them.
Dedicated to every brave man and woman who stands up against tyranny and oppression across the world.
And in memory of those who were silenced before they could speak freely.