Merge \\"CtsShim: Support building with tapas\\" into nyc-dev am: c47168d592
am: 222a6998b7
Change-Id: I6444d115d5dd17f92a335e734ab16819bd89dc81
This commit is contained in:
@@ -53,3 +53,4 @@ LOCAL_SRC_FILES := CtsShim.apk
|
|||||||
|
|
||||||
include $(BUILD_PREBUILT)
|
include $(BUILD_PREBUILT)
|
||||||
|
|
||||||
|
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||||
|
|||||||
@@ -16,25 +16,6 @@
|
|||||||
|
|
||||||
LOCAL_PATH := $(my-dir)
|
LOCAL_PATH := $(my-dir)
|
||||||
|
|
||||||
###########################################################
|
|
||||||
# Variant: Privileged app
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
# this needs to be a privileged application
|
|
||||||
LOCAL_PRIVILEGED_MODULE := true
|
|
||||||
|
|
||||||
LOCAL_MODULE_TAGS := optional
|
|
||||||
LOCAL_SDK_VERSION := current
|
|
||||||
LOCAL_PROGUARD_ENABLED := disabled
|
|
||||||
LOCAL_DEX_PREOPT := false
|
|
||||||
|
|
||||||
LOCAL_PACKAGE_NAME := CtsShimPriv
|
|
||||||
|
|
||||||
LOCAL_MANIFEST_FILE := shim_priv/AndroidManifest.xml
|
|
||||||
|
|
||||||
include $(BUILD_PACKAGE)
|
|
||||||
|
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
# Variant: Privileged app upgrade
|
# Variant: Privileged app upgrade
|
||||||
|
|
||||||
@@ -52,7 +33,34 @@ LOCAL_PACKAGE_NAME := CtsShimPrivUpgrade
|
|||||||
LOCAL_MANIFEST_FILE := shim_priv_upgrade/AndroidManifest.xml
|
LOCAL_MANIFEST_FILE := shim_priv_upgrade/AndroidManifest.xml
|
||||||
|
|
||||||
include $(BUILD_PACKAGE)
|
include $(BUILD_PACKAGE)
|
||||||
|
my_shim_priv_upgrade_apk := $(LOCAL_BUILT_MODULE)
|
||||||
|
|
||||||
|
###########################################################
|
||||||
|
# Variant: Privileged app
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
# this needs to be a privileged application
|
||||||
|
LOCAL_PRIVILEGED_MODULE := true
|
||||||
|
|
||||||
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
LOCAL_SDK_VERSION := current
|
||||||
|
LOCAL_PROGUARD_ENABLED := disabled
|
||||||
|
LOCAL_DEX_PREOPT := false
|
||||||
|
|
||||||
|
LOCAL_PACKAGE_NAME := CtsShimPriv
|
||||||
|
|
||||||
|
# Generate the upgrade key by taking the hash of the built CtsShimPrivUpgrade apk
|
||||||
|
gen := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),,true)/AndroidManifest.xml
|
||||||
|
$(gen): PRIVATE_CUSTOM_TOOL = sed -e "s/__HASH__/`sha512sum $(PRIVATE_INPUT_APK) | cut -d' ' -f1`/" $< >$@
|
||||||
|
$(gen): PRIVATE_INPUT_APK := $(my_shim_priv_upgrade_apk)
|
||||||
|
$(gen): $(LOCAL_PATH)/shim_priv/AndroidManifest.xml $(my_shim_priv_upgrade_apk)
|
||||||
|
$(transform-generated-source)
|
||||||
|
|
||||||
|
my_shim_priv_upgrade_apk :=
|
||||||
|
|
||||||
|
LOCAL_FULL_MANIFEST_FILE := $(gen)
|
||||||
|
|
||||||
|
include $(BUILD_PACKAGE)
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
# Variant: System app
|
# Variant: System app
|
||||||
|
|||||||
@@ -6,31 +6,18 @@ must specify the singular APK that can be used to upgrade it.
|
|||||||
NOTE: The need to include a binary on the system image may be deprecated if a
|
NOTE: The need to include a binary on the system image may be deprecated if a
|
||||||
solution involving a temporarily writable /system partition is implemented.
|
solution involving a temporarily writable /system partition is implemented.
|
||||||
|
|
||||||
MAKING THE PREBUILTS
|
|
||||||
In order to generate the upgrade key, the shim directory needs to be built multiple
|
|
||||||
times. First to generate the upgrade APK [so its hash can be obtained] and again
|
|
||||||
once the hash has been included as part of the pre-installed APK.
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
$ mmm frameworks/base/packages/CtsShim/build
|
$ tapas CtsShim CtsShimPriv CtsShimPrivUpgrade
|
||||||
|
$ m
|
||||||
|
|
||||||
update the manifest:
|
local testing:
|
||||||
$ sed -i -e "s/__HASH__/`sha512sum out/target/product/shamu/system/priv-app/CtsShimPrivUpgrade/CtsShimPrivUpgrade.apk | cut -d' ' -f1`/" \
|
$ cp $OUT/system/priv-app/CtsShimPrivUpgrade/CtsShimPrivUpgrade.apk \
|
||||||
frameworks/base/packages/CtsShim/build/shim_priv/AndroidManifest.xml
|
|
||||||
|
|
||||||
build:
|
|
||||||
$ mmm frameworks/base/packages/CtsShim/build
|
|
||||||
|
|
||||||
update prebuilts:
|
|
||||||
$ cp out/target/product/shamu/system/priv-app/CtsShimPrivUpgrade/CtsShimPrivUpgrade.apk \
|
|
||||||
cts/hostsidetests/appsecurity/test-apps/PrivilegedUpdateApp
|
cts/hostsidetests/appsecurity/test-apps/PrivilegedUpdateApp
|
||||||
$ cp out/target/product/shamu/system/priv-app/CtsShimPriv/CtsShimPriv.apk \
|
$ cp $OUT/system/priv-app/CtsShimPriv/CtsShimPriv.apk \
|
||||||
frameworks/base/packages/CtsShim
|
frameworks/base/packages/CtsShim
|
||||||
$ cp out/target/product/shamu/system/app/CtsShim/CtsShim.apk \
|
$ cp $OUT/system/app/CtsShim/CtsShim.apk \
|
||||||
frameworks/base/packages/CtsShim
|
frameworks/base/packages/CtsShim
|
||||||
|
|
||||||
revert manifest:
|
For final submission, the APKs should be downloaded from the build server, then
|
||||||
$ pushd frameworks/base && git checkout -- packages/CtsShim/build/shim_priv/AndroidManifest.xml && popd
|
submitted to the cts/ and frameworks/base/ repos.
|
||||||
|
|
||||||
Finally, upload and submit both the cts/ and frameworks/base/ repos.
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user