Todd Kennedy 317d352de3 New non-priv prebuilt
Need to target API 24 and not 'N'

Bug: 29116156
Change-Id: Iec215f41147ca13e955b02dc57eaabee89589cf0
2016-06-06 09:38:49 -07:00
..
2016-06-06 09:38:49 -07:00

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/PrivilegedUpdateApp
    $ cp out/target/product/shamu/system/priv-app/CtsShimPriv/CtsShimPriv.apk \
        frameworks/base/packages/CtsShim
    $ cp out/target/product/shamu/system/app/CtsShim/CtsShim.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.