File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
AndroidSDK/src/com/leanplum/internal Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -100,15 +100,31 @@ private static byte[] getByteArrayOfManifest() {
100100 return null ;
101101 }
102102 byte [] manifestXml = null ;
103+ JarFile jarFile = null ;
104+ DataInputStream dataInputStream = null ;
103105 try {
104- JarFile jarFile = new JarFile (context .getPackageResourcePath ());
106+ jarFile = new JarFile (context .getPackageResourcePath ());
105107 ZipEntry entry = jarFile .getEntry (ANDROID_MANIFEST );
106108 manifestXml = new byte [(int ) entry .getSize ()];
107- DataInputStream dataInputStream = new DataInputStream (jarFile .getInputStream (entry ));
109+ dataInputStream = new DataInputStream (jarFile .getInputStream (entry ));
108110 dataInputStream .readFully (manifestXml );
109- dataInputStream .close ();
110111 } catch (Exception e ) {
111112 Log .e ("Cannot parse " + ANDROID_MANIFEST + " file: " + e .getMessage ());
113+ } catch (Throwable t ) {
114+ Log .e ("Cannot parse " + ANDROID_MANIFEST + " file: " + t .getMessage ());
115+ Util .handleException (t );
116+ } finally {
117+ try {
118+ if (jarFile != null ) {
119+ jarFile .close ();
120+ }
121+
122+ if (dataInputStream != null ) {
123+ dataInputStream .close ();
124+ }
125+ } catch (Throwable ignored ) {
126+
127+ }
112128 }
113129 return manifestXml ;
114130 }
You can’t perform that action at this time.
0 commit comments