Browse Source

able to connect to tor control port via go

remote
Dan Ballard 5 years ago
parent
commit
db899ffcf6
  1. 1
      .gitignore
  2. 25
      app/src/main/java/im/ricochet/androidod/ConnectActivity.java
  3. 2
      app/src/main/res/layout/activity_connect.xml
  4. BIN
      goRicochetMobile/goRicochetMobile.aar

1
.gitignore

@ -1,4 +1,5 @@
*.iml
*.aar
.gradle
/local.properties
/.idea/workspace.xml

25
app/src/main/java/im/ricochet/androidod/ConnectActivity.java

@ -9,6 +9,9 @@ import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import goRicochetMobile.GoRicochetMobile;
@ -55,14 +58,34 @@ public class ConnectActivity extends AppCompatActivity {
Log.i(TAG, "Attempting manual java connection to tor control");
try {
Socket socket = new Socket("127.0.0.1", 5051);
Socket socket = new Socket("127.0.0.1", 9051);
PrintWriter out =
new PrintWriter(socket.getOutputStream(), true);
BufferedReader in =
new BufferedReader(
new InputStreamReader(socket.getInputStream()));
out.write("hello");
//String result = in.readLine();
Log.i(TAG, "wrote");
//in.close();
socket.close();
} catch (Exception e) {
Log.e(TAG, e.toString());
Log.e(TAG, Log.getStackTraceString(e));
}
Log.i(TAG, "Go Net Test...");
try {
boolean ok = GoRicochetMobile.testNet();
Log.i(TAG, "NetTest: " + ok);
} catch(Exception e) {
}
Log.i(TAG, "Starting Echo Bot");
GoRicochetMobile.echoBot(privateKey);
}
}

2
app/src/main/res/layout/activity_connect.xml

@ -82,7 +82,7 @@
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ControlPort 5051"
android:text="ControlPort 9051"
android:layout_marginTop="7dp"
app:layout_constraintTop_toBottomOf="@+id/textView2"
android:layout_marginRight="8dp"

BIN
goRicochetMobile/goRicochetMobile.aar

Binary file not shown.
Loading…
Cancel
Save