Comments (13)
Hi.
Try start it in a background thread. Not UI thread.
from torandroid.
Can You give me sample code
from torandroid.
Sample code of connection is available in README.md and AndroidTest.
https://github.com/mirsamantajbakhsh/TorAndroid/blob/main/app/src/androidTest/java/ir/mstajbakhsh/torandroid/ExampleInstrumentedTest.java
Just put that code inside an AsynchTask
https://developer.android.com/reference/android/os/AsyncTask
from torandroid.
Can you Integrate My Project I will hire you
from torandroid.
I can check your code. Upload it to github and send me the repository link, but for hiring, I am busy and cannot be hired. Thanks for suggestion.
from torandroid.
check this code
from torandroid.
It did not load. Would you please paste the code here as a code segment like:
sample code segment
?
from torandroid.
from torandroid.
I've checked the code. You have used the TorAndroid library in lightning/connect/TorConnect.java file. I've tried your code and faced an exception in library and created an issue #4 and fixed it in 3a48012
I've uploaded the library to Bintray and now it is working. Here is a sample code which will start Tor in another thread. Feel free to ask if you have another question.
public void startTorInBackground(Context cntx) {
HandlerThread mHandlerThread = new HandlerThread("TorThread");
mHandlerThread.start();
Handler mHandler = new Handler(mHandlerThread.getLooper());
mHandler.postDelayed(() -> {
final TorProxy tb = new TorProxy.TorBuilder()
.setSOCKsPort(9150)
.setUseBrideges(false)
.setDebuggable(false)
.build(cntx.getApplicationContext());
tb.init();
try {
final IConnectionDone icd = new IConnectionDone() {
@Override
public void onSuccess() {
Log.d("TorAndroid", "Tor Started Successfully.");
}
@Override
public void onFailure(Exception ex) {
Log.e("TorAndroid", "Error in Starting Tor.\r\n" + ex.getMessage());
}
};
tb.start(icd);
} catch (IOException e) {
e.printStackTrace();
}
}, 1000);
}
from torandroid.
I integrate this but when I try to use onion URL in my browser application then not working also https://check.torproject.org open not connected, please check yourself
from torandroid.
public void startTorInBackground(Context cntx) { HandlerThread mHandlerThread = new HandlerThread("TorThread"); mHandlerThread.start(); Handler mHandler = new Handler(mHandlerThread.getLooper()); mHandler.postDelayed(() -> { final TorProxy tb = new TorProxy.TorBuilder() .setSOCKsPort(9150) .setUseBrideges(false) .setDebuggable(false) .build(cntx.getApplicationContext()); tb.init(); try { final IConnectionDone icd = new IConnectionDone() { @Override public void onSuccess() { Log.d("TorAndroid", "Tor Started Successfully."); } @Override public void onFailure(Exception ex) { Log.e("TorAndroid", "Error in Starting Tor.\r\n" + ex.getMessage()); } }; tb.start(icd); } catch (IOException e) { e.printStackTrace(); } }, 1000); }
This Code not working, Nullpointer exception
from torandroid.
I think that you are using un-updated version of the library (May be the old version is in your Gradle's cache). However, I've released a new version both in GitHub release page and Bintray.
Update your library version to 2.0.0447 and it will be fixed.
implementation 'com.github.mirsamantajbakhsh:TorAndroid:2.0.0447'
I've checked it myself. Now it is working.
I've used the same code I've sent previously:
from torandroid.
It seems that the issue has been fixed. So I close it.
from torandroid.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from torandroid.