xref: /aosp_15_r20/cts/hostsidetests/securitybulletin/test-apps/BUG-237291548/Android.bp (revision b7c941bb3fa97aba169d73cee0bed2de8ac964bf)
1// Copyright (C) 2022 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_team: "trendy_team_platform_security",
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20android_test_helper_app {
21    name: "BUG-237291548",
22    defaults: ["cts_support_defaults"],
23    srcs: ["src/**/*.java"],
24    test_suites: [
25        "cts",
26        "vts10",
27        "sts",
28    ],
29    static_libs: [
30        "androidx.appcompat_appcompat",
31        "androidx.test.rules",
32        "androidx.test.uiautomator_uiautomator",
33        "androidx.test.core",
34    ],
35    sdk_version: "current",
36}
37
38android_test_helper_app {
39    name: "BUG-237291548-FAIL-INSTALL",
40    defaults: ["cts_support_defaults"],
41    srcs: ["src/**/*.java"],
42    manifest: ":BUG-237291548-BAD-MANIFEST",
43    test_suites: [
44        "cts",
45        "vts10",
46        "sts",
47    ],
48    static_libs: [
49        "androidx.appcompat_appcompat",
50        "androidx.test.rules",
51        "androidx.test.uiautomator_uiautomator",
52        "androidx.test.core",
53    ],
54    sdk_version: "current",
55}
56
57// Modify the manifest file to include more than 500 MIME groups. The resulting
58// test apk generated using this manifest should fail package install since the
59// number of MIME groups is limited to a maximum of 500 per package.
60genrule {
61    name: "BUG-237291548-BAD-MANIFEST",
62    srcs: ["AndroidManifest.xml"],
63    out: ["BadAndroidManifest.xml"],
64    cmd: "awk '/myMimeGroup/{print;for(i=0;i<501;i++){sub(/myMimeGroup[0-9]*/,\"myMimeGroup\"i);print}}1' $(in) > $(out)",
65}
66