Skip to content

Commit

Permalink
[DEX] Keep EnumKey instance
Browse files Browse the repository at this point in the history
  • Loading branch information
REAndroid committed Dec 11, 2024
1 parent 0b81bae commit 2052d39
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/main/java/com/reandroid/dex/key/EnumKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,32 @@

public class EnumKey extends FieldKey {

EnumKey(FieldKey fieldKey) {
private EnumKey(FieldKey fieldKey) {
super(fieldKey.getDeclaring(), fieldKey.getNameKey(), fieldKey.getType());
}

@Override
public EnumKey changeDeclaring(TypeKey typeKey) {
return create(super.changeDeclaring(typeKey));
}
@Override
public EnumKey changeName(String name) {
return create(super.changeName(name));
}
@Override
public EnumKey changeName(StringKey name) {
return create(super.changeName(name));
}
@Override
public EnumKey changeType(TypeKey typeKey) {
return create(super.changeType(typeKey));
}

@Override
public EnumKey replaceKey(Key search, Key replace) {
return create(super.replaceKey(search, replace));
}

@Override
public void append(SmaliWriter writer) throws IOException {
SmaliDirective.ENUM.append(writer);
Expand Down

0 comments on commit 2052d39

Please sign in to comment.