diff --git a/src/org/torproject/android/Orbot.java b/src/org/torproject/android/Orbot.java index 73748221..0f162af7 100644 --- a/src/org/torproject/android/Orbot.java +++ b/src/org/torproject/android/Orbot.java @@ -26,6 +26,7 @@ import android.content.Intent; import android.content.ServiceConnection; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; +import android.content.pm.PackageManager.NameNotFoundException; import android.net.Uri; import android.os.Bundle; import android.os.Handler; @@ -136,16 +137,24 @@ public class Orbot extends Activity implements OnLongClickListener, TorConstants private void showAbout () { - LayoutInflater li = LayoutInflater.from(this); - View view = li.inflate(R.layout.layout_about, null); - - TextView versionName = (TextView)view.findViewById(R.id.versionName); - versionName.setText(R.string.app_version); - - new AlertDialog.Builder(this) - .setTitle(getString(R.string.button_about)) - .setView(view) - .show(); + LayoutInflater li = LayoutInflater.from(this); + View view = li.inflate(R.layout.layout_about, null); + + String version = ""; + + try { + version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName; + } catch (NameNotFoundException e) { + version = "Version Not Found"; + } + + TextView versionName = (TextView)view.findViewById(R.id.versionName); + versionName.setText(version); + + new AlertDialog.Builder(this) + .setTitle(getString(R.string.button_about)) + .setView(view) + .show(); } /* When a menu item is selected launch the appropriate view or activity diff --git a/src/org/torproject/android/service/Api.java b/src/org/torproject/android/service/IptablesManager.java similarity index 96% rename from src/org/torproject/android/service/Api.java rename to src/org/torproject/android/service/IptablesManager.java index fdd357b4..27817052 100644 --- a/src/org/torproject/android/service/Api.java +++ b/src/org/torproject/android/service/IptablesManager.java @@ -55,7 +55,7 @@ import android.widget.Toast; * Contains shared programming interfaces. * All iptables "communication" is handled by this class. */ -public final class Api { +public final class IptablesManager { /** application version string */ public static final String VERSION = "1.5.1-dev"; /** special application UID used to indicate "any application" */ @@ -861,8 +861,8 @@ public final class Api { return; } /* notify */ - final Intent message = new Intent(Api.STATUS_CHANGED_MSG); - message.putExtra(Api.STATUS_EXTRA, enabled); + final Intent message = new Intent(IptablesManager.STATUS_CHANGED_MSG); + message.putExtra(IptablesManager.STATUS_EXTRA, enabled); ctx.sendBroadcast(message); } /** diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java index 1b114923..57c43b04 100644 --- a/src/org/torproject/android/service/TorService.java +++ b/src/org/torproject/android/service/TorService.java @@ -416,16 +416,12 @@ public class TorService extends Service implements TorServiceConstants, Runnable private boolean checkTorBinaries () throws Exception { - //android.os.Debug.waitForDebugger(); - //check and install iptables - Api.assertBinaries(this, true); + IptablesManager.assertBinaries(this, true); - File fileInstall = getDir("",0); - String subBinPath = "bin/"; + File fileInstall = getDir("bin/",0); appHome = fileInstall.getAbsolutePath(); - appBinHome = appHome + subBinPath; appDataHome = getCacheDir().getAbsolutePath() + '/'; logNotice( "appHome=" + appHome);