diff options
author | Mohammad Samiul Islam <samiul@google.com> | 2020-03-27 19:46:26 +0000 |
---|---|---|
committer | Mohammad Samiul Islam <samiul@google.com> | 2020-03-27 19:51:51 +0000 |
commit | 57c68c7482b66e8a47964395866e370dce894b27 (patch) | |
tree | 2381d276d777d11eaa41c9105a911a155fa44de2 /packages/CtsShim | |
parent | cc45f332a42d4d62b321a28363b28273361200f7 (diff) |
Create a shim apk which is malformed
This shim-apk will be embedded in an apex to test out scenarios where
apk-in-apex fails to install.
Since this shim-apk is malformed, PackageManager will fail to parse it.
Hence it should not be possible to install this app at all. Hence I did
not add the hash of this shim-apk inside the manifest of shim-apk-v1
that comes pre-installed with device.
Bug: 152021141
Test: builds succesfully
Test: adb install CtsShimTargetPSdk.apk (fails to parse)
Change-Id: I3509009de62d38c5028185fe3588b674aa006e56
Diffstat (limited to 'packages/CtsShim')
-rw-r--r-- | packages/CtsShim/build/Android.bp | 14 | ||||
-rw-r--r-- | packages/CtsShim/build/shim/AndroidManifestTargetPSdk.xml | 22 |
2 files changed, 36 insertions, 0 deletions
diff --git a/packages/CtsShim/build/Android.bp b/packages/CtsShim/build/Android.bp index ede1fab64973..587109d5dae9 100644 --- a/packages/CtsShim/build/Android.bp +++ b/packages/CtsShim/build/Android.bp @@ -100,6 +100,20 @@ android_app { } //########################################################## +// Variant: Non Privileged app upgrade which is malformed +android_app { + name: "CtsShimTargetPSdk", + sdk_version: "current", + optimize: { + enabled: false, + }, + dex_preopt: { + enabled: false, + }, + manifest: "shim/AndroidManifestTargetPSdk.xml" +} + +//########################################################## // Variant: System app android_app { diff --git a/packages/CtsShim/build/shim/AndroidManifestTargetPSdk.xml b/packages/CtsShim/build/shim/AndroidManifestTargetPSdk.xml new file mode 100644 index 000000000000..2e9381aac806 --- /dev/null +++ b/packages/CtsShim/build/shim/AndroidManifestTargetPSdk.xml @@ -0,0 +1,22 @@ +<!-- + ~ Copyright (C) 2020 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.android.apk.cts.shim" + android:versionCode="2" + android:versionName="2.0" > + + <uses-sdk android:minSdkVersion="28" android:targetSdkVersion="P" /> +</manifest>
\ No newline at end of file |