lib/DexClient.java in ruboto-0.9.0 vs lib/DexClient.java in ruboto-0.10.0.rc.0
- old
+ new
@@ -2,24 +2,30 @@
import java.io.ByteArrayOutputStream;
import java.io.OutputStreamWriter;
import com.android.dx.cf.iface.ParseException;
+// import com.android.dx.dex.DexFormat;
+// import com.android.dx.dex.DexOptions;
import com.android.dx.dex.cf.CfOptions;
import com.android.dx.dex.cf.CfTranslator;
import com.android.dx.dex.code.PositionList;
import com.android.dx.dex.file.ClassDefItem;
import com.android.dx.dex.file.DexFile;
public class DexClient {
/** {@code non-null;} output file in-progress */
private static DexFile outputDex;
-
+ // private static DexOptions dexOptions = new DexOptions();
+ // static {
+ // dexOptions.targetApiLevel = DexFormat.API_NO_EXTENDED_OPCODES;
+ // }
private final CfOptions cfOptions;
public DexClient() {
outputDex = new DexFile();
+ // outputDex = new DexFile(dexOptions);
cfOptions = new CfOptions();
cfOptions.positionInfo = PositionList.LINES;
cfOptions.localInfo = true;
cfOptions.strictNameCheck = true;
@@ -49,11 +55,12 @@
* @param bytes {@code non-null;} contents of the file
* @return whether processing was successful
*/
private boolean processClass(String name, byte[] bytes) {
try {
- ClassDefItem clazz =
- CfTranslator.translate(name, bytes, cfOptions);
+ ClassDefItem clazz;
+ clazz = CfTranslator.translate(name, bytes, cfOptions);
+ // clazz = CfTranslator.translate(name, bytes, cfOptions, dexOptions);
outputDex.add(clazz);
return true;
} catch (ParseException ex) {
ex.printStackTrace();
}