[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] no longer needed



commit 8b3a26f297f49edd2aac93bba4e621d0456a3635
Author: Juan Ezquerro LLanes <juan@xxxxxxxxxxxxx>
Date:   Thu Nov 17 13:45:31 2016 +0100

    no longer needed
---
 .../org/torproject/android/service/TorService.java | 71 ----------------------
 1 file changed, 71 deletions(-)

diff --git a/orbotservice/src/main/java/org/torproject/android/service/TorService.java b/orbotservice/src/main/java/org/torproject/android/service/TorService.java
index 9942abb..e1971c8 100644
--- a/orbotservice/src/main/java/org/torproject/android/service/TorService.java
+++ b/orbotservice/src/main/java/org/torproject/android/service/TorService.java
@@ -465,75 +465,6 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
         sendCallbackStatus(STATUS_OFF);
     }
 
-
-    private String getHiddenServiceHostname ()
-    {
-
-        SharedPreferences prefs = TorServiceUtils.getSharedPrefs(getApplicationContext());
-
-        boolean enableHiddenServices = prefs.getBoolean("pref_hs_enable", false);
-
-        StringBuffer result = new StringBuffer();
-
-        if (enableHiddenServices)
-        {
-            String hsPorts = prefs.getString("pref_hs_ports","");
-
-            StringTokenizer st = new StringTokenizer (hsPorts,",");
-            String hsPortConfig = null;
-
-            while (st.hasMoreTokens())
-            {
-
-                int hsPort = Integer.parseInt(st.nextToken().split(" ")[0]);;
-
-                File fileDir = new File(appCacheHome, "hs" + hsPort);
-                File file = new File(fileDir, "hostname");
-
-
-                if (file.exists())
-                {
-                    try {
-                        String onionHostname = Utils.readString(new FileInputStream(file)).trim();
-
-                        if (result.length() > 0)
-                            result.append(",");
-
-                        result.append(onionHostname);
-
-
-                    } catch (FileNotFoundException e) {
-                        logException("unable to read onion hostname file",e);
-                        showToolbarNotification(getString(R.string.unable_to_read_hidden_service_name), HS_NOTIFY_ID, R.drawable.ic_stat_notifyerr);
-                        return null;
-                    }
-                }
-                else
-                {
-                    showToolbarNotification(getString(R.string.unable_to_read_hidden_service_name), HS_NOTIFY_ID, R.drawable.ic_stat_notifyerr);
-                    return null;
-
-                }
-            }
-
-            if (result.length() > 0)
-            {
-                String onionHostname = result.toString();
-
-                showToolbarNotification(getString(R.string.hidden_service_on) + ' ' + onionHostname, HS_NOTIFY_ID, R.drawable.ic_stat_tor);
-                Editor pEdit = prefs.edit();
-                pEdit.putString("pref_hs_hostname",onionHostname);
-                pEdit.commit();
-
-                return onionHostname;
-            }
-
-        }
-
-        return null;
-    }
-
-
     private void killAllDaemons() throws Exception {
         if (conn != null) {
             logNotice("Using control port to shutdown Tor");
@@ -831,8 +762,6 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
                 enableTransparentProxy();
             }
 
-            getHiddenServiceHostname ();
-
         } catch (Exception e) {
             logException("Unable to start Tor: " + e.toString(), e);
             showToolbarNotification(



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits