Set the visibility of interface members to public

According to the Java spec interface members are always implicitly
public.

Signed-off-by: Graham <gpe@openrs2.dev>
bzip2
Graham 5 years ago
parent 78db7d3179
commit dd8dc533e9
  1. 7
      deob/src/main/java/dev/openrs2/deob/transform/VisibilityTransformer.kt

@ -56,8 +56,13 @@ class VisibilityTransformer : Transformer() {
references: Multimap<DisjointSet.Partition<MemberRef>, String>, references: Multimap<DisjointSet.Partition<MemberRef>, String>,
disjointSet: DisjointSet<MemberRef>, disjointSet: DisjointSet<MemberRef>,
member: MemberRef, member: MemberRef,
classAccess: Int,
access: Int access: Int
): Int { ): Int {
if (classAccess and Opcodes.ACC_INTERFACE != 0) {
return Opcodes.ACC_PUBLIC
}
val method = Type.getType(member.desc).sort == Type.METHOD val method = Type.getType(member.desc).sort == Type.METHOD
if (method) { if (method) {
if (member.name == "<clinit>") { if (member.name == "<clinit>") {
@ -120,6 +125,7 @@ class VisibilityTransformer : Transformer() {
fieldReferences, fieldReferences,
inheritedFieldSets, inheritedFieldSets,
MemberRef(clazz, field), MemberRef(clazz, field),
clazz.access,
access access
) )
field.access = (access and VISIBILITY_FLAGS.inv()) or visibility field.access = (access and VISIBILITY_FLAGS.inv()) or visibility
@ -137,6 +143,7 @@ class VisibilityTransformer : Transformer() {
methodReferences, methodReferences,
inheritedMethodSets, inheritedMethodSets,
MemberRef(clazz, method), MemberRef(clazz, method),
clazz.access,
access access
) )
method.access = (access and VISIBILITY_FLAGS.inv()) or visibility method.access = (access and VISIBILITY_FLAGS.inv()) or visibility

Loading…
Cancel
Save