[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [orbot/master] cleanup of imports and unclosed streams
commit 7df2acd59c6aabfdabd68bc5320a5749c98695e9
Author: n8fr8 <nathan@xxxxxxxxxxx>
Date: Tue Feb 12 14:26:12 2013 +0700
cleanup of imports and unclosed streams
---
src/org/torproject/android/service/TorBinaryInstaller.java | 12 ++++++------
src/org/torproject/android/settings/AppManager.java | 6 ------
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/src/org/torproject/android/service/TorBinaryInstaller.java b/src/org/torproject/android/service/TorBinaryInstaller.java
index 51ff907..ffaeab3 100644
--- a/src/org/torproject/android/service/TorBinaryInstaller.java
+++ b/src/org/torproject/android/service/TorBinaryInstaller.java
@@ -13,19 +13,14 @@ import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.GZIPOutputStream;
import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
-import java.util.zip.ZipOutputStream;
import org.torproject.android.R;
import org.torproject.android.TorConstants;
import android.content.Context;
import android.util.Log;
-import android.widget.Toast;
public class TorBinaryInstaller implements TorServiceConstants {
@@ -125,10 +120,11 @@ public class TorBinaryInstaller implements TorServiceConstants {
OutputStream stmOut = new FileOutputStream(outFile, append);
+ ZipInputStream zis = null;
if (zip)
{
- ZipInputStream zis = new ZipInputStream(stm);
+ zis = new ZipInputStream(stm);
ZipEntry ze = zis.getNextEntry();
stm = zis;
@@ -144,6 +140,10 @@ public class TorBinaryInstaller implements TorServiceConstants {
stmOut.close();
stm.close();
+ if (zis != null)
+ zis.close();
+
+
return true;
}
diff --git a/src/org/torproject/android/settings/AppManager.java b/src/org/torproject/android/settings/AppManager.java
index 46b33f1..ae03924 100644
--- a/src/org/torproject/android/settings/AppManager.java
+++ b/src/org/torproject/android/settings/AppManager.java
@@ -6,15 +6,12 @@ package org.torproject.android.settings;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
-import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
import org.torproject.android.R;
import org.torproject.android.TorConstants;
-import org.torproject.android.R.id;
-import org.torproject.android.R.layout;
import android.app.Activity;
import android.content.Context;
@@ -23,9 +20,6 @@ import android.content.SharedPreferences.Editor;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.pm.PermissionInfo;
-import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits