[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #32476 [Applications/Tor Browser]: Support Launching TorService Using JNI
#32476: Support Launching TorService Using JNI
-------------------------------------------------+-------------------------
Reporter: sisbell | Owner: tbb-
| team
Type: defect | Status: new
Priority: Medium | Milestone:
Component: Applications/Tor Browser | Version:
Severity: Normal | Resolution:
Keywords: Android, tbb-mobile, | Actual Points:
TorBrowserTeam201911 |
Parent ID: | Points:
Reviewer: | Sponsor:
-------------------------------------------------+-------------------------
Comment (by sisbell):
I'm not in exact agreement that startup can't be shared without making the
code unmaintainable (although this has some subjectivity). I'm using a
base broadcaster, followed by an Android broadcaster that encapsulates the
logic. The main class is then just invoking the interface implementation.
https://github.com/sisbell/tor-android-
service/blob/master/service/src/main/java/org/torproject/android/service/AndroidEventBroadcaster.java
https://github.com/thaliproject/Tor_Onion_Proxy_Library/blob/master/universal/src/main/java/com/msopentech/thali/toronionproxy/BaseEventBroadcaster.java
This all doesn't have to be decided up-front. It looks good enough for
now. After getting the Android tor variant integrated into the build
system, the next step will be to pick this up to include the embedded JNI
interface and implementation. After that, we can circle back on more
integration specifics.
Replying to [comment:7 eighthave]:
> I agree that having Java support is good, plus I don't think it'll be
much work. I've been working on TorService and jtorctl always with
supporting both Java and Android in mind. The JNI code should already
support Java, its just not tested there for a while.
>
> The clear border of sharing is
''src/feature/api/org_torproject_jni_TorService.c'' instead of
''TorService.java''. The biggest block of logic in ''TorService.java'' is
the startup procedure, and it seems very unlikely that the startup
procedure should be shared between Java and Android. They will have
similarities, but not close enough that code sharing makes sense. So if
that core stuff isn't shared, then separating the Android-specific stuff
like broadcasts from the Android-specific startup logic would only make
the code more unreadable and unmaintainable.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/32476#comment:8>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs