Search in sources :

Example 1 with MetaObjectDex

use of com.google.classyshark.silverghost.translator.java.dex.MetaObjectDex in project android-classyshark by google.

the class MetaObjectFactory method getMetaObjectFromDex.

private static MetaObject getMetaObjectFromDex(String className, File archiveFile) {
    MetaObject result;
    try {
        DexFile dexFile = DexlibLoader.loadDexFile(archiveFile);
        ClassDef classDef = DexlibAdapter.getClassDefByName(className, dexFile);
        result = new MetaObjectDex(classDef);
    } catch (Exception e) {
        result = new MetaObjectClass(Exception.class);
    }
    return result;
}
Also used : ClassDef(org.jf.dexlib2.iface.ClassDef) MetaObjectClass(com.google.classyshark.silverghost.translator.java.clazz.reflect.MetaObjectClass) DexFile(org.jf.dexlib2.iface.DexFile) MalformedURLException(java.net.MalformedURLException) MetaObjectDex(com.google.classyshark.silverghost.translator.java.dex.MetaObjectDex)

Aggregations

MetaObjectClass (com.google.classyshark.silverghost.translator.java.clazz.reflect.MetaObjectClass)1 MetaObjectDex (com.google.classyshark.silverghost.translator.java.dex.MetaObjectDex)1 MalformedURLException (java.net.MalformedURLException)1 ClassDef (org.jf.dexlib2.iface.ClassDef)1 DexFile (org.jf.dexlib2.iface.DexFile)1