Delete empty <clinit> methods

Signed-off-by: Graham <gpe@openrs2.dev>
Graham 5 years ago
parent 524a894df2
commit 64dc49e15b
  1. 5
      deob/src/main/java/dev/openrs2/deob/transform/StaticScramblingTransformer.kt

@ -228,6 +228,11 @@ class StaticScramblingTransformer @Inject constructor(private val profile: Profi
methodClasses[partition] = staticClass.name methodClasses[partition] = staticClass.name
return@removeIf true return@removeIf true
} }
val first = clinit?.instructions?.firstOrNull { it.opcode != -1 }
if (first != null && first.opcode == Opcodes.RETURN) {
clazz.methods.remove(clinit)
}
} }
spliceInitializers() spliceInitializers()

Loading…
Cancel
Save