1 # 2 # Copyright (C) 2016 The Android Open Source Project 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 # 16 LOCAL_PATH := $(call my-dir) 17 18 # apksig library, for signing APKs and verifying signatures of APKs 19 # ============================================================ 20 include $(CLEAR_VARS) 21 LOCAL_MODULE := apksig 22 LOCAL_SRC_FILES := $(call all-java-files-under, src/main/java) 23 24 # Disable warnnings about our use of internal proprietary OpenJDK API. 25 # TODO: Remove this workaround by moving to our own implementation of PKCS #7 26 # SignedData block generation, parsing, and verification. 27 LOCAL_JAVACFLAGS := -XDignore.symbol.file 28 29 include $(BUILD_HOST_JAVA_LIBRARY) 30 31 32 # apksigner command-line tool for signing APKs and verifying their signatures 33 # ============================================================ 34 include $(CLEAR_VARS) 35 LOCAL_MODULE := apksigner 36 LOCAL_SRC_FILES := $(call all-java-files-under, src/apksigner/java) 37 LOCAL_JAVA_RESOURCE_DIRS = src/apksigner/java 38 LOCAL_JAR_MANIFEST := src/apksigner/apksigner.mf 39 LOCAL_STATIC_JAVA_LIBRARIES := apksig 40 # Output the apksigner.jar library 41 include $(BUILD_HOST_JAVA_LIBRARY) 42 43 # Output the shell script wrapper around the library 44 include $(CLEAR_VARS) 45 LOCAL_IS_HOST_MODULE := true 46 LOCAL_MODULE_CLASS := EXECUTABLES 47 LOCAL_MODULE := apksigner 48 49 include $(BUILD_SYSTEM)/base_rules.mk 50 51 $(LOCAL_BUILT_MODULE): $(HOST_OUT_JAVA_LIBRARIES)/apksigner$(COMMON_JAVA_PACKAGE_SUFFIX) 52 $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/etc/apksigner | $(ACP) 53 @echo "Copy: $(PRIVATE_MODULE) ($@)" 54 $(copy-file-to-new-target) 55 $(hide) chmod 755 $@ 56