blob: ec14d50b371d94130b436514ef0a6f53ca2d8286 [file] [log] [blame]
Todd Kennedy20047d72016-04-20 14:07:07 -07001#
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
17LOCAL_PATH := $(my-dir)
18
19###########################################################
Todd Kennedy20047d72016-04-20 14:07:07 -070020# Variant: Privileged app upgrade
21
22include $(CLEAR_VARS)
23# this needs to be a privileged application
24LOCAL_PRIVILEGED_MODULE := true
25
26LOCAL_MODULE_TAGS := optional
27LOCAL_SDK_VERSION := current
28LOCAL_PROGUARD_ENABLED := disabled
29LOCAL_DEX_PREOPT := false
30
31LOCAL_PACKAGE_NAME := CtsShimPrivUpgrade
32
33LOCAL_MANIFEST_FILE := shim_priv_upgrade/AndroidManifest.xml
34
Winston Man0e68a3e2017-09-05 15:12:35 +010035LOCAL_MULTILIB := both
36LOCAL_JNI_SHARED_LIBRARIES := libshim_jni
37
Todd Kennedy20047d72016-04-20 14:07:07 -070038include $(BUILD_PACKAGE)
Dan Willemsen06b93912016-06-08 15:08:04 -070039my_shim_priv_upgrade_apk := $(LOCAL_BUILT_MODULE)
Todd Kennedy20047d72016-04-20 14:07:07 -070040
Dan Willemsen06b93912016-06-08 15:08:04 -070041###########################################################
42# Variant: Privileged app
43
44include $(CLEAR_VARS)
45# this needs to be a privileged application
46LOCAL_PRIVILEGED_MODULE := true
47
48LOCAL_MODULE_TAGS := optional
49LOCAL_SDK_VERSION := current
50LOCAL_PROGUARD_ENABLED := disabled
51LOCAL_DEX_PREOPT := false
52
53LOCAL_PACKAGE_NAME := CtsShimPriv
54
55# Generate the upgrade key by taking the hash of the built CtsShimPrivUpgrade apk
56gen := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),,true)/AndroidManifest.xml
57$(gen): PRIVATE_CUSTOM_TOOL = sed -e "s/__HASH__/`sha512sum $(PRIVATE_INPUT_APK) | cut -d' ' -f1`/" $< >$@
58$(gen): PRIVATE_INPUT_APK := $(my_shim_priv_upgrade_apk)
59$(gen): $(LOCAL_PATH)/shim_priv/AndroidManifest.xml $(my_shim_priv_upgrade_apk)
60 $(transform-generated-source)
61
62my_shim_priv_upgrade_apk :=
63
64LOCAL_FULL_MANIFEST_FILE := $(gen)
65
Winston Man0e68a3e2017-09-05 15:12:35 +010066LOCAL_MULTILIB := both
67LOCAL_JNI_SHARED_LIBRARIES := libshim_jni
68
Dan Willemsen06b93912016-06-08 15:08:04 -070069include $(BUILD_PACKAGE)
Todd Kennedy20047d72016-04-20 14:07:07 -070070
71###########################################################
Todd Kennedy0d0b59c2016-06-14 12:35:39 -070072# Variant: Privileged app upgrade w/ the wrong SHA
73
74include $(CLEAR_VARS)
75# this needs to be a privileged application
76LOCAL_PRIVILEGED_MODULE := true
77
78LOCAL_MODULE_TAGS := optional
79LOCAL_SDK_VERSION := current
80LOCAL_PROGUARD_ENABLED := disabled
81LOCAL_DEX_PREOPT := false
82# anything to make this package's SHA different from CtsShimPrivUpgrade
83LOCAL_AAPT_FLAGS := --version-name WrongSHA
84
85LOCAL_PACKAGE_NAME := CtsShimPrivUpgradeWrongSHA
86
87LOCAL_MANIFEST_FILE := shim_priv_upgrade/AndroidManifest.xml
88
Winston Man0e68a3e2017-09-05 15:12:35 +010089LOCAL_MULTILIB := both
90LOCAL_JNI_SHARED_LIBRARIES := libshim_jni
91
Todd Kennedy0d0b59c2016-06-14 12:35:39 -070092include $(BUILD_PACKAGE)
93
94
95###########################################################
Todd Kennedy20047d72016-04-20 14:07:07 -070096# Variant: System app
97
98include $(CLEAR_VARS)
99
100LOCAL_MODULE_TAGS := optional
101LOCAL_SDK_VERSION := current
102LOCAL_PROGUARD_ENABLED := disabled
103LOCAL_DEX_PREOPT := false
104
105LOCAL_PACKAGE_NAME := CtsShim
106
107LOCAL_MANIFEST_FILE := shim/AndroidManifest.xml
108
109include $(BUILD_PACKAGE)
110
Winston Man0e68a3e2017-09-05 15:12:35 +0100111###########################################################
112include $(call all-makefiles-under,$(LOCAL_PATH))