Skip to content

Commit

Permalink
[DEX] Fix annotation value conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
REAndroid committed Oct 30, 2024
1 parent d8756f3 commit 5084234
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/reandroid/dex/data/AnnotationElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ public AnnotationElement() {

@Override
public AnnotationElementKey getKey(){
return checkKey(new AnnotationElementKey(getName(), getValue()));
return new AnnotationElementKey(getName(), getValue());
}
@Override
public void setKey(Key key) {
AnnotationElementKey elementKey = (AnnotationElementKey) key;
setName(elementKey.getName());
setValue(elementKey.getValue());
}
public Key getValue() {
DexValueBlock<?> valueBlock = getValueBlock();
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/reandroid/dex/value/DexValueType.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ public static Key createNull(TypeKey typeKey) {
if (TypeKey.TYPE_F.equals(typeKey)) {
return PrimitiveKey.of(0.0f);
}
if (TypeKey.TYPE_I.equals(typeKey)) {
return PrimitiveKey.of(0);
}
if (TypeKey.TYPE_J.equals(typeKey)) {
return PrimitiveKey.of(0L);
}
Expand Down

0 comments on commit 5084234

Please sign in to comment.