Skip to content

Commit 90591e0

Browse files
committed
fix: handle more malformed APKs
1 parent 4a40685 commit 90591e0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

binxml.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ func ParseXml(r io.Reader, enc ManifestEncoder, resources *ResourceTable) error
112112
} else if err != nil {
113113
return fmt.Errorf("Chunk: 0x%08x: %s", id, err.Error())
114114
} else if lm.N != 0 {
115-
return fmt.Errorf("Chunk: 0x%08x: was not fully read", id)
115+
// da62a1edc4d9826c8bf2ed8d5be857614f7908163269d80f9d4ad9ee4d12405e
116+
io.CopyN(ioutil.Discard, lm, lm.N)
117+
//return fmt.Errorf("Chunk: 0x%08x: was not fully read (%d remaining)", id, lm.N)
116118
}
117119
}
118120

@@ -273,7 +275,10 @@ func (x *binxmlParseInfo) parseTagStart(r *io.LimitedReader) error {
273275
case AttrTypeString:
274276
resultAttr.Value, err = x.strings.get(attr.RawValueIdx)
275277
if err != nil {
276-
return fmt.Errorf("error decoding attrStringIdx: %s", err.Error())
278+
// da62a1edc4d9826c8bf2ed8d5be857614f7908163269d80f9d4ad9ee4d12405e
279+
resultAttr.Value = fmt.Sprintf("#%d", attr.RawValueIdx)
280+
err = nil
281+
//return fmt.Errorf("error decoding attrStringIdx: %s", err.Error())
277282
}
278283
case AttrTypeIntBool:
279284
resultAttr.Value = strconv.FormatBool(attr.Res.Data != 0)

0 commit comments

Comments
 (0)