xref: /aosp_15_r20/frameworks/av/media/mtp/tests/MtpFuzzer/Android.bp (revision ec779b8e0859a360c3d303172224686826e6e0e1)
1/*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package {
18    // See: http://go/android-license-faq
19    // A large-scale-change added 'default_applicable_licenses' to import
20    // all of the 'license_kinds' from "frameworks_av_media_mtp_license"
21    // to get the below license kinds:
22    //   SPDX-license-identifier-Apache-2.0
23    default_applicable_licenses: ["frameworks_av_media_mtp_license"],
24}
25cc_defaults {
26    name: "mtp_fuzzer_defaults",
27    shared_libs: [
28        "libbase",
29        "liblog",
30        "libutils",
31    ],
32    cflags: [
33        "-Wall",
34        "-Wextra",
35        "-Werror",
36        "-Wno-unused-parameter",
37    ],
38    fuzz_config: {
39
40        cc: ["[email protected]"],
41        componentid: 1407286,
42        acknowledgement: [
43            "Grant Hernandez of Google",
44        ],
45        hotlists: [
46            "4593311",
47        ],
48        description: "The fuzzer targets the APIs of libmtp library",
49        vector: "local_no_privileges_required",
50        service_privilege: "privileged",
51        users: "multi_user",
52        fuzzed_code_usage: "shipped",
53    },
54}
55cc_fuzz {
56    name: "mtp_fuzzer",
57    srcs: [
58        "mtp_fuzzer.cpp",
59        "MtpMockDatabase.cpp",
60    ],
61    cflags: ["-DMTP_DEVICE",],
62    shared_libs: ["libmtp",],
63    defaults: ["mtp_fuzzer_defaults"],
64    dictionary: "mtp_fuzzer.dict",
65    corpus: ["corpus/*"],
66}
67
68cc_defaults {
69    name: "mtp_property_fuzzer_defaults",
70    srcs: ["mtp_property_fuzzer.cpp"],
71    shared_libs: [
72        "libmtp",
73        "libasyncio",
74        "libusbhost",
75    ],
76    defaults: ["mtp_fuzzer_defaults"],
77}
78
79cc_fuzz {
80     name: "mtp_device_property_fuzzer",
81     defaults: ["mtp_property_fuzzer_defaults"],
82     cflags: [
83         "-DMTP_DEVICE",
84     ],
85}
86
87cc_fuzz {
88     name: "mtp_host_property_fuzzer",
89     defaults: ["mtp_property_fuzzer_defaults"],
90     cflags: [
91         "-DMTP_HOST",
92     ],
93}
94
95cc_fuzz {
96    name: "mtp_handle_fuzzer",
97    srcs: ["mtp_handle_fuzzer.cpp"],
98    shared_libs: ["libmtp_fuzz"],
99    defaults: ["mtp_fuzzer_defaults"],
100    cflags: ["-DMTP_FUZZER"],
101}
102
103cc_defaults  {
104     name: "mtp_packet_defaults",
105     shared_libs: [
106        "libmtp",
107        "libasyncio",
108        "libusbhost",
109     ],
110     defaults: ["mtp_fuzzer_defaults"],
111     cflags: [
112         "-DMTP_HOST",
113         "-DMTP_DEVICE",
114     ],
115}
116
117cc_fuzz {
118     name: "mtp_packet_fuzzer",
119     srcs: ["mtp_packet_fuzzer.cpp"],
120     defaults: ["mtp_packet_defaults"],
121}
122
123cc_fuzz {
124     name: "mtp_device_fuzzer",
125     srcs: ["mtp_device_fuzzer.cpp"],
126     shared_libs: [
127        "libmtp",
128        "libusbhost",
129     ],
130     defaults: ["mtp_fuzzer_defaults"],
131     cflags: [
132         "-DMTP_DEVICE",
133     ],
134}
135
136cc_fuzz {
137     name: "mtp_request_packet_fuzzer",
138     srcs: ["mtp_request_packet_fuzzer.cpp"],
139     defaults: ["mtp_packet_defaults"],
140}
141
142cc_fuzz {
143     name: "mtp_event_packet_fuzzer",
144     srcs: ["mtp_event_packet_fuzzer.cpp"],
145     defaults: ["mtp_packet_defaults"],
146}
147
148cc_fuzz {
149     name: "mtp_response_packet_fuzzer",
150     srcs: ["mtp_response_packet_fuzzer.cpp"],
151     defaults: ["mtp_packet_defaults"],
152}
153
154cc_fuzz {
155     name: "mtp_data_packet_fuzzer",
156     srcs: ["mtp_data_packet_fuzzer.cpp"],
157     defaults: ["mtp_packet_defaults"],
158}
159