Home | History | Annotate | Download | only in build
      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 
     17 LOCAL_PATH := $(my-dir)
     18 
     19 ###########################################################
     20 # Variant: Privileged app upgrade
     21 
     22 include $(CLEAR_VARS)
     23 # this needs to be a privileged application
     24 LOCAL_PRIVILEGED_MODULE := true
     25 
     26 LOCAL_MODULE_TAGS := optional
     27 LOCAL_SDK_VERSION := current
     28 LOCAL_PROGUARD_ENABLED := disabled
     29 LOCAL_DEX_PREOPT := false
     30 
     31 LOCAL_PACKAGE_NAME := CtsShimPrivUpgrade
     32 
     33 LOCAL_MANIFEST_FILE := shim_priv_upgrade/AndroidManifest.xml
     34 
     35 include $(BUILD_PACKAGE)
     36 my_shim_priv_upgrade_apk := $(LOCAL_BUILT_MODULE)
     37 
     38 ###########################################################
     39 # Variant: Privileged app
     40 
     41 include $(CLEAR_VARS)
     42 # this needs to be a privileged application
     43 LOCAL_PRIVILEGED_MODULE := true
     44 
     45 LOCAL_MODULE_TAGS := optional
     46 LOCAL_SDK_VERSION := current
     47 LOCAL_PROGUARD_ENABLED := disabled
     48 LOCAL_DEX_PREOPT := false
     49 
     50 LOCAL_PACKAGE_NAME := CtsShimPriv
     51 
     52 # Generate the upgrade key by taking the hash of the built CtsShimPrivUpgrade apk
     53 gen := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),,true)/AndroidManifest.xml
     54 $(gen): PRIVATE_CUSTOM_TOOL = sed -e "s/__HASH__/`sha512sum $(PRIVATE_INPUT_APK) | cut -d' ' -f1`/" $< >$@
     55 $(gen): PRIVATE_INPUT_APK := $(my_shim_priv_upgrade_apk)
     56 $(gen): $(LOCAL_PATH)/shim_priv/AndroidManifest.xml $(my_shim_priv_upgrade_apk)
     57 	$(transform-generated-source)
     58 
     59 my_shim_priv_upgrade_apk :=
     60 
     61 LOCAL_FULL_MANIFEST_FILE := $(gen)
     62 
     63 include $(BUILD_PACKAGE)
     64 
     65 ###########################################################
     66 # Variant: Privileged app upgrade w/ the wrong SHA
     67 
     68 include $(CLEAR_VARS)
     69 # this needs to be a privileged application
     70 LOCAL_PRIVILEGED_MODULE := true
     71 
     72 LOCAL_MODULE_TAGS := optional
     73 LOCAL_SDK_VERSION := current
     74 LOCAL_PROGUARD_ENABLED := disabled
     75 LOCAL_DEX_PREOPT := false
     76 # anything to make this package's SHA different from CtsShimPrivUpgrade
     77 LOCAL_AAPT_FLAGS := --version-name WrongSHA
     78 
     79 LOCAL_PACKAGE_NAME := CtsShimPrivUpgradeWrongSHA
     80 
     81 LOCAL_MANIFEST_FILE := shim_priv_upgrade/AndroidManifest.xml
     82 
     83 include $(BUILD_PACKAGE)
     84 
     85 
     86 ###########################################################
     87 # Variant: System app
     88 
     89 include $(CLEAR_VARS)
     90 
     91 LOCAL_MODULE_TAGS := optional
     92 LOCAL_SDK_VERSION := current
     93 LOCAL_PROGUARD_ENABLED := disabled
     94 LOCAL_DEX_PREOPT := false
     95 
     96 LOCAL_PACKAGE_NAME := CtsShim
     97 
     98 LOCAL_MANIFEST_FILE := shim/AndroidManifest.xml
     99 
    100 include $(BUILD_PACKAGE)
    101 
    102