diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java index fca8c8e2..4f154e5c 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/Androlib.java @@ -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); diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApktoolProperties.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApktoolProperties.java index 32e8eb55..b01e81a6 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApktoolProperties.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApktoolProperties.java @@ -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()); } \ No newline at end of file diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ResFileDecoder.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ResFileDecoder.java index 6c80f093..271d5d08 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ResFileDecoder.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ResFileDecoder.java @@ -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)); } } diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/src/SmaliBuilder.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/src/SmaliBuilder.java index c497f442..999e0f40 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/src/SmaliBuilder.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/src/SmaliBuilder.java @@ -82,6 +82,7 @@ public class SmaliBuilder { StringBuilder out = new StringBuilder(); List 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);