Search in sources :

Example 6 with ClassProto

use of org.jf.dexlib2.analysis.ClassProto in project smali by JesusFreke.

the class FieldGapOrderTest method testOldOrder.

@Test
public void testOldOrder() {
    DexFile dexFile = getInputDexFile("FieldGapOrder", new BaksmaliOptions());
    Assert.assertEquals(3, dexFile.getClasses().size());
    ClassPath classPath = new ClassPath(Lists.newArrayList(new DexClassProvider(dexFile)), false, 66);
    ClassProto classProto = (ClassProto) classPath.getClass("LGapOrder;");
    Assert.assertEquals("r1", classProto.getFieldByOffset(12).getName());
    Assert.assertEquals("r2", classProto.getFieldByOffset(16).getName());
    Assert.assertEquals("d", classProto.getFieldByOffset(24).getName());
    Assert.assertEquals("s", classProto.getFieldByOffset(36).getName());
    Assert.assertEquals("i", classProto.getFieldByOffset(32).getName());
}
Also used : ClassProto(org.jf.dexlib2.analysis.ClassProto) ClassPath(org.jf.dexlib2.analysis.ClassPath) DexClassProvider(org.jf.dexlib2.analysis.DexClassProvider) DexFile(org.jf.dexlib2.iface.DexFile) Test(org.junit.Test)

Aggregations

ClassProto (org.jf.dexlib2.analysis.ClassProto)3 ClassDef (org.jf.dexlib2.iface.ClassDef)3 IOException (java.io.IOException)2 ClassPath (org.jf.dexlib2.analysis.ClassPath)2 DexClassProvider (org.jf.dexlib2.analysis.DexClassProvider)2 DexFile (org.jf.dexlib2.iface.DexFile)2 Method (org.jf.dexlib2.iface.Method)2 Test (org.junit.Test)2 Matcher (java.util.regex.Matcher)1 Nonnull (javax.annotation.Nonnull)1 FieldReference (org.jf.dexlib2.iface.reference.FieldReference)1 ImmutableMethod (org.jf.dexlib2.immutable.ImmutableMethod)1 ImmutableMethodParameter (org.jf.dexlib2.immutable.ImmutableMethodParameter)1 ImmutableMethodReference (org.jf.dexlib2.immutable.reference.ImmutableMethodReference)1