Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d0b59c1 authored by Todd Kennedy's avatar Todd Kennedy
Browse files

Update CTS shims

* define a update hash such that com.android.cts.priv.ctsshim can't
  be updated
* create a new APK to verify that <restrict-update> works as expected

Bug: 29311441
Change-Id: I61f3ae3dbd9c79b2dcdfbc30757af0f9a669fce6
parent 8507d98a
Loading
Loading
Loading
Loading
+105 B (4.71 KiB)

File changed.

No diff preview for this file type.

+49 B (5.93 KiB)

File changed.

No diff preview for this file type.

+21 −0
Original line number Diff line number Diff line
@@ -62,6 +62,27 @@ LOCAL_FULL_MANIFEST_FILE := $(gen)

include $(BUILD_PACKAGE)

###########################################################
# Variant: Privileged app upgrade w/ the wrong SHA

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
# anything to make this package's SHA different from CtsShimPrivUpgrade
LOCAL_AAPT_FLAGS := --version-name WrongSHA

LOCAL_PACKAGE_NAME := CtsShimPrivUpgradeWrongSHA

LOCAL_MANIFEST_FILE := shim_priv_upgrade/AndroidManifest.xml

include $(BUILD_PACKAGE)


###########################################################
# Variant: System app

+3 −1
Original line number Diff line number Diff line
@@ -7,12 +7,14 @@ 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.

build:
    $ tapas CtsShim CtsShimPriv CtsShimPrivUpgrade
    $ tapas CtsShim CtsShimPriv CtsShimPrivUpgrade CtsShimPrivUpgradeWrongSHA
    $ m

local testing:
    $ cp $OUT/system/priv-app/CtsShimPrivUpgrade/CtsShimPrivUpgrade.apk \
        cts/hostsidetests/appsecurity/test-apps/PrivilegedUpdateApp
    $ cp $OUT/system/priv-app/CtsShimPrivUpgradeWrongSHA/CtsShimPrivUpgradeWrongSHA.apk \
        cts/hostsidetests/appsecurity/test-apps/PrivilegedUpdateApp
    $ cp $OUT/system/priv-app/CtsShimPriv/CtsShimPriv.apk \
        frameworks/base/packages/CtsShim
    $ cp $OUT/system/app/CtsShim/CtsShim.apk \
+3 −0
Original line number Diff line number Diff line
@@ -22,6 +22,9 @@
    <uses-sdk android:minSdkVersion="24"
        android:targetSdkVersion="24" />

    <restrict-update
        android:hash="__CAN_NOT_BE_UPDATED__" />

    <application
        android:hasCode="false"
        tools:ignore="AllowBackup,MissingApplicationIcon" >
Loading