clairehurst pushed to branch tor-browser-147.0a1-16.0-2 at The Tor Project / 
Applications / Tor Browser


Commits:
5f102b4d by Pier Angelo Vendrame at 2026-02-09T15:32:21+01:00
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.

- - - - -


1 changed file:

- 
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/TorAndroidIntegration.java


Changes:

=====================================
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;
@@ -100,7 +102,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();
   }
@@ -357,15 +359,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;



View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/5f102b4d21f034afd9340e559eba3de35a997805

-- 
View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/5f102b4d21f034afd9340e559eba3de35a997805
You're receiving this email because of your account on gitlab.torproject.org.


_______________________________________________
tor-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to