Don't obfuscate static fields in fr.username404.gui.feature to fix reflection on objects
This commit is contained in:
parent
84032f60eb
commit
82de485b17
|
@ -45,7 +45,7 @@ subprojects {
|
|||
keep("class $group.snowygui.fabric.**")
|
||||
keep("class $group.snowygui.forge.**")
|
||||
keepnames("class $group.snowygui.Snowy")
|
||||
keep("class $group.snowygui.gui.feature.**")
|
||||
keep("class $group.snowygui.gui.feature.** { static <fields>; }")
|
||||
keepclassmembers("class $group.snowygui.** { public protected <methods>; }")
|
||||
keepattributes("*Annotation*, Signature, InnerClasses, EnclosingMethod, MethodParameters, Synthetic, Exceptions")
|
||||
obfuscationdictionary("$dictionariesDir/dictionary.txt")
|
||||
|
|
|
@ -11,7 +11,6 @@ import fr.username404.snowygui.gui.Renderable.Rendering.defaultRectFunc
|
|||
import fr.username404.snowygui.gui.elements.ClickBox
|
||||
import fr.username404.snowygui.gui.feature.ButtonInfo.Companion.Type
|
||||
import kotlin.reflect.full.findAnnotation
|
||||
import kotlin.reflect.jvm.isAccessible
|
||||
|
||||
sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) {
|
||||
companion object {
|
||||
|
@ -22,9 +21,7 @@ sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) {
|
|||
((try {
|
||||
it.getConstructor().newInstance()
|
||||
} catch (e: NoSuchMethodException) {
|
||||
try {
|
||||
it.kotlin.objectInstance!!
|
||||
} catch (e: NullPointerException) { it.kotlin.constructors.first().also { build -> build.isAccessible = true }.call() }
|
||||
it.kotlin.objectInstance!!
|
||||
}) as ButtonImpl).let { impl ->
|
||||
with(impl) {
|
||||
if (info.kind == ButtonInfo.Companion.Type.TOGGLE) {
|
||||
|
|
Loading…
Reference in New Issue