Don't depend on Bouncy Castle.
This switches PKCS#7 SignedData generation code from Bouncy Castle to
OpenJDK's proprietary internal API. This is to avoid depending on a
huge library that's not really needed. In the longer term, it's best
to add our own implementation of PKCS#7 SignedData building, parsing,
and verification. This will give the code more power to mimic what the
Android platform does.
Bug: 27461702
Change-Id: I29f1ceea1293e35424fde69c0f2969d551345100
diff --git a/tools/apksigner/core/Android.mk b/tools/apksigner/core/Android.mk
index c86208b..132a6f1 100644
--- a/tools/apksigner/core/Android.mk
+++ b/tools/apksigner/core/Android.mk
@@ -20,7 +20,10 @@
include $(CLEAR_VARS)
LOCAL_MODULE := apksigner-core
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_LIBRARIES = \
- bouncycastle-host \
- bouncycastle-bcpkix-host
+
+# Disable warnnings about our use of internal proprietary OpenJDK API.
+# TODO: Remove this workaround by moving to our own implementation of PKCS #7
+# SignedData block generation, parsing, and verification.
+LOCAL_JAVACFLAGS := -XDignore.symbol.file
+
include $(BUILD_HOST_JAVA_LIBRARY)