mirror of
https://github.com/revanced/Apktool.git
synced 2025-05-05 08:14:26 +02: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) {
|
public void setSparseResources(boolean flag) {
|
||||||
|
if (mApkInfo.sparseResources != flag) {
|
||||||
|
LOGGER.info("Sparsely packed resources detected.");
|
||||||
|
}
|
||||||
mApkInfo.sparseResources = flag;
|
mApkInfo.sparseResources = flag;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearSdkInfo() {
|
public void clearSdkInfo() {
|
||||||
|
@ -65,11 +65,16 @@ public class ARSCDecoder {
|
|||||||
Set<ResPackage> pkgs = new LinkedHashSet<>();
|
Set<ResPackage> pkgs = new LinkedHashSet<>();
|
||||||
|
|
||||||
ResTypeSpec typeSpec;
|
ResTypeSpec typeSpec;
|
||||||
|
int chunkNumber = 1;
|
||||||
|
|
||||||
chunkLoop:
|
chunkLoop:
|
||||||
for (;;) {
|
for (;;) {
|
||||||
nextChunk();
|
nextChunk();
|
||||||
|
|
||||||
|
LOGGER.fine(String.format(
|
||||||
|
"Chunk #%d start: type=0x%04x chunkSize=0x%08x", chunkNumber++, mHeader.type, mHeader.chunkSize
|
||||||
|
));
|
||||||
|
|
||||||
switch (mHeader.type) {
|
switch (mHeader.type) {
|
||||||
case ARSCHeader.RES_NULL_TYPE:
|
case ARSCHeader.RES_NULL_TYPE:
|
||||||
readUnknownChunk();
|
readUnknownChunk();
|
||||||
@ -266,9 +271,6 @@ public class ARSCDecoder {
|
|||||||
mHeader.checkForUnreadHeader(mIn);
|
mHeader.checkForUnreadHeader(mIn);
|
||||||
|
|
||||||
if ((typeFlags & 0x01) != 0) {
|
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);
|
mResTable.setSparseResources(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ public class ResFileDecoder {
|
|||||||
resFileMapping.put(inFilePath, outFilePath);
|
resFileMapping.put(inFilePath, outFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.fine("Decoding file: " + inFilePath + " to: " + outFilePath);
|
LOGGER.fine("Decoding file " + inFilePath + " to " + outFilePath);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (typeName.equals("raw")) {
|
if (typeName.equals("raw")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user