Skip to content

Commit 121ae6a

Browse files
committed
add all value types decoding ignoring ANY
1 parent 970d509 commit 121ae6a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/main/java/com/reandroid/arsc/array/CompoundItemArray.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ private void updateCountToHeader() {
5050
public AttributeDataFormat[] getFormats(){
5151
ResValueMap formatsMap = getByType(AttributeType.FORMATS);
5252
if(formatsMap != null){
53-
return AttributeDataFormat.decodeValueTypes(
54-
formatsMap.getData() & 0xff);
53+
return AttributeDataFormat.decodeValueTypes((byte) formatsMap.getData());
5554
}
5655
return null;
5756
}

src/main/java/com/reandroid/arsc/value/AttributeDataFormat.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ public static int sum(AttributeDataFormat[] typeValues){
157157
}
158158
return result;
159159
}
160-
160+
/** Decodes value types ignoring {@link #ANY} */
161+
public static AttributeDataFormat[] decodeValueTypes(byte data) {
162+
return decodeValueTypes((int) data);
163+
}
161164
public static AttributeDataFormat[] decodeValueTypes(int data) {
162165
if ((data & 0xffff) == 0xffff) {
163166
return new AttributeDataFormat[]{ANY};

0 commit comments

Comments
 (0)