Examples of DexBackedDexFile


Examples of org.jf.dexlib2.dexbacked.DexBackedDexFile

            } else if (fileLength > Integer.MAX_VALUE) {
                throw new ExceptionWithContext("The " + dexEntry + " file in %s is too large to read in", dexFile.getName());
            }
            byte[] dexBytes = new byte[(int)fileLength];
            ByteStreams.readFully(zipFile.getInputStream(zipEntry), dexBytes);
            return new DexBackedDexFile(opcodes, dexBytes);
        } catch (IOException ex) {
            // don't continue on if we know it's a zip file
            if (isZipFile) {
                throw ex;
            }
View Full Code Here

Examples of org.jf.dexlib2.dexbacked.DexBackedDexFile

            System.err.println("Can't find the file " + inputDexFileName);
            System.exit(1);
        }

        //Read in and parse the dex file
        DexBackedDexFile dexFile = DexFileFactory.loadDexFile(dexFileFile, options.dexEntry, options.apiLevel);

        if (dexFile.isOdexFile()) {
            if (!options.deodex) {
                System.err.println("Warning: You are disassembling an odex file without deodexing it. You");
                System.err.println("won't be able to re-assemble the results unless you deodex it with the -x");
                System.err.println("option");
                options.allowOdex = true;
View Full Code Here

Examples of org.jf.dexlib2.dexbacked.DexBackedDexFile

                                methodBuilder.getMethodImplementation())));

        MemoryDataStore dexStore = new MemoryDataStore();
        dexBuilder.writeTo(dexStore);

        DexBackedDexFile dexFile = new DexBackedDexFile(new Opcodes(15), dexStore.getData());

        ClassDef classDef = Iterables.getFirst(dexFile.getClasses(), null);
        Assert.assertNotNull(classDef);

        Method method = Iterables.getFirst(classDef.getMethods(), null);
        Assert.assertNotNull(method);
View Full Code Here

Examples of org.jf.dexlib2.dexbacked.DexBackedDexFile

                                methodImpl)));

        MemoryDataStore dexStore = new MemoryDataStore();
        dexBuilder.writeTo(dexStore);

        DexBackedDexFile dexFile = new DexBackedDexFile(new Opcodes(15), dexStore.getData());

        ClassDef classDef = Iterables.getFirst(dexFile.getClasses(), null);
        Assert.assertNotNull(classDef);

        Method method = Iterables.getFirst(classDef.getMethods(), null);
        Assert.assertNotNull(method);
View Full Code Here

Examples of org.jf.dexlib2.dexbacked.DexBackedDexFile

            DexPool.writeTo(dataStore, new ImmutableDexFile(ImmutableSet.of(classDef)));
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }

        DexBackedDexFile dexFile = new DexBackedDexFile(new Opcodes(15), dataStore.getData());
        ClassDef dbClassDef = Iterables.getFirst(dexFile.getClasses(), null);
        Assert.assertNotNull(dbClassDef);
        Annotation dbAnnotation = Iterables.getFirst(dbClassDef.getAnnotations(), null);
        Assert.assertNotNull(dbAnnotation);
        List<AnnotationElement> dbElements = Lists.newArrayList(dbAnnotation.getElements());
View Full Code Here

Examples of org.jf.dexlib2.dexbacked.DexBackedDexFile

            System.err.println("Can't find the file " + inputDexFileName);
            System.exit(1);
        }

        try {
            DexBackedDexFile dexFile = DexFileFactory.loadDexFile(dexFileFile, apiLevel);
            Iterable<String> bootClassPaths = Splitter.on(":").split("core.jar:ext.jar:framework.jar:android.policy.jar:services.jar");
            ClassPath classPath = ClassPath.fromClassPath(bootClassPathDirs, bootClassPaths, dexFile, apiLevel);
            FileOutputStream outStream = new FileOutputStream(outFile);

            for (ClassDef classDef: dexFile.getClasses()) {
                ClassProto classProto = (ClassProto) classPath.getClass(classDef);
                List<Method> methods = classProto.getVtable();
                String className = "Class "  + classDef.getType() + " extends " + classDef.getSuperclass() + " : " + methods.size() + " methods\n";
                outStream.write(className.getBytes());
                for (int i=0;i<methods.size();i++) {
View Full Code Here

Examples of org.jf.dexlib2.dexbacked.DexBackedDexFile

        MemoryDataStore dataStore = new MemoryDataStore();

        dexBuilder.writeTo(dataStore);

        DexBackedDexFile dexFile = new DexBackedDexFile(new Opcodes(15), dataStore.getData());

        return Iterables.getFirst(dexFile.getClasses(), null);
    }
View Full Code Here

Examples of org.jf.dexlib2.dexbacked.DexBackedDexFile

            System.err.println("Can't find the file " + inputDexFileName);
            System.exit(1);
        }

        try {
            DexBackedDexFile dexFile = DexFileFactory.loadDexFile(dexFileFile, apiLevel);
            Iterable<String> bootClassPaths = Splitter.on(":").split("core.jar:ext.jar:framework.jar:android.policy.jar:services.jar");
            ClassPath classPath = ClassPath.fromClassPath(bootClassPathDirs, bootClassPaths, dexFile, apiLevel);
            FileOutputStream outStream = new FileOutputStream(outFile);

            for (ClassDef classDef: dexFile.getClasses()) {
                ClassProto classProto = (ClassProto) classPath.getClass(classDef);
                SparseArray<FieldReference> fields = classProto.getInstanceFields();
                String className = "Class "  + classDef.getType() + " : " + fields.size() + " instance fields\n";
                outStream.write(className.getBytes());
                for (int i=0;i<fields.size();i++) {
View Full Code Here

Examples of org.jf.dexlib2.dexbacked.DexBackedDexFile

            System.err.println("Can't find the file " + inputDexFileName);
            System.exit(1);
        }

        //Read in and parse the dex file
        DexBackedDexFile dexFile = DexFileFactory.loadDexFile(dexFileFile, options.apiLevel);

        if (dexFile.isOdexFile()) {
            if (!options.deodex) {
                System.err.println("Warning: You are disassembling an odex file without deodexing it. You");
                System.err.println("won't be able to re-assemble the results unless you deodex it with the -x");
                System.err.println("option");
                options.allowOdex = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.