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