mirror of
https://github.com/revanced/Apktool.git
synced 2025-01-20 16:57:34 +01:00
Make messages outputing/logging consistent between files.
This commit is contained in:
parent
3561384aec
commit
c09e74c4dd
@ -29,6 +29,7 @@ import brut.directory.*;
|
||||
import brut.util.*;
|
||||
import java.io.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.logging.Logger;
|
||||
import org.xmlpull.v1.XmlSerializer;
|
||||
|
||||
/**
|
||||
@ -228,14 +229,12 @@ final public class AndrolibResources {
|
||||
"Arsc file with zero package groups");
|
||||
}
|
||||
if (groups.length > 1) {
|
||||
System.err.println(
|
||||
"warning: arsc file with multiple package groups");
|
||||
LOGGER.warning("Arsc file with multiple package groups");
|
||||
}
|
||||
for (int i = 0; i < groups.length; i++) {
|
||||
if (groups.length != 1 && i == 0
|
||||
&& "android".equals(groups[i].getName())) {
|
||||
System.err.println(
|
||||
"warning: skipping \"android\" package group");
|
||||
LOGGER.warning("Skipping \"android\" package group");
|
||||
continue;
|
||||
}
|
||||
resTable.addPackage(groups[i], main);
|
||||
@ -259,4 +258,7 @@ final public class AndrolibResources {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private final static Logger LOGGER =
|
||||
Logger.getLogger(AndrolibResources.class.getName());
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Iterator;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
@ -125,8 +126,8 @@ public class ResSmaliUpdater {
|
||||
RES_NAME_FORMAT, spec.getFullName()));
|
||||
} catch (UndefinedResObject ex) {
|
||||
if (! R_FILE_PATTERN.matcher(fileName).matches()) {
|
||||
System.err.println(String.format(
|
||||
"warning: undefined resource spec in %s: 0x%08x"
|
||||
LOGGER.warning(String.format(
|
||||
"Undefined resource spec in %s: 0x%08x"
|
||||
, fileName, resID));
|
||||
}
|
||||
}
|
||||
@ -161,4 +162,7 @@ public class ResSmaliUpdater {
|
||||
|
||||
private final static Pattern R_FILE_PATTERN = Pattern.compile(
|
||||
".*R\\$[a-z]+\\.smali$");
|
||||
|
||||
private final static Logger LOGGER =
|
||||
Logger.getLogger(ResSmaliUpdater.class.getName());
|
||||
}
|
||||
|
@ -311,13 +311,12 @@ public class AXmlResourceParser implements XmlResourceParser {
|
||||
return mAttrDecoder.decode(valueType, valueData,
|
||||
getAttributeNameResource(index));
|
||||
} catch (AndrolibException ex) {
|
||||
Logger.getLogger(AXmlResourceParser.class.getName()).log(
|
||||
Level.WARNING, String.format(
|
||||
"Could not decode attr value, using undecoded value " +
|
||||
"instead: ns=%s, name=%s, value=0x%08x",
|
||||
getAttributePrefix(index), getAttributeName(index),
|
||||
valueData
|
||||
), ex);
|
||||
LOGGER.log(Level.WARNING, String.format(
|
||||
"Could not decode attr value, using undecoded value " +
|
||||
"instead: ns=%s, name=%s, value=0x%08x",
|
||||
getAttributePrefix(index), getAttributeName(index),
|
||||
valueData
|
||||
), ex);
|
||||
}
|
||||
}
|
||||
|
||||
@ -923,6 +922,9 @@ public class AXmlResourceParser implements XmlResourceParser {
|
||||
private int m_idAttribute;
|
||||
private int m_classAttribute;
|
||||
private int m_styleAttribute;
|
||||
|
||||
private final static Logger LOGGER =
|
||||
Logger.getLogger(AXmlResourceParser.class.getName());
|
||||
private static final String E_NOT_SUPPORTED = "Method is not supported.";
|
||||
private static final int
|
||||
ATTRIBUTE_IX_NAMESPACE_URI = 0,
|
||||
|
@ -51,15 +51,15 @@ public class XmlPullStreamDecoder implements ResStreamDecoder {
|
||||
in.close();
|
||||
out.close();
|
||||
} catch (XmlPullParserException ex) {
|
||||
mLogger.log(Level.SEVERE, null, ex);
|
||||
LOGGER.log(Level.SEVERE, null, ex);
|
||||
} catch (IOException ex) {
|
||||
mLogger.log(Level.SEVERE, null, ex);
|
||||
LOGGER.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
private final XmlPullParser mParser;
|
||||
private final XmlSerializer mSerial;
|
||||
|
||||
private final static Logger mLogger =
|
||||
private final static Logger LOGGER =
|
||||
Logger.getLogger(XmlPullStreamDecoder.class.getName());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user