Todd Kennedy | 20047d7 | 2016-04-20 14:07:07 -0700 | [diff] [blame] | 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 | ########################################################### |
Todd Kennedy | 20047d7 | 2016-04-20 14:07:07 -0700 | [diff] [blame] | 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 | |
Winston Man | 0e68a3e | 2017-09-05 15:12:35 +0100 | [diff] [blame] | 35 | LOCAL_MULTILIB := both |
| 36 | LOCAL_JNI_SHARED_LIBRARIES := libshim_jni |
| 37 | |
Todd Kennedy | 20047d7 | 2016-04-20 14:07:07 -0700 | [diff] [blame] | 38 | include $(BUILD_PACKAGE) |
Dan Willemsen | 06b9391 | 2016-06-08 15:08:04 -0700 | [diff] [blame] | 39 | my_shim_priv_upgrade_apk := $(LOCAL_BUILT_MODULE) |
Todd Kennedy | 20047d7 | 2016-04-20 14:07:07 -0700 | [diff] [blame] | 40 | |
Dan Willemsen | 06b9391 | 2016-06-08 15:08:04 -0700 | [diff] [blame] | 41 | ########################################################### |
| 42 | # Variant: Privileged app |
| 43 | |
| 44 | include $(CLEAR_VARS) |
| 45 | # this needs to be a privileged application |
| 46 | LOCAL_PRIVILEGED_MODULE := true |
| 47 | |
| 48 | LOCAL_MODULE_TAGS := optional |
| 49 | LOCAL_SDK_VERSION := current |
| 50 | LOCAL_PROGUARD_ENABLED := disabled |
| 51 | LOCAL_DEX_PREOPT := false |
| 52 | |
| 53 | LOCAL_PACKAGE_NAME := CtsShimPriv |
| 54 | |
| 55 | # Generate the upgrade key by taking the hash of the built CtsShimPrivUpgrade apk |
| 56 | gen := $(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 | |
| 62 | my_shim_priv_upgrade_apk := |
| 63 | |
| 64 | LOCAL_FULL_MANIFEST_FILE := $(gen) |
| 65 | |
Winston Man | 0e68a3e | 2017-09-05 15:12:35 +0100 | [diff] [blame] | 66 | LOCAL_MULTILIB := both |
| 67 | LOCAL_JNI_SHARED_LIBRARIES := libshim_jni |
| 68 | |
Dan Willemsen | 06b9391 | 2016-06-08 15:08:04 -0700 | [diff] [blame] | 69 | include $(BUILD_PACKAGE) |
Todd Kennedy | 20047d7 | 2016-04-20 14:07:07 -0700 | [diff] [blame] | 70 | |
| 71 | ########################################################### |
Todd Kennedy | 0d0b59c | 2016-06-14 12:35:39 -0700 | [diff] [blame] | 72 | # Variant: Privileged app upgrade w/ the wrong SHA |
| 73 | |
| 74 | include $(CLEAR_VARS) |
| 75 | # this needs to be a privileged application |
| 76 | LOCAL_PRIVILEGED_MODULE := true |
| 77 | |
| 78 | LOCAL_MODULE_TAGS := optional |
| 79 | LOCAL_SDK_VERSION := current |
| 80 | LOCAL_PROGUARD_ENABLED := disabled |
| 81 | LOCAL_DEX_PREOPT := false |
| 82 | # anything to make this package's SHA different from CtsShimPrivUpgrade |
| 83 | LOCAL_AAPT_FLAGS := --version-name WrongSHA |
| 84 | |
| 85 | LOCAL_PACKAGE_NAME := CtsShimPrivUpgradeWrongSHA |
| 86 | |
| 87 | LOCAL_MANIFEST_FILE := shim_priv_upgrade/AndroidManifest.xml |
| 88 | |
Winston Man | 0e68a3e | 2017-09-05 15:12:35 +0100 | [diff] [blame] | 89 | LOCAL_MULTILIB := both |
| 90 | LOCAL_JNI_SHARED_LIBRARIES := libshim_jni |
| 91 | |
Todd Kennedy | 0d0b59c | 2016-06-14 12:35:39 -0700 | [diff] [blame] | 92 | include $(BUILD_PACKAGE) |
| 93 | |
| 94 | |
| 95 | ########################################################### |
Todd Kennedy | 20047d7 | 2016-04-20 14:07:07 -0700 | [diff] [blame] | 96 | # Variant: System app |
| 97 | |
| 98 | include $(CLEAR_VARS) |
| 99 | |
| 100 | LOCAL_MODULE_TAGS := optional |
| 101 | LOCAL_SDK_VERSION := current |
| 102 | LOCAL_PROGUARD_ENABLED := disabled |
| 103 | LOCAL_DEX_PREOPT := false |
| 104 | |
| 105 | LOCAL_PACKAGE_NAME := CtsShim |
| 106 | |
| 107 | LOCAL_MANIFEST_FILE := shim/AndroidManifest.xml |
| 108 | |
| 109 | include $(BUILD_PACKAGE) |
| 110 | |
Winston Man | 0e68a3e | 2017-09-05 15:12:35 +0100 | [diff] [blame] | 111 | ########################################################### |
| 112 | include $(call all-makefiles-under,$(LOCAL_PATH)) |