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     Format30t(6),
55     Format31c(6),
56     Format31i(6),
57     Format31t(6),
58     Format32x(6),
59     Format35c(6),
60     Format35mi(6),
61     Format35ms(6),
62     Format3rc(6),
63     Format3rmi(6),
64     Format3rms(6),
65     Format51l(10),
66     ArrayPayload(-1, true),
67     PackedSwitchPayload(-1, true),
68     SparseSwitchPayload(-1, true),
69     UnresolvedOdexInstruction(-1);
70 
71     public final int size;
72     public final boolean isPayloadFormat;
73 
Format(int size)74     private Format(int size) {
75         this(size, false);
76     }
77 
Format(int size, boolean isPayloadFormat)78     private Format(int size, boolean isPayloadFormat) {
79         this.size = size;
80         this.isPayloadFormat = isPayloadFormat;
81     }
82 }
83