Giter Site home page Giter Site logo

shadowsocks-android's Introduction

Shadowsocks for Android

CircleCI API Releases Language: Kotlin Codacy Badge License: GPL-3.0

for Android & Chrome OS (beta)
for Android TV (beta)

PREREQUISITES

  • JDK 11+
  • Android SDK
    • Android NDK
  • Rust with Android targets installed using rustup target add armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android

BUILD

You can check whether the latest commit builds under UNIX environment by checking Travis status.

  • Install prerequisites
  • Clone the repo using git clone --recurse-submodules <repo> or update submodules using git submodule update --init --recursive
  • Build it using Android Studio or gradle script

CONTRIBUTING

If you are interested in contributing or getting involved with this project, please read the CONTRIBUTING page for more information. The page can be found here.

OPEN SOURCE LICENSES

LICENSE

Copyright (C) 2017 by Max Lv <[email protected]>
Copyright (C) 2017 by Mygod Studio <[email protected]>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

shadowsocks-android's People

Contributors

aaronchen0 avatar anyofyou avatar ayanamist avatar clowwindy avatar czbix avatar dev4u avatar ewrfdv avatar fossabot avatar haobug avatar jllk avatar jlund avatar kaneawk avatar madeye avatar mygod avatar nmyggg avatar pexcn avatar prihlop avatar shadowsocksrb avatar squallatf avatar sunsysjp avatar v-e-o avatar vmlinz avatar wongsyrone avatar wyzdot avatar wyzegob avatar xmh19936688 avatar yyxida avatar zedifen avatar zhaofengli avatar zhongl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shadowsocks-android's Issues

shadowsocks should not open port 1080 publicly

Installed shadowsocks for android version 1.6.6 from google play, 172.233.233.2 is the IP address of my android phone, I do the scanning and curl fetching on my computer:

$ nmap -n 172.233.233.2 -p 1080

Starting Nmap 6.25 ( http://nmap.org ) at 2013-06-26 14:44 CST
Nmap scan report for 172.233.233.2
Host is up (0.16s latency).
PORT STATE SERVICE
1080/tcp open socks

Nmap done: 1 IP address (1 host up) scanned in 0.25 seconds

$ proxychains curl -I t.co
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains.so.4.2.0
[proxychains] DLL init
[proxychains] Dynamic chain ... 172.233.233.2:1080 ... t.co:80 ... OK
HTTP/1.1 200 OK
content-type: text/html; charset=utf-8
date: Wed, 26 Jun 2013 06:44:42 GMT
server: tfe
x-xss-protection: 1; mode=block
Content-Length: 0

使用更为准确的**IP

现在的**IP只管到/16,还是有很多国内流量会走翻墙路由,例如豆瓣电台……
刚翻了下,现在的gfw_list也有847条路由了,我写了个小程序,滤出所有非**IP,有4483条路由信息,改动了下代码,似乎在VPN模式下连接速度还是可以接受的。
附我的Python程序,需要先到http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest中把文件下载下来,然后导入到stdin中,输出到stdout里。
推荐用PyPy运行,需要IPy代码

#!/usr/bin/python
# -*- encoding: utf8 -*-

import itertools
import math
import sys

import IPy


def main():
    china_list_set = IPy.IPSet()
    for line in sys.stdin:
        line_params = line.split("|")
        if len(line_params) < 5 or line_params[2] != "ipv4" or line_params[1] != "CN":
            continue
        ip_addr = line_params[3]
        ip_length = float(line_params[4])
        ip_mask = 32 - int(math.ceil(math.log(ip_length, 2)))
        china_list_set.add(IPy.IP("%s/%d" % (ip_addr, ip_mask)))

    # 添加内网地址
    internal_list = IPy.IPSet(map(IPy.IP, [
        "0.0.0.0/8",
        "10.0.0.0/8",
        "100.64.0.0/10",
        "127.0.0.0/8",
        "169.254.0.0/16",
        "172.16.0.0/12",
        "192.0.0.0/29",
        "192.0.2.0/24",
        "192.88.99.0/24",
        "192.168.0.0/16",
        "198.18.0.0/15",
        "198.51.100.0/24",
        "203.0.113.0/24",
        "224.0.0.0/4",
        "240.0.0.0/4",
    ]))
    china_list_set += internal_list

    # 取反
    all = IPy.IPSet([IPy.IP("0.0.0.0/0")])
    # 剔除所有孤立的C段
    for ip in itertools.ifilter(lambda x: len(x) > 256, china_list_set):
        all.discard(ip)

    # 输出结果
    for ip in all:
        print ip


if __name__ == "__main__":
    main()

qsort is not equivalent to the original sorting algorithm

I find a bug when I try to port your code to iOS. qsort is not equivalent to the original code. It's not a stable sorting algorithm, so it will generate a different cipher with the one generated by Python or node.js server.

You can find the right implementation with bubble sort here:

https://github.com/clowwindy/shadowsocks-libev/blob/master/encrypt.c

If you want to speed up the calculation, use merge sort, which is a stable sorting algorithm with n*log(n) complexity.

请求增加这样一个功能. 感谢!

此乃Android 的shadowsocks翻墙神器.

请求增加, 保存服务器配置信息的功能.
这样就不用每次更换服务器时候再输入一次信息了.

万分感谢.

Root issue with SuperSU

When SuperSU with Re-authentication disabled, reinstall(uninstall+install) shadowsocks will cause root issue, looks like shadowsocks can't check root state.
Temporary solution is manually removing shadowsocks session in SuperSU and restarting shadowsocks.
Tested shadowsocks v2.0.5 on Android 4.1.2.

希望能增加自定义GFWLIST或者IP黑名单

我现在遇到这样的情况,210.59.246.0**网段,其中有个别IP是需要翻墙访问的,其他IP可以直连。
目前的相关的IP段信息都是编译进APK的,无法简单改。

顺便问一下,我修改了arrays.xml,在gfw_list中增加了210.59.246.241/24,自己编译安装后,用“国内路由”,这个IP依然无法访问,关掉“国内路由”就可以了。这是IP格式不对吗?

Some sites still skip the VPN connection even when the CHN Route checkbox is enabled

For example, traffic to the Tor status page that is located at torstatus.blutmagie.de (192.251.226.204) is not routed through Shadowsocks even when the CHN Route checkbox is enabled.

Unlike my other issue, this IP address doesn't appear to be part of the GFW or CHN checks. Perhaps an overzealous 192.* matcher is considering this local traffic and therefore causing it to skip Shadowsocks?

更新到 2.0.0 以后无法在 YouTube 里加载视频

2013-10-16

如上图,YouTube App 中所有元素都已经加载了,除了视频是连接不上服务器。

之前的用 1.8.x 没有这个问题,看 YouTube 一直很流畅。

Shadowsocks 服务器端是从 pip 安装的 1.3.3。测试过 Android 4.0 和 4.3 更新到 Shadowsocks 2.0.0 都有此问题。客户端测试环境都没有 Root。

1.3.3版本在android 4.2.2上DNS不正常

1.3.3版本安装自google play
服务器端试过go版0.9.6和python版0.9.4

首先,缺少了pdnsd.conf这个文件,看logcat的话似乎每次还是调用这个文件的,不知是故意这样的还是忘了?
第二,我从github上获取了pdns.conf,放到相应目录下,pdnsd仍然不能启动,未产生.pid文件,端口也未打开
然后,我发现不管是否打开DNS代理功能,都一定会产生一条iptables规则,将udp 53端口的所有请求都转发到8153,看了代码似乎是一个bug(不开启DNS代理时应该没有这条规则,否则完全无法发出DNS请求)。用iptables命令去掉这条规则后,访问普通网站正常(server端能看到日志),访问twitter等被墙网站会遇到明显的DNS污染
最后,我尝试以android-17为PLATFORM编译pdnsd,效果仍然一样(我自己搞不定从pdnsd官方源码移植)

简单来说,我认为有三个BUG:
1,缺失pdnsd.conf
2,android 4.2.2下pdnsd无法启动
3,iptables规则错误,应当在不开启DNS代理功能时不转发upd 53的请求

个人建议不要使用pdnsd这种移植的东西,不知能否原生实现简单的DNS forward,比如有一个app就叫DNS forward,通过它把DNS请求走tcp发到openDNS的5353已经足矣解决大多数的DNS污染效果

can't play youtube videos unless enable chn route

I am confused about this, why do I have to enable chn route to play youtube, It doesn't make sense. Either I enable system proxy or enable individual proxy, none of them works unless I enable chn route.

more specifically, I use youtube app, and I can see video lists, descriptions and comments, but I cant start playing. my phone is gn, official 4.3 with root.

网络连接断断续续

在所有的网络连接,会一直断断续续,虽然每次大约是断开5秒左右,但因为手机上的网络标志,会在蓝色和灰色来回转换,感觉还是很不好,如果用 VPN 就没有这种情况发生。

build failed

hi,
I followed the instructions step by step, but end up with the following build error:
make: *** No rule to make target jni/shadowsocks/src/local.c', needed byobj/local/armeabi/objs/shadowsocks/shadowsocks/src/local.o'. Stop.

I also noticed my jni/shadowsocks/ directory is empty. I am not very familiar with git, so please forgive me if I made some stupid mistakes.

any help will be appreciated.

CHN Route includes addresses that are not in China

I was getting confusing results from dnsleaktest.com (50.116.37.59) when the CHN Route checkbox was disabled, even though it is a US site hosted by Linode in their Atlanta, Georgia datacenter.

This site is not located in China, but the VPN was still bypassed.

A shortcut to start current profile will be very handful~

Shadowsocks can only be started by the main UI, it's not a problem in most cases.

Sometimes I am running a fat app (such as large game), when it needs to connect via shadowsocks. I have to switch to shadowsocks app. At that time, It is possible the game got terminated by Android OS due to not actively running, to release enough memory for Shadowsocks. When I switch back to the game, it is launched from the scratch.

If a shortcut is implemented, then app switch and its negative consequence could be avoided via utility app like "SwipePad".

可否提供开关切换DNS

现在好像使用的是8.8.8.8作为DNS服务器吧。但在不少运营商,标准53端口(无论是TCP还是UDP)都是被劫持的状态,即无论如何都是返回错误的结果。
可否提供个开关,切换使用208.67.222.222:5353这个OpenDNS的非标准端口。

english translation in set-indiviual-proxy-for-apps is wrong

It shows 'select app to use with shadowsocks' , but actually, it should be 'select app NOT to use shadwowsocks'. This confused me for a while, at one point I thought this function was not working at all but at the last I realized it is a translation mistake.

best practice for debugging a slow connection?

just wondering if there are any debug logs i may look into.

I have recently ran into issues that only appear when my phone is on 3G network.

My shadowsocks server is running fine and connection over WIFI works like a charm. But when I switch to 3G (on the same android phone), none of my twitter client were able to update timeline.

It could be due to slow network but I can't be sure, as weibo and other app works on this 3G network, only shadowsocks are failling.

BTW: I am using RC4 as encryption.

Please put the ShadowsocksService into separate process for smaller memory footprint.

Currently, ShadowsocksService shares the same process with the configuration UI. This leads to large amount of memory usage (15-20M), and is not optimal for long-running background service.

If separated into its own process (with "android:process" parameter in AndroidManifest.xml), the app process can be reclaimed soon after the configuration UI is closed, leaving ShadowsocksService only small amount of memory footprint (usually < 5M) for long-running.

Process separation does need more work on data passing-through, since no more shared memory space. I found the current implementation of ShadowsocksService was perfectly suitable for process separation, with all its configuration shared via SharedPreferences.

使用电信2/3G无法翻墙

如题。我在wifi下,shadownsocks运行得很好,但是如果使用移动数据,那么就没法正常工作。
网络是电信的cdma,手机是sony的m35c,原版系统,没有任何第三方应用管理工具。
请问可能的原因?
谢谢。

BackupAgent在多配置文件下无法正确备份所有配置

ShadowSocks使用了BackupAgent将配置备份到Google服务器上。
但添加了多配置文件支持后,只会备份当前配置,其余所有配置文件在重装后均消失,只剩下之前激活的那个配置文件。
能否备份所有配置文件?

app takes looong time to launch and connect and often stops responding

Hi Madeye,

I installed 1.5.1 on my new lenovo k900. It works but it takes long time to load. When I press the shadowsocks icon, the screen becomes white. I have wait patiently for the shadowsocks screen to appear. If I press the screen during loading, I will receive a "stops responding dialog". It also takes a long time for the phone to respond when I try to turn it on. "Stops responding dialog" appears frequently. I need to be super patient to make it work.

Yifan

Crash when failing to resolve the server domain

When I am connecting to a WIFI which has problems connecting 8.8.8.8, the shadowsocks will simply crash after clicking "connect". I've tried to reset, clean the data, reinstall and it's all the same. The ADB logcat shows the following:

D/Shadowsocks(17196): Connecting start
E/AndroidRuntime(17196):    at com.github.shadowsocks.ShadowsocksService.resolve(ShadowsocksService.scala:150)
E/AndroidRuntime(17196):    at com.github.shadowsocks.ShadowsocksService$$anon$5.run(ShadowsocksService.scala:208)
W/ActivityManager(  600):   Force finishing activity com.github.shadowsocks/.Shadowsocks
I/ActivityManager(  600): Process com.github.shadowsocks (pid 17196) has died.
W/ActivityManager(  600): Scheduling restart of crashed service com.github.shadowsocks/.ShadowsocksService in 5000ms

When I change the server domain to IP(or connect to another network that has access to 8.8.8.8), everything is OK again.

[feature-request] Multi-Server

可否考虑加入多服务端配置,进一步的,选择最快服务器连接之类的功能。个人想法。
多谢!

关于 password 输错显示连接成功 + 无错误提示

本想在 Twitter @反馈,还是这里说吧,免得 140 限制。

这是我今天发的一条囧推基本说明了问题:
『我犯了个很长时间的低级错误: Shadowsocks-Android 无法在我的 Nexus 7 下面使用的真正原因 = 我一直输错 Password :为何一直没发现低级错误 = Shadowsocks-Android 从来没提示(或者根本没这个功能)我输入的密码是错误』

我想同一个 ROM 有些人说不管是设置了开机就启动还是却换飞行模式都不能代理的原因应该有些是和这个有关:不小心输错密码,但显示连接成功,无错误提示。

所以我想能不能加个密码错误判断 + 错误提示?

default config

Installed on Play Store.
When configuring it, I found out that the config UI is prefilled with values.
Is this server provided for users who do not have their own ss-server,
or just for test in developing this android client (and forgot to empty the test config file when building apk)?

Some blocked sites cannot be opened

I use blocked site http://myip.net to test IP after connection, but this site still cannot be opened. Does ss-android uses a blacklist? How to add sites to this list if so?

Thank you very much for this great app!

华为 C8812E中崩溃

该程序在华为 C8812E中崩溃,系统版本为Android 4.0.4.

只要点击链接,就会显示“shadowsocks 已经停止”这种提示信息,完全无法正常使用。

已经刷机,依然不能解决问题

程序的版本为最新的1.3版本,原先1.2.0版本也是同样崩溃。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.