Package com.android.dx.dex.file

Examples of com.android.dx.dex.file.DexFile


     * 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);
        }
    }
View Full Code Here


    Log.debug("DExing:" + relativePath);

    CfOptions options= new CfOptions();
    options.strictNameCheck= false;
    ClassDefItem item= CfTranslator.translate(relativePath, classFile.getDataAsBytes(), options);
    DexFile dexFile= new DexFile();
    dexFile.add(item);
    try
    {
      byte[] rawDex= dexFile.toDex(null, false);
      OutputFile result= new OutputFile(rawDex);
      result.setLocation(classFile.getLocation());
      result.setFileName(classFile.getFileName().replace(ClassFile.CLASS_ENDING, DEX_ENDING));
      return result;
    }
View Full Code Here

     * specified classes, and populate the resources map if required.
     *
     * @return whether processing was successful
     */
    private static boolean processAllFiles() {
        outputDex = new DexFile();

        if (args.jarOutput) {
            outputResources = new TreeMap<String, byte[]>();
        }

View Full Code Here

TOP

Related Classes of com.android.dx.dex.file.DexFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.