diff --git a/AndroidManifest.xml b/AndroidManifest.xml index cdc1e16f..4d909b1c 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,12 +1,12 @@ - + @@ -92,10 +92,11 @@ - + + diff --git a/external/Makefile b/external/Makefile index 4af10163..999c24d1 100644 --- a/external/Makefile +++ b/external/Makefile @@ -281,7 +281,7 @@ obfsclient-clean: # polipo polipo-build-stamp: - CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) -C polipo + CC="$(CC)" CFLAGS="$(PIEFLAGS)" LDFLAGS="$(PIEFLAGS)" $(MAKE) -C polipo touch polipo-build-stamp polipo: polipo-build-stamp @@ -289,6 +289,7 @@ polipo: polipo-build-stamp cp polipo/polipo bin polipo-clean: + -rm -f polipo/polipo -rm -f bin/polipo -rm -f polipo-build-stamp diff --git a/res/raw/torrc b/res/raw/torrc new file mode 100644 index 00000000..e5a4c499 --- /dev/null +++ b/res/raw/torrc @@ -0,0 +1,7 @@ +RunAsDaemon 1 +AvoidDiskWrites 1 +ControlPort auto +SOCKSPort 0 +DNSPort 0 +TransPort 0 +CookieAuthentication 1 \ No newline at end of file diff --git a/src/org/torproject/android/OnBootReceiver.java b/src/org/torproject/android/OnBootReceiver.java index 652e5c9a..2876a261 100644 --- a/src/org/torproject/android/OnBootReceiver.java +++ b/src/org/torproject/android/OnBootReceiver.java @@ -7,40 +7,39 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; -import android.util.Log; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.content.pm.PackageManager.NameNotFoundException; +import android.os.Build.VERSION; public class OnBootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - - //Log.i(TorService.TAG,"got boot receiver event"); - if (intent.getAction() != null - && Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) + SharedPreferences prefs = TorServiceUtils.getSharedPrefs(context.getApplicationContext()); + + boolean startOnBoot = prefs.getBoolean("pref_start_boot",true); + + if (startOnBoot) { - - //Log.i(TorService.TAG,"boot is completed"); - - SharedPreferences prefs = TorServiceUtils.getSharedPrefs(context.getApplicationContext()); - - boolean startOnBoot = prefs.getBoolean("pref_start_boot",true); - - // Log.i(TorService.TAG,"start on boot: " + startOnBoot); - - - if (startOnBoot) - { - Intent torService = new Intent(context.getApplicationContext(), TorService.class); - torService.setAction(Intent.ACTION_BOOT_COMPLETED); - context.getApplicationContext().startService(torService); - - } + startService("init",context); + startService("start",context); } - - - } + } + + + private void startService (String action, Context context) + { + + Intent torService = new Intent(context, TorService.class); + torService.setAction(action); + context.startService(torService); + + + } } diff --git a/src/org/torproject/android/service/TorServiceConstants.java b/src/org/torproject/android/service/TorServiceConstants.java index c6c7031b..0b648567 100644 --- a/src/org/torproject/android/service/TorServiceConstants.java +++ b/src/org/torproject/android/service/TorServiceConstants.java @@ -76,7 +76,7 @@ public interface TorServiceConstants { public static final int DISABLE_TOR_MSG = 3; public static final int LOG_MSG = 4; - public static final String BINARY_TOR_VERSION = "0.2.5.10-openssl1.0.1i"; + public static final String BINARY_TOR_VERSION = "0.2.5.10-openssl1.0.1i-nonPIE-polipofix"; public static final String PREF_BINARY_TOR_VERSION_INSTALLED = "BINARY_TOR_VERSION_INSTALLED"; //obfsproxy