@@ -308,7 +308,7 @@ private ResType readTableType() throws IOException, AndrolibException {
308
308
309
309
for (int i : entryOffsetMap .keySet ()) {
310
310
int offset = entryOffsetMap .get (i );
311
- if (offset == - 1 ) {
311
+ if (offset == NO_ENTRY ) {
312
312
continue ;
313
313
}
314
314
mMissingResSpecMap .put (i , false );
@@ -318,12 +318,15 @@ private ResType readTableType() throws IOException, AndrolibException {
318
318
if (mCountIn .getCount () == mHeader .endPosition ) {
319
319
int remainingEntries = entryCount - i ;
320
320
LOGGER .warning (String .format ("End of chunk hit. Skipping remaining entries (%d) in type: %s" ,
321
- remainingEntries , mTypeSpec .getName ())
322
- );
321
+ remainingEntries , mTypeSpec .getName ()
322
+ )) ;
323
323
break ;
324
324
}
325
325
326
- readEntry (readEntryData ());
326
+ EntryData entryData = readEntryData ();
327
+ if (entryData != null ) {
328
+ readEntry (entryData );
329
+ }
327
330
}
328
331
329
332
// skip "TYPE 8 chunks" and/or padding data at the end of this chunk
@@ -344,6 +347,10 @@ private EntryData readEntryData() throws IOException, AndrolibException {
344
347
345
348
short flags = mIn .readShort ();
346
349
int specNamesId = mIn .readInt ();
350
+ if (specNamesId == NO_ENTRY ) {
351
+ return null ;
352
+ }
353
+
347
354
ResValue value = (flags & ENTRY_FLAG_COMPLEX ) == 0 ? readValue () : readComplexEntry ();
348
355
EntryData entryData = new EntryData ();
349
356
entryData .mFlags = flags ;
@@ -662,5 +669,7 @@ private void checkChunkType(int expectedType) throws AndrolibException {
662
669
663
670
private static final int KNOWN_CONFIG_BYTES = 64 ;
664
671
672
+ private static final int NO_ENTRY = 0xFFFFFFFF ;
673
+
665
674
private static final Logger LOGGER = Logger .getLogger (ARSCDecoder .class .getName ());
666
675
}
0 commit comments