blob: b1c6940207db318eb832bd530712a2969528c3b7 [file] [log] [blame]
Pawan Wagh00777b22023-05-17 20:20:33 +00001/*
2 * Copyright (C) 2023 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#include <fuzzbinder/libbinder_driver.h>
17
18#include "InstalldNativeService.h"
19#include "dexopt.h"
20
21using ::android::fuzzService;
22using ::android::sp;
23using ::android::installd::InstalldNativeService;
24
25namespace android {
26namespace installd {
27
28bool calculate_oat_file_path(char path[PKG_PATH_MAX], const char* oat_dir, const char* apk_path,
29 const char* instruction_set) {
30 return calculate_oat_file_path_default(path, oat_dir, apk_path, instruction_set);
31}
32
33bool calculate_odex_file_path(char path[PKG_PATH_MAX], const char* apk_path,
34 const char* instruction_set) {
35 return calculate_odex_file_path_default(path, apk_path, instruction_set);
36}
37
38bool create_cache_path(char path[PKG_PATH_MAX], const char* src, const char* instruction_set) {
39 return create_cache_path_default(path, src, instruction_set);
40}
41
42bool force_compile_without_image() {
43 return false;
44}
45
46} // namespace installd
47} // namespace android
48
49extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
50 auto service = sp<InstalldNativeService>::make();
51 fuzzService(service, FuzzedDataProvider(data, size));
52 return 0;
53}