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

Commit 57c68c74 authored by Mohammad Samiul Islam's avatar Mohammad Samiul Islam
Browse files

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
parent cc45f332
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -99,6 +99,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

+22 −0
Original line number Diff line number Diff line
<!--
  ~ 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