Commit Graph
51 Commits
Author SHA1 Message Date
Mygod 7922be5653 Fix signatures are being deprecated 2018-03-08 23:50:49 -08:00
Mygod da2490b1b8 Use ContextCompat.getSystemService 2018-03-08 23:31:29 -08:00
Mygod 3a8f863bd1 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-08 22:47:58 -08:00
Mygod 39a0a61da2 Allow using TileService in direct boot mode 2018-02-22 11:56:26 -08:00
Mygod 510098911e Fix domain name display in TileService 2018-02-17 20:35:09 -08:00
Mygod 201bb4fe58 Remove unnecessary tint in TileService 2018-02-17 14:13:08 -08:00
Max Lv 439d56d1d7 Remove the return value in traffic IPC 2018-02-05 01:38:45 -08:00
Mygod a755b669c8 Fix code style issues 2018-02-04 15:07:38 -08:00
Mygod 4a97ff1d30 Makes less noise while stopping service 2018-02-04 04:14:39 -08:00
Mygod 7cc3c48240 Fix translucent style 2018-02-04 04:08:34 -08:00
Mygod 0046ed87d5 Fix a crash on Android 6.0 2018-02-03 20:56:55 -08:00
Mygod 7a49ddc045 Fix #1612 2018-01-28 00:09:01 -08:00
Max Lv c63a659d88 Fix remote DNS 2018-01-24 18:21:32 +08:00
Max Lv 8e7ddaebbd Add OpenDNS into the primary list 2018-01-23 23:10:01 -08:00
Max Lv e2c29594f2 Set different timeouts 2018-01-22 19:04:00 -08:00
Mygod ac96e6fc9c Min API 19 -> 21
Fix #1579.
2018-01-18 19:57:30 -08:00
Max Lv 7297a2664c Avoid problematic local DNS resolver 2018-01-16 23:17:00 -08:00
Max Lv 4e943bc782 Reduce the DNS timeout 2018-01-12 17:02:22 +08:00
Max Lv 90dd0ab300 Refine local DNS resolver 2018-01-06 15:13:26 +08:00
Mygod 56728a3f40 Hide profileName in secure lock screen 2017-12-29 22:43:01 +08:00
Mygod cc070223b4 Add doc for ServiceNotification 2017-12-29 22:32:07 +08:00
Mygod 540b1d3710 Add some sweet animation to replace old circular progress 2017-12-19 17:01:11 -08:00
Mygod f381ad6300 Fix crash when no profile is selected 2017-12-17 05:53:35 -08:00
Mygod 922eb8b202 Faster VPN connection and less wait
I just saved everyone ~0.9s every VPN connection.
2017-12-17 05:04:40 -08:00
Mygod 1010edc561 Speed up Acl.fromReader
It should run 9x faster than before now.

Past mistakes:

* InetAddress.parseNumericAddress throws TWO exceptions underthehood if the string passed is invalid. This caused a huge overhead;
* CharSequence.split in Kotlin is EXTREMELY SLOW.
2017-12-17 04:43:19 -08:00
Mygod 870fd9e652 Move custom-rules.acl to PublicDatabase
Less files to backup. Less constants to keep track of.
2017-12-16 23:50:54 -08:00
Mygod 11dd7112c3 Implement plugin entirely in Kotlin 2017-12-16 16:07:01 -08:00
Mygod d7a11eaa3b Implement direct boot awareness
To do direct boot, important files need to be moved to device storage (i.e. not as safe storage). The only thing sensitive is user credentials (server settings in each profile) and the config file passed to libss-*.so. In order to implement direct boot, at least the active profile has to be moved/copied to device storage.

This commit keeps profile information (and temporary data used by ProfileConfigFragment) and Shadowsocks config in credential storage and move everything else to device storage. In order to make direct boot work, active profile is also copied into device storage and Shadowsocks config file is created in device storage during direct boot. Cleanup of those information is also implemented.

Fixes #1457.

NB:

* `android:directBootAware` can't be used on application element. That seems to be used by system apps.
* Works fine with multi-user;
* Old GSM files are not migrated (see App.kt) to device storage.
2017-12-15 15:36:19 -08:00
Mygod 9a2643ec2c Add missing error message 2017-12-14 12:00:13 -08:00
Mygod 5c2d548dee Reduce the number of default methods 2017-12-14 12:00:13 -08:00
Max Lv b88f836616 Refine #1489 2017-12-13 23:35:10 +08:00
Max Lv 9aa0a4e3c5 Fix a potential issue in localSocket 2017-12-11 10:51:17 +08:00
Max Lv aa53318408 Refine #1489 2017-12-10 22:51:18 +08:00
Max Lv 5bc7200d21 Fix the exception when addAllowedApplication 2017-12-09 23:02:45 +08:00
Mygod 97e93552c6 Always proxy the app itself
No need to keep a confusing option. Fix #1484.
2017-12-08 17:37:11 -08:00
Mygod 497a74760d Refine #1489 2017-12-08 17:24:29 -08:00
Max Lv 3c62d70650 Fix #1489 2017-12-08 12:05:52 +08:00
Mygod b622545c4b Remove the useless sleep 2017-12-06 21:58:48 -08:00
Mygod c124e1e8ef Misc refinements
* Refine Kotlin codes;
* Support RTL;
* Use VectorDrawable for notification;
* Remove redundant resources;
* Better IDE integration.
2017-12-06 19:46:26 -08:00
Mygod f49d3cb443 Save LocalSocket instance from getting GC 2017-12-06 19:01:35 -08:00
Mygod 334cd5ea1e Fix issues with keeping compatibility with old databases 2017-12-06 17:32:39 -08:00
Mygod c013284b1b Fix LocalSocketListener on debug builds
I have no idea what I'm doing. Somebody please explain.
2017-12-06 16:57:40 -08:00
Mygod 8e126511de Revert "Remove file socket on thread finishes"
This reverts commit 8c55630e9b.
2017-12-06 16:31:06 -08:00
Mygod 8c55630e9b Remove file socket on thread finishes 2017-12-06 16:22:18 -08:00
Mygod b808920e6c Fix EBADF error caused by race condition 2017-12-06 16:08:44 -08:00
Mygod e19e629487 Move catch blocks to child classes
This reverts commit 07a48bc20b and f870093c94.
2017-12-06 16:07:37 -08:00
Mygod 79d2290d28 Use thread with exception handling in GuardedProcess 2017-12-06 15:18:49 -08:00
Max Lv 07a48bc20b Refine the local socket closing logic 2017-12-06 02:42:59 -08:00
Max Lv f870093c94 Fix EBADF error with proguard 2017-12-05 23:16:29 -08:00
Max Lv 9fc1a4e0ad Fix the release build 2017-12-05 22:18:03 +08:00