Skip to content

Commit

Permalink
Add a Proguard rule to keep Protobuf classes as-is.
Browse files Browse the repository at this point in the history
AndroidX Security delegates crypto operation to Tink which
depends on Protobuf Javalite. Recently Protobuf Javalite
introduced a change that relies on reflection, which doesn't
work with Proguard.

This change adds a rule that keeps the (shaded) Protobuf
classes in Tink as-is.

See also:
 - https://buganizer.corp.google.com/issues/154315507
 - tink-crypto/tink#361
 - protocolbuffers/protobuf#6463
 - https://b.corp.google.com/issues/144631039
  • Loading branch information
thaidn committed May 22, 2020
1 parent eef4111 commit 7ecebf1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,17 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

# AndroidX Security delegates crypto operation to Tink which
# depends on Protobuf Javalite. Recently Protobuf Javalite
# introduced a change that relies on reflection, which doesn't
# work with Proguard.
# This rule keeps the (shaded) Protobuf classes in Tink as-is.
# See also:
# - https://github.com/google/tink/issues/361
# - https://github.com/protocolbuffers/protobuf/issues/6463
# - https://b.corp.google.com/issues/144631039
-keep class * extends com.google.crypto.tink.shaded.protobuf.GeneratedMessageLite {
*;
}

0 comments on commit 7ecebf1

Please sign in to comment.