cleanup of imports and unclosed streams

This commit is contained in:
n8fr8 2013-02-12 14:26:12 +07:00
parent ba9b95a1cb
commit 7df2acd59c
2 changed files with 6 additions and 12 deletions

View File

@ -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;
}

View File

@ -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;