mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-02 22:04:24 +02:00
fix: fix classes having multiple instances of fields
This commit is contained in:
parent
398239dc10
commit
7cc8a7dec3
@ -6,6 +6,7 @@ import app.revanced.patcher.proxy.mutableTypes.MutableMethod.Companion.toMutable
|
|||||||
import com.google.common.collect.Iterables
|
import com.google.common.collect.Iterables
|
||||||
import org.jf.dexlib2.base.reference.BaseTypeReference
|
import org.jf.dexlib2.base.reference.BaseTypeReference
|
||||||
import org.jf.dexlib2.iface.ClassDef
|
import org.jf.dexlib2.iface.ClassDef
|
||||||
|
import org.jf.dexlib2.util.FieldUtil
|
||||||
import org.jf.dexlib2.util.MethodUtil
|
import org.jf.dexlib2.util.MethodUtil
|
||||||
|
|
||||||
class MutableClass(classDef: ClassDef) : ClassDef, BaseTypeReference() {
|
class MutableClass(classDef: ClassDef) : ClassDef, BaseTypeReference() {
|
||||||
@ -27,12 +28,8 @@ class MutableClass(classDef: ClassDef) : ClassDef, BaseTypeReference() {
|
|||||||
|
|
||||||
// Fields
|
// Fields
|
||||||
private val _fields by lazy { classDef.fields.map { field -> field.toMutable() }.toMutableSet() }
|
private val _fields by lazy { classDef.fields.map { field -> field.toMutable() }.toMutableSet() }
|
||||||
private val _staticFields by lazy {
|
private val _staticFields by lazy { Iterables.filter(_fields, FieldUtil.FIELD_IS_STATIC).toMutableSet() }
|
||||||
classDef.staticFields.map { staticField -> staticField.toMutable() }.toMutableSet()
|
private val _instanceFields by lazy {Iterables.filter(_fields, FieldUtil.FIELD_IS_INSTANCE) .toMutableSet() }
|
||||||
}
|
|
||||||
private val _instanceFields by lazy {
|
|
||||||
classDef.instanceFields.map { instanceFields -> instanceFields.toMutable() }.toMutableSet()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setType(type: String) {
|
fun setType(type: String) {
|
||||||
this.type = type
|
this.type = type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user