Skip to content
GreaterFire edited this page Aug 30, 2018 · 40 revisions

The Trojan Protocol has yet to be implemented on any mobile platforms. It would be unlikely for an implementation to come out any time soon, due to the complexity involed. (i.e g to implement a session layer protocol on top of a network layer interface). However, there are still various of workarounds which you can use to make Trojan run on Android, iOS or other platforms.

Android

Trojan can be compiled in Termux, an Android terminal emulator. Follow these steps to build and install it:

apt install git clang cmake boost-dev openssl-dev
git clone https://github.com/trojan-gfw/trojan
cd trojan/
cmake -DCMAKE_INSTALL_PREFIX=/data/data/com.termux/files/usr -DENABLE_MYSQL=OFF .
make install

If you encounter linker errors, you may need to patch the CMakeLists.txt before cmake:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,7 @@ if(ENABLE_MYSQL)
     target_link_libraries(trojan ${MYSQL_LIBRARIES})
     add_definitions(-DENABLE_MYSQL)
 endif()
+target_link_libraries(trojan atomic)
 if(WIN32)
     target_link_libraries(trojan wsock32 ws2_32 crypt32)
 else()

Next, use Privoxy to convert SOCKS5 proxy to HTTP proxy, and set system proxy settings to privoxy address and port.

Privoxy can be installed via

apt install privoxy

iOS

iOS has more restrictions than Android. Therefore, the only way to use trojan is to setup a computer on the same LAN to run trojan and then either:

  • Convert SOCKS5 proxy to HTTP proxy by the same means introduced above and set the system proxy settings

OR

  • Use apps like Potatso to redirect network flow to the SOCKS5 proxy.