DnsResolver: make libcrypto a shared lib.

A statically linked libcrypto's self test will not succeed because
the linker step (symbol relocations etc.) will change the checksum.

Since libssl is also provided by boringssl, we're giving it the
same treatment for consistency.

Note that the DnsResolver module carries its own copies of these
shared libraries on-device:

$ adb shell 'su 0 find /apex/com.android.resolv/ -name "*.so"'
/apex/com.android.resolv/lib64/libnetd_resolv.so
/apex/com.android.resolv/lib64/libcrypto.so
/apex/com.android.resolv/lib64/libssl.so

Bug: 137267623
Test: Treehugger

Change-Id: Ia418f379b7a8c8ede6539ce735a19c7f284bbce7
diff --git a/Android.bp b/Android.bp
index b8e7b5a..d05881f 100644
--- a/Android.bp
+++ b/Android.bp
@@ -66,19 +66,16 @@
         "ResolverController.cpp",
         "ResolverEventReporter.cpp",
     ],
-    // Link everything statically (except for libc) to minimize our dependence
-    // on system ABIs
+    // Link most things statically to minimize our dependence on system ABIs.
     stl: "libc++_static",
     static_libs: [
         "dnsresolver_aidl_interface-ndk_platform",
         "libbase",
-        "libcrypto",
         "libcutils",
         "libjsoncpp",
         "liblog", //Used by libstatslog_resolv
         "libnetdutils",
         "libprotobuf-cpp-lite",
-        "libssl",
         "libstatslog_resolv",
         "libstatssocket",
         "libsysutils",
@@ -87,8 +84,14 @@
         "server_configurable_flags",
         "stats_proto",
     ],
+    // libcrypto needs to be used as a shared library because it performs an
+    // integrity check (against a checksum) that is not supported for static
+    // libs. See http://b/141248879
+    // We're also adding libssl here to treat it consistently.
     shared_libs: [
         "libbinder_ndk",
+        "libcrypto",
+        "libssl",
     ],
     header_libs: [
         "libnetd_client_headers",