Files
android/libwvdrmengine/Android.mk
Rahul Frias 80659961ac Merges to android Pi release (part 7)
These are a set of CLs merged from the wv cdm repo to the android repo.

* Resolve intermittent decrypt error.

  Author: Jeff Fore <jfore@google.com>

  [ Merge of http://go/wvgerrit/35720 ]

  The CdmSession's closed state was not properly
  initialized resulting in intermittent
  SESSION_NOT_FOUND_FOR_DECRYPT errors.

  In CdmEngine::Decrypt the session is looked up by
  the key id. A list of open sessions is acquired
  by calling CdmSessionMap::GetSessionList and each
  session in the list is queried to see if it has
  the key.

  In building the list in CdmSessionMap::GetSessionList,
  sessions are only added to the query list *if* the session
  is not closed.

  The closed status was not initialized and during testing
  the query list would not contain the session causing
  CdmEngine::Decrypt to return SESSION_NOT_FOUND_FOR_DECRYPT
  resulting in the ce cdm api returning widevine::Cdm::kNoKey.

* No support for pre- C++11 compilation.

  Author: Gene Morgan <gmorgan@google.com>

  [ Merge of http://go/wvgerrit/35381 ]

* Handle unaligned nonce pointer in RewrapDeviceRSAKey calls.

  Author: Gene Morgan <gmorgan@google.com>

  [ Merge of http://go/wvgerrit/35340 ]

  The pointer points into a message and it may not be aligned.
  Always copy the nonce into aligned memory before checking it.

  BUG: 38140370

  Add note to CHANGELOG for this.

* Compiler strictness: more checks and code cleanup.

  Author: Gene Morgan <gmorgan@google.com>

  [ Merge of http://go/wvgerrit/35300 ]

  Use the switches proposed in b/38033653 (as much as possible - some
  conflicts with protobufs and gtest prevent fully accepting them).

  Switch to clang for x32 build; ensure that both x86-64 and x86-32 builds
  compile and link cleanly.

  BUG: 38032429
  BUG: 38033653

  This partially resolves b/38458986

* Android build fixes

  Author: Rahul Frias <rfrias@google.com>

  [ Merge of http://go/wvgerrit/35102 ]

  These corrections address compile warnings and errors for android
  and unit tests.

* Embedded License: Add sub license key sessions.

  Author: Jeff Fore <jfore@google.com>

  [ Merge of http://go/wvgerrit/33680 ]

  NOTE: this adds the AddSubSession() method, but it is not yet being
  used. Use and proper cleanup is in an upcoming CL.

* Embedded license: Add track label field.

  Author: Jeff Fore <jfore@google.com>

  [ Merge of http://go/wvgerrit/33660 ]

  A new track label field (a string) is added to the key container and the
  sub session data objects.

  This field will be used in handling sub license requests.

* Embedded license: extract keys from init_data.

  Author: Jeff Fore <jfore@google.com>

  [ Merge of http://go/wvgerrit/33621 ]

* Embedded license: add protobuf messages.

  Author: Jeff Fore <jfore@google.com>

  [ Merge of http://go/wvgerrit/33620 ]

  also sync the widevine header definition with recent naming changes.

* Improve handling of provisioning response errors.

  Author: Gene Morgan <gmorgan@google.com>

  [ Merge of http://go/wvgerrit/33600 ]

  Separate out the case of no response and the case
  where the message is believed to be a JSON+base64
  message but it doesn't parse properly.

BUG: 71650075
Test: Not currently passing. Will be addressed in a subsequent
  commit in the chain.

Change-Id: I3c86f1c54980b071aec7461ac58541836551f896
2018-01-16 19:29:04 -08:00

249 lines
6.7 KiB
Makefile

# -----------------------------------------------------------------------------
# CDM top level makefile
#
LOCAL_PATH := $(call my-dir)
# -----------------------------------------------------------------------------
# Copies move script to /system/bin.
# The mv command preserves SELinux labels(i.e. media_data_file).
# We need to run restorecon to put the correct context after the move.
# However, restorecon is not implemented for /vendor/bin, so we put
# the script in /system/bin.
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := move_widevine_data.sh
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_MODULE := $(LOCAL_SRC_FILES)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_OWNER := widevine
include $(BUILD_PREBUILT)
# -----------------------------------------------------------------------------
# Builds android.hardware.drm@1.0-service.widevine
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := src_hidl/service.cpp
LOCAL_C_INCLUDES := \
vendor/widevine/libwvdrmengine/include_hidl \
vendor/widevine/libwvdrmengine/mediadrm/include \
vendor/widevine/libwvdrmengine/oemcrypto/include \
LOCAL_SHARED_LIBRARIES := \
android.hardware.drm@1.0 \
libbase \
libhidltransport \
libhwbinder \
liblog \
libutils \
libwvhidl \
libbinder \
LOCAL_HEADER_LIBRARIES := \
libstagefright_foundation_headers
LOCAL_MODULE := android.hardware.drm@1.0-service.widevine
LOCAL_INIT_RC := src_hidl/android.hardware.drm@1.0-service.widevine.rc
LOCAL_REQUIRED_MODULES := move_widevine_data.sh
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/bin/hw
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_OWNER := widevine
ifneq ($(TARGET_ENABLE_MEDIADRM_64), true)
LOCAL_MODULE_TARGET_ARCH := arm x86 mips
endif
include $(BUILD_EXECUTABLE)
# -----------------------------------------------------------------------------
# Builds libcdm_utils.a
#
include $(CLEAR_VARS)
LOCAL_MODULE := libcdm_utils
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_PROPRIETARY_MODULE := true
LOCAL_STATIC_LIBRARIES := libcrypto_static
LOCAL_C_INCLUDES := \
vendor/widevine/libwvdrmengine/cdm/core/include \
vendor/widevine/libwvdrmengine/cdm/include \
vendor/widevine/libwvdrmengine/oemcrypto/include \
LOCAL_HEADER_LIBRARIES := \
libutils_headers \
LOCAL_SHARED_LIBRARIES := \
liblog
SRC_DIR := cdm/src
CORE_SRC_DIR := cdm/core/src
LOCAL_SRC_FILES := \
$(CORE_SRC_DIR)/properties.cpp \
$(CORE_SRC_DIR)/string_conversions.cpp \
$(SRC_DIR)/clock.cpp \
$(SRC_DIR)/file_store.cpp \
$(SRC_DIR)/file_utils.cpp \
$(SRC_DIR)/lock.cpp \
$(SRC_DIR)/log.cpp \
$(SRC_DIR)/properties_android.cpp \
$(SRC_DIR)/timer.cpp \
include $(BUILD_STATIC_LIBRARY)
# -----------------------------------------------------------------------------
# Builds libcdm_protos.a
# Generates *.a, *.pb.h and *.pb.cc for *.proto files.
#
include $(CLEAR_VARS)
LOCAL_MODULE := libcdm_protos
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_PROPRIETARY_MODULE := true
CORE_PROTO_SRC_FILES := $(call all-proto-files-under, cdm/core/src)
METRICS_PROTO_SRC_FILES := $(call all-proto-files-under, cdm/metrics/src)
LOCAL_SRC_FILES := $(CORE_PROTO_SRC_FILES) $(METRICS_PROTO_SRC_FILES)
generated_sources_dir := $(call local-generated-sources-dir)
# $(generated_sources_dir)/proto/$(LOCAL_PATH)/cdm/core/src is used
# to locate *.pb.h by cdm source
# $(generated_sources_dir)/proto is used to locate *.pb.h included
# by *.pb.cc
# The module that depends on this library will have LOCAL_C_INCLUDES prepended
# with this path.
LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(generated_sources_dir)/proto \
$(generated_sources_dir)/proto/$(LOCAL_PATH)/cdm/core/src \
$(generated_sources_dir)/proto/$(LOCAL_PATH)/cdm/metrics/src
include $(BUILD_STATIC_LIBRARY)
# -----------------------------------------------------------------------------
# Builds libwvdrmengine.so
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
src/WVCDMSingleton.cpp \
src/WVCreatePluginFactories.cpp \
src/WVCryptoFactory.cpp \
src/WVDrmFactory.cpp \
src/WVUUID.cpp \
LOCAL_C_INCLUDES := \
frameworks/av/include \
frameworks/native/include \
vendor/widevine/libwvdrmengine/cdm/core/include \
vendor/widevine/libwvdrmengine/cdm/metrics/include \
vendor/widevine/libwvdrmengine/cdm/include \
vendor/widevine/libwvdrmengine/include \
vendor/widevine/libwvdrmengine/mediacrypto/include \
vendor/widevine/libwvdrmengine/mediadrm/include \
vendor/widevine/libwvdrmengine/oemcrypto/include \
LOCAL_STATIC_LIBRARIES := \
libcdm \
libcdm_protos \
libcdm_utils \
libcrypto_static \
libjsmn \
libwvdrmcryptoplugin \
libwvdrmdrmplugin \
libwvlevel3 \
LOCAL_SHARED_LIBRARIES := \
libcutils \
libdl \
liblog \
libprotobuf-cpp-lite \
libstagefright_foundation \
libutils \
LOCAL_HEADER_LIBRARIES := \
libutils_headers \
libstagefright_headers
LOCAL_MODULE := libwvdrmengine
LOCAL_MODULE_RELATIVE_PATH := mediadrm
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_OWNER := widevine
LOCAL_PROPRIETARY_MODULE := true
include $(BUILD_SHARED_LIBRARY)
# -----------------------------------------------------------------------------
# Builds libwvhidl.so
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
src/WVCDMSingleton.cpp \
src/WVUUID.cpp \
src_hidl/WVCreatePluginFactories.cpp \
src_hidl/WVCryptoFactory.cpp \
src_hidl/WVDrmFactory.cpp \
LOCAL_C_INCLUDES := \
frameworks/av/include \
frameworks/native/include \
vendor/widevine/libwvdrmengine/cdm/core/include \
vendor/widevine/libwvdrmengine/cdm/metrics/include \
vendor/widevine/libwvdrmengine/cdm/include \
vendor/widevine/libwvdrmengine/include_hidl \
vendor/widevine/libwvdrmengine/include \
vendor/widevine/libwvdrmengine/mediacrypto/include_hidl \
vendor/widevine/libwvdrmengine/mediacrypto/include \
vendor/widevine/libwvdrmengine/mediadrm/include_hidl \
vendor/widevine/libwvdrmengine/mediadrm/include \
vendor/widevine/libwvdrmengine/oemcrypto/include \
LOCAL_STATIC_LIBRARIES := \
libcdm \
libcdm_protos \
libcdm_utils \
libcrypto_static \
libjsmn \
libwvdrmcryptoplugin_hidl \
libwvdrmdrmplugin_hidl \
libwvlevel3 \
LOCAL_SHARED_LIBRARIES := \
android.hardware.drm@1.0 \
android.hidl.memory@1.0 \
libcutils \
libdl \
libhidlbase \
libhidlmemory \
libhidltransport \
libhwbinder \
liblog \
libprotobuf-cpp-lite \
libutils \
LOCAL_MODULE := libwvhidl
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_OWNER := widevine
LOCAL_PROPRIETARY_MODULE := true
include $(BUILD_SHARED_LIBRARY)
include vendor/widevine/libwvdrmengine/cdm/Android.mk
include vendor/widevine/libwvdrmengine/level3/Android.mk
include vendor/widevine/libwvdrmengine/mediacrypto/Android.mk
include vendor/widevine/libwvdrmengine/mediadrm/Android.mk
include vendor/widevine/libwvdrmengine/vts/vendor_module/Android.mk