| package { |
| // See: http://go/android-license-faq |
| // A large-scale-change added 'default_applicable_licenses' to import |
| // all of the 'license_kinds' from "system_nfc_license" |
| // to get the below license kinds: |
| // SPDX-license-identifier-Apache-2.0 |
| default_applicable_licenses: ["system_nfc_license"], |
| } |
| |
| cc_library_shared { |
| arch: { |
| arm: { |
| instruction_set: "arm", |
| }, |
| }, |
| name: "libnfc-nci", |
| shared_libs: [ |
| "libcutils", |
| "liblog", |
| "libdl", |
| "libz", |
| "libchrome", |
| "libbase", |
| "libstatslog", |
| |
| // Treble configuration |
| "libhidlbase", |
| "libutils", |
| "android.hardware.nfc@1.0", |
| "android.hardware.nfc@1.1", |
| "android.hardware.nfc@1.2", |
| // Add for AIDL |
| "android.hardware.nfc-V1-ndk", |
| "libbinder_ndk", |
| ], |
| static_libs: [ |
| "libnfcutils", |
| ], |
| cflags: [ |
| "-DDYN_ALLOC=1", |
| "-DBUILDCFG=1", |
| "-DGKI_PTHREAD_JOINABLE", |
| "-Wall", |
| "-Werror", |
| "-Wimplicit-fallthrough", |
| ], |
| local_include_dirs: [ |
| "include", |
| "gki/ulinux", |
| "gki/common", |
| "nfa/include", |
| "nfc/include", |
| ], |
| srcs: [ |
| "nfa/ce/*.cc", |
| "nfa/dm/*.cc", |
| "nfa/ee/*.cc", |
| "nfa/hci/*.cc", |
| "nfa/p2p/*.cc", |
| "nfa/rw/*.cc", |
| "nfa/sys/*.cc", |
| "nfc/llcp/*.cc", |
| "nfc/nci/*.cc", |
| "nfc/ndef/*.cc", |
| "nfc/nfc/*.cc", |
| "nfc/tags/*.cc", |
| "adaptation/*.cc", |
| "gki/common/*.cc", |
| "gki/ulinux/*.cc", |
| ], |
| required: [ |
| // Provide a default libnfc-nci.conf in /system/etc for devices that |
| // does not ship one in /product |
| "libnfc-nci.conf-default", |
| ], |
| product_variables: { |
| debuggable: { |
| cflags: [ |
| "-DDCHECK_ALWAYS_ON", |
| ], |
| }, |
| }, |
| sanitize: { |
| misc_undefined: ["bounds"], |
| integer_overflow: true, |
| scs: true, |
| }, |
| |
| } |
| |
| cc_defaults { |
| name: "nfc_fuzzer_defaults", |
| host_supported: true, |
| native_coverage: true, |
| static_libs: [ |
| "libnfcutils", |
| "libcutils", |
| "liblog", |
| "libbase", |
| "libchrome", |
| ], |
| cflags: [ |
| "-DBUILDCFG=1", |
| "-Wall", |
| "-Werror", |
| "-Wimplicit-fallthrough", |
| "-g", |
| "-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION", |
| "-DGKI_ENABLE_BUF_CORRUPTION_CHECK=FALSE", |
| ], |
| product_variables: { |
| debuggable: { |
| cflags: [ |
| "-DDCHECK_ALWAYS_ON" |
| ], |
| }, |
| }, |
| local_include_dirs: [ |
| "include", |
| "gki/ulinux", |
| "gki/common", |
| "nfc/include", |
| "nfa/include", |
| "fuzzers/inc", |
| ], |
| fuzz_config: { |
| cc: [ |
| "android-security-assurance-redteam@google.com", |
| "zachoverflow@google.com", |
| "jackcwyu@google.com", |
| "georgekgchang@google.com", |
| "alisher@google.com", |
| ], |
| }, |
| } |
| |
| cc_fuzz { |
| name: "nfc_nci_fuzzer", |
| defaults: ["nfc_fuzzer_defaults"], |
| srcs: [ |
| "nfc/nci/*.cc", |
| "nfc/nfc/*.cc", |
| "adaptation/debug_lmrt.cc", |
| "gki/common/*.cc", |
| "gki/ulinux/*.cc", |
| "fuzzers/*.cc", |
| "fuzzers/nci/*.cc", |
| ], |
| } |
| |
| cc_fuzz { |
| name: "nfc_rw_fuzzer", |
| defaults: ["nfc_fuzzer_defaults"], |
| srcs: [ |
| "nfc/tags/rw_*.cc", |
| "nfc/tags/tags_int.cc", |
| "gki/common/*.cc", |
| "gki/ulinux/*.cc", |
| "fuzzers/*.cc", |
| "fuzzers/rw/*.cc", |
| ], |
| } |
| |
| cc_fuzz { |
| name: "nfc_ce_fuzzer", |
| defaults: ["nfc_fuzzer_defaults"], |
| srcs: [ |
| "nfc/tags/ce_*.cc", |
| "nfc/tags/tags_int.cc", |
| "gki/common/*.cc", |
| "gki/ulinux/*.cc", |
| "fuzzers/*.cc", |
| "fuzzers/ce/*.cc", |
| ], |
| } |
| |
| cc_fuzz { |
| name: "nfc_ndef_fuzzer", |
| defaults: ["nfc_fuzzer_defaults"], |
| srcs: [ |
| "nfa/dm/nfa_dm_ndef.cc", |
| "nfc/ndef/*.cc", |
| "gki/common/*.cc", |
| "gki/ulinux/*.cc", |
| "fuzzers/*.cc", |
| "fuzzers/ndef/*.cc", |
| ], |
| } |
| |
| cc_fuzz { |
| name: "nfc_llcp_fuzzer", |
| defaults: ["nfc_fuzzer_defaults"], |
| srcs: [ |
| "nfc/llcp/*.cc", |
| "gki/common/*.cc", |
| "gki/ulinux/*.cc", |
| "fuzzers/*.cc", |
| "fuzzers/llcp/*.cc", |
| ], |
| } |
| |
| cc_library_static { |
| name: "nfc_integration_fuzzer_proto", |
| owner: "google", |
| host_supported: true, |
| srcs: ["fuzzers/integration/nfc_integration_fuzzer.proto"], |
| proto: { |
| type: "full", |
| export_proto_headers: true, |
| }, |
| shared_libs: ["libprotobuf-cpp-full"], |
| } |
| |
| cc_fuzz { |
| name: "nfc_integration_fuzzer", |
| defaults: ["nfc_fuzzer_defaults"], |
| srcs: [ |
| "adaptation/debug_nfcsnoop.cc", |
| "fuzzers/integration/*.cc", |
| "fuzzers/integration/fakes/*.cc", |
| "gki/common/gki_buffer.cc", |
| "adaptation/debug_lmrt.cc", |
| "nfa/ce/*.cc", |
| "nfa/dm/*.cc", |
| "nfa/ee/*.cc", |
| "nfa/hci/*.cc", |
| "nfa/p2p/*.cc", |
| "nfa/rw/*.cc", |
| "nfa/sys/*.cc", |
| "nfc/llcp/*.cc", |
| "nfc/nci/*.cc", |
| "nfc/ndef/*.cc", |
| "nfc/nfc/*.cc", |
| "nfc/tags/*.cc", |
| ], |
| cflags: [ |
| "-DNFC_INTEGRATION_FUZZER", |
| ], |
| local_include_dirs: [ |
| "fuzzers/integration", |
| "fuzzers/integration/fakes", |
| ], |
| static_libs: [ |
| "libprotobuf-mutator", |
| "libutils", |
| "nfc_integration_fuzzer_proto", |
| ], |
| shared_libs: [ |
| "libprotobuf-cpp-full", |
| "libz", |
| ] |
| } |
| |
| genrule { |
| name: "NfcGeneratedPackets_rust", |
| tools: [ |
| "bluetooth_packetgen", |
| ], |
| cmd: "$(location bluetooth_packetgen) --include=system/nfc/src --out=$(genDir) $(in) --rust", |
| srcs: [ |
| "nci_packets.pdl", |
| ], |
| out: [ |
| "nci_packets.rs", |
| ], |
| } |
| |
| rust_library { |
| name: "libnfc_packets", |
| defaults: ["nfc_rust_defaults"], |
| crate_name: "nfc_packets", |
| srcs: ["rust/packets/lib.rs", ":NfcGeneratedPackets_rust"], |
| host_supported: true, |
| proc_macros: ["libnum_derive"], |
| rustlibs: [ |
| "libbytes", |
| "libnum_traits", |
| "libthiserror", |
| "liblog_rust", |
| ], |
| } |
| |
| rust_test_host { |
| name: "libnfc_packets_test", |
| defaults: ["nfc_rust_defaults"], |
| srcs: ["rust/packets/lib.rs", ":NfcGeneratedPackets_rust"], |
| test_suites: ["general-tests"], |
| proc_macros: ["libnum_derive"], |
| rustlibs: [ |
| "libbytes", |
| "libnum_traits", |
| "libthiserror", |
| "liblog_rust", |
| ], |
| } |