0001-Revert-Bug-30318-Add-snowflake-support.patch 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. From f3cf622e537a1283b821b3f3ce8e396a01bcb84b Mon Sep 17 00:00:00 2001
  2. From: Georg Koppen <gk@torproject.org>
  3. Date: Sat, 16 Jan 2021 20:56:30 +0000
  4. Subject: [PATCH] Revert "Bug 30318: Add snowflake support"
  5. This reverts commit ecc251d0a73f7e2034a271efd28036a0108b8688.
  6. diff --git a/service/src/main/assets/common/bridges.txt b/service/src/main/assets/common/bridges.txt
  7. index 1525eba..fe37735 100644
  8. --- a/service/src/main/assets/common/bridges.txt
  9. +++ b/service/src/main/assets/common/bridges.txt
  10. @@ -13,5 +13,3 @@ obfs4 45.145.95.6:27015 C5B7CD6946FF10C5B3E89691A7D3F2C122D2117C cert=TD7PbUO0/0
  11. obfs4 [2a0c:4d80:42:702::1]:27015 C5B7CD6946FF10C5B3E89691A7D3F2C122D2117C cert=TD7PbUO0/0k6xYHMPW3vJxICfkMZNdkRrb63Zhl5j9dW3iRGiCx0A7mPhe5T2EDzQ35+Zw iat-mode=0
  12. obfs4 51.222.13.177:80 5EDAC3B810E12B01F6FD8050D2FD3E277B289A08 cert=2uplIpLQ0q9+0qMFrK5pkaYRDOe460LL9WHBvatgkuRr/SL31wBOEupaMMJ6koRE6Ld0ew iat-mode=0
  13. meek_lite 0.0.2.0:2 97700DFE9F483596DDA6264C4D7DF7641E1E39CE url=https://meek.azureedge.net/ front=ajax.aspnetcdn.com
  14. -
  15. -snowflake 0.0.3.0:1 2B280B23E1107BB62ABFC40DDCC8824814F80A72
  16. diff --git a/service/src/main/java/org/torproject/android/service/CustomTorInstaller.java b/service/src/main/java/org/torproject/android/service/CustomTorInstaller.java
  17. index 52bc4fe..198c981 100644
  18. --- a/service/src/main/java/org/torproject/android/service/CustomTorInstaller.java
  19. +++ b/service/src/main/java/org/torproject/android/service/CustomTorInstaller.java
  20. @@ -40,17 +40,14 @@ public class CustomTorInstaller extends TorInstaller {
  21. @Override
  22. public InputStream openBridgesStream() throws IOException {
  23. /*
  24. - BridgesList is an overloaded field, which can cause some confusion.
  25. - The list can be:
  26. - 1) a filter like obfs4, meek, or snowflake OR
  27. - 2) it can be a custom bridge
  28. - For (1), we just pass back all bridges, the filter will occur
  29. - elsewhere in the library.
  30. - For (2) we return the bridge list as a raw stream.
  31. - If length is greater than 9, then we know this is a custom bridge
  32. + BridgesList is an overloaded field, which can cause some confusion. The list can be:
  33. + 1) a filter like obfs4 or meek OR 2) it can be a custom bridge
  34. + For (1), we just pass back all bridges, the filter will occur elsewhere in the library.
  35. + For (2) we return the bridge list as a raw stream
  36. + If length is greater than 5, then we know this is a custom bridge
  37. */
  38. String userDefinedBridgeList = Prefs.getBridgesList();
  39. - byte bridgeType = (byte) (userDefinedBridgeList.length() > 9 ? 1 : 0);
  40. + byte bridgeType = (byte) (userDefinedBridgeList.length() > 5 ? 1 : 0);
  41. // Terrible hack. Must keep in sync with topl::addBridgesFromResources.
  42. if (bridgeType == 0) {
  43. switch (userDefinedBridgeList) {
  44. @@ -60,9 +57,6 @@ public class CustomTorInstaller extends TorInstaller {
  45. case "meek":
  46. bridgeType = 3;
  47. break;
  48. - case "snowflake":
  49. - bridgeType = 4;
  50. - break;
  51. }
  52. }
  53. diff --git a/service/src/main/java/org/torproject/android/service/TorService.java b/service/src/main/java/org/torproject/android/service/TorService.java
  54. index f1ddcda..32d7f30 100644
  55. --- a/service/src/main/java/org/torproject/android/service/TorService.java
  56. +++ b/service/src/main/java/org/torproject/android/service/TorService.java
  57. @@ -365,12 +365,10 @@ public final class TorService extends Service implements TorServiceConstants, Or
  58. //Check bridges to see if we need this
  59. File nativeDir = new File(getApplicationInfo().nativeLibraryDir);
  60. - File pluggableTransportObfs = new File(nativeDir, "libObfs4proxy.so");
  61. - if(!pluggableTransportObfs.canExecute()) pluggableTransportObfs.setExecutable(true);
  62. - File pluggableTransportSnow = new File(nativeDir, "libSnowflake.so");
  63. - if(!pluggableTransportSnow.canExecute()) pluggableTransportSnow.setExecutable(true);
  64. + File pluggableTransport = new File(nativeDir, "libObfs4proxy.so");
  65. + if(!pluggableTransport.canExecute()) pluggableTransport.setExecutable(true);
  66. - builder.configurePluggableTransportsFromSettings(pluggableTransportObfs, pluggableTransportSnow);
  67. + builder.configurePluggableTransportsFromSettings(pluggableTransport);
  68. mDataService.updateConfigBuilder(builder);
  69. onionProxyManager.getTorInstaller().updateTorConfigCustom
  70. (builder.asString());
  71. --
  72. 2.30.0