{"id":31701956,"url":"https://github.com/getlantern/lantern-mobile","last_synced_at":"2025-10-08T21:10:31.639Z","repository":{"id":35695695,"uuid":"39972760","full_name":"getlantern/lantern-mobile","owner":"getlantern","description":"**Umaintained ** Lantern for Android","archived":false,"fork":false,"pushed_at":"2017-10-02T12:53:55.000Z","size":37949,"stargazers_count":113,"open_issues_count":17,"forks_count":30,"subscribers_count":34,"default_branch":"master","last_synced_at":"2024-04-15T03:25:45.772Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getlantern.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-30T21:12:25.000Z","updated_at":"2024-03-01T16:16:38.000Z","dependencies_parsed_at":"2022-09-03T14:30:15.860Z","dependency_job_id":null,"html_url":"https://github.com/getlantern/lantern-mobile","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/getlantern/lantern-mobile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Flantern-mobile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Flantern-mobile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Flantern-mobile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Flantern-mobile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getlantern","download_url":"https://codeload.github.com/getlantern/lantern-mobile/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getlantern%2Flantern-mobile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000716,"owners_count":26082837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-08T21:10:29.829Z","updated_at":"2025-10-08T21:10:31.632Z","avatar_url":"https://github.com/getlantern.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **UNMAINTAINED** Lantern Android\n\n### This project is no longer maintained, see [lantern-client](https://github.com/getlantern/lantern-client) instead.\n\n## Overview\n\n\u003cimg src=\"screenshots/screenshot1.png\" height=\"330px\" width=\"200px\"\u003e\n\nLantern Android is an App that uses the Android [VpnService][4] API to route\nall device traffic through a packet interception service and subsequently the\nLantern circumvention tool.\n\n## Building Lantern Android\n\nBefore building make sure you've compiled the Lantern proxy for Android:\n\n```\ncd $GOPATH/src/github.com/getlantern/lantern\nmake android-lib\n```\n\n### Building from Android Studio\n\n#### Prerequisites\n\n* [Android Studio][1]\n* Git\n* [Android NDK][2]\n\nDownload the most recent copy of the Lantern Android source code using `git`:\n\n```\nmkdir -p ~/AndroidstudioProjects\ncd ~/AndroidstudioProjects\ngit clone https://github.com/getlantern/lantern-mobile.git\n```\n\nIn the welcome screen choose the \"Open an existing Android Studio\" option and\nselect the `lantern` folder you just checked out with git.\n\n### Building from the Command Line (beta, for development only)\n\n#### Prerequisites\n\n* Java Development Kit 1.7\n* Git\n* [Android NDK][2]\n* [Android SDK Tools][4] (if not using Android Studio)\n* Go (1.6 tip is best as it eliminates text-relocations and provides the best performance)\n\nReplace the paths based on wherever you've installed the Android SDK and NDK\n\n```bash\nexport ANDROID_HOME=/opt/adt-bundle-mac-x86_64-20130917/sdk\nexport PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/23.0.2/:$PATH\nexport NDK_HOME=/opt/android-ndk-r10e\nexport PATH=$NDK_HOME:$PATH\n```\n\nUsing the sdk-manager (`$ANDROID_HOME/tools/android`), install Android 6.0 API\n23 and also the Android SDK Build Tools rev. 23.0.1.\n\n#### Building `tun2socks`\n\nLantern Android uses [tun2socks][3] to route intercepted VPN traffic through a\nlocal SOCKS server.\n\n```\nmake build-tun2socks\n```\n\n#### Building, installing and running\n\nBuild the Debug target:\n\n```\nmake build-debug\n```\n\nInstall it:\n\n```\nmake install\n```\n\nRun the app on the device from the command line:\n\n```\nmake run\n```\n\nBy default, all three tasks will be run in order with:\n\n```\nmake\n```\n\nNote - if you want to test with an emulator, run `android` and then choose\nTools -\u003e Manage AVDs.  Create an AVD (e.g. Nexus_4) and then run the emulator\nfrom the command line like so:\n\n```\nemulator -avd Nexus_4\n```\n\nThe following settings seem to work well enough performance wise:\n\n```\nDevice: 3.4\" WQVGA 240x432\nTarget: Android 5.1.1 - API Level 22\nCPU/ABI: ARM (armeabi-v7a)\nKeyboard: x Hardware keyboard present\nSkin: Skin with dynamic hardware controls\nFront Camera: None\nBack Camera: None\nMemory RAM: 2048\nVM Heap: 128\nInternal Storage: 200\nSD Card: 4GiB (probably more than necessary)\nEmulation Options: x Use Host GPU\n```\n\n#### Testing the app\n\n#### Debugging\n\nWith Lantern Android running, to filter Logcat messages:\n\n```\nmake logcat\n```\n\n#### Simulating tun2socks and lantern outside Android\n\nThis is very useful when you can to check each moving part separately.\n\nWithin Android, the [VpnService][4] creates a [TUN device][5] and configures\nthe network to route all traffic to this virtual device, an app is listening on\nthis device and has the ability to inspect, modify and reinject packets back to\nthe device. Some special packets can ignore the tun device and pass to the\nInternet directly ([protected packages][6]).\n\nWe are going to use a Linux virtual machine to simulate the `device \u003c-\u003e tun \u003c-\u003e\ntun2sock \u003c-\u003e lantern \u003c-\u003e Internet` dance, on a normal Linux we don't have the\n[VpnService][4] API but we have the ability to create tun devices and route\ntraffic at will.\n\nThe main idea is to create a tun device, run a vanilla tun2socks and route all\noutgoing traffic to this device, everything but DNS server requests and a\nspecial route that goes directly to the virtual machine's host, which will be\nrunning a Lantern-SOCKs server.\n\nLet's create and configure this virtual machine:\n\n```\ncd /path/to/lantern-mobile\nvagrant up\n```\n\nWhile you're waiting for the vm to build up go back to the local machine (the\nvm's host) and compile the socks-server:\n\n```\ncd ~/go/src/github.com/getlantern/lantern\nsource setenv.bash\ngo build github.com/getlantern/lantern-mobile/lantern/socks-server\n```\n\nRun the server you've just compiled:\n\n```\n./socks-server\n# ...\n# DEBUG lantern-android.interceptor: interceptor.go:90 SOCKS proxy now listening on port: 8788\n# 2015/09/15 08:47:40 Go and play for 10 minutes.\n```\n\nRun a simple test with cURL and watch the `sock-server` output.\n\n```\ncurl --socks5 127.0.0.1:8788 https://www.google.com/humans.txt\n# Google is built by a large team of engineers, designers, researchers, robots, and others in many different sites across the globe. It is updated continuously, and built with more tools and technologies than we can shake a stick at. If you'd like to help us out, see google.com/careers.\n```\n\nThe SOCKs server will run for 10 minutes and then it will exit, you can also\nstop it anytime with `^C`.\n\nYou can also cross-compile the tests we're going to run within the vm:\n\n```\ncd ~/go/src/github.com/getlantern/lantern\nmake mobile-test-linux-amd64\n# ...\n# ok      github.com/getlantern/lantern-mobile/lantern    0.082s\n```\n\nOnce the build has finished log in into the new box:\n\n```\nvagrant ssh\n```\n\nAnd run the script that is going to setup\n\n```\nchmod +x /vagrant/vagrant-tun-up.sh\n/vagrant/vagrant-tun-up.sh\n```\n\nThe script will ask you for a `HOST_IP`, this is the IP of the host machine\nwhich in my case is `10.0.0.101`:\n\n```\nHOST_IP=10.0.0.101 /vagrant/vagrant-tun-up.sh\n# NOTICE(tun2socks): initializing BadVPN tun2socks 1.999.130\n# NOTICE(tun2socks): entering event loop\n```\n\nGo back to your host and restart the socks-server.\n\n```\n./socks-server\n# ^C\n./socks-server\n# ...\n```\n\nOpen another terminal without stopping the tun2socks process and we'll be ready\nto test everything.\n\n```\nvagrant ssh\ncurl https://www.google.com/humans.txt\n# Google is built by a large team of engineers, designers, researchers, robots, and others in many different sites across the globe. It is updated continuously, and built with more tools and technologies than we can shake a stick at. If you'd like to help us out, see google.com/careers.\n```\n\nMake sure the request is catched by tun2socks and by the socks-server by\nwatching each program's output.\n\nFinally, run the transparent test, which will basically do the same as a normal\ncURL through tun2socks and the socks-server:\n\n```\n/vagrant/lantern/lantern_mobile_test -test.v -test.run TestTransparentRequestPassingThroughTun0\n# ...\n# --- PASS: TestTransparentRequestPassingThroughTun0 (1.36s)\n# PASS\n```\n\n[1]: http://developer.android.com/tools/studio/index.html\n[2]: https://developer.android.com/ndk/downloads/index.html#download\n[3]: https://code.google.com/p/badvpn/wiki/tun2socks\n[4]: http://developer.android.com/reference/android/net/VpnService.html\n[5]: https://www.kernel.org/doc/Documentation/networking/tuntap.txt\n[6]: http://developer.android.com/reference/android/net/VpnService.html#protect(int)\n[7]: http://developer.android.com/sdk/index.html#Other\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetlantern%2Flantern-mobile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetlantern%2Flantern-mobile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetlantern%2Flantern-mobile/lists"}