1 /* 2 * Copyright (C) 2011 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 package com.android.dx.dex; 18 19 /** 20 * Container for options used to control details of dex file generation. 21 */ 22 public class DexOptions { 23 /** target API level */ 24 public int targetApiLevel = DexFormat.API_NO_EXTENDED_OPCODES; 25 26 /** 27 * Gets the dex file magic number corresponding to this instance. 28 */ getMagic()29 public String getMagic() { 30 return DexFormat.apiToMagic(targetApiLevel); 31 } 32 33 /** 34 * Returns whether extended opcodes are allowed. This became 35 * allowed as of Ice Cream Sandwich. 36 */ canUseExtendedOpcodes()37 public boolean canUseExtendedOpcodes() { 38 return targetApiLevel >= DexFormat.API_CURRENT; 39 } 40 } 41