Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions external/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ tor/Makefile: tor/configure.ac tor/Makefile.am
--enable-zstd \
--disable-lzma \
--disable-module-relay \
--disable-unittests \
--disable-module-dirauth \
--disable-asciidoc \
--disable-tool-name-check \
Expand Down Expand Up @@ -288,8 +289,8 @@ ifneq ($(DEBUG), 1)
ls -l $(INSTALL_DIR)/libtor.so
endif
grep "Java_org_torproject_jni_TorService" $(INSTALL_DIR)/libtor.so
install -d $(EXTERNAL_ROOT)/test/$(APP_ABI)
cp tor/src/test/test tor/src/test/test-memwipe tor/src/test/test-slow \
# install -d $(EXTERNAL_ROOT)/test/$(APP_ABI)
# cp tor/src/test/test tor/src/test/test-memwipe tor/src/test/test-slow \
$(EXTERNAL_ROOT)/test/$(APP_ABI)

PREBUILD_SHARED_LIBRARY-clean:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,17 @@ private static File getAppTorServiceDataDir(Context context) {
private native int runMain();


public native static boolean fatal();

@bitmold bitmold Mar 1, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this fatal() method and the corresponding C method JNIEXPORT jboolean JNICALL Java_org_torproject_jni_TorService_fatal(JNIEnv *env, jobject thisObj);. This is just temporarily here for testing

public static final String STATUS_ABORT = "ABORTING";
private static Context ctx;
public static void onTorRawAbort() {
Log.wtf("OrbotAbortReport", "made it to java abort");
if (ctx == null) return; // TorService's onCreate() hasn't been called, no valid context.
Log.wtf("OrbotAbortReport", "sending abort ");
broadcastStatus(ctx, STATUS_ABORT);
}


public class LocalBinder extends Binder {
public TorService getService() {
return TorService.this;
Expand All @@ -248,6 +259,7 @@ public IBinder onBind(Intent intent) {
public void onCreate() {
super.onCreate();
broadcastStatus(this, STATUS_STARTING);
ctx = this;
startTorServiceThread();
}

Expand Down Expand Up @@ -443,6 +455,7 @@ private void startTorServiceThread() {
@Override
public void onDestroy() {
super.onDestroy();
ctx = null;
if (torControlConnection != null) {
torControlConnection.removeRawEventListener(startedEventListener);
}
Expand Down