mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-29 21:10:20 +02:00
fix declared fields
This commit is contained in:
parent
ccfbc260a0
commit
073f81526c
@ -23,7 +23,7 @@ abstract class AbstractWrapper(
|
|||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
fun setEnumValue(fieldName: String, value: Enum<*>) {
|
fun setEnumValue(fieldName: String, value: Enum<*>) {
|
||||||
val type = instance!!.javaClass.fields.find { it.name == fieldName }?.type as Class<out Enum<*>>
|
val type = instance!!.javaClass.declaredFields.find { it.name == fieldName }?.type as Class<out Enum<*>>
|
||||||
XposedHelpers.setObjectField(instance, fieldName, java.lang.Enum.valueOf(type, value.name))
|
XposedHelpers.setObjectField(instance, fieldName, java.lang.Enum.valueOf(type, value.name))
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user