This repository has been archived by the owner on Apr 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a ProGuard/R8 rule to keep the (shaded) Protobuf classes as-is.
GitHub issue: #361. PiperOrigin-RevId: 313043816
- Loading branch information
1 parent
3691465
commit 8bdaed4
Showing
5 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# Rules File Format: https://github.com/bazelbuild/bazel/blob/master/third_party/jarjar/java/com/tonicsystems/jarjar/help.txt. | ||
# | ||
# Shade protobuf to avoid dependency version conflicts in user projects. | ||
# WARNING: the shaded package name com.google.crypto.tink.shaded.protobuf must | ||
# be kept in sync with src/main/resources/META-INF/proguard/tink.pro. | ||
rule com.google.protobuf.** com.google.crypto.tink.shaded.protobuf.@1 |
14 changes: 14 additions & 0 deletions
14
java_src/src/main/resources/META-INF/proguard/protobuf.pro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Recently Protobuf Javalite introduced a change that relies on reflection, | ||
# which doesn't work with Proguard. This rule keeps the reflection usages in | ||
# (shaded) Protobuf classes in Tink as-is. | ||
# The location of this file is determined by | ||
# - https://developer.android.com/studio/build/shrink-code#configuration-files | ||
# - https://docs.bazel.build/versions/master/be/java.html#java_library.resources | ||
# See also: | ||
# - https://github.com/google/tink/issues/361 | ||
# - https://github.com/protocolbuffers/protobuf/issues/6463 | ||
# WARNING: the shaded package name com.google.crypto.tink.shaded.protobuf must | ||
# be kept in sync with jar_jar_rules.txt. | ||
-keepclassmembers class * extends com.google.crypto.tink.shaded.protobuf.GeneratedMessageLite { | ||
<fields>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters