diff --git a/src/main/java/com/reandroid/arsc/chunk/Chunk.java b/src/main/java/com/reandroid/arsc/chunk/Chunk.java index c31124ed1..949a9e152 100755 --- a/src/main/java/com/reandroid/arsc/chunk/Chunk.java +++ b/src/main/java/com/reandroid/arsc/chunk/Chunk.java @@ -56,11 +56,14 @@ public void onReadBytes(BlockReader reader) throws IOException { HeaderBlock headerBlock=reader.readHeaderBlock(); checkInvalidChunk(headerBlock); BlockReader chunkReader = reader.create(headerBlock.getChunkSize()); - super.onReadBytes(chunkReader); + onReadChildes(chunkReader); reader.offset(headerBlock.getChunkSize()); chunkReader.close(); onChunkLoaded(); } + protected void onReadChildes(BlockReader reader) throws IOException{ + super.onReadBytes(reader); + } void checkInvalidChunk(HeaderBlock headerBlock) throws IOException { ChunkType chunkType = headerBlock.getChunkType(); if(chunkType==null || chunkType==ChunkType.NULL){ diff --git a/src/main/java/com/reandroid/arsc/chunk/xml/ResXmlEndNamespace.java b/src/main/java/com/reandroid/arsc/chunk/xml/ResXmlEndNamespace.java index 8ff388b1a..601e01874 100755 --- a/src/main/java/com/reandroid/arsc/chunk/xml/ResXmlEndNamespace.java +++ b/src/main/java/com/reandroid/arsc/chunk/xml/ResXmlEndNamespace.java @@ -16,6 +16,10 @@ package com.reandroid.arsc.chunk.xml; import com.reandroid.arsc.chunk.ChunkType; +import com.reandroid.arsc.header.HeaderBlock; +import com.reandroid.arsc.io.BlockReader; + +import java.io.IOException; public class ResXmlEndNamespace extends ResXmlNamespaceChunk { public ResXmlEndNamespace() { @@ -27,4 +31,14 @@ public ResXmlStartNamespace getStart(){ public void setStart(ResXmlStartNamespace namespace){ setPair(namespace); } + + @Override + public void onReadBytes(BlockReader reader) throws IOException { + HeaderBlock headerBlock = reader.readHeaderBlock(); + if(headerBlock.getChunkSize() < 8){ + super.onReadChildes(reader); + }else { + super.onReadBytes(reader); + } + } }