Don't read more data than entryChunk has
- fixes
@@ -238,6 +238,12 @@ public class ARSCDecoder {
short flags = mIn.readShort();
int specNamesId = mIn.readInt();
+ // If we are here, we probably already inserted any remaining dummy resources. No need to parse
+ // any resources that doesn't have type information
+ if (mCountIn.getCount() == mHeader.endPosition) {
+ return;
+ }
+
ResValue value = (flags & ENTRY_FLAG_COMPLEX) == 0 ? readValue() : readComplexEntry();
if (mTypeSpec.isString() && value instanceof ResFileValue) {
@@ -519,6 +525,8 @@ public class ARSCDecoder {
private HashMap<Integer, ResTypeSpec> mResTypeSpecs = new HashMap<>();
private final static short ENTRY_FLAG_COMPLEX = 0x0001;
+ private final static short ENTRY_FLAG_PUBLIC = 0x0002;
+ private final static short ENTRY_FLAG_WEAK = 0x0004;
public static class Header {
public final short type;
