mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-02 17:12:55 +01:00
Refactor logging for chunks and sparse flags. (#3260)
* refactor: log each chunk in verbose mode * refactor: drop unneeded ":" from log output * refactor: spit out sparse message once
This commit is contained in:
parent
0d7a1bc3a8
commit
1243dd5546
@ -256,8 +256,10 @@ public class ResTable {
|
||||
}
|
||||
|
||||
public void setSparseResources(boolean flag) {
|
||||
if (mApkInfo.sparseResources != flag) {
|
||||
LOGGER.info("Sparsely packed resources detected.");
|
||||
}
|
||||
mApkInfo.sparseResources = flag;
|
||||
|
||||
}
|
||||
|
||||
public void clearSdkInfo() {
|
||||
|
@ -65,11 +65,16 @@ public class ARSCDecoder {
|
||||
Set<ResPackage> pkgs = new LinkedHashSet<>();
|
||||
|
||||
ResTypeSpec typeSpec;
|
||||
int chunkNumber = 1;
|
||||
|
||||
chunkLoop:
|
||||
for (;;) {
|
||||
nextChunk();
|
||||
|
||||
LOGGER.fine(String.format(
|
||||
"Chunk #%d start: type=0x%04x chunkSize=0x%08x", chunkNumber++, mHeader.type, mHeader.chunkSize
|
||||
));
|
||||
|
||||
switch (mHeader.type) {
|
||||
case ARSCHeader.RES_NULL_TYPE:
|
||||
readUnknownChunk();
|
||||
@ -266,9 +271,6 @@ public class ARSCDecoder {
|
||||
mHeader.checkForUnreadHeader(mIn);
|
||||
|
||||
if ((typeFlags & 0x01) != 0) {
|
||||
LOGGER.fine("Sparse type flags detected: " + mTypeSpec.getName());
|
||||
|
||||
// We've detected sparse resources, lets record this so we can rebuild in that same format
|
||||
mResTable.setSparseResources(true);
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class ResFileDecoder {
|
||||
resFileMapping.put(inFilePath, outFilePath);
|
||||
}
|
||||
|
||||
LOGGER.fine("Decoding file: " + inFilePath + " to: " + outFilePath);
|
||||
LOGGER.fine("Decoding file " + inFilePath + " to " + outFilePath);
|
||||
|
||||
try {
|
||||
if (typeName.equals("raw")) {
|
||||
|
Loading…
Reference in New Issue
Block a user