mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-01 14:44:26 +02:00
aapt2: read the type spec and infer if sparsely packed
This commit is contained in:
parent
88987e60b3
commit
0827b2b7a2
@ -151,7 +151,7 @@ public class ARSCDecoder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ResTypeSpec readTableTypeSpec() throws AndrolibException, IOException {
|
private void readTableTypeSpec() throws AndrolibException, IOException {
|
||||||
mTypeSpec = readSingleTableTypeSpec();
|
mTypeSpec = readSingleTableTypeSpec();
|
||||||
addTypeSpec(mTypeSpec);
|
addTypeSpec(mTypeSpec);
|
||||||
|
|
||||||
@ -162,6 +162,12 @@ public class ARSCDecoder {
|
|||||||
resTypeSpec = readSingleTableTypeSpec();
|
resTypeSpec = readSingleTableTypeSpec();
|
||||||
addTypeSpec(resTypeSpec);
|
addTypeSpec(resTypeSpec);
|
||||||
type = nextChunk().type;
|
type = nextChunk().type;
|
||||||
|
|
||||||
|
// We've detected sparse resources, lets record this so we can rebuild in that same format (sparse/not)
|
||||||
|
// with aapt2. aapt1 will ignore this.
|
||||||
|
if (! mResTable.getSparseResources()) {
|
||||||
|
mResTable.setSparseResources(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (type == Header.TYPE_TYPE) {
|
while (type == Header.TYPE_TYPE) {
|
||||||
@ -177,8 +183,6 @@ public class ARSCDecoder {
|
|||||||
|
|
||||||
addMissingResSpecs();
|
addMissingResSpecs();
|
||||||
}
|
}
|
||||||
|
|
||||||
return mTypeSpec;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ResTypeSpec readSingleTableTypeSpec() throws AndrolibException, IOException {
|
private ResTypeSpec readSingleTableTypeSpec() throws AndrolibException, IOException {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user