DexFile getDexFile() { if (outputDex == null) { DexOptions options = new DexOptions(); options.minSdkVersion = DexFormat.API_NO_EXTENDED_OPCODES; outputDex = new DexFile(options); } return outputDex; }
/** * Generates a dex file and returns its bytes. */ public byte[] generate() { if (outputDex == null) { DexOptions options = new DexOptions(); options.minSdkVersion = DexFormat.API_NO_EXTENDED_OPCODES; outputDex = new DexFile(options); } for (TypeDeclaration typeDeclaration : types.values()) { outputDex.add(typeDeclaration.toClassDefItem()); } try { return outputDex.toDex(null, false); } catch (IOException e) { throw new RuntimeException(e); } }
com.android.dx.dex.file.DexFile dxFile = new com.android.dx.dex.file.DexFile(dexOptions); try { CfTranslator.translate(new DxContext(), dcf, data, cfOptions, dexOptions, dxFile);
/** * {@inheritDoc} */ public DexProcessor.Conversion create() { return new Conversion(new DexFile(dexFileOptions)); }
private void createDexFile() { outputDex = new DexFile(args.dexOptions); if (args.dumpWidth != 0) { outputDex.setDumpWidth(args.dumpWidth); } }
private void createDexFile() { outputDex = new DexFile(args.dexOptions); if (args.dumpWidth != 0) { outputDex.setDumpWidth(args.dumpWidth); } }
private void createDexFile() { outputDex = new DexFile(args.dexOptions); if (args.dumpWidth != 0) { outputDex.setDumpWidth(args.dumpWidth); } }
DexFile getDexFile() { if (outputDex == null) { DexOptions options = new DexOptions(); options.targetApiLevel = DexFormat.API_NO_EXTENDED_OPCODES; outputDex = new DexFile(options); } return outputDex; }
private static void createDexFile() { if (outputDex != null) { dexOutputArrays.add(writeDex()); } outputDex = new DexFile(args.dexOptions); if (args.dumpWidth != 0) { outputDex.setDumpWidth(args.dumpWidth); } }
/** * Generates a dex file and returns its bytes. */ public byte[] generate() { DexOptions options = new DexOptions(); options.targetApiLevel = DexFormat.API_NO_EXTENDED_OPCODES; DexFile outputDex = new DexFile(options); for (TypeDeclaration typeDeclaration : types.values()) { outputDex.add(typeDeclaration.toClassDefItem()); } try { return outputDex.toDex(null, false); } catch (IOException e) { throw new RuntimeException(e); } }
/** * Returns a .dex formatted file. */ public byte[] generate() { DexFile outputDex = new DexFile(new DexOptions()); for (TypeDeclaration typeDeclaration : types.values()) { outputDex.add(typeDeclaration.toClassDefItem()); } try { return outputDex.toDex(null, false); } catch (IOException e) { throw new RuntimeException(e); } }
try { DexFile file = new DexFile(dex_options); DirectClassFile cf = new DirectClassFile(bytes, name + ".class", cf_options.strictNameCheck);
/** * Generates a dex file and returns its bytes. */ public byte[] generate() { if (outputDex == null) { DexOptions options = new DexOptions(); options.targetApiLevel = DexFormat.API_NO_EXTENDED_OPCODES; outputDex = new DexFile(options); } for (TypeDeclaration typeDeclaration : types.values()) { outputDex.add(typeDeclaration.toClassDefItem()); } try { return outputDex.toDex(null, false); } catch (IOException e) { throw new RuntimeException(e); } }
outputDex = new DexFile(args.dexOptions);
outputDex = new DexFile();
cf.setAttributeFactory(StdAttributeFactory.THE_ONE); cf.getMagic(); dexFile = new com.android.dx.dex.file.DexFile(dex_options); items.add(CfTranslator.translate(cf, bytes, cf_options, dex_options, dexFile)); for(ClassDefItem item : items)
/** * {@inheritDoc} */ public void register(String name, byte[] binaryRepresentation) { DirectClassFile directClassFile = new DirectClassFile(binaryRepresentation, name.replace('.', '/') + CLASS_FILE_EXTENSION, NON_STRICT); directClassFile.setAttributeFactory(new StdAttributeFactory()); dexFile.add(CfTranslator.translate(directClassFile, binaryRepresentation, dexCompilerOptions, dexFileOptions, new DexFile(dexFileOptions))); }
public EvalResult evaluate(String scriptText) throws IOException, IllegalAccessException, InstantiationException, ClassNotFoundException { long sd = System.nanoTime(); final Set<String> classNames = new LinkedHashSet<String>(); final DexFile dexFile = new DexFile(dexOptions); CompilerConfiguration config = new CompilerConfiguration(); config.setBytecodePostprocessor(new BytecodeProcessor() {
private static final byte[] dex(String className, byte[] classData) throws ClassFormatError { try { DexOptions dexOptions = new DexOptions(); DexFile dxFile = new DexFile(dexOptions); CfOptions cfOptions = new CfOptions(); dxFile.add(CfTranslator.translate(className.replace('.', '/') + ".class", classData, cfOptions, dexOptions)); StringWriter out = BridJ.debug ? new StringWriter() : null; byte[] dexData = dxFile.toDex(out, false); if (BridJ.debug) { BridJ.info("Dex output for class " + className + " : " + out); } return dexData; } catch (IOException ex) { throw new ClassFormatError("Unable to convert class data to Dalvik code using Dex : " + ex); } }
options.strictNameCheck= false; ClassDefItem item= CfTranslator.translate(relativePath, classFile.getDataAsBytes(), options); DexFile dexFile= new DexFile(); dexFile.add(item); try