Ryan Mitchell | fc225b2 | 2018-08-21 14:52:51 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2018 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 | |
| 17 | #ifndef AAPT2_DUMP_MANIFEST_H |
| 18 | #define AAPT2_DUMP_MANIFEST_H |
| 19 | |
| 20 | #include <Diagnostics.h> |
| 21 | #include <ValueVisitor.h> |
| 22 | #include <io/ZipArchive.h> |
| 23 | |
| 24 | |
| 25 | #include "cmd/Command.h" |
| 26 | #include "process/IResourceTableConsumer.h" |
| 27 | #include "text/Printer.h" |
| 28 | #include "xml/XmlDom.h" |
| 29 | |
| 30 | namespace aapt { |
| 31 | |
| 32 | class DumpBadgingCommand : public Command { |
| 33 | public: |
| 34 | explicit DumpBadgingCommand(IDiagnostics* diag) : Command("badging"), diag_(diag) { |
| 35 | SetDescription("Print information extracted from the manifest of the APK."); |
| 36 | AddOptionalSwitch("--include-meta-data", "Include meta-data information.", |
| 37 | &include_metadata_); |
| 38 | } |
| 39 | |
| 40 | int Action(const std::vector<std::string>& args) override; |
| 41 | |
| 42 | private: |
| 43 | IDiagnostics* diag_; |
| 44 | bool include_metadata_ = false; |
| 45 | }; |
| 46 | |
| 47 | class DumpPermissionsCommand : public Command { |
| 48 | public: |
| 49 | explicit DumpPermissionsCommand(IDiagnostics* diag) : Command("permissions"), diag_(diag) { |
| 50 | SetDescription("Print the permissions extracted from the manifest of the APK."); |
| 51 | } |
| 52 | |
| 53 | int Action(const std::vector<std::string>& args) override; |
| 54 | |
| 55 | private: |
| 56 | IDiagnostics* diag_; |
| 57 | }; |
| 58 | |
| 59 | }// namespace aapt |
| 60 | |
| 61 | #endif //AAPT2_DUMP_MANIFEST_H |