Search in sources :

Example 1 with ApplicationReader

use of org.ow2.asmdex.ApplicationReader in project android-classyshark by google.

the class ApkDashboard method fillAnalysisPerClassesDexIndex.

public static ClassesDexDataEntry fillAnalysisPerClassesDexIndex(int dexIndex, File classesDex) {
    ClassesDexDataEntry dexData = new ClassesDexDataEntry(dexIndex);
    try {
        InputStream is = new FileInputStream(classesDex);
        ApplicationVisitor av = new ApkNativeMethodsVisitor(dexData);
        ApplicationReader ar = new ApplicationReader(Opcodes.ASM4, is);
        ar.accept(av, 0);
    } catch (Exception e) {
        e.printStackTrace();
    }
    try {
        DexFile dxFile = DexlibLoader.loadDexFile(classesDex);
        DexBackedDexFile dataPack = (DexBackedDexFile) dxFile;
        dexData.allMethods = dataPack.getMethodCount();
    //dexData.syntheticAccessors =
    //        new SyntheticAccessorsInspector(dxFile).getSyntheticAccessors();
    } catch (Exception e) {
        e.printStackTrace();
        System.out.println("here " + e);
    }
    return dexData;
}
Also used : DexBackedDexFile(org.jf.dexlib2.dexbacked.DexBackedDexFile) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) ApplicationVisitor(org.ow2.asmdex.ApplicationVisitor) FileInputStream(java.io.FileInputStream) ApplicationReader(org.ow2.asmdex.ApplicationReader) DexBackedDexFile(org.jf.dexlib2.dexbacked.DexBackedDexFile) DexFile(org.jf.dexlib2.iface.DexFile)

Example 2 with ApplicationReader

use of org.ow2.asmdex.ApplicationReader in project android-classyshark by google.

the class DexMethodsDumper method fillAnalysis.

private static List<String> fillAnalysis(int dexIndex, File file) throws IOException {
    ArrayList result = new ArrayList();
    InputStream is = new FileInputStream(file);
    ApplicationVisitor av = new ApkInspectVisitor(result);
    ApplicationReader ar = new ApplicationReader(Opcodes.ASM4, is);
    ar.accept(av, 0);
    return result;
}
Also used : ZipInputStream(java.util.zip.ZipInputStream) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) ApplicationVisitor(org.ow2.asmdex.ApplicationVisitor) ArrayList(java.util.ArrayList) FileInputStream(java.io.FileInputStream) ApplicationReader(org.ow2.asmdex.ApplicationReader)

Aggregations

FileInputStream (java.io.FileInputStream)2 InputStream (java.io.InputStream)2 ApplicationReader (org.ow2.asmdex.ApplicationReader)2 ApplicationVisitor (org.ow2.asmdex.ApplicationVisitor)2 ArrayList (java.util.ArrayList)1 ZipInputStream (java.util.zip.ZipInputStream)1 DexBackedDexFile (org.jf.dexlib2.dexbacked.DexBackedDexFile)1 DexFile (org.jf.dexlib2.iface.DexFile)1