The testing shim should be included as a prebuilt. This allows us to destroy the signing key. This means that the shim can never be upgraded in the field; aside from its intended purpose in a CTS test. Bug: 28398205 Change-Id: I033835d227416ff8aa6602abfc8b977c74cb666d
33 lines
1.4 KiB
Plaintext
33 lines
1.4 KiB
Plaintext
|
|
The CTS shim is a package that resides on a device's /system partition in order
|
|
to verify certain upgrade scenarios. Not only must it not contain code, but, it
|
|
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
|
|
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:
|
|
$ mmm frameworks/base/packages/CtsShim/build
|
|
|
|
update the manifest:
|
|
$ sed -i -e "s/__HASH__/`sha512sum out/target/product/shamu/system/priv-app/CtsShimPrivUpgrade/CtsShimPrivUpgrade.apk | cut -d' ' -f1`/" \
|
|
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/IntentFilterApp
|
|
$ cp out/target/product/shamu/system/priv-app/CtsShimPriv/CtsShimPriv.apk \
|
|
frameworks/base/packages/CtsShim
|
|
|
|
revert manifest:
|
|
$ pushd frameworks/base && git checkout -- packages/CtsShim/build/shim_priv/AndroidManifest.xml && popd
|
|
|
|
Finally, upload and submit both the cts/ and frameworks/base/ repos. |