chenkris | fe8968a | 2024-06-10 03:14:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2024 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 <android-base/file.h> |
| 17 | #include <dump/pixel_dump.h> |
| 18 | #include <log/log.h> |
| 19 | #include <stdio.h> |
| 20 | #include <string.h> |
| 21 | |
| 22 | static constexpr const char *kTombstonesDirPath = "/data/vendor/tombstones/fingerprint/"; |
| 23 | |
| 24 | int main() { |
| 25 | printf("------ Fingerprint tombstones ------\n"); |
| 26 | std::unique_ptr<DIR, decltype(&closedir)> tombstones_dir(opendir(kTombstonesDirPath), closedir); |
| 27 | if (tombstones_dir) { |
| 28 | dirent *entry; |
| 29 | while ((entry = readdir(tombstones_dir.get())) != nullptr) { |
| 30 | std::string file_name(entry->d_name); |
| 31 | if (!strcmp(file_name.c_str(), ".") || !strcmp(file_name.c_str(), "..")) |
| 32 | continue; |
| 33 | std::string file_path(kTombstonesDirPath + file_name); |
| 34 | dumpFileContent(file_name.c_str(), file_path.c_str()); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | return 0; |
| 39 | } |