xref: /aosp_15_r20/art/dexdump/dexdump.h (revision 795d594fd825385562da6b089ea9b2033f3abf5a)
1*795d594fSAndroid Build Coastguard Worker /*
2*795d594fSAndroid Build Coastguard Worker  * Copyright (C) 2015 The Android Open Source Project
3*795d594fSAndroid Build Coastguard Worker  *
4*795d594fSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
5*795d594fSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
6*795d594fSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
7*795d594fSAndroid Build Coastguard Worker  *
8*795d594fSAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
9*795d594fSAndroid Build Coastguard Worker  *
10*795d594fSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
11*795d594fSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
12*795d594fSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*795d594fSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
14*795d594fSAndroid Build Coastguard Worker  * limitations under the License.
15*795d594fSAndroid Build Coastguard Worker  *
16*795d594fSAndroid Build Coastguard Worker  * Header file of the dexdump utility.
17*795d594fSAndroid Build Coastguard Worker  *
18*795d594fSAndroid Build Coastguard Worker  * This is a re-implementation of the original dexdump utility that was
19*795d594fSAndroid Build Coastguard Worker  * based on Dalvik functions in libdex into a new dexdump that is now
20*795d594fSAndroid Build Coastguard Worker  * based on Art functions in libart instead. The output is identical to
21*795d594fSAndroid Build Coastguard Worker  * the original for correct DEX files. Error messages may differ, however.
22*795d594fSAndroid Build Coastguard Worker  * Also, ODEX files are no longer supported.
23*795d594fSAndroid Build Coastguard Worker  */
24*795d594fSAndroid Build Coastguard Worker 
25*795d594fSAndroid Build Coastguard Worker #ifndef ART_DEXDUMP_DEXDUMP_H_
26*795d594fSAndroid Build Coastguard Worker #define ART_DEXDUMP_DEXDUMP_H_
27*795d594fSAndroid Build Coastguard Worker 
28*795d594fSAndroid Build Coastguard Worker #include <stdint.h>
29*795d594fSAndroid Build Coastguard Worker #include <stdio.h>
30*795d594fSAndroid Build Coastguard Worker 
31*795d594fSAndroid Build Coastguard Worker namespace art {
32*795d594fSAndroid Build Coastguard Worker 
33*795d594fSAndroid Build Coastguard Worker /* Supported output formats. */
34*795d594fSAndroid Build Coastguard Worker enum OutputFormat {
35*795d594fSAndroid Build Coastguard Worker   OUTPUT_PLAIN = 0,  // default
36*795d594fSAndroid Build Coastguard Worker   OUTPUT_XML,        // XML-style
37*795d594fSAndroid Build Coastguard Worker };
38*795d594fSAndroid Build Coastguard Worker 
39*795d594fSAndroid Build Coastguard Worker /* Command-line options. */
40*795d594fSAndroid Build Coastguard Worker struct Options {
41*795d594fSAndroid Build Coastguard Worker   bool checksumOnly;
42*795d594fSAndroid Build Coastguard Worker   bool disassemble;
43*795d594fSAndroid Build Coastguard Worker   bool exportsOnly;
44*795d594fSAndroid Build Coastguard Worker   bool ignoreBadChecksum;
45*795d594fSAndroid Build Coastguard Worker   bool disableVerifier;
46*795d594fSAndroid Build Coastguard Worker   bool showAnnotations;
47*795d594fSAndroid Build Coastguard Worker   bool showCfg;
48*795d594fSAndroid Build Coastguard Worker   bool showFileHeaders;
49*795d594fSAndroid Build Coastguard Worker   bool showSectionHeaders;
50*795d594fSAndroid Build Coastguard Worker   bool showDebugInfo;
51*795d594fSAndroid Build Coastguard Worker   bool verbose;
52*795d594fSAndroid Build Coastguard Worker   OutputFormat outputFormat;
53*795d594fSAndroid Build Coastguard Worker   const char* outputFileName;
54*795d594fSAndroid Build Coastguard Worker   bool showAllStrings;
55*795d594fSAndroid Build Coastguard Worker };
56*795d594fSAndroid Build Coastguard Worker 
57*795d594fSAndroid Build Coastguard Worker /* Prototypes. */
58*795d594fSAndroid Build Coastguard Worker extern struct Options gOptions;
59*795d594fSAndroid Build Coastguard Worker extern FILE* gOutFile;
60*795d594fSAndroid Build Coastguard Worker int processFile(const char* fileName);
61*795d594fSAndroid Build Coastguard Worker 
62*795d594fSAndroid Build Coastguard Worker }  // namespace art
63*795d594fSAndroid Build Coastguard Worker 
64*795d594fSAndroid Build Coastguard Worker #endif  // ART_DEXDUMP_DEXDUMP_H_
65