mirror of
https://github.com/revanced/Apktool.git
synced 2024-12-12 05:47:46 +01:00
Cleanup unclosed streams plus formatting
- run FindBugs to find problems
This commit is contained in:
parent
f3e21023ac
commit
b29df52b87
@ -628,7 +628,7 @@ public class Androlib {
|
||||
}
|
||||
|
||||
ZipEntry newEntry = new ZipEntry(unknownFileInfo.getKey());
|
||||
int method = Integer.valueOf(unknownFileInfo.getValue());
|
||||
int method = Integer.parseInt(unknownFileInfo.getValue());
|
||||
LOGGER.fine(String.format("Copying unknown file %s with method %d", unknownFileInfo.getKey(), method));
|
||||
if (method == ZipEntry.STORED) {
|
||||
newEntry.setMethod(ZipEntry.STORED);
|
||||
|
@ -62,8 +62,8 @@ public class ApktoolProperties {
|
||||
try {
|
||||
properties.load(templateStream);
|
||||
version = properties.getProperty("application.version");
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
templateStream.close();
|
||||
} catch (IOException ignored) { }
|
||||
}
|
||||
sProps.put("baksmaliVersion", version);
|
||||
|
||||
@ -80,14 +80,13 @@ public class ApktoolProperties {
|
||||
try {
|
||||
properties.load(templateStream);
|
||||
version = properties.getProperty("application.version");
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
templateStream.close();
|
||||
} catch (IOException ignored) { }
|
||||
}
|
||||
sProps.put("smaliVersion", version);
|
||||
}
|
||||
|
||||
private static Properties sProps;
|
||||
|
||||
private static final Logger LOGGER = Logger
|
||||
.getLogger(ApktoolProperties.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(ApktoolProperties.class.getName());
|
||||
}
|
@ -106,7 +106,7 @@ public class ResFileDecoder {
|
||||
} catch (AndrolibException ex) {
|
||||
LOGGER.log(Level.SEVERE, String.format(
|
||||
"Could not decode file, replacing by FALSE value: %s",
|
||||
inFileName, outFileName), ex);
|
||||
inFileName), ex);
|
||||
res.replace(new ResBoolValue(false, 0, null));
|
||||
}
|
||||
}
|
||||
|
@ -82,6 +82,7 @@ public class SmaliBuilder {
|
||||
|
||||
StringBuilder out = new StringBuilder();
|
||||
List<String> lines = IOUtils.readLines(inStream);
|
||||
inStream.close();
|
||||
|
||||
if (! mDebug) {
|
||||
final String[] linesArray = lines.toArray(new String[0]);
|
||||
@ -107,9 +108,6 @@ public class SmaliBuilder {
|
||||
out.append(line).append('\n');
|
||||
}
|
||||
}
|
||||
|
||||
inStream.close();
|
||||
|
||||
try {
|
||||
if (!SmaliMod.assembleSmaliFile(out.toString(),dexBuilder, false, false, inFile)) {
|
||||
throw new AndrolibException("Could not smali file: " + fileName);
|
||||
|
Loading…
Reference in New Issue
Block a user