From cc1ba504e7596577a2ed93676fb968891e5309fd Mon Sep 17 00:00:00 2001 From: Windy Date: Sun, 9 Feb 2020 16:48:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dstream=E6=9C=AA=E5=85=B3?= =?UTF-8?q?=E9=97=AD=EF=BC=8C=E5=AF=BC=E8=87=B4rename=20file=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/storm/wind/xpatch/util/ManifestParser.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xpatch/src/main/java/com/storm/wind/xpatch/util/ManifestParser.java b/xpatch/src/main/java/com/storm/wind/xpatch/util/ManifestParser.java index 97d6dcd..5ca0084 100644 --- a/xpatch/src/main/java/com/storm/wind/xpatch/util/ManifestParser.java +++ b/xpatch/src/main/java/com/storm/wind/xpatch/util/ManifestParser.java @@ -25,8 +25,9 @@ public class ManifestParser { System.out.println(" manifest file not exist!!! filePath -> " + filePath); return null; } + FileInputStream inputStream = null; try { - FileInputStream inputStream = new FileInputStream(file); + inputStream = new FileInputStream(file); parser.open(inputStream); @@ -65,6 +66,14 @@ public class ManifestParser { } catch (XmlPullParserException | IOException e) { e.printStackTrace(); System.out.println("parseManifestFile failed, reason --> " + e.getMessage()); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } return new Pair(packageName, applicationName); }