1 /*
2  * Copyright 2012, Google Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  *     * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *     * Redistributions in binary form must reproduce the above
12  * copyright notice, this list of conditions and the following disclaimer
13  * in the documentation and/or other materials provided with the
14  * distribution.
15  *     * Neither the name of Google Inc. nor the names of its
16  * contributors may be used to endorse or promote products derived from
17  * this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 package org.jf.dexlib2;
33 
34 public enum Format {
35     Format10t(2),
36     Format10x(2),
37     Format11n(2),
38     Format11x(2),
39     Format12x(2),
40     Format20bc(4),
41     Format20t(4),
42     Format21c(4),
43     Format21ih(4),
44     Format21lh(4),
45     Format21s(4),
46     Format21t(4),
47     Format22b(4),
48     Format22c(4),
49     Format22cs(4),
50     Format22s(4),
51     Format22t(4),
52     Format22x(4),
53     Format23x(4),
54     Format25x(4),
55     Format30t(6),
56     Format31c(6),
57     Format31i(6),
58     Format31t(6),
59     Format32x(6),
60     Format35c(6),
61     Format35mi(6),
62     Format35ms(6),
63     Format3rc(6),
64     Format3rmi(6),
65     Format3rms(6),
66     Format51l(10),
67     ArrayPayload(-1, true),
68     PackedSwitchPayload(-1, true),
69     SparseSwitchPayload(-1, true),
70     UnresolvedOdexInstruction(-1);
71 
72     public final int size;
73     public final boolean isPayloadFormat;
74 
Format(int size)75     private Format(int size) {
76         this(size, false);
77     }
78 
Format(int size, boolean isPayloadFormat)79     private Format(int size, boolean isPayloadFormat) {
80         this.size = size;
81         this.isPayloadFormat = isPayloadFormat;
82     }
83 }
84