From dd8dc533e919809f8ff4d5988dae46e56d296ed3 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 7 Mar 2020 14:00:12 +0000 Subject: [PATCH] Set the visibility of interface members to public According to the Java spec interface members are always implicitly public. Signed-off-by: Graham --- .../dev/openrs2/deob/transform/VisibilityTransformer.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deob/src/main/java/dev/openrs2/deob/transform/VisibilityTransformer.kt b/deob/src/main/java/dev/openrs2/deob/transform/VisibilityTransformer.kt index 8974e2a3..b2bd45b2 100644 --- a/deob/src/main/java/dev/openrs2/deob/transform/VisibilityTransformer.kt +++ b/deob/src/main/java/dev/openrs2/deob/transform/VisibilityTransformer.kt @@ -56,8 +56,13 @@ class VisibilityTransformer : Transformer() { references: Multimap, String>, disjointSet: DisjointSet, member: MemberRef, + classAccess: Int, access: Int ): Int { + if (classAccess and Opcodes.ACC_INTERFACE != 0) { + return Opcodes.ACC_PUBLIC + } + val method = Type.getType(member.desc).sort == Type.METHOD if (method) { if (member.name == "") { @@ -120,6 +125,7 @@ class VisibilityTransformer : Transformer() { fieldReferences, inheritedFieldSets, MemberRef(clazz, field), + clazz.access, access ) field.access = (access and VISIBILITY_FLAGS.inv()) or visibility @@ -137,6 +143,7 @@ class VisibilityTransformer : Transformer() { methodReferences, inheritedMethodSets, MemberRef(clazz, method), + clazz.access, access ) method.access = (access and VISIBILITY_FLAGS.inv()) or visibility