1load("//bazel:compat.bzl", "SKIP_ON_WINDOWS") 2load("@fmeum_rules_jni//jni:defs.bzl", "cc_jni_library") 3load("@bazel_skylib//rules:copy_file.bzl", "copy_file") 4 5copy_file( 6 name = "jvmti_h_encoded", 7 src = "@android_jvmti//file", 8 out = "jvmti.encoded", 9 is_executable = False, 10 tags = ["manual"], 11 target_compatible_with = SKIP_ON_WINDOWS, 12) 13 14genrule( 15 name = "jvmti_h", 16 srcs = [ 17 "jvmti.encoded", 18 ], 19 outs = ["jvmti.h"], 20 cmd = "base64 --decode $< > $(OUTS)", 21 tags = ["manual"], 22 target_compatible_with = SKIP_ON_WINDOWS, 23) 24 25cc_jni_library( 26 name = "android_native_agent", 27 srcs = [ 28 "dex_file_manager.cpp", 29 "dex_file_manager.h", 30 "jazzer_jvmti_allocator.h", 31 "native_agent.cpp", 32 ":jvmti_h", 33 ], 34 includes = [ 35 ".", 36 ], 37 linkopts = [ 38 "-lz", 39 ], 40 tags = ["manual"], 41 target_compatible_with = SKIP_ON_WINDOWS, 42 visibility = ["//visibility:public"], 43 deps = [ 44 "@com_google_absl//absl/strings", 45 "@jazzer_slicer", 46 ], 47) 48