diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index dc3b9cae..4c185e34 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -80,7 +80,7 @@
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
\ No newline at end of file
+ android:text="test2" />
+
+
+
diff --git a/res/layout/notification_template_part_chronometer.xml b/res/layout/notification_template_part_chronometer.xml
new file mode 100644
index 00000000..14a4758a
--- /dev/null
+++ b/res/layout/notification_template_part_chronometer.xml
@@ -0,0 +1,25 @@
+
+
+
+
diff --git a/res/layout/notification_template_part_time.xml b/res/layout/notification_template_part_time.xml
new file mode 100644
index 00000000..e3b91fad
--- /dev/null
+++ b/res/layout/notification_template_part_time.xml
@@ -0,0 +1,25 @@
+
+
+
+
diff --git a/res/menu/main.xml b/res/menu/main.xml
old mode 100755
new mode 100644
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
new file mode 100644
index 00000000..f96195c8
--- /dev/null
+++ b/res/values/dimens.xml
@@ -0,0 +1,361 @@
+
+
+
+
+ 164dp
+
+ 145dp
+
+ 48dip
+
+ 2
+ 64dip
+
+ 25dip
+
+ 48dp
+
+ 48dp
+
+ 42dp
+
+ 24dip
+
+ 48sp
+
+ @dimen/navigation_bar_height
+
+ 32dip
+
+ 5dp
+
+
+ 104dp
+
+ 52sp
+
+ 16dp
+
+ 64dp
+
+ 52dp
+
+ 800dp
+
+
+ 56dip
+
+ 56dip
+
+ 4dip
+
+ 3dip
+
+ 9dip
+
+
+ 270dp
+
+
+ 135dip
+
+
+ 75dip
+
+
+ 40dip
+
+
+ 15dip
+
+
+ 0dp
+
+ 0dp
+
+ 0dp
+
+ 0dp
+
+ 48dp
+
+ 0dp
+
+ 16dp
+
+ 4
+
+ 6
+
+ 0dp
+
+ 0dp
+
+ 0dp
+
+ - 65%
+
+
+ - 320dp
+
+ - 320dp
+
+ - 80%
+
+ - 100%
+
+
+ 0dp
+
+ 16dip
+ 0x02000000
+
+ 0x02000000
+
+ 8dip
+ 8dip
+ 16dip
+
+
+ - 95%
+
+
+ 64dp
+
+ 64dp
+
+
+ 160dip
+
+
+ 320dip
+
+
+ 64dip
+
+ 48dip
+
+
+ 48dip
+
+ 8dip
+
+ 18dp
+
+ 14dp
+
+ -3dp
+
+ 5dip
+
+
+ 80dip
+
+
+ 14dip
+
+
+ 42dip
+
+
+ 22dip
+
+
+ 12dip
+
+
+ 40dip
+
+
+ 330dip
+
+
+ 200dip
+
+
+ 8dip
+
+
+ 8dip
+
+
+ 8dip
+
+
+ 32dip
+
+
+ 240dip
+
+
+ 80dp
+
+
+ 8dp
+ 8dp
+ 8dp
+ 8dp
+
+
+ 56dip
+
+
+ 48dp
+
+
+ 180dp
+
+
+ 14dp
+
+ 18dp
+
+ 12dp
+
+
+
+ 600dp
+
+
+ 480dp
+
+
+ 0dp
+
+
+ 0dp
+
+
+ 75dp
+
+
+ 15dp
+
+
+ 13dp
+
+
+ 16dp
+
+
+ -16dp
+
+
+ 0dp
+
+
+ 0dp
+
+
+ 60dp
+
+
+ 46dp
+
+
+ 7dp
+
+
+ 2dp
+
+
+ 16dp
+
+
+ 0dp
+
+
+ 64dp
+
+
+ 0dp
+
+
+ 80dip
+
+
+ 320dp
+
+
+ 400dp
+
+
+ 8dp
+
+
+ 8dp
+
+
+ 2dp
+
+
+ 1dp
+
+
+ 66dp
+
+
+ 10sp
+
+
+ 24dp
+
+
+ 600dp
+
+
+ 160dp
+
+
+ 2dp
+
+
+ 2dp
+
+
+ 2dp
+
+
+ 2dp
+
+
+ -1px
+
diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java
index df6443a6..205be245 100644
--- a/src/org/torproject/android/service/TorService.java
+++ b/src/org/torproject/android/service/TorService.java
@@ -24,6 +24,8 @@ import java.util.List;
import java.util.StringTokenizer;
import java.util.Timer;
import java.util.TimerTask;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import net.freehaven.tor.control.ConfigEntry;
import net.freehaven.tor.control.EventHandler;
@@ -58,10 +60,10 @@ import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationCompat.Builder;
+import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
-import android.view.View;
-import android.widget.Button;
import android.widget.RemoteViews;
+import android.widget.Toast;
public class TorService extends Service implements TorServiceConstants, TorConstants, EventHandler
{
@@ -82,6 +84,8 @@ public class TorService extends Service implements TorServiceConstants, TorConst
private static final int HS_NOTIFY_ID = 3;
private boolean prefPersistNotifications = true;
+ String IPADDRESS_PATTERN =
+ "(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";
private static final int MAX_START_TRIES = 3;
@@ -111,6 +115,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst
private NotificationManager mNotificationManager = null;
private Builder mNotifyBuilder;
private Notification mNotification;
+ private String exitIP = "";
private boolean mHasRoot = false;
private boolean mEnableTransparentProxy = false;
@@ -223,21 +228,24 @@ public class TorService extends Service implements TorServiceConstants, TorConst
mNotificationManager.cancelAll();
}
-
+
@SuppressLint("NewApi")
private void showToolbarNotification (String notifyMsg, int notifyId, int icon, boolean isOngoing)
{
//Reusable code.
- Intent intent = new Intent(TorService.this, Orbot.class);
- PendingIntent pendIntent = PendingIntent.getActivity(TorService.this, 0, intent, 0);
+ Intent intent = new Intent(TorService.this, Orbot.class);
+ PendingIntent pendIntent = PendingIntent.getActivity(TorService.this, 0, intent, 0);
// Create remote view that needs to be set as bigContentView for the notification.
RemoteViews expandedView = new RemoteViews(this.getPackageName(),
R.layout.layout_notification_expanded);
- expandedView.setTextViewText(R.id.tv, notifyMsg);
- expandedView.setOnClickPendingIntent(R.id.but, pendIntent);
- expandedView.setImageViewResource(R.id.img, icon);
+
+ expandedView.setTextViewText(R.id.text, notifyMsg);
+ expandedView.setTextViewText(R.id.title, "ORBOT "+exitIP);
+ //expandedView.setTextViewText(R.id.exitIP, exitIP);
+ //expandedView.setOnClickPendingIntent(R.id._tor_notificationBT, pendIntent);
+ expandedView.setImageViewResource(R.id.icon, icon);
if (mNotifyBuilder == null)
{
@@ -269,7 +277,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst
}
mNotification = mNotifyBuilder.build();
- //mNotification.bigContentView = expandedView;
+ mNotification.bigContentView = expandedView;
if (isOngoing)
{
@@ -1204,10 +1212,33 @@ public class TorService extends Service implements TorServiceConstants, TorConst
while (st.hasMoreTokens())
{
node = st.nextToken();
+ final String nodeName = parseNodeName(node);
+ sb.append(nodeName);
- sb.append(parseNodeName(node));
-
-
+ if(status.equals("BUILT") && currentStatus==STATUS_ON){
+ Thread thread = new Thread()
+ {
+ @Override
+ public void run() {
+ try {
+ String nodeDetails = conn.getInfo("ns/name/"+nodeName);
+ Pattern pattern = Pattern.compile(IPADDRESS_PATTERN);
+ Matcher matcher = pattern.matcher(nodeDetails);
+ if (matcher.find()) {
+ Log.d(TAG, "ip: "+matcher.group());
+ exitIP = matcher.group();
+ }
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ };
+ thread.start();
+
+ Log.d(TAG ,"Node name: "+nodeName+"IP: "+exitIP);
+ }
+
if (st.hasMoreTokens())
sb.append (" > ");
}
diff --git a/update-ant-build.sh b/update-ant-build.sh
old mode 100755
new mode 100644