mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-04-30 06:14:25 +02:00
ensure complex resource entry
This commit is contained in:
parent
004f7fc6f1
commit
21c9d4e6bb
@ -29,6 +29,13 @@ public class EntryArray extends OffsetBlockArray<Entry> implements JSONConvert<J
|
|||||||
public EntryArray(IntegerArray offsets, IntegerItem itemCount, IntegerItem itemStart){
|
public EntryArray(IntegerArray offsets, IntegerItem itemCount, IntegerItem itemStart){
|
||||||
super(offsets, itemCount, itemStart);
|
super(offsets, itemCount, itemStart);
|
||||||
}
|
}
|
||||||
|
public boolean hasComplexEntry(){
|
||||||
|
Entry first = iterator(true).next();
|
||||||
|
if(first==null){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return first.isComplex();
|
||||||
|
}
|
||||||
public boolean isEmpty(){
|
public boolean isEmpty(){
|
||||||
return !iterator(true).hasNext();
|
return !iterator(true).hasNext();
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ public class TypeBlock extends Chunk<TypeHeader>
|
|||||||
.getSpecStringPool().getOrCreate(name);
|
.getSpecStringPool().getOrCreate(name);
|
||||||
Entry entry = getOrCreateEntry((short) id);
|
Entry entry = getOrCreateEntry((short) id);
|
||||||
if(entry.isNull()){
|
if(entry.isNull()){
|
||||||
entry.setValueAsRaw(ValueType.NULL, 0);
|
entry.ensureComplex(getEntryArray().hasComplexEntry());
|
||||||
}
|
}
|
||||||
entry.setSpecReference(specString.getIndex());
|
entry.setSpecReference(specString.getIndex());
|
||||||
return entry;
|
return entry;
|
||||||
|
@ -37,6 +37,9 @@
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ensureComplex(boolean isComplex){
|
||||||
|
ensureTableEntry(isComplex);
|
||||||
|
}
|
||||||
public int getId(){
|
public int getId(){
|
||||||
return getIndex();
|
return getIndex();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user