Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b4b4b213d | ||
|
|
0093e02849 | ||
|
|
4768bb1aff | ||
|
|
258191d02c | ||
|
|
bb7ad6df16 | ||
|
|
2f682ef3ec | ||
|
|
d3903cbc9d | ||
|
|
a6728e6025 | ||
|
|
be688205ce | ||
|
|
5c75148813 | ||
|
|
ae833210c6 | ||
|
|
722ca5b4f4 | ||
|
|
0171261465 | ||
|
|
273eca7bd1 | ||
|
|
4e5c67e814 | ||
|
|
8c33345a1f | ||
|
|
74917eac13 | ||
|
|
f2b2aba900 | ||
|
|
0ae15f61d9 | ||
|
|
e1d2511b0b | ||
|
|
a16aa35d3c | ||
|
|
5abb9061c4 | ||
|
|
398e0f4d01 | ||
|
|
d4c9e25d3a | ||
|
|
4168bd65d2 | ||
|
|
b0fb43c4db | ||
|
|
47c2c8ea9a | ||
|
|
d68ccedf32 | ||
|
|
2f9bfb9050 | ||
|
|
1f1a60c279 | ||
|
|
6d6ffba83b | ||
|
|
6bd2d077ac | ||
|
|
d4152856f4 | ||
|
|
197ef557a3 | ||
|
|
f5036bbde5 | ||
|
|
36edc2e728 | ||
|
|
f34770f3fb | ||
|
|
3cb6bb73b3 | ||
|
|
7b4cae2794 | ||
|
|
dc2a5ca19c | ||
|
|
ae171a7084 | ||
|
|
987b545cb2 | ||
|
|
5505c78fdc | ||
|
|
f59f7137f1 | ||
|
|
f4eeab0548 | ||
|
|
3f92857e52 | ||
|
|
7154f9fdba | ||
|
|
b510e0ab58 | ||
|
|
c5e9e6a81c | ||
|
|
5ad2e9a55d | ||
|
|
dea3aa1c19 | ||
|
|
2733d61003 | ||
|
|
42e930391f | ||
|
|
e0bf727bf4 | ||
|
|
b1c8d3c617 | ||
|
|
59a6eaac56 | ||
|
|
c6bb913ba2 | ||
|
|
265ecc0406 | ||
|
|
fb2fdd5dea | ||
|
|
99e5cb8579 | ||
|
|
e1a51b0d22 | ||
|
|
79f40b8812 | ||
|
|
13ef297a03 | ||
|
|
967f198131 | ||
|
|
b72fb267e3 | ||
|
|
86ebbd0db5 | ||
|
|
725fb04f3f | ||
|
|
6678fd9541 | ||
|
|
7fb19c40af | ||
|
|
6c49a1aa4e | ||
|
|
4292b177ad | ||
|
|
274505db00 | ||
|
|
6fa1c822ef | ||
|
|
e79a93545b | ||
|
|
9075d079d2 | ||
|
|
bc0b503098 | ||
|
|
81b7add2dd | ||
|
|
55ab8b4be7 | ||
|
|
c1cd7e2ca1 | ||
|
|
a2df7a7efa | ||
|
|
918eec4394 | ||
|
|
2b787d5072 | ||
|
|
2cae9384ee | ||
|
|
c007313268 | ||
|
|
9c1a640baf | ||
|
|
ae3bcd7405 | ||
|
|
2a3c9f91a3 | ||
|
|
bb25df8692 | ||
|
|
e8b5953701 | ||
|
|
b8d7ade44d | ||
|
|
d7183fe147 | ||
|
|
8b870877d5 | ||
|
|
024628483e | ||
|
|
73fe14d643 | ||
|
|
512cb06671 | ||
|
|
3d069b10ee | ||
|
|
4490d95c7f | ||
|
|
390cb522d5 | ||
|
|
b14fdcaed9 | ||
|
|
b6adeda924 | ||
|
|
253286c482 | ||
|
|
f25406b86c | ||
|
|
2c8718163a | ||
|
|
450bde5305 | ||
|
|
d51bf46413 | ||
|
|
a69183cc0f | ||
|
|
62a0bb59c7 | ||
|
|
4eb77c8854 | ||
|
|
839765b724 | ||
|
|
a3f57d2557 | ||
|
|
f5247d627d | ||
|
|
f19f8d8ffa | ||
|
|
adaca76b12 | ||
|
|
010fd6158f | ||
|
|
8b57b53788 | ||
|
|
1db2d81aca | ||
|
|
258cb0c9c9 | ||
|
|
af057d0740 | ||
|
|
52499f5c2d | ||
|
|
230a018326 | ||
|
|
f6f4f45f62 | ||
|
|
f950037003 | ||
|
|
d8179b5b17 | ||
|
|
d701fb4cee | ||
|
|
5549dfd20a | ||
|
|
6978b921bb | ||
|
|
ac28b83a0b | ||
|
|
422924f3f4 | ||
|
|
e1ee53567a | ||
|
|
9c36f84b40 | ||
|
|
143afb052d | ||
|
|
27fc27346c | ||
|
|
02c8be58e3 | ||
|
|
2e1564b7b9 | ||
|
|
250373b92a | ||
|
|
dc439b0802 | ||
|
|
26b6853061 | ||
|
|
a84070c2d3 | ||
|
|
49e30e7b09 | ||
|
|
398db4f407 | ||
|
|
8208ac1510 | ||
|
|
5542f463a6 | ||
|
|
1e750e45e9 | ||
|
|
574f80aefd | ||
|
|
424e1bd1bc | ||
|
|
bbf52c4f1d | ||
|
|
0acfaa12c0 | ||
|
|
1ec80175ea | ||
|
|
2b985686a4 | ||
|
|
095f4831db | ||
|
|
ba75b7af75 | ||
|
|
d5dc3a8379 | ||
|
|
89ddc2f7c9 | ||
|
|
f721b57e00 | ||
|
|
3a785ab75e | ||
|
|
b68689f731 | ||
|
|
cf2f17dfff | ||
|
|
a64eb8ac58 | ||
|
|
9ab9230960 | ||
|
|
8f6357d9cf | ||
|
|
73462b08af | ||
|
|
6d07c03bc7 | ||
|
|
953f59ea43 | ||
|
|
6df5179734 | ||
|
|
2f312486a1 | ||
|
|
88d5c01cb0 | ||
|
|
2b05da3aff | ||
|
|
c5a98a9b12 | ||
|
|
5633ae7b21 | ||
|
|
92af48f528 | ||
|
|
59f02cfa53 | ||
|
|
bd782dae98 | ||
|
|
ea738d17d7 | ||
|
|
915b1a74b1 | ||
|
|
9898ab88e0 | ||
|
|
c082a23c37 | ||
|
|
6636cf815d | ||
|
|
6df8f14fb2 | ||
|
|
6ca3e8abda | ||
|
|
0b88881fa4 | ||
|
|
85532a6b48 | ||
|
|
3a935b3274 | ||
|
|
ea848f3b71 | ||
|
|
93274ffb04 | ||
|
|
fcd6ed847a | ||
|
|
36c4d80ee4 | ||
|
|
e864873ee4 | ||
|
|
80411c61d6 | ||
|
|
adb7285d54 | ||
|
|
7356eded16 | ||
|
|
1268376b68 | ||
|
|
b71019149f | ||
|
|
451e9c1fd3 | ||
|
|
9d5c9456c9 | ||
|
|
4988faf574 | ||
|
|
189058b5c4 | ||
|
|
529ee3a929 | ||
|
|
53af99eb98 | ||
|
|
90cc3dbf2d | ||
|
|
6fe38f76be | ||
|
|
4df1d68501 | ||
|
|
9eceefcceb | ||
|
|
af6e58ec46 | ||
|
|
9617418e70 | ||
|
|
c09a96a203 | ||
|
|
1ad08c6dba | ||
|
|
64c8529705 | ||
|
|
b1670679d7 | ||
|
|
5ac1343b5d | ||
|
|
41f4f3a3bc | ||
|
|
c21bd74302 | ||
|
|
a8822330a3 | ||
|
|
1cf6e4802c | ||
|
|
f64014eb7b | ||
|
|
2f6f991e6e | ||
|
|
90e00a3857 | ||
|
|
712b764a9b | ||
|
|
019f9d30e8 | ||
|
|
9c97dc9bf6 | ||
|
|
7d2e0a515f | ||
|
|
26b68876f4 | ||
|
|
a494f56ce8 | ||
|
|
a433822d0a | ||
|
|
60d7d90565 | ||
|
|
d2ba9493c0 | ||
|
|
0eaece7af9 | ||
|
|
96320896aa | ||
|
|
54efe36ffc | ||
|
|
d5d6740a5a | ||
|
|
2e69eafdf8 | ||
|
|
86773085c3 | ||
|
|
b6667b9e0f | ||
|
|
0ee7e9d40e | ||
|
|
5f2ce1804f | ||
|
|
a5e316999a | ||
|
|
64a3d75ba2 | ||
|
|
9d09c9a097 | ||
|
|
b78f48504f | ||
|
|
a61b03c86c | ||
|
|
f43362fb18 | ||
|
|
4f0e527df7 | ||
|
|
a8878298cc | ||
|
|
c920c0daa4 | ||
|
|
8e3854b496 | ||
|
|
ad42167b2e | ||
|
|
3bf0963c5a | ||
|
|
c3315d35ed | ||
|
|
103dc10a0a | ||
|
|
36c94b8d83 | ||
|
|
890be54403 | ||
|
|
31984d1001 | ||
|
|
df72b29302 | ||
|
|
f30c31ae3e | ||
|
|
05963b6c82 | ||
|
|
98da4cd6e5 | ||
|
|
64da35c59b | ||
|
|
458a3473b1 | ||
|
|
66db347215 | ||
|
|
f9e32c995b | ||
|
|
0626ce8787 | ||
|
|
11d827c6ba | ||
|
|
dc46cd971a | ||
|
|
876e92f275 | ||
|
|
41747c976b | ||
|
|
8277b07d24 | ||
|
|
b982867130 | ||
|
|
491710679a | ||
|
|
24c6aca85c | ||
|
|
293e9b5dff | ||
|
|
3ac77e1f8d | ||
|
|
fd2c67d0b8 | ||
|
|
684698c8e4 | ||
|
|
6a02d4b985 | ||
|
|
7219ce429c | ||
|
|
9975b135d0 | ||
|
|
5d46ef45e3 | ||
|
|
018aa781d3 | ||
|
|
f7e2f8694d | ||
|
|
2d86122297 | ||
|
|
ad0578d073 | ||
|
|
b671bc2c50 | ||
|
|
be5036183d | ||
|
|
212c3f666b | ||
|
|
deba1028c0 | ||
|
|
5559295beb | ||
|
|
41eec3e351 | ||
|
|
56709385b1 | ||
|
|
dc13249a1e | ||
|
|
d579660682 | ||
|
|
1e96a13ab1 | ||
|
|
b71b27fbdf | ||
|
|
3fa8a0c90c | ||
|
|
f121ea2549 | ||
|
|
df1e40d60b | ||
|
|
ee08f02660 | ||
|
|
7af26d1a4b | ||
|
|
88319ecac7 | ||
|
|
b397ab2bbd | ||
|
|
33c087f13f | ||
|
|
4996d4fc52 | ||
|
|
14fd86c716 | ||
|
|
3b9a35d3e6 | ||
|
|
3b93302539 | ||
|
|
8de1dc1f7a | ||
|
|
55667c9e76 | ||
|
|
e81c4f257e | ||
|
|
61a926ff5e | ||
|
|
8d1f2da1f0 | ||
|
|
30c8c7e6eb | ||
|
|
dadeffa903 | ||
|
|
04e0cb02b5 | ||
|
|
1cec7299e8 | ||
|
|
e634083820 | ||
|
|
d8775d4420 | ||
|
|
41da705fc2 | ||
|
|
911eb3dab3 | ||
|
|
a31befef7f | ||
|
|
4d4d6ed1a0 | ||
|
|
a8222317d7 | ||
|
|
b3bab982a8 | ||
|
|
6fb7330e36 | ||
|
|
974c254460 | ||
|
|
c0aff7dda1 | ||
|
|
f6253d2eba | ||
|
|
cbb0345e5b | ||
|
|
128d47aba1 | ||
|
|
e3ad38318d | ||
|
|
77296cbd3e | ||
|
|
14745317d0 | ||
|
|
9e6948caf6 | ||
|
|
18302e1c40 | ||
|
|
340e9cfffa | ||
|
|
caf5731ff6 | ||
|
|
36faaad44d | ||
|
|
4c45c923be | ||
|
|
2181e664ef | ||
|
|
56e4f153ed | ||
|
|
2e3baa727d | ||
|
|
7491a667a5 | ||
|
|
1041dc370a | ||
|
|
d734e9fd4e | ||
|
|
0e85514c76 | ||
|
|
7e6cc4e846 | ||
|
|
4f3c7dd8fd | ||
|
|
923374a28b | ||
|
|
7d3f6096b7 | ||
|
|
c7c72c6543 | ||
|
|
b95bee968a | ||
|
|
99d97d1dbd | ||
|
|
b78c10e8cc | ||
|
|
91be4146f9 | ||
|
|
77a06cb519 | ||
|
|
6eb6c571ac | ||
|
|
01c5e8bb6f | ||
|
|
437d8c3026 | ||
|
|
70e0b3991d | ||
|
|
0ffae32a44 | ||
|
|
44b47e6cd3 | ||
|
|
c54745e241 | ||
|
|
e3cf54f703 | ||
|
|
d5be325ab5 | ||
|
|
a38c9920c3 | ||
|
|
1887c6ffb0 | ||
|
|
5ead55d67a | ||
|
|
a03ef5dfe9 | ||
|
|
f6bbaa7251 | ||
|
|
2798eddaa7 | ||
|
|
044f6f1fce | ||
|
|
0030c29b62 | ||
|
|
2c1c4b9b4f | ||
|
|
f2c260a438 | ||
|
|
d2d1796852 | ||
|
|
c7b242789d | ||
|
|
1c53181c9c | ||
|
|
bcbd860457 | ||
|
|
33d8139f57 | ||
|
|
5a8493e0b1 | ||
|
|
3c3e531718 | ||
|
|
1f6d6bbd14 | ||
|
|
c25433e2da | ||
|
|
0b68faf672 | ||
|
|
7978bcedbf | ||
|
|
eb3b01053e | ||
|
|
17bedaffcd | ||
|
|
49fbfcc2ac | ||
|
|
c2930bfe04 | ||
|
|
e7cc5ad0ba | ||
|
|
f81b16ead6 | ||
|
|
162fcb47bc | ||
|
|
67fab0392f | ||
|
|
bf89e202d1 | ||
|
|
050cc7a018 | ||
|
|
7e92e1ac0d | ||
|
|
1758f360c0 | ||
|
|
e32ac67794 | ||
|
|
5434193903 | ||
|
|
2efb6fb4c6 | ||
|
|
5d744066ac | ||
|
|
b897e4d044 | ||
|
|
5206b4c1f1 | ||
|
|
694be8abbe | ||
|
|
0a2d374de2 | ||
|
|
9dec28a022 | ||
|
|
5a6e45a2a7 | ||
|
|
6d536a901b | ||
|
|
57be4055d3 | ||
|
|
2d9102719e | ||
|
|
5e9f78d31a | ||
|
|
f4026e5a86 | ||
|
|
fb98b3e4a1 | ||
|
|
f629c432b0 | ||
|
|
4c15d27a99 | ||
|
|
341c85049b | ||
|
|
35d7611524 | ||
|
|
d10acf52ec | ||
|
|
0234acbf5f | ||
|
|
292c76b227 | ||
|
|
a67c29314e | ||
|
|
0fc9c6fb8a | ||
|
|
82a3e429d1 | ||
|
|
b4425e3b06 | ||
|
|
ac2b668a4b | ||
|
|
8374a8cdcc | ||
|
|
7feb049f4b | ||
|
|
5bc7c9f8cc | ||
|
|
115fbcb2fe | ||
|
|
69d2bc1ee5 | ||
|
|
af9e8c786d | ||
|
|
5ca3baac95 | ||
|
|
878c53ee30 | ||
|
|
eb7e608d0b | ||
|
|
ef6a9e7727 | ||
|
|
2edc14a695 | ||
|
|
bc94adef38 | ||
|
|
dd8031519c | ||
|
|
b0412b4f1f | ||
|
|
7e94e25d49 | ||
|
|
068906cd0f | ||
|
|
e24c2256af | ||
|
|
d78e823ce2 | ||
|
|
8e46be5900 | ||
|
|
2e73741825 | ||
|
|
022b6da9c9 | ||
|
|
622cef048c |
@@ -0,0 +1,99 @@
|
||||
### Troubleshooting
|
||||
|
||||
Cannot connect to server:
|
||||
|
||||
1. Stop battery saver if it's active;
|
||||
2. If an upgrade breaks anything, do a manual reset first by pressing Reset at the end of the list;
|
||||
3. Check your config;
|
||||
4. Wipe app data.
|
||||
|
||||
Crash: [Submit an issue](https://github.com/shadowsocks/shadowsocks-android/issues/new) with logcat attached, or submit a crash report to Google Play. Then, try wiping app data.
|
||||
|
||||
### How to create a widget and/or switch profile based on network connectivity?
|
||||
|
||||
Use [Tasker](http://tasker.dinglisch.net/) integration.
|
||||
|
||||
### How to add QR code from local gallery?
|
||||
|
||||
Scan it with a third-party scanner like [QuickMark Barcode Scanner](https://play.google.com/store/apps/details?id=tw.com.quickmark) and click the `ss` url.
|
||||
|
||||
|
||||
### Why is NAT mode deprecated?
|
||||
|
||||
1. Requiring ROOT permission;
|
||||
2. No IPv6 support;
|
||||
3. No UDP relay support.
|
||||
|
||||
### How to remove the exclamation mark when using VPN mode?
|
||||
|
||||
The exclamation mark in the Wi-Fi/cellular icon appears because the system fails to connect to portal server (defaults to `clients3.google.com`) without VPN connection. To remove it, follow the instructions in [this article](https://www.noisyfox.cn/45.html). (in Simplified Chinese)
|
||||
|
||||
### Why is my ROM not supported?
|
||||
|
||||
1. Some ROM has broken VPNService implementation, especially for IPv6;
|
||||
2. Some ROM has aggressive (or called broken) background service killing policy;
|
||||
3. If you have Xposed framework and/or battery saver apps, it's likely that this app wouldn't work well with these either.
|
||||
|
||||
* Fixes for MIUI: [#772](https://github.com/shadowsocks/shadowsocks-android/issues/772)
|
||||
* Fixes for Huawei: [#1091 (comment)](https://github.com/shadowsocks/shadowsocks-android/issues/1091#issuecomment-276949836)
|
||||
* Related to Xposed: [#1414](https://github.com/shadowsocks/shadowsocks-android/issues/1414)
|
||||
* Samsung and/or Brevent: [#1410](https://github.com/shadowsocks/shadowsocks-android/issues/1410)
|
||||
* Don't install this app on SD card because of permission issues: [#1124 (comment)](https://github.com/shadowsocks/shadowsocks-android/issues/1124#issuecomment-307556453)
|
||||
|
||||
### How to pause Shadowsocks service?
|
||||
|
||||
* For Android 7.0+: Use quick switch tile in Quick Settings;
|
||||
* Use Tasker integration;
|
||||
* Add a profile with per-app proxy enabled for Shadowsocks only, bypass mode off.
|
||||
|
||||
### Why does Shadowsocks consume so much battery on Android 5.0+?
|
||||
|
||||
As Shadowsocks takes over the whole device network, any battery used by network activities from other apps are also counted as those from Shadowsocks. So, the battery usage of Shadowsocks equals to the sum of all the network activities of your device. Shadowsocks itself is a totally I/O bound application on modern Android devices, which is expected not to consume any notable battery.
|
||||
|
||||
So if you notice a significant increase in battery usage after you use Shadowsocks, it's most likely caused by other apps. For example, Google Play services can consume more battery after being able to connecting to Google, etc.
|
||||
|
||||
More details: https://kb.adguard.com/en/android/solving-problems/battery
|
||||
|
||||
### It works fine under Wi-Fi but can't connect through cellular data?
|
||||
|
||||
Allow this app to consume background data in app settings.
|
||||
|
||||
### Why Camera permission is required on devices below Android 6.0?
|
||||
|
||||
To scan the QR code through the integrated QR scanner.
|
||||
|
||||
By the way, upgrade your Android system already.
|
||||
|
||||
### How to use Transproxy mode?
|
||||
|
||||
1. Install [AFWall+](https://github.com/ukanth/afwall);
|
||||
2. Set custom script:
|
||||
```sh
|
||||
IP6TABLES=/system/bin/ip6tables
|
||||
IPTABLES=/system/bin/iptables
|
||||
ULIMIT=/system/bin/ulimit
|
||||
SHADOWSOCKS_UID=`dumpsys package com.github.shadowsocks | grep userId | cut -d= -f2 - | cut -d' ' -f1 -`
|
||||
PORT_DNS=5450
|
||||
PORT_TRANSPROXY=8200
|
||||
$ULIMIT -n 4096
|
||||
$IP6TABLES -F
|
||||
$IP6TABLES -A INPUT -j DROP
|
||||
$IP6TABLES -A OUTPUT -j DROP
|
||||
$IPTABLES -t nat -F OUTPUT
|
||||
$IPTABLES -t nat -A OUTPUT -o lo -j RETURN
|
||||
$IPTABLES -t nat -A OUTPUT -d 127.0.0.1 -j RETURN
|
||||
$IPTABLES -t nat -A OUTPUT -m owner --uid-owner $SHADOWSOCKS_UID -j RETURN
|
||||
$IPTABLES -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination 127.0.0.1:$PORT_DNS
|
||||
$IPTABLES -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 127.0.0.1:$PORT_DNS
|
||||
$IPTABLES -t nat -A OUTPUT -p tcp -j DNAT --to-destination 127.0.0.1:$PORT_TRANSPROXY
|
||||
$IPTABLES -t nat -A OUTPUT -p udp -j DNAT --to-destination 127.0.0.1:$PORT_TRANSPROXY
|
||||
```
|
||||
3. Set custom shutdown script:
|
||||
```sh
|
||||
IP6TABLES=/system/bin/ip6tables
|
||||
IPTABLES=/system/bin/iptables
|
||||
$IPTABLES -t nat -F OUTPUT
|
||||
$IP6TABLES -F
|
||||
```
|
||||
4. Make sure to allow traffic for Shadowsocks;
|
||||
5. Start Shadowsocks transproxy service and enable firewall.
|
||||
@@ -1,4 +1,4 @@
|
||||
Please read FAQ in wiki then answer these questions before submitting your issue. Thanks!
|
||||
Please read FAQ then answer these questions before submitting your issue. Thanks!
|
||||
|
||||
### Environment
|
||||
|
||||
@@ -15,9 +15,7 @@ _Put an `x` inside the [ ] that applies._
|
||||
* [ ] IPv6 server address
|
||||
* [ ] Client IPv4 availability
|
||||
* [ ] Client IPv6 availability
|
||||
* Local port: 1080
|
||||
* Encrypt method:
|
||||
* [ ] One-time authentication
|
||||
* Route
|
||||
* [ ] All
|
||||
* [ ] Bypass LAN
|
||||
@@ -25,14 +23,16 @@ _Put an `x` inside the [ ] that applies._
|
||||
* [ ] Bypass LAN & China
|
||||
* [ ] GFW List
|
||||
* [ ] China List
|
||||
* [ ] Custom rules
|
||||
* [ ] IPv6 route
|
||||
* [ ] Per-App Proxy
|
||||
* [ ] Apps VPN mode
|
||||
* [ ] Bypass mode
|
||||
* [ ] UDP Forwarding
|
||||
* KCP Parameters: (leave blank if not enabled)
|
||||
* Remote DNS: 8.8.8.8
|
||||
* [ ] DNS Forwarding
|
||||
* Plugin configuration (if applicable):
|
||||
* [ ] Auto Connect
|
||||
* [ ] TCP Fast Open
|
||||
* [ ] NAT mode
|
||||
* If you're not using VPN mode, please supply more details here:
|
||||
|
||||
### What did you do?
|
||||
|
||||
|
||||
@@ -1,33 +1,25 @@
|
||||
classes
|
||||
bin
|
||||
gen
|
||||
target
|
||||
local.properties
|
||||
.classpath
|
||||
.project
|
||||
.settings
|
||||
tests/bin
|
||||
tests/gen
|
||||
tests/local.properties
|
||||
NUL
|
||||
gen_*
|
||||
*.class
|
||||
*.o
|
||||
local.sbt
|
||||
.deps
|
||||
/proguard-sbt.txt
|
||||
|
||||
#Intellij IDEA
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
out/
|
||||
.d
|
||||
gen/
|
||||
|
||||
#NDK
|
||||
src/main/obj
|
||||
src/main/libs
|
||||
src/main/assets/armeabi-v7a/*
|
||||
src/main/assets/x86/*
|
||||
jni/Application.mk
|
||||
mobile/src/main/libs
|
||||
mobile/src/main/obj
|
||||
mobile/src/main/jni/overture
|
||||
|
||||
mobile/src/overture/.deps
|
||||
mobile/src/overture/bin
|
||||
mobile/src/overture/pkg
|
||||
|
||||
mobile/src/overture/src/github.com/Sirupsen
|
||||
mobile/src/overture/src/github.com/mattn
|
||||
mobile/src/overture/src/github.com/miekg
|
||||
mobile/src/overture/src/github.com/shawn1m
|
||||
mobile/src/overture/src/github.com/tools
|
||||
mobile/src/overture/src/golang.org
|
||||
mobile/src/overture/src/gopkg.in
|
||||
|
||||
@@ -1,35 +1,38 @@
|
||||
[submodule "src/main/jni/shadowsocks-libev"]
|
||||
path = src/main/jni/shadowsocks-libev
|
||||
[submodule "mobile/src/main/jni/shadowsocks-libev"]
|
||||
path = mobile/src/main/jni/shadowsocks-libev
|
||||
url = https://github.com/shadowsocks/shadowsocks-libev
|
||||
[submodule "src/main/jni/badvpn"]
|
||||
path = src/main/jni/badvpn
|
||||
[submodule "mobile/src/main/jni/badvpn"]
|
||||
path = mobile/src/main/jni/badvpn
|
||||
url = https://github.com/shadowsocks/badvpn.git
|
||||
branch = shadowsocks-android
|
||||
[submodule "src/main/jni/libancillary"]
|
||||
path = src/main/jni/libancillary
|
||||
[submodule "mobile/src/main/jni/libancillary"]
|
||||
path = mobile/src/main/jni/libancillary
|
||||
url = https://github.com/shadowsocks/libancillary.git
|
||||
branch = shadowsocks-android
|
||||
[submodule "src/main/jni/libevent"]
|
||||
path = src/main/jni/libevent
|
||||
[submodule "mobile/src/main/jni/libevent"]
|
||||
path = mobile/src/main/jni/libevent
|
||||
url = https://github.com/shadowsocks/libevent.git
|
||||
branch = shadowsocks-android
|
||||
[submodule "src/main/jni/redsocks"]
|
||||
path = src/main/jni/redsocks
|
||||
[submodule "mobile/src/main/jni/redsocks"]
|
||||
path = mobile/src/main/jni/redsocks
|
||||
url = https://github.com/shadowsocks/redsocks.git
|
||||
branch = shadowsocks-android
|
||||
[submodule "src/main/jni/pdnsd"]
|
||||
path = src/main/jni/pdnsd
|
||||
url = https://github.com/shadowsocks/pdnsd.git
|
||||
branch = shadowsocks-android
|
||||
[submodule "kcptun/kcptun"]
|
||||
path = kcptun/kcptun
|
||||
url = https://github.com/shadowsocks/kcptun
|
||||
[submodule "kcptun/go"]
|
||||
path = kcptun/go
|
||||
url = https://github.com/shadowsocks/go
|
||||
[submodule "src/main/jni/mbedtls"]
|
||||
path = src/main/jni/mbedtls
|
||||
[submodule "mobile/src/main/jni/mbedtls"]
|
||||
path = mobile/src/main/jni/mbedtls
|
||||
url = https://github.com/ARMmbed/mbedtls
|
||||
[submodule "src/main/jni/pcre"]
|
||||
path = src/main/jni/pcre
|
||||
[submodule "mobile/src/main/jni/pcre"]
|
||||
path = mobile/src/main/jni/pcre
|
||||
url = https://android.googlesource.com/platform/external/pcre
|
||||
[submodule "mobile/src/main/jni/libsodium"]
|
||||
path = mobile/src/main/jni/libsodium
|
||||
url = https://github.com/jedisct1/libsodium.git
|
||||
branch = stable
|
||||
[submodule "mobile/src/main/jni/libev"]
|
||||
path = mobile/src/main/jni/libev
|
||||
url = https://github.com/shadowsocks/libev.git
|
||||
[submodule "mobile/src/overture/go"]
|
||||
path = mobile/src/overture/go
|
||||
url = https://github.com/shadowsocks/go.git
|
||||
[submodule "mobile/src/overture/src/github.com/shadowsocks/overture"]
|
||||
path = mobile/src/overture/src/github.com/shadowsocks/overture
|
||||
url = https://github.com/shadowsocks/overture.git
|
||||
|
||||
@@ -5,7 +5,7 @@ jdk:
|
||||
|
||||
env:
|
||||
global:
|
||||
- NDK_VERSION=r12b
|
||||
- NDK_VERSION=r16
|
||||
- NDK_CCACHE=ccache
|
||||
- GOROOT_BOOTSTRAP=$GOROOT
|
||||
- ANDROID_NDK_HOME=$HOME/.android/android-ndk-${NDK_VERSION}
|
||||
@@ -13,7 +13,7 @@ env:
|
||||
- PATH=${ANDROID_NDK_HOME}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${PATH}
|
||||
|
||||
scala:
|
||||
- 2.11.8
|
||||
- 2.11.11
|
||||
|
||||
before_cache:
|
||||
- find $HOME/.sbt -name "*.lock" | xargs rm
|
||||
@@ -27,7 +27,7 @@ cache:
|
||||
android:
|
||||
components:
|
||||
- tools
|
||||
- build-tools-25.0.2
|
||||
- build-tools-27.0.0
|
||||
- extra-android-m2repository
|
||||
- extra-google-m2repository
|
||||
|
||||
@@ -50,4 +50,4 @@ install:
|
||||
fi
|
||||
|
||||
script:
|
||||
- $SBTPATH/sbt native-build android:package-debug
|
||||
- $SBTPATH/sbt go-build android:package
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
Copyright (C) 2016 by Max Lv <max.c.lv@gmail.com>
|
||||
Copyright (C) 2016 by Mygod Studio <contact-shadowsocks-android@mygod.be>
|
||||
Copyright (C) 2017 by Max Lv <max.c.lv@gmail.com>
|
||||
Copyright (C) 2017 by Mygod Studio <contact-shadowsocks-android@mygod.be>
|
||||
|
||||
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
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
## Shadowsocks for Android
|
||||
|
||||
A [shadowsocks](http://shadowsocks.org) client for Android, written in Scala.
|
||||
[](https://travis-ci.org/shadowsocks/shadowsocks-android)
|
||||
[](https://github.com/shadowsocks/shadowsocks-android/releases)
|
||||
|
||||
A [shadowsocks](http://shadowsocks.org) client for Android, written in Scala.
|
||||
<a href="https://play.google.com/store/apps/details?id=com.github.shadowsocks"><img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png" height="48"></a>
|
||||
|
||||
### CI STATUS
|
||||
|
||||
[](https://travis-ci.org/shadowsocks/shadowsocks-android)
|
||||
|
||||
### PREREQUISITES
|
||||
|
||||
@@ -14,41 +13,54 @@ A [shadowsocks](http://shadowsocks.org) client for Android, written in Scala.
|
||||
* SBT 0.13.0+
|
||||
* Go 1.4+
|
||||
* Android SDK
|
||||
- Build Tools 25+
|
||||
- Build Tools 26+
|
||||
- Android Support Repository and Google Repository (see `build.sbt` for version)
|
||||
* Android NDK r12b+
|
||||
- Android NDK r16+
|
||||
|
||||
### BUILD
|
||||
|
||||
* Set environment variable `ANDROID_HOME` to `/path/to/android-sdk`
|
||||
* Set environment variable `ANDROID_NDK_HOME` to `/path/to/android-ndk`
|
||||
* (optional) Set environment variable `ANDROID_NDK_HOME` to `/path/to/android-ndk` (default: `$ANDROID_HOME/ndk-bundle`)
|
||||
* Set environment variable `GOROOT_BOOTSTRAP` to `/path/to/go`
|
||||
* Create your key following the instructions at https://developer.android.com/studio/publish/app-signing.html
|
||||
* Create `local.properties` from `local.properties.example` with your own key information
|
||||
* Create `mobile/local.properties` from `mobile/local.properties.example` with your own key information
|
||||
* Invoke the building like this
|
||||
|
||||
```bash
|
||||
git submodule update --init
|
||||
git submodule update --init --recursive
|
||||
|
||||
# Build the App
|
||||
sbt native-build clean android:package-release
|
||||
sbt clean go-build android:package-release
|
||||
```
|
||||
|
||||
### TRANSLATE
|
||||
|
||||
Translators can go to [POEditor](https://poeditor.com/join/project/u5VHO9vhSf) to help translate shadowsocks-android. Guidelines:
|
||||
|
||||
* It's okay to leave some strings untranslated if you think it should use the same string as English (US).
|
||||
* `faq_url` should not be changed. If you'd like to translate FAQ, submit a pull request with the translated [`faq.md`](https://github.com/shadowsocks/shadowsocks-android/blob/master/.github/faq.md) (it should be named properly, e.g. `.github/faq.zh-CN.md`). Administrators will take care of the rest.
|
||||
* Do not add/edit/remove comments.
|
||||
|
||||
## OPEN SOURCE LICENSES
|
||||
|
||||
* shadowsocks-libev: [GPLv3](https://github.com/shadowsocks/shadowsocks-libev/blob/master/LICENSE)
|
||||
* tun2socks: [BSD](https://github.com/shadowsocks/badvpn/blob/shadowsocks-android/COPYING)
|
||||
* redsocks: [APL 2.0](https://github.com/shadowsocks/redsocks/blob/master/README)
|
||||
* OpenSSL: [OpenSSL](https://github.com/shadowsocks/openssl-android/blob/master/NOTICE)
|
||||
* pdnsd: [GPLv3](https://github.com/shadowsocks/shadowsocks-android/blob/master/src/main/jni/pdnsd/COPYING)
|
||||
* libev: [GPLv2](https://github.com/shadowsocks/shadowsocks-android/blob/master/src/main/jni/libev/LICENSE)
|
||||
* libevent: [BSD](https://github.com/shadowsocks/libevent/blob/master/LICENSE)
|
||||
* kcptun: [MIT](https://github.com/xtaci/kcptun)
|
||||
<ul>
|
||||
<li>redsocks: <a href="https://github.com/shadowsocks/redsocks/blob/shadowsocks-android/README">APL 2.0</a></li>
|
||||
<li>mbed TLS: <a href="https://github.com/ARMmbed/mbedtls/blob/development/LICENSE">APL 2.0</a></li>
|
||||
<li>libevent: <a href="https://github.com/shadowsocks/libevent/blob/master/LICENSE">BSD</a></li>
|
||||
<li>tun2socks: <a href="https://github.com/shadowsocks/badvpn/blob/shadowsocks-android/COPYING">BSD</a></li>
|
||||
<li>pcre: <a href="https://android.googlesource.com/platform/external/pcre/+/master/dist2/LICENCE">BSD</a></li>
|
||||
<li>libancillary: <a href="https://github.com/shadowsocks/libancillary/blob/shadowsocks-android/COPYING">BSD</a></li>
|
||||
<li>shadowsocks-libev: <a href="https://github.com/shadowsocks/shadowsocks-libev/blob/master/LICENSE">GPLv3</a></li>
|
||||
<li>overture: <a href="https://github.com/shawn1m/overture/blob/master/LICENSE">MIT</a></li>
|
||||
<li>libev: <a href="https://github.com/shadowsocks/libev/blob/master/LICENSE">GPLv2</a></li>
|
||||
<li>libsodium: <a href="https://github.com/jedisct1/libsodium/blob/master/LICENSE">ISC</a></li>
|
||||
<li>libudns: <a href="https://github.com/shadowsocks/libudns/blob/master/COPYING.LGPL">LGPL</a></li>
|
||||
</ul>
|
||||
|
||||
### LICENSE
|
||||
|
||||
Copyright (C) 2016 by Max Lv <<max.c.lv@gmail.com>>
|
||||
Copyright (C) 2016 by Mygod Studio <<contact-shadowsocks-android@mygod.be>>
|
||||
Copyright (C) 2017 by Max Lv <<max.c.lv@gmail.com>>
|
||||
Copyright (C) 2017 by Mygod Studio <<contact-shadowsocks-android@mygod.be>>
|
||||
|
||||
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
|
||||
|
||||
@@ -1,65 +1,56 @@
|
||||
scalaVersion := "2.11.8"
|
||||
dexMaxHeap := "4g"
|
||||
lazy val commonSettings = Seq(
|
||||
scalaVersion := "2.11.12",
|
||||
dexMaxHeap := "4g",
|
||||
|
||||
enablePlugins(AndroidApp)
|
||||
android.useSupportVectors
|
||||
organization := "com.github.shadowsocks",
|
||||
|
||||
name := "shadowsocks"
|
||||
version := "3.4.0"
|
||||
versionCode := Some(172)
|
||||
platformTarget := "android-27",
|
||||
|
||||
platformTarget := "android-25"
|
||||
compileOrder := CompileOrder.JavaThenScala,
|
||||
javacOptions ++= "-source" :: "1.7" :: "-target" :: "1.7" :: Nil,
|
||||
scalacOptions ++= "-target:jvm-1.7" :: "-Xexperimental" :: Nil,
|
||||
ndkArgs := "-j" :: java.lang.Runtime.getRuntime.availableProcessors.toString :: Nil,
|
||||
ndkAbiFilter := Seq("armeabi-v7a", "arm64-v8a", "x86"),
|
||||
|
||||
compileOrder := CompileOrder.JavaThenScala
|
||||
javacOptions ++= "-source" :: "1.7" :: "-target" :: "1.7" :: Nil
|
||||
scalacOptions ++= "-target:jvm-1.7" :: "-Xexperimental" :: Nil
|
||||
ndkJavah := Seq()
|
||||
ndkBuild := Seq()
|
||||
proguardVersion := "5.3.3",
|
||||
proguardCache := Seq(),
|
||||
|
||||
proguardVersion := "5.3.2"
|
||||
proguardCache := Seq()
|
||||
proguardOptions ++=
|
||||
"-keep class com.github.shadowsocks.System { *; }" ::
|
||||
"-dontwarn com.google.android.gms.internal.**" ::
|
||||
"-dontwarn com.j256.ormlite.**" ::
|
||||
"-dontwarn okio.**" ::
|
||||
"-dontwarn org.xbill.**" ::
|
||||
Nil
|
||||
shrinkResources := true,
|
||||
typedResources := false,
|
||||
|
||||
shrinkResources := true
|
||||
typedResources := false
|
||||
resConfigs := Seq("ja", "ru", "zh-rCN", "zh-rTW")
|
||||
resConfigs := Seq("fa", "ja", "ko", "ru", "zh-rCN", "zh-rTW"),
|
||||
|
||||
resolvers += Resolver.jcenterRepo
|
||||
libraryDependencies ++=
|
||||
"com.android.support" % "cardview-v7" % "25.1.0" ::
|
||||
"com.android.support" % "design" % "25.1.0" ::
|
||||
"com.android.support" % "gridlayout-v7" % "25.1.0" ::
|
||||
"com.android.support" % "preference-v14" % "25.1.0" ::
|
||||
"com.evernote" % "android-job" % "1.1.3" ::
|
||||
"com.github.jorgecastilloprz" % "fabprogresscircle" % "1.01" ::
|
||||
"com.google.android.gms" % "play-services-ads" % "10.0.1" ::
|
||||
"com.google.android.gms" % "play-services-analytics" % "10.0.1" ::
|
||||
"com.google.android.gms" % "play-services-gcm" % "10.0.1" ::
|
||||
"com.j256.ormlite" % "ormlite-android" % "5.0" ::
|
||||
"com.mikepenz" % "crossfader" % "1.5.0" ::
|
||||
"com.mikepenz" % "fastadapter" % "2.1.5" ::
|
||||
"com.mikepenz" % "iconics-core" % "2.8.2" ::
|
||||
"com.mikepenz" % "materialdrawer" % "5.8.1" ::
|
||||
"com.mikepenz" % "materialize" % "1.0.0" ::
|
||||
"com.squareup.okhttp3" % "okhttp" % "3.5.0" ::
|
||||
"com.twofortyfouram" % "android-plugin-api-for-locale" % "1.0.2" ::
|
||||
"dnsjava" % "dnsjava" % "2.1.7" ::
|
||||
"eu.chainfire" % "libsuperuser" % "1.0.0.201608240809" ::
|
||||
"com.google.zxing" % "android-integration" % "3.2.1" ::
|
||||
"net.glxn.qrgen" % "android" % "2.0" ::
|
||||
Nil
|
||||
resolvers += Resolver.jcenterRepo,
|
||||
resolvers += Resolver.bintrayRepo("gericop", "maven"),
|
||||
resolvers += "google" at "https://maven.google.com"
|
||||
)
|
||||
|
||||
lazy val nativeBuild = TaskKey[Unit]("native-build", "Build native executables")
|
||||
nativeBuild := {
|
||||
val logger = streams.value.log
|
||||
Process("./build.sh") ! logger match {
|
||||
case 0 => // Success!
|
||||
case n => sys.error(s"Native build script exit code: $n")
|
||||
}
|
||||
}
|
||||
val supportLibsVersion = "27.0.2"
|
||||
val takisoftFixVersion = "27.0.2.0"
|
||||
lazy val root = Project(id = "shadowsocks-android", base = file("."))
|
||||
.settings(commonSettings)
|
||||
.aggregate(plugin, mobile)
|
||||
|
||||
install in Android := (install in (mobile, Android)).value
|
||||
run in Android := (run in (mobile, Android)).evaluated
|
||||
|
||||
lazy val plugin = project
|
||||
.settings(commonSettings)
|
||||
.settings(
|
||||
libraryDependencies ++=
|
||||
"com.android.support" % "preference-v14" % supportLibsVersion ::
|
||||
"com.takisoft.fix" % "preference-v7" % takisoftFixVersion ::
|
||||
"com.takisoft.fix" % "preference-v7-simplemenu" % takisoftFixVersion ::
|
||||
Nil
|
||||
)
|
||||
|
||||
lazy val mobile = project
|
||||
.settings(commonSettings)
|
||||
.settings(
|
||||
libraryDependencies ++=
|
||||
"com.android.support" % "customtabs" % supportLibsVersion ::
|
||||
"com.android.support" % "design" % supportLibsVersion ::
|
||||
"com.android.support" % "gridlayout-v7" % supportLibsVersion ::
|
||||
Nil
|
||||
)
|
||||
.dependsOn(plugin)
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function try () {
|
||||
"$@" || exit -1
|
||||
}
|
||||
|
||||
# Build native binaries
|
||||
pushd src/main
|
||||
try $ANDROID_NDK_HOME/ndk-build -j8
|
||||
|
||||
rm -rf assets/armeabi-v7a
|
||||
rm -rf assets/x86
|
||||
mkdir -p assets/armeabi-v7a
|
||||
mkdir -p assets/x86
|
||||
|
||||
#copy executables
|
||||
for app in pdnsd redsocks ss-local ss-tunnel tun2socks
|
||||
do
|
||||
echo $app
|
||||
try mv libs/armeabi-v7a/$app assets/armeabi-v7a/
|
||||
try mv libs/x86/$app assets/x86/
|
||||
done
|
||||
popd
|
||||
|
||||
# Build kcptun
|
||||
pushd kcptun
|
||||
try ./make.bash
|
||||
popd
|
||||
@@ -1,69 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function try () {
|
||||
"$@" || exit -1
|
||||
}
|
||||
|
||||
[ -z "$ANDROID_NDK_HOME" ] && ANDROID_NDK_HOME=~/android-ndk-r12b
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
DEPS=$DIR/.deps
|
||||
ANDROID_ARM_TOOLCHAIN=$DEPS/android-toolchain-16-arm
|
||||
ANDROID_X86_TOOLCHAIN=$DEPS/android-toolchain-16-x86
|
||||
|
||||
ANDROID_ARM_CC=$ANDROID_ARM_TOOLCHAIN/bin/arm-linux-androideabi-gcc
|
||||
ANDROID_ARM_STRIP=$ANDROID_ARM_TOOLCHAIN/bin/arm-linux-androideabi-strip
|
||||
|
||||
ANDROID_X86_CC=$ANDROID_X86_TOOLCHAIN/bin/i686-linux-android-gcc
|
||||
ANDROID_X86_STRIP=$ANDROID_X86_TOOLCHAIN/bin/i686-linux-android-strip
|
||||
|
||||
|
||||
if [ ! -d "$DEPS" ]; then
|
||||
mkdir -p $DEPS
|
||||
fi
|
||||
|
||||
if [ ! -d "$ANDROID_ARM_TOOLCHAIN" ]; then
|
||||
echo "Make standalone toolchain for ARM arch"
|
||||
$ANDROID_NDK_HOME/build/tools/make_standalone_toolchain.py --arch arm \
|
||||
--api 16 --install-dir $ANDROID_ARM_TOOLCHAIN
|
||||
fi
|
||||
|
||||
if [ ! -d "$ANDROID_X86_TOOLCHAIN" ]; then
|
||||
echo "Make standalone toolchain for X86 arch"
|
||||
$ANDROID_NDK_HOME/build/tools/make_standalone_toolchain.py --arch x86 \
|
||||
--api 16 --install-dir $ANDROID_X86_TOOLCHAIN
|
||||
fi
|
||||
|
||||
if [ ! -d "$DIR/go/bin" ]; then
|
||||
echo "Build the custom go"
|
||||
|
||||
pushd $DIR/go/src
|
||||
try ./make.bash
|
||||
popd
|
||||
fi
|
||||
|
||||
export GOROOT=$DIR/go
|
||||
export GOPATH=$DEPS/gopath
|
||||
export GOBIN=$GOPATH/bin
|
||||
mkdir -p $GOBIN
|
||||
export PATH=$GOROOT/bin:$PATH
|
||||
|
||||
pushd kcptun/client
|
||||
|
||||
echo "Get dependences for kcptun"
|
||||
go get -u github.com/xtaci/kcp-go
|
||||
go get -u github.com/xtaci/smux
|
||||
go get
|
||||
|
||||
echo "Cross compile kcptun for arm"
|
||||
try env CGO_ENABLED=1 CC=$ANDROID_ARM_CC GOOS=android GOARCH=arm GOARM=7 go build -ldflags="-s -w"
|
||||
try $ANDROID_ARM_STRIP client
|
||||
try mv client $DIR/../src/main/assets/armeabi-v7a/kcptun
|
||||
|
||||
echo "Cross compile kcptun for x86"
|
||||
try env CGO_ENABLED=1 CC=$ANDROID_X86_CC GOOS=android GOARCH=386 go build -ldflags="-s -w"
|
||||
try $ANDROID_X86_STRIP client
|
||||
try mv client $DIR/../src/main/assets/x86/kcptun
|
||||
popd
|
||||
|
||||
echo "Successfully build kcptun"
|
||||
@@ -0,0 +1,71 @@
|
||||
enablePlugins(AndroidApp)
|
||||
enablePlugins(AndroidGms)
|
||||
|
||||
android.useSupportVectors
|
||||
|
||||
name := "shadowsocks"
|
||||
version := "4.3.2"
|
||||
versionCode := Some(198)
|
||||
|
||||
proguardOptions ++=
|
||||
"-dontwarn com.google.android.gms.internal.**" ::
|
||||
"-dontwarn com.j256.ormlite.**" ::
|
||||
"-dontwarn okhttp3.**" ::
|
||||
"-dontwarn okio.**" ::
|
||||
"-dontwarn org.xbill.**" ::
|
||||
"-keep class com.github.shadowsocks.JniHelper { *; }" ::
|
||||
"-dontwarn com.evernote.android.job.gcm.**" ::
|
||||
"-dontwarn com.evernote.android.job.util.GcmAvailableHelper" ::
|
||||
"-keep public class com.evernote.android.job.v21.PlatformJobService" ::
|
||||
"-keep public class com.evernote.android.job.v14.PlatformAlarmService" ::
|
||||
"-keep public class com.evernote.android.job.v14.PlatformAlarmReceiver" ::
|
||||
"-keep public class com.evernote.android.job.JobBootReceiver" ::
|
||||
"-keep public class com.evernote.android.job.JobRescheduleService" ::
|
||||
Nil
|
||||
|
||||
val playServicesVersion = "11.6.2"
|
||||
resolvers += Resolver.jcenterRepo
|
||||
libraryDependencies ++=
|
||||
"com.futuremind.recyclerfastscroll" % "fastscroll" % "0.2.5" ::
|
||||
"com.evernote" % "android-job" % "1.2.1" ::
|
||||
"com.github.jorgecastilloprz" % "fabprogresscircle" % "1.01" ::
|
||||
"com.google.android.gms" % "play-services-ads" % playServicesVersion ::
|
||||
"com.google.android.gms" % "play-services-analytics" % playServicesVersion ::
|
||||
"com.google.android.gms" % "play-services-gcm" % playServicesVersion ::
|
||||
"com.google.firebase" % "firebase-config" % playServicesVersion ::
|
||||
"com.j256.ormlite" % "ormlite-android" % "5.0" ::
|
||||
"com.mikepenz" % "crossfader" % "1.5.1" ::
|
||||
"com.mikepenz" % "fastadapter" % "3.0.4" ::
|
||||
"com.mikepenz" % "iconics-core" % "3.0.0" ::
|
||||
"com.mikepenz" % "materialdrawer" % "6.0.2" ::
|
||||
"com.mikepenz" % "materialize" % "1.1.2" ::
|
||||
"com.squareup.okhttp3" % "okhttp" % "3.9.1" ::
|
||||
"com.twofortyfouram" % "android-plugin-api-for-locale" % "1.0.2" ::
|
||||
"dnsjava" % "dnsjava" % "2.1.8" ::
|
||||
"eu.chainfire" % "libsuperuser" % "1.0.0.201704021214" ::
|
||||
"me.dm7.barcodescanner" % "zxing" % "1.9.8" ::
|
||||
"net.glxn.qrgen" % "android" % "2.0" ::
|
||||
Nil
|
||||
|
||||
packagingOptions := PackagingOptions(excludes =
|
||||
"META-INF/maven/com.squareup.okio/okio/pom.properties" ::
|
||||
"META-INF/maven/com.squareup.okio/okio/pom.xml" ::
|
||||
"META-INF/maven/com.squareup.okhttp3/okhttp/pom.properties" ::
|
||||
"META-INF/maven/com.squareup.okhttp3/okhttp/pom.xml" ::
|
||||
Nil)
|
||||
|
||||
lazy val goClean: TaskKey[Unit] = TaskKey[Unit]("go-clean", "Clean go build dependencies")
|
||||
goClean := {
|
||||
IO.delete(baseDirectory(base => base / "src/overture/.deps").value)
|
||||
IO.delete(baseDirectory(base => base / "src/overture/bin").value)
|
||||
IO.delete(baseDirectory(base => base / "src/overture/go/bin").value)
|
||||
IO.delete(baseDirectory(base => base / "src/main/jni/overture").value)
|
||||
}
|
||||
|
||||
lazy val goBuild: TaskKey[Unit] = TaskKey[Unit]("go-build", "Build go and overture")
|
||||
goBuild := {
|
||||
Process(Seq("mobile/src/overture/make.bash", minSdkVersion.value)) ! streams.value.log match {
|
||||
case 0 => // Success!
|
||||
case n => sys.error(s"Native build script exit code: $n")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "261400168171",
|
||||
"firebase_url": "https://admob-app-id-3330146721.firebaseio.com",
|
||||
"project_id": "admob-app-id-3330146721",
|
||||
"storage_bucket": "admob-app-id-3330146721.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:261400168171:android:dbdd6331c434162f",
|
||||
"android_client_info": {
|
||||
"package_name": "com.github.shadowsocks"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "261400168171-sfik8o3pj7e243583olorh7s5974vab1.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.github.shadowsocks",
|
||||
"certificate_hash": "58a90f84cfe99d4280aec677c9a1292fae131677"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "261400168171-g7aelv5bu012ojr7dod7lq09c9anjimh.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyCee3fAad7nb3YsxeUO9mqqHFfAvsSCbVs"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"analytics_service": {
|
||||
"status": 1
|
||||
},
|
||||
"appinvite_service": {
|
||||
"status": 1,
|
||||
"other_platform_oauth_client": []
|
||||
},
|
||||
"ads_service": {
|
||||
"status": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@@ -2,35 +2,33 @@
|
||||
xmlns:tools="http://schemas.android.com/tools" package="com.github.shadowsocks">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
<uses-permission android:name="android.permission.NFC" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<uses-feature android:name="android.hardware.touchscreen"
|
||||
android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.camera"
|
||||
android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.nfc"
|
||||
android:required="false"/>
|
||||
<uses-feature android:name="android.software.leanback"
|
||||
android:required="false"/>
|
||||
<uses-feature android:name="android.hardware.camera"
|
||||
android:required="false"/>
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="19"
|
||||
android:targetSdkVersion="25"/>
|
||||
android:targetSdkVersion="27"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:extractNativeLibs="false"
|
||||
android:name=".ShadowsocksApplication"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:backupAgent=".ShadowsocksBackupAgent"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.Material"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:banner="@drawable/ic_start_connected">
|
||||
|
||||
<meta-data android:name="android.webkit.WebView.EnableSafeBrowsing"
|
||||
android:value="true" />
|
||||
<meta-data android:name="com.google.android.gms.version"
|
||||
android:value="@integer/google_play_services_version"/>
|
||||
<meta-data android:name="com.google.android.backup.api_key"
|
||||
@@ -83,6 +81,12 @@
|
||||
android:excludeFromRecents="true"
|
||||
android:launchMode="singleTask"/>
|
||||
|
||||
<activity
|
||||
android:name=".ScannerActivity"
|
||||
android:label="@string/add_profile_methods_scan_qr_code"
|
||||
android:parentActivityName=".MainActivity"
|
||||
android:excludeFromRecents="true"/>
|
||||
|
||||
<activity android:name=".TaskerActivity"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<intent-filter>
|
||||
@@ -95,7 +99,8 @@
|
||||
android:label="@string/quick_toggle"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
||||
android:excludeFromRecents="true"
|
||||
android:taskAffinity=""
|
||||
android:taskAffinity=""
|
||||
android:process=":bg"
|
||||
android:launchMode="singleTask">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.CREATE_SHORTCUT" />
|
||||
@@ -103,18 +108,7 @@
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name=".ShadowsocksRunnerService"
|
||||
android:exported="false">
|
||||
</service>
|
||||
|
||||
<service
|
||||
android:name=".ShadowsocksNatService"
|
||||
android:process=":bg"
|
||||
android:exported="false">
|
||||
</service>
|
||||
|
||||
<service
|
||||
android:name=".ShadowsocksVpnService"
|
||||
android:name=".bg.VpnService"
|
||||
android:process=":bg"
|
||||
android:label="@string/app_name"
|
||||
android:permission="android.permission.BIND_VPN_SERVICE"
|
||||
@@ -124,7 +118,19 @@
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service android:name=".ShadowsocksTileService" android:label="@string/quick_toggle"
|
||||
<service
|
||||
android:name=".bg.TransproxyService"
|
||||
android:process=":bg"
|
||||
android:exported="false">
|
||||
</service>
|
||||
|
||||
<service
|
||||
android:name=".bg.ProxyService"
|
||||
android:process=":bg"
|
||||
android:exported="false">
|
||||
</service>
|
||||
|
||||
<service android:name=".bg.ServiceTileService" android:label="@string/quick_toggle"
|
||||
android:process=":bg"
|
||||
android:icon="@drawable/ic_start_connected"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
@@ -133,13 +139,13 @@
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<receiver android:name=".BootReceiver" android:enabled="false">
|
||||
<receiver android:name=".BootReceiver" android:process=":bg" android:enabled="false">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".TaskerReceiver" tools:ignore="ExportedReceiver">
|
||||
<receiver android:name=".TaskerReceiver" android:process=":bg" tools:ignore="ExportedReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.twofortyfouram.locale.intent.action.FIRE_SETTING"/>
|
||||
</intent-filter>
|
||||
@@ -152,13 +158,12 @@
|
||||
android:process=":bg"/>
|
||||
<service android:name="com.evernote.android.job.gcm.PlatformGcmService"
|
||||
android:process=":bg"/>
|
||||
<service android:name="com.evernote.android.job.JobRescheduleService"
|
||||
android:process=":bg"/>
|
||||
<receiver android:name="com.evernote.android.job.v14.PlatformAlarmReceiver"
|
||||
android:process=":bg"/>
|
||||
<receiver android:name="com.evernote.android.job.JobBootReceiver"
|
||||
android:process=":bg"/>
|
||||
|
||||
<!-- Strip useless components -->
|
||||
<activity android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity" tools:node="remove"/>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -10,7 +10,4 @@ interface IShadowsocksService {
|
||||
oneway void startListeningForBandwidth(IShadowsocksServiceCallback cb);
|
||||
oneway void stopListeningForBandwidth(IShadowsocksServiceCallback cb);
|
||||
oneway void unregisterCallback(IShadowsocksServiceCallback cb);
|
||||
|
||||
oneway void use(in int profileId);
|
||||
void useSync(in int profileId);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.github.shadowsocks.aidl;
|
||||
|
||||
interface IShadowsocksServiceCallback {
|
||||
oneway void stateChanged(int state, String profileName, String msg);
|
||||
oneway void trafficUpdated(int profileId, long txRate, long rxRate, long txTotal, long rxTotal);
|
||||
// Traffic data has persisted to database, listener should refetch their data from database
|
||||
oneway void trafficPersisted(int profileId);
|
||||
}
|
||||
@@ -4424,7 +4424,14 @@
|
||||
223.255.236.0/22
|
||||
223.255.252.0/23
|
||||
|
||||
[white_list]
|
||||
[proxy_list]
|
||||
# manhuaren
|
||||
mangaapi.manhuaren.com
|
||||
# Telegram IPs$
|
||||
91.108.4.0/22
|
||||
91.108.56.0/22
|
||||
109.239.140.0/24
|
||||
149.154.160.0/20
|
||||
^(.*\.)?4tern\.com$
|
||||
^(.*\.)?adorama\.com$
|
||||
^(.*\.)?akiba-web\.com$
|
||||
@@ -4603,6 +4610,7 @@
|
||||
^(.*\.)?freewww\.info$
|
||||
^(.*\.)?ftp1\.biz$
|
||||
^(.*\.)?ftpserver\.biz$
|
||||
^(.*\.)?gamer\.com\.tw$
|
||||
^(.*\.)?gettrials\.com$
|
||||
^(.*\.)?got-game\.org$
|
||||
^(.*\.)?gr8domain\.biz$
|
||||
@@ -4667,6 +4675,7 @@
|
||||
^(.*\.)?organiccrap\.com$
|
||||
^(.*\.)?otzo\.com$
|
||||
^(.*\.)?ourhobby\.com$
|
||||
^(.*\.)?pixiv\.net$
|
||||
^(.*\.)?pcanywhere\.net$
|
||||
^(.*\.)?port25\.biz$
|
||||
^(.*\.)?qhigh\.com$
|
||||
@@ -4733,7 +4742,7 @@
|
||||
^(.*\.)?android\.com$
|
||||
^(.*\.)?androidify\.com$
|
||||
^(.*\.)?appspot\.com$
|
||||
^(.*\.)?blogspot(\.[^.]{2,4}){1,2}$
|
||||
^(.*\.)?blogspot(\.(?!-)[a-zA-Z0-9-]{1,63}(?<!-)){1,2}$
|
||||
^(.*\.)?certificate-transparency\.org$
|
||||
^(.*\.)?chrome\.com$
|
||||
^(.*\.)?chromecast\.com$
|
||||
@@ -4756,8 +4765,8 @@
|
||||
^(.*\.)?gmail\.com$
|
||||
^(.*\.)?gmodules\.com$
|
||||
^(.*\.)?goo\.gl$
|
||||
^(.*\.)?google(\.[^.]{2,4}){1,2}$
|
||||
^(.*\.)?googleapis(\.[^.]{2,4}){1,2}$
|
||||
^(.*\.)?google(\.(?!-)[a-zA-Z0-9-]{1,63}(?<!-)){1,2}$
|
||||
^(.*\.)?googleapis(\.(?!-)[a-zA-Z0-9-]{1,63}(?<!-)){1,2}$
|
||||
^(.*\.)?googleapps\.com$
|
||||
^(.*\.)?googleartproject\.com$
|
||||
^(.*\.)?googleblog\.com$
|
||||
@@ -4780,6 +4789,7 @@
|
||||
^(.*\.)?googlezip\.net$
|
||||
^(.*\.)?gvt0\.com$
|
||||
^(.*\.)?gvt1\.com$
|
||||
^(.*\.)?gvt2\.com$
|
||||
^(.*\.)?gvt3\.com$
|
||||
^(.*\.)?html5rocks\.com$
|
||||
^(.*\.)?iam\.soy$
|
||||
@@ -4814,7 +4824,6 @@
|
||||
^(.*\.)?zynamics\.com$
|
||||
^(.*\.)?kat\.cr$
|
||||
^(.*\.)?naughtyamerica\.com$
|
||||
^(.*\.)?v2ex\.com$
|
||||
^(.*\.)?0to255\.com$
|
||||
^(.*\.)?100ke\.org$
|
||||
^(.*\.)?1000giri\.net$
|
||||
@@ -4439,6 +4439,13 @@
|
||||
223.255.252.0/23
|
||||
|
||||
[proxy_list]
|
||||
# manhuaren
|
||||
mangaapi.manhuaren.com
|
||||
# Telegram IPs$
|
||||
91.108.4.0/22
|
||||
91.108.56.0/22
|
||||
109.239.140.0/24
|
||||
149.154.160.0/20
|
||||
^(.*\.)?4tern\.com$
|
||||
^(.*\.)?adorama\.com$
|
||||
^(.*\.)?akiba-web\.com$
|
||||
@@ -4617,6 +4624,7 @@
|
||||
^(.*\.)?freewww\.info$
|
||||
^(.*\.)?ftp1\.biz$
|
||||
^(.*\.)?ftpserver\.biz$
|
||||
^(.*\.)?gamer\.com\.tw$
|
||||
^(.*\.)?gettrials\.com$
|
||||
^(.*\.)?got-game\.org$
|
||||
^(.*\.)?gr8domain\.biz$
|
||||
@@ -4681,6 +4689,7 @@
|
||||
^(.*\.)?organiccrap\.com$
|
||||
^(.*\.)?otzo\.com$
|
||||
^(.*\.)?ourhobby\.com$
|
||||
^(.*\.)?pixiv\.net$
|
||||
^(.*\.)?pcanywhere\.net$
|
||||
^(.*\.)?port25\.biz$
|
||||
^(.*\.)?qhigh\.com$
|
||||
@@ -4747,7 +4756,7 @@
|
||||
^(.*\.)?android\.com$
|
||||
^(.*\.)?androidify\.com$
|
||||
^(.*\.)?appspot\.com$
|
||||
^(.*\.)?blogspot(\.[^.]{2,4}){1,2}$
|
||||
^(.*\.)?blogspot(\.(?!-)[a-zA-Z0-9-]{1,63}(?<!-)){1,2}$
|
||||
^(.*\.)?certificate-transparency\.org$
|
||||
^(.*\.)?chrome\.com$
|
||||
^(.*\.)?chromecast\.com$
|
||||
@@ -4770,8 +4779,8 @@
|
||||
^(.*\.)?gmail\.com$
|
||||
^(.*\.)?gmodules\.com$
|
||||
^(.*\.)?goo\.gl$
|
||||
^(.*\.)?google(\.[^.]{2,4}){1,2}$
|
||||
^(.*\.)?googleapis(\.[^.]{2,4}){1,2}$
|
||||
^(.*\.)?google(\.(?!-)[a-zA-Z0-9-]{1,63}(?<!-)){1,2}$
|
||||
^(.*\.)?googleapis(\.(?!-)[a-zA-Z0-9-]{1,63}(?<!-)){1,2}$
|
||||
^(.*\.)?googleapps\.com$
|
||||
^(.*\.)?googleartproject\.com$
|
||||
^(.*\.)?googleblog\.com$
|
||||
@@ -4794,6 +4803,7 @@
|
||||
^(.*\.)?googlezip\.net$
|
||||
^(.*\.)?gvt0\.com$
|
||||
^(.*\.)?gvt1\.com$
|
||||
^(.*\.)?gvt2\.com$
|
||||
^(.*\.)?gvt3\.com$
|
||||
^(.*\.)?html5rocks\.com$
|
||||
^(.*\.)?iam\.soy$
|
||||
@@ -4828,7 +4838,6 @@
|
||||
^(.*\.)?zynamics\.com$
|
||||
^(.*\.)?kat\.cr$
|
||||
^(.*\.)?naughtyamerica\.com$
|
||||
^(.*\.)?v2ex\.com$
|
||||
^(.*\.)?0to255\.com$
|
||||
^(.*\.)?100ke\.org$
|
||||
^(.*\.)?1000giri\.net$
|
||||
@@ -3,6 +3,8 @@
|
||||
[bypass_all]
|
||||
|
||||
[proxy_list]
|
||||
# manhuaren
|
||||
mangaapi.manhuaren.com
|
||||
# Telegram IPs$
|
||||
91.108.4.0/22
|
||||
91.108.56.0/22
|
||||
@@ -186,6 +188,7 @@
|
||||
^(.*\.)?freewww\.info$
|
||||
^(.*\.)?ftp1\.biz$
|
||||
^(.*\.)?ftpserver\.biz$
|
||||
^(.*\.)?gamer\.com\.tw$
|
||||
^(.*\.)?gettrials\.com$
|
||||
^(.*\.)?got-game\.org$
|
||||
^(.*\.)?gr8domain\.biz$
|
||||
@@ -250,6 +253,7 @@
|
||||
^(.*\.)?organiccrap\.com$
|
||||
^(.*\.)?otzo\.com$
|
||||
^(.*\.)?ourhobby\.com$
|
||||
^(.*\.)?pixiv\.net$
|
||||
^(.*\.)?pcanywhere\.net$
|
||||
^(.*\.)?port25\.biz$
|
||||
^(.*\.)?qhigh\.com$
|
||||
@@ -316,7 +320,7 @@
|
||||
^(.*\.)?android\.com$
|
||||
^(.*\.)?androidify\.com$
|
||||
^(.*\.)?appspot\.com$
|
||||
^(.*\.)?blogspot(\.[^.]{2,4}){1,2}$
|
||||
^(.*\.)?blogspot(\.(?!-)[a-zA-Z0-9-]{1,63}(?<!-)){1,2}$
|
||||
^(.*\.)?certificate-transparency\.org$
|
||||
^(.*\.)?chrome\.com$
|
||||
^(.*\.)?chromecast\.com$
|
||||
@@ -339,8 +343,8 @@
|
||||
^(.*\.)?gmail\.com$
|
||||
^(.*\.)?gmodules\.com$
|
||||
^(.*\.)?goo\.gl$
|
||||
^(.*\.)?google(\.[^.]{2,4}){1,2}$
|
||||
^(.*\.)?googleapis(\.[^.]{2,4}){1,2}$
|
||||
^(.*\.)?google(\.(?!-)[a-zA-Z0-9-]{1,63}(?<!-)){1,2}$
|
||||
^(.*\.)?googleapis(\.(?!-)[a-zA-Z0-9-]{1,63}(?<!-)){1,2}$
|
||||
^(.*\.)?googleapps\.com$
|
||||
^(.*\.)?googleartproject\.com$
|
||||
^(.*\.)?googleblog\.com$
|
||||
@@ -363,6 +367,7 @@
|
||||
^(.*\.)?googlezip\.net$
|
||||
^(.*\.)?gvt0\.com$
|
||||
^(.*\.)?gvt1\.com$
|
||||
^(.*\.)?gvt2\.com$
|
||||
^(.*\.)?gvt3\.com$
|
||||
^(.*\.)?html5rocks\.com$
|
||||
^(.*\.)?iam\.soy$
|
||||
@@ -397,7 +402,6 @@
|
||||
^(.*\.)?zynamics\.com$
|
||||
^(.*\.)?kat\.cr$
|
||||
^(.*\.)?naughtyamerica\.com$
|
||||
^(.*\.)?v2ex\.com$
|
||||
^(.*\.)?0to255\.com$
|
||||
^(.*\.)?100ke\.org$
|
||||
^(.*\.)?1000giri\.net$
|
||||
@@ -0,0 +1 @@
|
||||
127.0.0.1 localhost
|
||||
@@ -274,8 +274,8 @@ img {
|
||||
</head>
|
||||
<body>
|
||||
<p>A <a href="http://shadowsocks.org">Shadowsocks</a> client for Android, written in Scala.</p>
|
||||
<p>Copyright (C) 2016 by Max Lv <a href="mailto:max.c.lv@gmail.com">max.c.lv@gmail.com</a></p>
|
||||
<p>Copyright (C) 2016 by Mygod Studio <a href="contact-shadowsocks-android@mygod.be">contact-shadowsocks-android@mygod.be</a></p>
|
||||
<p>Copyright (C) 2017 by Max Lv <a href="mailto:max.c.lv@gmail.com">max.c.lv@gmail.com</a></p>
|
||||
<p>Copyright (C) 2017 by Mygod Studio <a href="mailto:contact-shadowsocks-android@mygod.be">contact-shadowsocks-android@mygod.be</a></p>
|
||||
<p>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
|
||||
@@ -289,14 +289,17 @@ along with this program. If not, see <a href="http://www.gnu.org/licenses/">http
|
||||
|
||||
<h3>Open Source Licenses</h3>
|
||||
<ul>
|
||||
<li>shadowsocks-libev: <a href="https://github.com/shadowsocks/shadowsocks-libev/blob/master/LICENSE">GPLv3</a></li>
|
||||
<li>tun2socks: <a href="https://github.com/shadowsocks/badvpn/blob/shadowsocks-android/COPYING">BSD</a></li>
|
||||
<li>redsocks: <a href="https://github.com/shadowsocks/redsocks/blob/shadowsocks-android/README">APL 2.0</a></li>
|
||||
<li>OpenSSL: <a href="https://github.com/shadowsocks/openssl-android/blob/master/NOTICE">OpenSSL</a></li>
|
||||
<li>pdnsd: <a href="https://github.com/shadowsocks/shadowsocks-android/blob/master/src/main/jni/pdnsd/COPYING">GPLv3</a></li>
|
||||
<li>libev: <a href="https://github.com/shadowsocks/libevent/blob/shadowsocks-android/LICENSE">GPLv2</a></li>
|
||||
<li>libevent: <a href="https://github.com/shadowsocks/shadowsocks-android/blob/master/src/main/jni/libevent/LICENSE">BSD</a></li>
|
||||
<li>kcptun: <a href="https://github.com/xtaci/kcptun/commits/master/LICENSE.md">MIT</a></li>
|
||||
<li>mbed TLS: <a href="https://github.com/ARMmbed/mbedtls/blob/development/LICENSE">APL 2.0</a></li>
|
||||
<li>libevent: <a href="https://github.com/shadowsocks/libevent/blob/master/LICENSE">BSD</a></li>
|
||||
<li>tun2socks: <a href="https://github.com/shadowsocks/badvpn/blob/shadowsocks-android/COPYING">BSD</a></li>
|
||||
<li>pcre: <a href="https://android.googlesource.com/platform/external/pcre/+/master/dist2/LICENCE">BSD</a></li>
|
||||
<li>libancillary: <a href="https://github.com/shadowsocks/libancillary/blob/shadowsocks-android/COPYING">BSD</a></li>
|
||||
<li>shadowsocks-libev: <a href="https://github.com/shadowsocks/shadowsocks-libev/blob/master/LICENSE">GPLv3</a></li>
|
||||
<li>overture: <a href="https://github.com/shawn1m/overture/blob/master/LICENSE">MIT</a></li>
|
||||
<li>libev: <a href="https://github.com/shadowsocks/libev/blob/master/LICENSE">GPLv2</a></li>
|
||||
<li>libsodium: <a href="https://github.com/jedisct1/libsodium/blob/master/LICENSE">ISC</a></li>
|
||||
<li>libudns: <a href="https://github.com/shadowsocks/libudns/blob/master/COPYING.LGPL">LGPL</a></li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
|
After Width: | Height: | Size: 41 KiB |
@@ -38,13 +38,36 @@
|
||||
|
||||
package com.github.shadowsocks;
|
||||
|
||||
public class System {
|
||||
static {
|
||||
java.lang.System.loadLibrary("system");
|
||||
}
|
||||
import android.os.Build;
|
||||
import android.system.ErrnoException;
|
||||
|
||||
public static native int exec(String cmd);
|
||||
public static native String getABI();
|
||||
public static native int sendfd(int fd, String path);
|
||||
public static native void jniclose(int fd);
|
||||
public class JniHelper {
|
||||
static {
|
||||
System.loadLibrary("jni-helper");
|
||||
}
|
||||
|
||||
@Deprecated // Use Process.destroy() since API 24
|
||||
public static void sigtermCompat(Process process) throws Exception {
|
||||
if (Build.VERSION.SDK_INT >= 24) throw new UnsupportedOperationException("Never call this method in OpenJDK!");
|
||||
int errno = sigterm(process);
|
||||
if (errno != 0) throw Build.VERSION.SDK_INT >= 21
|
||||
? new ErrnoException("kill", errno) : new Exception("kill failed: " + errno);
|
||||
}
|
||||
|
||||
@Deprecated // only implemented for before API 24
|
||||
public static boolean waitForCompat(Process process, long millis) throws Exception {
|
||||
if (Build.VERSION.SDK_INT >= 24) throw new UnsupportedOperationException("Never call this method in OpenJDK!");
|
||||
final Object mutex = getExitValueMutex(process);
|
||||
synchronized (mutex) {
|
||||
if (getExitValue(process) == null) mutex.wait(millis);
|
||||
return getExitValue(process) != null;
|
||||
}
|
||||
}
|
||||
|
||||
public static native int sigkill(int pid);
|
||||
private static native int sigterm(Process process);
|
||||
private static native Integer getExitValue(Process process);
|
||||
private static native Object getExitValueMutex(Process process);
|
||||
public static native int sendFd(int fd, String path);
|
||||
public static native void close(int fd);
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.github.shadowsocks.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* Commandline objects help handling command lines specifying processes to
|
||||
* execute.
|
||||
*
|
||||
* The class can be used to define a command line as nested elements or as a
|
||||
* helper to define a command line by an application.
|
||||
* <p>
|
||||
* <code>
|
||||
* <someelement><br>
|
||||
* <acommandline executable="/executable/to/run"><br>
|
||||
* <argument value="argument 1" /><br>
|
||||
* <argument line="argument_1 argument_2 argument_3" /><br>
|
||||
* <argument value="argument 4" /><br>
|
||||
* </acommandline><br>
|
||||
* </someelement><br>
|
||||
* </code>
|
||||
*
|
||||
* Based on: https://github.com/apache/ant/blob/588ce1f/src/main/org/apache/tools/ant/types/Commandline.java
|
||||
*
|
||||
* Adds support for escape character '\'.
|
||||
*
|
||||
* @author Mygod
|
||||
*/
|
||||
public final class Commandline {
|
||||
private Commandline() { }
|
||||
|
||||
/**
|
||||
* Quote the parts of the given array in way that makes them
|
||||
* usable as command line arguments.
|
||||
* @param args the list of arguments to quote.
|
||||
* @return empty string for null or no command, else every argument split
|
||||
* by spaces and quoted by quoting rules.
|
||||
*/
|
||||
public static String toString(Iterable<String> args) {
|
||||
// empty path return empty string
|
||||
if (args == null) {
|
||||
return "";
|
||||
}
|
||||
// path containing one or more elements
|
||||
final StringBuilder result = new StringBuilder();
|
||||
for (String arg : args) {
|
||||
if (result.length() > 0) result.append(' ');
|
||||
for (int j = 0; j < arg.length(); ++j) {
|
||||
char ch = arg.charAt(j);
|
||||
switch (ch) {
|
||||
case ' ': case '\\': case '"': case '\'': result.append('\\'); // intentionally no break
|
||||
default: result.append(ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
/**
|
||||
* Quote the parts of the given array in way that makes them
|
||||
* usable as command line arguments.
|
||||
* @param args the list of arguments to quote.
|
||||
* @return empty string for null or no command, else every argument split
|
||||
* by spaces and quoted by quoting rules.
|
||||
*/
|
||||
public static String toString(String[] args) {
|
||||
return toString(Arrays.asList(args)); // thanks to Java, arrays aren't iterable
|
||||
}
|
||||
|
||||
/**
|
||||
* Crack a command line.
|
||||
* @param toProcess the command line to process.
|
||||
* @return the command line broken into strings.
|
||||
* An empty or null toProcess parameter results in a zero sized array.
|
||||
*/
|
||||
public static String[] translateCommandline(String toProcess) {
|
||||
if (toProcess == null || toProcess.length() == 0) {
|
||||
//no command? no string
|
||||
return new String[0];
|
||||
}
|
||||
// parse with a simple finite state machine
|
||||
|
||||
final int normal = 0;
|
||||
final int inQuote = 1;
|
||||
final int inDoubleQuote = 2;
|
||||
int state = normal;
|
||||
final StringTokenizer tok = new StringTokenizer(toProcess, "\\\"\' ", true);
|
||||
final ArrayList<String> result = new ArrayList<>();
|
||||
final StringBuilder current = new StringBuilder();
|
||||
boolean lastTokenHasBeenQuoted = false;
|
||||
boolean lastTokenIsSlash = false;
|
||||
|
||||
while (tok.hasMoreTokens()) {
|
||||
String nextTok = tok.nextToken();
|
||||
switch (state) {
|
||||
case inQuote:
|
||||
if ("\'".equals(nextTok)) {
|
||||
lastTokenHasBeenQuoted = true;
|
||||
state = normal;
|
||||
} else {
|
||||
current.append(nextTok);
|
||||
}
|
||||
break;
|
||||
case inDoubleQuote:
|
||||
if ("\"".equals(nextTok)) {
|
||||
if (lastTokenIsSlash) {
|
||||
current.append(nextTok);
|
||||
lastTokenIsSlash = false;
|
||||
} else {
|
||||
lastTokenHasBeenQuoted = true;
|
||||
state = normal;
|
||||
}
|
||||
} else if ("\\".equals(nextTok)) {
|
||||
if (lastTokenIsSlash) {
|
||||
current.append(nextTok);
|
||||
lastTokenIsSlash = false;
|
||||
} else lastTokenIsSlash = true;
|
||||
} else {
|
||||
if (lastTokenIsSlash) {
|
||||
current.append("\\"); // unescaped
|
||||
lastTokenIsSlash = false;
|
||||
}
|
||||
current.append(nextTok);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (lastTokenIsSlash) {
|
||||
current.append(nextTok);
|
||||
lastTokenIsSlash = false;
|
||||
} else if ("\\".equals(nextTok)) lastTokenIsSlash = true; else if ("\'".equals(nextTok)) {
|
||||
state = inQuote;
|
||||
} else if ("\"".equals(nextTok)) {
|
||||
state = inDoubleQuote;
|
||||
} else if (" ".equals(nextTok)) {
|
||||
if (lastTokenHasBeenQuoted || current.length() != 0) {
|
||||
result.add(current.toString());
|
||||
current.setLength(0);
|
||||
}
|
||||
} else {
|
||||
current.append(nextTok);
|
||||
}
|
||||
lastTokenHasBeenQuoted = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (lastTokenHasBeenQuoted || current.length() != 0) {
|
||||
result.add(current.toString());
|
||||
}
|
||||
if (state == inQuote || state == inDoubleQuote) {
|
||||
throw new IllegalArgumentException("unbalanced quotes in " + toProcess);
|
||||
}
|
||||
if (lastTokenIsSlash) throw new IllegalArgumentException("escape character following nothing in " + toProcess);
|
||||
return result.toArray(new String[result.size()]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright 2010 Brave New Software Project, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.github.shadowsocks.utils;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.LinkProperties;
|
||||
import android.os.Build;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.InetAddress;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
public class Dns {
|
||||
public static String getDnsResolver(Context context) throws Exception {
|
||||
Collection<InetAddress> dnsResolvers = getDnsResolvers(context);
|
||||
if (dnsResolvers.isEmpty()) {
|
||||
throw new Exception("Couldn't find an active DNS resolver");
|
||||
}
|
||||
String dnsResolver = dnsResolvers.iterator().next().toString();
|
||||
if (dnsResolver.startsWith("/")) {
|
||||
dnsResolver = dnsResolver.substring(1);
|
||||
}
|
||||
return dnsResolver;
|
||||
}
|
||||
|
||||
private static Collection<InetAddress> getDnsResolvers(Context context) throws Exception {
|
||||
ArrayList<InetAddress> addresses = new ArrayList<InetAddress>();
|
||||
ConnectivityManager connectivityManager =
|
||||
(ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
Class<?> LinkPropertiesClass = Class.forName("android.net.LinkProperties");
|
||||
Method getActiveLinkPropertiesMethod = ConnectivityManager.class.getMethod("getActiveLinkProperties");
|
||||
Object linkProperties = getActiveLinkPropertiesMethod.invoke(connectivityManager);
|
||||
if (linkProperties != null) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
Method getDnsesMethod = LinkPropertiesClass.getMethod("getDnses");
|
||||
Collection<?> dnses = (Collection<?>)getDnsesMethod.invoke(linkProperties);
|
||||
for (Object dns : dnses) {
|
||||
addresses.add((InetAddress)dns);
|
||||
}
|
||||
} else {
|
||||
addresses.addAll(((LinkProperties) linkProperties).getDnsServers());
|
||||
}
|
||||
}
|
||||
|
||||
return addresses;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,492 @@
|
||||
# Copyright (C) 2009 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
#
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
ROOT_PATH := $(LOCAL_PATH)
|
||||
|
||||
BUILD_SHARED_EXECUTABLE := $(LOCAL_PATH)/build-shared-executable.mk
|
||||
|
||||
########################################################
|
||||
## libsodium
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
SODIUM_SOURCE := \
|
||||
crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c \
|
||||
crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c \
|
||||
crypto_core/curve25519/ref10/curve25519_ref10.c \
|
||||
crypto_core/hchacha20/core_hchacha20.c \
|
||||
crypto_core/salsa/ref/core_salsa_ref.c \
|
||||
crypto_generichash/blake2b/ref/blake2b-compress-ref.c \
|
||||
crypto_generichash/blake2b/ref/blake2b-ref.c \
|
||||
crypto_generichash/blake2b/ref/generichash_blake2b.c \
|
||||
crypto_onetimeauth/poly1305/onetimeauth_poly1305.c \
|
||||
crypto_onetimeauth/poly1305/donna/poly1305_donna.c \
|
||||
crypto_pwhash/crypto_pwhash.c \
|
||||
crypto_pwhash/argon2/argon2-core.c \
|
||||
crypto_pwhash/argon2/argon2.c \
|
||||
crypto_pwhash/argon2/argon2-encoding.c \
|
||||
crypto_pwhash/argon2/argon2-fill-block-ref.c \
|
||||
crypto_pwhash/argon2/blake2b-long.c \
|
||||
crypto_pwhash/argon2/pwhash_argon2i.c \
|
||||
crypto_scalarmult/curve25519/scalarmult_curve25519.c \
|
||||
crypto_scalarmult/curve25519/ref10/x25519_ref10.c \
|
||||
crypto_stream/chacha20/stream_chacha20.c \
|
||||
crypto_stream/chacha20/ref/chacha20_ref.c \
|
||||
crypto_stream/salsa20/stream_salsa20.c \
|
||||
crypto_stream/salsa20/ref/salsa20_ref.c \
|
||||
crypto_verify/sodium/verify.c \
|
||||
randombytes/randombytes.c \
|
||||
randombytes/sysrandom/randombytes_sysrandom.c \
|
||||
sodium/core.c \
|
||||
sodium/runtime.c \
|
||||
sodium/utils.c \
|
||||
sodium/version.c
|
||||
|
||||
LOCAL_MODULE := sodium
|
||||
LOCAL_CFLAGS += -I$(LOCAL_PATH)/libsodium/src/libsodium/include \
|
||||
-I$(LOCAL_PATH)/include \
|
||||
-I$(LOCAL_PATH)/include/sodium \
|
||||
-I$(LOCAL_PATH)/libsodium/src/libsodium/include/sodium \
|
||||
-DPACKAGE_NAME=\"libsodium\" -DPACKAGE_TARNAME=\"libsodium\" \
|
||||
-DPACKAGE_VERSION=\"1.0.15\" -DPACKAGE_STRING=\"libsodium\ 1.0.15\" \
|
||||
-DPACKAGE_BUGREPORT=\"https://github.com/jedisct1/libsodium/issues\" \
|
||||
-DPACKAGE_URL=\"https://github.com/jedisct1/libsodium\" \
|
||||
-DPACKAGE=\"libsodium\" -DVERSION=\"1.0.15\" \
|
||||
-DHAVE_PTHREAD=1 \
|
||||
-DSTDC_HEADERS=1 \
|
||||
-DHAVE_SYS_TYPES_H=1 \
|
||||
-DHAVE_SYS_STAT_H=1 \
|
||||
-DHAVE_STDLIB_H=1 \
|
||||
-DHAVE_STRING_H=1 \
|
||||
-DHAVE_MEMORY_H=1 \
|
||||
-DHAVE_STRINGS_H=1 \
|
||||
-DHAVE_INTTYPES_H=1 \
|
||||
-DHAVE_STDINT_H=1 \
|
||||
-DHAVE_UNISTD_H=1 \
|
||||
-D__EXTENSIONS__=1 \
|
||||
-D_ALL_SOURCE=1 \
|
||||
-D_GNU_SOURCE=1 \
|
||||
-D_POSIX_PTHREAD_SEMANTICS=1 \
|
||||
-D_TANDEM_SOURCE=1 \
|
||||
-DHAVE_DLFCN_H=1 \
|
||||
-DLT_OBJDIR=\".libs/\" \
|
||||
-DHAVE_SYS_MMAN_H=1 \
|
||||
-DNATIVE_LITTLE_ENDIAN=1 \
|
||||
-DASM_HIDE_SYMBOL=.hidden \
|
||||
-DHAVE_WEAK_SYMBOLS=1 \
|
||||
-DHAVE_ATOMIC_OPS=1 \
|
||||
-DHAVE_ARC4RANDOM=1 \
|
||||
-DHAVE_ARC4RANDOM_BUF=1 \
|
||||
-DHAVE_MMAP=1 \
|
||||
-DHAVE_MLOCK=1 \
|
||||
-DHAVE_MADVISE=1 \
|
||||
-DHAVE_MPROTECT=1 \
|
||||
-DHAVE_NANOSLEEP=1 \
|
||||
-DHAVE_POSIX_MEMALIGN=1 \
|
||||
-DHAVE_GETPID=1 \
|
||||
-DCONFIGURED=1
|
||||
|
||||
LOCAL_SRC_FILES := $(addprefix libsodium/src/libsodium/,$(SODIUM_SOURCE))
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
########################################################
|
||||
## libevent
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LIBEVENT_SOURCES := \
|
||||
buffer.c bufferevent.c event.c \
|
||||
bufferevent_sock.c bufferevent_ratelim.c \
|
||||
evthread.c log.c evutil.c evutil_time.c evmap.c epoll.c poll.c signal.c select.c
|
||||
|
||||
LOCAL_MODULE := event
|
||||
LOCAL_SRC_FILES := $(addprefix libevent/, $(LIBEVENT_SOURCES))
|
||||
LOCAL_CFLAGS := -I$(LOCAL_PATH)/libevent \
|
||||
-I$(LOCAL_PATH)/libevent/include \
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
########################################################
|
||||
## libancillary
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
ANCILLARY_SOURCE := fd_recv.c fd_send.c
|
||||
|
||||
LOCAL_MODULE := libancillary
|
||||
LOCAL_CFLAGS += -I$(LOCAL_PATH)/libancillary
|
||||
|
||||
LOCAL_SRC_FILES := $(addprefix libancillary/, $(ANCILLARY_SOURCE))
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
########################################################
|
||||
## libbloom
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
BLOOM_SOURCE := bloom.c murmur2/MurmurHash2.c
|
||||
|
||||
LOCAL_MODULE := libbloom
|
||||
LOCAL_CFLAGS += -I$(LOCAL_PATH)/shadowsocks-libev/libbloom \
|
||||
-I$(LOCAL_PATH)/shadowsocks-libev/libbloom/murmur2
|
||||
|
||||
LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/libbloom/, $(BLOOM_SOURCE))
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
########################################################
|
||||
## libipset
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
bdd_src = bdd/assignments.c bdd/basics.c bdd/bdd-iterator.c bdd/expanded.c \
|
||||
bdd/reachable.c bdd/read.c bdd/write.c
|
||||
map_src = map/allocation.c map/inspection.c map/ipv4_map.c map/ipv6_map.c \
|
||||
map/storage.c
|
||||
set_src = set/allocation.c set/inspection.c set/ipv4_set.c set/ipv6_set.c \
|
||||
set/iterator.c set/storage.c
|
||||
|
||||
IPSET_SOURCE := general.c $(bdd_src) $(map_src) $(set_src)
|
||||
|
||||
LOCAL_MODULE := libipset
|
||||
LOCAL_CFLAGS += -I$(LOCAL_PATH)/shadowsocks-libev/libipset/include \
|
||||
-I$(LOCAL_PATH)/shadowsocks-libev/libcork/include
|
||||
|
||||
LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/libipset/src/libipset/,$(IPSET_SOURCE))
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
########################################################
|
||||
## libcork
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
cli_src := cli/commands.c
|
||||
core_src := core/allocator.c core/error.c core/gc.c \
|
||||
core/hash.c core/ip-address.c core/mempool.c \
|
||||
core/timestamp.c core/u128.c
|
||||
ds_src := ds/array.c ds/bitset.c ds/buffer.c ds/dllist.c \
|
||||
ds/file-stream.c ds/hash-table.c ds/managed-buffer.c \
|
||||
ds/ring-buffer.c ds/slice.c
|
||||
posix_src := posix/directory-walker.c posix/env.c posix/exec.c \
|
||||
posix/files.c posix/process.c posix/subprocess.c
|
||||
pthreads_src := pthreads/thread.c
|
||||
|
||||
CORK_SOURCE := $(cli_src) $(core_src) $(ds_src) $(posix_src) $(pthreads_src)
|
||||
|
||||
LOCAL_MODULE := libcork
|
||||
LOCAL_CFLAGS += -I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \
|
||||
-DCORK_API=CORK_LOCAL
|
||||
|
||||
LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/libcork/src/libcork/,$(CORK_SOURCE))
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
########################################################
|
||||
## libev
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := libev
|
||||
LOCAL_CFLAGS += -DNDEBUG -DHAVE_CONFIG_H \
|
||||
-I$(LOCAL_PATH)/include/libev
|
||||
LOCAL_SRC_FILES := \
|
||||
libev/ev.c \
|
||||
libev/event.c
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
########################################################
|
||||
## redsocks
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
REDSOCKS_SOURCES := base.c http-connect.c \
|
||||
log.c md5.c socks5.c \
|
||||
base64.c http-auth.c http-relay.c main.c \
|
||||
parser.c redsocks.c socks4.c utils.c
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libevent
|
||||
|
||||
LOCAL_MODULE := redsocks
|
||||
LOCAL_SRC_FILES := $(addprefix redsocks/, $(REDSOCKS_SOURCES))
|
||||
LOCAL_CFLAGS := -std=gnu99 -DUSE_IPTABLES \
|
||||
-I$(LOCAL_PATH)/redsocks \
|
||||
-I$(LOCAL_PATH)/libevent/include \
|
||||
-I$(LOCAL_PATH)/libevent
|
||||
|
||||
include $(BUILD_SHARED_EXECUTABLE)
|
||||
|
||||
########################################################
|
||||
## shadowsocks-libev local
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
SHADOWSOCKS_SOURCES := local.c \
|
||||
cache.c udprelay.c utils.c netutils.c json.c jconf.c \
|
||||
acl.c http.c tls.c rule.c \
|
||||
crypto.c aead.c stream.c base64.c \
|
||||
plugin.c ppbloom.c \
|
||||
android.c
|
||||
|
||||
LOCAL_MODULE := ss-local
|
||||
LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/src/, $(SHADOWSOCKS_SOURCES))
|
||||
LOCAL_CFLAGS := -Wall -fno-strict-aliasing -DMODULE_LOCAL \
|
||||
-DUSE_CRYPTO_MBEDTLS -DHAVE_CONFIG_H \
|
||||
-DCONNECT_IN_PROGRESS=EINPROGRESS \
|
||||
-I$(LOCAL_PATH)/include/shadowsocks-libev \
|
||||
-I$(LOCAL_PATH)/include \
|
||||
-I$(LOCAL_PATH)/libancillary \
|
||||
-I$(LOCAL_PATH)/mbedtls/include \
|
||||
-I$(LOCAL_PATH)/pcre \
|
||||
-I$(LOCAL_PATH)/libsodium/src/libsodium/include \
|
||||
-I$(LOCAL_PATH)/libsodium/src/libsodium/include/sodium \
|
||||
-I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \
|
||||
-I$(LOCAL_PATH)/shadowsocks-libev/libipset/include \
|
||||
-I$(LOCAL_PATH)/shadowsocks-libev/libbloom \
|
||||
-I$(LOCAL_PATH)/libev
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libev libmbedtls libipset libcork libbloom \
|
||||
libsodium libancillary libpcre
|
||||
|
||||
LOCAL_LDLIBS := -llog
|
||||
|
||||
include $(BUILD_SHARED_EXECUTABLE)
|
||||
|
||||
########################################################
|
||||
## shadowsocks-libev tunnel
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
SHADOWSOCKS_SOURCES := tunnel.c \
|
||||
cache.c udprelay.c utils.c netutils.c json.c jconf.c \
|
||||
crypto.c aead.c stream.c base64.c \
|
||||
plugin.c ppbloom.c \
|
||||
android.c
|
||||
|
||||
LOCAL_MODULE := ss-tunnel
|
||||
LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/src/, $(SHADOWSOCKS_SOURCES))
|
||||
LOCAL_CFLAGS := -Wall -fno-strict-aliasing -DMODULE_TUNNEL \
|
||||
-DUSE_CRYPTO_MBEDTLS -DHAVE_CONFIG_H -DSSTUNNEL_JNI \
|
||||
-DCONNECT_IN_PROGRESS=EINPROGRESS \
|
||||
-I$(LOCAL_PATH)/libancillary \
|
||||
-I$(LOCAL_PATH)/include \
|
||||
-I$(LOCAL_PATH)/libsodium/src/libsodium/include \
|
||||
-I$(LOCAL_PATH)/libsodium/src/libsodium/include/sodium \
|
||||
-I$(LOCAL_PATH)/mbedtls/include \
|
||||
-I$(LOCAL_PATH)/libev \
|
||||
-I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \
|
||||
-I$(LOCAL_PATH)/shadowsocks-libev/libbloom \
|
||||
-I$(LOCAL_PATH)/include/shadowsocks-libev
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libev libmbedtls libsodium libcork libbloom libancillary
|
||||
|
||||
LOCAL_LDLIBS := -llog
|
||||
|
||||
include $(BUILD_SHARED_EXECUTABLE)
|
||||
|
||||
########################################################
|
||||
## jni-helper
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE:= jni-helper
|
||||
|
||||
LOCAL_C_INCLUDES:= $(LOCAL_PATH)/libancillary
|
||||
|
||||
LOCAL_SRC_FILES:= jni-helper.cpp
|
||||
|
||||
LOCAL_LDLIBS := -ldl -llog
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := cpufeatures libancillary
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
########################################################
|
||||
## tun2socks
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_CFLAGS := -std=gnu99
|
||||
LOCAL_CFLAGS += -DBADVPN_THREADWORK_USE_PTHREAD -DBADVPN_LINUX -DBADVPN_BREACTOR_BADVPN -D_GNU_SOURCE
|
||||
LOCAL_CFLAGS += -DBADVPN_USE_SIGNALFD -DBADVPN_USE_EPOLL
|
||||
LOCAL_CFLAGS += -DBADVPN_LITTLE_ENDIAN -DBADVPN_THREAD_SAFE
|
||||
LOCAL_CFLAGS += -DNDEBUG -DANDROID
|
||||
# LOCAL_CFLAGS += -DTUN2SOCKS_JNI
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libancillary
|
||||
|
||||
LOCAL_C_INCLUDES:= \
|
||||
$(LOCAL_PATH)/libancillary \
|
||||
$(LOCAL_PATH)/badvpn/lwip/src/include/ipv4 \
|
||||
$(LOCAL_PATH)/badvpn/lwip/src/include/ipv6 \
|
||||
$(LOCAL_PATH)/badvpn/lwip/src/include \
|
||||
$(LOCAL_PATH)/badvpn/lwip/custom \
|
||||
$(LOCAL_PATH)/badvpn/
|
||||
|
||||
TUN2SOCKS_SOURCES := \
|
||||
base/BLog_syslog.c \
|
||||
system/BReactor_badvpn.c \
|
||||
system/BSignal.c \
|
||||
system/BConnection_common.c \
|
||||
system/BConnection_unix.c \
|
||||
system/BTime.c \
|
||||
system/BUnixSignal.c \
|
||||
system/BNetwork.c \
|
||||
flow/StreamRecvInterface.c \
|
||||
flow/PacketRecvInterface.c \
|
||||
flow/PacketPassInterface.c \
|
||||
flow/StreamPassInterface.c \
|
||||
flow/SinglePacketBuffer.c \
|
||||
flow/BufferWriter.c \
|
||||
flow/PacketBuffer.c \
|
||||
flow/PacketStreamSender.c \
|
||||
flow/PacketPassConnector.c \
|
||||
flow/PacketProtoFlow.c \
|
||||
flow/PacketPassFairQueue.c \
|
||||
flow/PacketProtoEncoder.c \
|
||||
flow/PacketProtoDecoder.c \
|
||||
socksclient/BSocksClient.c \
|
||||
tuntap/BTap.c \
|
||||
lwip/src/core/timers.c \
|
||||
lwip/src/core/udp.c \
|
||||
lwip/src/core/memp.c \
|
||||
lwip/src/core/init.c \
|
||||
lwip/src/core/pbuf.c \
|
||||
lwip/src/core/tcp.c \
|
||||
lwip/src/core/tcp_out.c \
|
||||
lwip/src/core/netif.c \
|
||||
lwip/src/core/def.c \
|
||||
lwip/src/core/mem.c \
|
||||
lwip/src/core/tcp_in.c \
|
||||
lwip/src/core/stats.c \
|
||||
lwip/src/core/inet_chksum.c \
|
||||
lwip/src/core/ipv4/icmp.c \
|
||||
lwip/src/core/ipv4/igmp.c \
|
||||
lwip/src/core/ipv4/ip4_addr.c \
|
||||
lwip/src/core/ipv4/ip_frag.c \
|
||||
lwip/src/core/ipv4/ip4.c \
|
||||
lwip/src/core/ipv4/autoip.c \
|
||||
lwip/src/core/ipv6/ethip6.c \
|
||||
lwip/src/core/ipv6/inet6.c \
|
||||
lwip/src/core/ipv6/ip6_addr.c \
|
||||
lwip/src/core/ipv6/mld6.c \
|
||||
lwip/src/core/ipv6/dhcp6.c \
|
||||
lwip/src/core/ipv6/icmp6.c \
|
||||
lwip/src/core/ipv6/ip6.c \
|
||||
lwip/src/core/ipv6/ip6_frag.c \
|
||||
lwip/src/core/ipv6/nd6.c \
|
||||
lwip/custom/sys.c \
|
||||
tun2socks/tun2socks.c \
|
||||
base/DebugObject.c \
|
||||
base/BLog.c \
|
||||
base/BPending.c \
|
||||
system/BDatagram_unix.c \
|
||||
flowextra/PacketPassInactivityMonitor.c \
|
||||
tun2socks/SocksUdpGwClient.c \
|
||||
udpgw_client/UdpGwClient.c
|
||||
|
||||
LOCAL_MODULE := tun2socks
|
||||
|
||||
LOCAL_LDLIBS := -ldl -llog
|
||||
|
||||
LOCAL_SRC_FILES := $(addprefix badvpn/, $(TUN2SOCKS_SOURCES))
|
||||
|
||||
include $(BUILD_SHARED_EXECUTABLE)
|
||||
|
||||
########################################################
|
||||
## mbed TLS
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := mbedtls
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/mbedtls/include
|
||||
|
||||
MBEDTLS_SOURCES := $(wildcard $(LOCAL_PATH)/mbedtls/library/*.c)
|
||||
|
||||
LOCAL_SRC_FILES := $(MBEDTLS_SOURCES:$(LOCAL_PATH)/%=%)
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
########################################################
|
||||
## pcre
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := pcre
|
||||
|
||||
LOCAL_CFLAGS += -DHAVE_CONFIG_H
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/pcre/dist $(LOCAL_PATH)/pcre
|
||||
|
||||
libpcre_src_files := \
|
||||
pcre_chartables.c \
|
||||
dist/pcre_byte_order.c \
|
||||
dist/pcre_compile.c \
|
||||
dist/pcre_config.c \
|
||||
dist/pcre_dfa_exec.c \
|
||||
dist/pcre_exec.c \
|
||||
dist/pcre_fullinfo.c \
|
||||
dist/pcre_get.c \
|
||||
dist/pcre_globals.c \
|
||||
dist/pcre_jit_compile.c \
|
||||
dist/pcre_maketables.c \
|
||||
dist/pcre_newline.c \
|
||||
dist/pcre_ord2utf8.c \
|
||||
dist/pcre_refcount.c \
|
||||
dist/pcre_string_utils.c \
|
||||
dist/pcre_study.c \
|
||||
dist/pcre_tables.c \
|
||||
dist/pcre_ucd.c \
|
||||
dist/pcre_valid_utf8.c \
|
||||
dist/pcre_version.c \
|
||||
dist/pcre_xclass.c
|
||||
|
||||
LOCAL_SRC_FILES := $(addprefix pcre/, $(libpcre_src_files))
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
########################################################
|
||||
## overture
|
||||
########################################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := overture
|
||||
LOCAL_SRC_FILES := overture/$(TARGET_ARCH_ABI)/liboverture.so
|
||||
|
||||
include $(PREBUILT_SHARED_LIBRARY)
|
||||
|
||||
# Import cpufeatures
|
||||
$(call import-module,android/cpufeatures)
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
APP_ABI := armeabi-v7a arm64-v8a x86
|
||||
APP_PLATFORM := android-19
|
||||
APP_STL := c++_static
|
||||
NDK_TOOLCHAIN_VERSION := clang
|
||||
@@ -0,0 +1,31 @@
|
||||
# Copyright (C) 2009 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# this file is included from Android.mk files to build a target-specific
|
||||
# executable program
|
||||
#
|
||||
# Modified by @Mygod, based on:
|
||||
# https://android.googlesource.com/platform/ndk/+/f2e98f8c066aed59caf61163d4b87c2b858f9814/build/core/build-shared-library.mk
|
||||
# https://android.googlesource.com/platform/ndk/+/f2e98f8c066aed59caf61163d4b87c2b858f9814/build/core/build-executable.mk
|
||||
LOCAL_BUILD_SCRIPT := BUILD_EXECUTABLE
|
||||
LOCAL_MAKEFILE := $(local-makefile)
|
||||
$(call check-defined-LOCAL_MODULE,$(LOCAL_BUILD_SCRIPT))
|
||||
$(call check-LOCAL_MODULE,$(LOCAL_MAKEFILE))
|
||||
$(call check-LOCAL_MODULE_FILENAME)
|
||||
# we are building target objects
|
||||
my := TARGET_
|
||||
$(call handle-module-filename,lib,$(TARGET_SONAME_EXTENSION))
|
||||
$(call handle-module-built)
|
||||
LOCAL_MODULE_CLASS := EXECUTABLE
|
||||
include $(BUILD_SYSTEM)/build-module.mk
|
||||
@@ -41,6 +41,9 @@
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the <linux/tcp.h> header file. */
|
||||
#define HAVE_LINUX_TCP_H 1
|
||||
|
||||
/* Define to 1 if you have the `epoll_ctl' function. */
|
||||
/* #undef HAVE_EPOLL_CTL */
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
#define LOG_TAG "JniHelper"
|
||||
|
||||
#include "jni.h"
|
||||
#include <android/log.h>
|
||||
#include <sys/system_properties.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <sys/un.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <ancillary.h>
|
||||
|
||||
#define LOGI(...) do { __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__); } while(0)
|
||||
#define LOGW(...) do { __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__); } while(0)
|
||||
#define LOGE(...) do { __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__); } while(0)
|
||||
#define THROW(env, clazz, msg) do { env->ThrowNew(env->FindClass(clazz), msg); } while (0)
|
||||
|
||||
static jclass ProcessImpl;
|
||||
static jfieldID ProcessImpl_pid, ProcessImpl_exitValue, ProcessImpl_exitValueMutex;
|
||||
|
||||
static int sdk_version() {
|
||||
char version[PROP_VALUE_MAX + 1];
|
||||
__system_property_get("ro.build.version.sdk", version);
|
||||
return atoi(version);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
JNIEXPORT jint JNICALL Java_com_github_shadowsocks_JniHelper_sigkill(JNIEnv *env, jobject thiz, jint pid) {
|
||||
// Suppress "No such process" errors. We just want the process killed. It's fine if it's already killed.
|
||||
return kill(pid, SIGKILL) == -1 && errno != ESRCH ? errno : 0;
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_github_shadowsocks_JniHelper_sigterm(JNIEnv *env, jobject thiz, jobject process) {
|
||||
if (!env->IsInstanceOf(process, ProcessImpl)) {
|
||||
THROW(env, "java/lang/ClassCastException",
|
||||
"Unsupported process object. Only java.lang.ProcessManager$ProcessImpl is accepted.");
|
||||
return -1;
|
||||
}
|
||||
jint pid = env->GetIntField(process, ProcessImpl_pid);
|
||||
// Suppress "No such process" errors. We just want the process killed. It's fine if it's already killed.
|
||||
return kill(pid, SIGTERM) == -1 && errno != ESRCH ? errno : 0;
|
||||
}
|
||||
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_com_github_shadowsocks_JniHelper_getExitValue(JNIEnv *env, jobject thiz, jobject process) {
|
||||
if (!env->IsInstanceOf(process, ProcessImpl)) {
|
||||
THROW(env, "java/lang/ClassCastException",
|
||||
"Unsupported process object. Only java.lang.ProcessManager$ProcessImpl is accepted.");
|
||||
return NULL;
|
||||
}
|
||||
return env->GetObjectField(process, ProcessImpl_exitValue);
|
||||
}
|
||||
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_com_github_shadowsocks_JniHelper_getExitValueMutex(JNIEnv *env, jobject thiz, jobject process) {
|
||||
if (!env->IsInstanceOf(process, ProcessImpl)) {
|
||||
THROW(env, "java/lang/ClassCastException",
|
||||
"Unsupported process object. Only java.lang.ProcessManager$ProcessImpl is accepted.");
|
||||
return NULL;
|
||||
}
|
||||
return env->GetObjectField(process, ProcessImpl_exitValueMutex);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_github_shadowsocks_JniHelper_close(JNIEnv *env, jobject thiz, jint fd) {
|
||||
close(fd);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_github_shadowsocks_JniHelper_sendFd(JNIEnv *env, jobject thiz, jint tun_fd, jstring path) {
|
||||
int fd;
|
||||
struct sockaddr_un addr;
|
||||
const char *sock_str = env->GetStringUTFChars(path, 0);
|
||||
|
||||
if ( (fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
|
||||
LOGE("socket() failed: %s (socket fd = %d)\n", strerror(errno), fd);
|
||||
return (jint)-1;
|
||||
}
|
||||
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.sun_family = AF_UNIX;
|
||||
strncpy(addr.sun_path, sock_str, sizeof(addr.sun_path)-1);
|
||||
|
||||
if (connect(fd, (struct sockaddr*)&addr, sizeof(addr)) == -1) {
|
||||
LOGE("connect() failed: %s (fd = %d)\n", strerror(errno), fd);
|
||||
close(fd);
|
||||
return (jint)-1;
|
||||
}
|
||||
|
||||
if (ancil_send_fd(fd, tun_fd)) {
|
||||
LOGE("ancil_send_fd: %s", strerror(errno));
|
||||
close(fd);
|
||||
return (jint)-1;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
env->ReleaseStringUTFChars(path, sock_str);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This is called by the VM when the shared library is first loaded.
|
||||
*/
|
||||
|
||||
typedef union {
|
||||
JNIEnv* env;
|
||||
void* venv;
|
||||
} UnionJNIEnvToVoid;
|
||||
|
||||
jint JNI_OnLoad(JavaVM* vm, void* reserved) {
|
||||
UnionJNIEnvToVoid uenv;
|
||||
uenv.venv = NULL;
|
||||
jint result = -1;
|
||||
JNIEnv* env = NULL;
|
||||
|
||||
if (vm->GetEnv(&uenv.venv, JNI_VERSION_1_6) != JNI_OK) {
|
||||
THROW(env, "java/lang/RuntimeException", "GetEnv failed");
|
||||
goto bail;
|
||||
}
|
||||
env = uenv.env;
|
||||
|
||||
if (sdk_version() < 24) {
|
||||
if (!(ProcessImpl = env->FindClass("java/lang/ProcessManager$ProcessImpl"))) {
|
||||
THROW(env, "java/lang/RuntimeException", "ProcessManager$ProcessImpl not found");
|
||||
goto bail;
|
||||
}
|
||||
ProcessImpl = (jclass) env->NewGlobalRef((jobject) ProcessImpl);
|
||||
if (!(ProcessImpl_pid = env->GetFieldID(ProcessImpl, "pid", "I"))) {
|
||||
THROW(env, "java/lang/RuntimeException", "ProcessManager$ProcessImpl.pid not found");
|
||||
goto bail;
|
||||
}
|
||||
if (!(ProcessImpl_exitValue = env->GetFieldID(ProcessImpl, "exitValue", "Ljava/lang/Integer;"))) {
|
||||
THROW(env, "java/lang/RuntimeException", "ProcessManager$ProcessImpl.exitValue not found");
|
||||
goto bail;
|
||||
}
|
||||
if (!(ProcessImpl_exitValueMutex = env->GetFieldID(ProcessImpl, "exitValueMutex", "Ljava/lang/Object;"))) {
|
||||
THROW(env, "java/lang/RuntimeException", "ProcessManager$ProcessImpl.exitValueMutex not found");
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
|
||||
result = JNI_VERSION_1_6;
|
||||
|
||||
bail:
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<gradient xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:startColor="#19000000"
|
||||
android:endColor="#00000000"
|
||||
android:startX="46.15"
|
||||
android:endX="108"
|
||||
android:startY="40.34"
|
||||
android:endY="102.18"
|
||||
android:type="linear"/>
|
||||
@@ -0,0 +1,13 @@
|
||||
<vector android:height="108dp" android:viewportHeight="108.0"
|
||||
android:viewportWidth="108.0" android:width="108dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@color/ic_launcher_foreground_shadow"
|
||||
android:pathData="M70.94,35.7l37.06,36.3l0,36l-23.92,0l-53.02,-52.57l39.88,-19.73l0,0"/>
|
||||
<path android:fillAlpha="0.79" android:fillColor="#fff"
|
||||
android:pathData="M70.94,35.7l-6.94,30.53l-15.56,-5l13.74,-16.38l-18.31,15.4l-12.81,-4.82l39.88,-19.73z"/>
|
||||
<path android:fillAlpha="0.79" android:fillColor="#fff"
|
||||
android:pathData="M48.79,64.37l4.96,1.6l-4.94,6.73l-0.02,-8.33z"/>
|
||||
<path android:fillAlpha="0.79" android:fillColor="#fff"
|
||||
android:pathData="M70.94,35.7l-6.94,30.53l-15.56,-5l13.74,-16.38l-18.31,15.4l-12.81,-4.82l39.88,-19.73z"/>
|
||||
<path android:fillAlpha="0.79" android:fillColor="#fff"
|
||||
android:pathData="M48.79,64.37l4.96,1.6l-4.94,6.73l-0.02,-8.33z"/>
|
||||
</vector>
|
||||
|
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 221 B |
|
Before Width: | Height: | Size: 806 B After Width: | Height: | Size: 806 B |
|
Before Width: | Height: | Size: 175 B After Width: | Height: | Size: 175 B |
|
Before Width: | Height: | Size: 556 B After Width: | Height: | Size: 556 B |
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:colorControlHighlight">
|
||||
<item>
|
||||
<selector android:enterFadeDuration="@android:integer/config_mediumAnimTime"
|
||||
android:exitFadeDuration="@android:integer/config_mediumAnimTime">
|
||||
<item android:state_selected="true">
|
||||
<color android:color="@color/material_primary_100"/>
|
||||
</item>
|
||||
</selector>
|
||||
</item>
|
||||
</ripple>
|
||||
|
Before Width: | Height: | Size: 257 B After Width: | Height: | Size: 257 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 347 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 436 B After Width: | Height: | Size: 436 B |
|
Before Width: | Height: | Size: 277 KiB After Width: | Height: | Size: 277 KiB |
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/material_primary_300" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<selector android:enterFadeDuration="@android:integer/config_mediumAnimTime"
|
||||
android:exitFadeDuration="@android:integer/config_mediumAnimTime">
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/material_green_700" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
</item>
|
||||
<item android:left="8dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@android:color/white" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:drawable="?android:attr/selectableItemBackground"/>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:enterFadeDuration="@android:integer/config_mediumAnimTime"
|
||||
android:exitFadeDuration="@android:integer/config_mediumAnimTime">
|
||||
<item android:state_selected="true">
|
||||
<color android:color="@color/material_primary_100"/>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M19,3h-4.18C14.4,1.84 13.3,1 12,1c-1.3,0 -2.4,0.84 -2.82,2L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM12,3c0.55,0 1,0.45 1,1s-0.45,1 -1,1 -1,-0.45 -1,-1 0.45,-1 1,-1zM14,17L7,17v-2h7v2zM17,13L7,13v-2h10v2zM17,9L7,9L7,7h10v2z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M11,18h2v-2h-2v2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM12,6c-2.21,0 -4,1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5 0,-2.21 -1.79,-4 -4,-4z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M14,10L2,10v2h12v-2zM14,6L2,6v2h12L14,6zM18,14v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM2,16h8v-2L2,14v2z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<Spinner android:id="@+id/template_selector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:entries="@array/acl_rule_templates"/>
|
||||
<EditText android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textNoSuggestions|textMultiLine"/>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp">
|
||||
<ImageView android:id="@android:id/icon"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"/>
|
||||
<Space android:layout_width="4dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
<LinearLayout android:orientation="vertical"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical">
|
||||
<TextView android:id="@android:id/text1"
|
||||
android:textAppearance="?android:attr/textAppearance"
|
||||
android:textColor="@android:color/primary_text_light"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"/>
|
||||
<TextView android:id="@android:id/text2"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
@@ -19,24 +20,22 @@
|
||||
android:textSize="18sp"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:paddingStart="60dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:ignore="RtlHardcoded"/>
|
||||
android:layout_height="wrap_content"/>
|
||||
<Switch android:checked="true"
|
||||
android:id="@+id/bypassSwitch"
|
||||
android:text="@string/bypass_apps"
|
||||
android:textSize="18sp"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:paddingStart="60dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:ignore="RtlHardcoded"/>
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
<FrameLayout android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
@@ -48,7 +47,19 @@
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:id="@+id/applistview"
|
||||
android:id="@+id/list"
|
||||
android:visibility="gone"/>
|
||||
<com.futuremind.recyclerviewfastscroll.FastScroller
|
||||
android:id="@+id/fastscroller"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:visibility="gone"
|
||||
app:fastscroll__handleColor="@color/material_primary_500"
|
||||
app:fastscroll__bubbleColor="@color/material_primary_500"
|
||||
app:fastscroll__bubbleTextAppearance="@style/StyledScrollerTextAppearance"/>
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
@@ -28,6 +28,6 @@
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:clickable="false"
|
||||
android:layout_marginEnd="8dp"/>
|
||||
android:layout_marginEnd="16dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<include layout="@layout/toolbar_light_dark"/>
|
||||
<FrameLayout android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
<android.support.v7.widget.RecyclerView android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="32dp"
|
||||
android:clipToPadding="false"/>
|
||||
<com.futuremind.recyclerviewfastscroll.FastScroller
|
||||
android:id="@+id/fastscroller"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
app:fastscroll__handleColor="@color/material_primary_500"
|
||||
app:fastscroll__bubbleColor="@color/material_primary_500"
|
||||
app:fastscroll__bubbleTextAppearance="@style/StyledScrollerTextAppearance"/>
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/background_header"/>
|
||||
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
@@ -4,12 +4,12 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<include layout="@layout/toolbar_light_dark"/>
|
||||
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/profilesList"
|
||||
<android.support.v7.widget.RecyclerView android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:paddingBottom="32dp"
|
||||
android:scrollbars="vertical"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"/>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Based on: https://github.com/android/platform_frameworks_base/blob/505e3ab/core/res/res/layout/simple_list_item_2.xml -->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/content"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/background_profile"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="true"
|
||||
android:nextFocusRight="@+id/edit">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="4dp"
|
||||
android:id="@+id/container">
|
||||
<TextView
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"/>
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:id="@+id/share"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:layout_gravity="top"
|
||||
app:srcCompat="@drawable/ic_social_share"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/share"
|
||||
android:focusable="true"
|
||||
android:nextFocusLeft="@+id/container"/>
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:id="@+id/edit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:layout_gravity="top"
|
||||
app:srcCompat="@drawable/ic_image_edit"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/edit"
|
||||
android:focusable="true"/>
|
||||
</LinearLayout>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="4dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="16dp">
|
||||
<TextView
|
||||
android:id="@android:id/text2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toStartOf="@+id/traffic"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"/>
|
||||
<TextView
|
||||
android:id="@+id/traffic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"/>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||