Mygod 0af450008b Implement network capabilities reporting
This commit should fix the problem where VPN connection is viewed as metered connections on Android P DP1. However as I only have an emulator to test, I can't tell if it really works but it should.

An interesting observation is that the developer can call setUnderlyingNetworks(arrayOfNulls(1)) to make the VPN connection always unmetered. This is more of a quick hack instead of a real fix. Source: https://android.googlesource.com/platform/frameworks/base/+/adbf1d0/services/core/java/com/android/server/connectivity/Vpn.java#312

One may ask whether it's possible to fix this issue for Android 8.1. The short answer is not that I know of.
After some intensive source code reading, I found out that this is the commit that "breaks" whether VPN is metered for Android 8.1: https://android.googlesource.com/platform/frameworks/base/+/43d2a1700b6eb1d804924c6a1e5e0161a13a5348%5E%21/
The key is that isActiveNetworkMetered() used to return getActiveNetworkInfo().isMetered() and now it uses the more up-to-date API getActiveNetwork(). However, getActiveNetworkInfo() ignores VPN connections while getActiveNetwork() prefers VPN connection. And since NetworkCapabilities for VPN Network is always metered by default, this ultimately causes the bug. One might be able to get around this bug by somehow calling NetworkAgent.sendNetworkCapabilities in the correct context.

Fix #1666.
2018-03-22 23:40:15 -07:00
2018-02-04 05:35:03 -08:00
2018-02-25 11:23:10 +08:00
2018-03-17 14:20:48 -07:00
2018-01-22 19:12:23 -08:00
2017-12-27 11:23:38 +08:00
2016-06-17 16:22:05 +08:00
2018-03-08 19:41:21 -08:00
2016-05-20 20:26:58 +08:00
2018-02-04 15:07:38 -08:00
2018-01-05 20:50:07 +08:00
2017-01-07 16:50:08 +08:00
2018-02-04 15:07:38 -08:00
2018-02-25 19:38:04 +08:00

Shadowsocks for Android

Build Status API Releases Codacy Badge License: GPL v3

A shadowsocks client for Android, written in Kotlin.

PREREQUISITES

  • JDK 1.8
  • Go 1.4+
  • Android SDK
    • Build Tools 27+
    • Android NDK r16+

BUILD

  • Set environment variable ANDROID_HOME to /path/to/android-sdk
  • (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
  • Fetch submodules using $ git submodule update --init --recursive
  • Build it using Android Studio or gradle script

TRANSLATE

Translators can go to POEditor 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 (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

LICENSE

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 the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

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

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

S
Description
No description provided
Readme
63 MiB
Languages
Kotlin 78.8%
C 8.4%
Makefile 3.6%
Gradle 2.8%
HTML 1.6%
Other 4.7%