tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit cf3d98bdce7917a28a12acb4845d0973738b3126
parent b5063787bff177a375ab0dd9ded6193502a15893
Author: Pier Angelo Vendrame <pierov@torproject.org>
Date:   Mon,  9 Feb 2026 15:32:21 +0100

fixup! TB 42247: Android helpers for the TorProvider

TB 44620: Move the Android IPC directory.

Move the the files we use to communicate with the tor process from the
cache directory to the data directory, as some OEMs might be doing some
strange things in the cache directory, which might result in proxy
errors for users.

Diffstat:
Mmobile/android/geckoview/src/main/java/org/mozilla/geckoview/TorAndroidIntegration.java | 15+++++----------
1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/TorAndroidIntegration.java b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/TorAndroidIntegration.java @@ -19,6 +19,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.InterruptedIOException; +import java.nio.file.Files; +import java.nio.file.attribute.PosixFilePermissions; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -97,7 +99,7 @@ public class TorAndroidIntegration implements BundleEventListener { /* package */ TorAndroidIntegration(Context context) { mLibraryDir = context.getApplicationInfo().nativeLibraryDir; mCacheDir = context.getCacheDir().getAbsolutePath(); - mIpcDirectory = mCacheDir + "/tor-private"; + mIpcDirectory = new File(context.getFilesDir(), "tor-ipc").getAbsolutePath(); mDataDir = new File(context.getFilesDir(), "tor"); registerListener(); } @@ -354,15 +356,8 @@ public class TorAndroidIntegration implements BundleEventListener { return; } try { - // First remove the permissions for everybody... - directory.setReadable(false, false); - directory.setWritable(false, false); - directory.setExecutable(false, false); - // ... then add them back, but only for the owner. - directory.setReadable(true, true); - directory.setWritable(true, true); - directory.setExecutable(true, true); - } catch (SecurityException e) { + Files.setPosixFilePermissions(directory.toPath(), PosixFilePermissions.fromString("rwx------")); + } catch (IOException | SecurityException e) { Log.e(TAG, "Could not set the permissions to the IPC directory.", e); } return;