From 9e983b3f54472bfdeeb7cce45f474300454fd392 Mon Sep 17 00:00:00 2001 From: Panxiaobo Date: Mon, 22 Oct 2012 19:51:04 +0800 Subject: [PATCH] move the change to V3InnerClzGather --HG-- branch : 0.0.9.x --- .../java/com/googlecode/dex2jar/v3/V3ClassAdapter.java | 5 +---- .../java/com/googlecode/dex2jar/v3/V3InnerClzGather.java | 8 ++++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3ClassAdapter.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3ClassAdapter.java index a393b103..26cab8d1 100644 --- a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3ClassAdapter.java +++ b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3ClassAdapter.java @@ -101,10 +101,7 @@ public class V3ClassAdapter implements DexClassVisitor { Clz clz = this.clz; - // the abstract or interface is in class_flags not in Innerclass - final int x = (Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT); - int access = (clz.access & ~x) | (access_flags & x); - + int access = clz.access; boolean isInnerClass = clz.enclosingClass != null || clz.enclosingMethod != null; int accessInClass = clearClassAccess(isInnerClass, access); String[] nInterfaceNames = null; diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3InnerClzGather.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3InnerClzGather.java index c5e753c1..25bc495f 100644 --- a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3InnerClzGather.java +++ b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3InnerClzGather.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; import com.googlecode.dex2jar.Annotation; @@ -104,6 +105,8 @@ public class V3InnerClzGather implements DexFileVisitor { return classes; } + private static final int ACC_INTERFACE_ABSTRACT = (Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT); + /* * (non-Javadoc) * @@ -114,7 +117,8 @@ public class V3InnerClzGather implements DexFileVisitor { public DexClassVisitor visit(int access_flags, final String className, String superClass, String[] interfaceNames) { final Clz clz = get(className); - clz.access |= access_flags; + + clz.access = (clz.access & ~ACC_INTERFACE_ABSTRACT) | access_flags; return new EmptyVisitor() { protected List anns = new ArrayList(); @@ -150,7 +154,7 @@ public class V3InnerClzGather implements DexFileVisitor { } else if ("Ldalvik/annotation/InnerClass;".equals(ann.type)) { for (Item it : ann.items) { if ("accessFlags".equals(it.name)) { - clz.access |= (Integer) it.value; + clz.access |= (Integer) it.value & ~ACC_INTERFACE_ABSTRACT; } else if ("name".equals(it.name)) { clz.innerName = (String) it.value; }