[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [orbot/master] for some devices, the process-id is listed first
commit 42d8ca1377e64559b685a1dbbd3cf26bb5899618
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
Date: Fri May 2 14:58:47 2014 -0400
for some devices, the process-id is listed first
---
src/org/torproject/android/service/TorServiceUtils.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/org/torproject/android/service/TorServiceUtils.java b/src/org/torproject/android/service/TorServiceUtils.java
index be1694e..70c5746 100644
--- a/src/org/torproject/android/service/TorServiceUtils.java
+++ b/src/org/torproject/android/service/TorServiceUtils.java
@@ -89,9 +89,17 @@ public class TorServiceUtils implements TorServiceConstants {
{
if (line.contains(command))
{
+
String[] lineParts = line.split("\\s+");
- procId = Integer.parseInt(lineParts[1]);
+ try {
+
+ procId = Integer.parseInt(lineParts[1]); //for most devices it is the second number
+ } catch(NumberFormatException e) {
+ procId = Integer.parseInt(lineParts[0]); //but for samsungs it is the first
+
+ }
+
break;
}
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits