Commit Graph
626 Commits
Author SHA1 Message Date
Mygod 09220ee335 Reduce notification priority 2016-07-13 00:45:19 +08:00
Mygod 6c992c5937 Refine proguard rules and flushing DNS on Android 4.x
This reverts commit 7a87eab47c.
2016-07-12 18:46:31 +08:00
Mygod c92d66d9f3 Revert "Refine #530 again and again" and probably fix #530
This reverts commit b833cb6267.
2016-07-12 15:56:32 +08:00
Max Lv b833cb6267 Refine #530 again and again
Put ShadowsocksRunnerService into :bg process. It helped to solve #530, but
still I'm not sure why it works.

One assumption is that the startService() in BootReceiver helps to ensure :bg
process in a valid state.
2016-07-12 13:36:23 +08:00
Mygod 44625ae5b0 Bugfix for DropDownPreference 2016-07-11 20:43:53 +08:00
Mygod 159e1dff78 Bugfix for NAT mode 2016-07-11 19:51:47 +08:00
Mygod 84ac2b06fa Refine #530 again
Have. To. Do. More. Refinements.

Here's what happened in the buggy versions: (I think)

* `BootReceiver` starts which invokes `Utils.startSsService` which starts `ShadowsocksRunnerService`;
* `ShadowsocksRunnerService` binds to `BaseService`;
* 1s after it's connected, it invokes `bgService.use` which returns immediately after pushing `use` in the queue since it's an oneway method;
* Then `stopSelf` => `detachService`, `BaseService` now have nothing bound to it and not started either (neither foreground nor background), so the system can destroy it any time; (at this point, `BaseService.use` isn't invoked yet)
* `com.github.shadowsocks` process then probably exits since booting is a resource-heavy task, anyway it doesn't matter;
* Some time later `com.github.shadowsocks:bg` resumes running, and `BaseService` is stopped and destroyed. Now the system is no longer aware of this `BaseService` instance but it isn't garbage collected yet;
* `use` is finally invoked;
* `startService` is invoked in `startRunner` and the destroyed background service starts running; (bug of Android?)
* `startForeground` is invoked in `ShadowsocksNotification` but the system probably refused it since the service itself is already destroyed;
* When the main activity UI is brought up and requests binding, `com.github.shadowsocks:bg` which is unaware of the existing instance of `BaseService` creates another `BaseService` and thus everything gets messed up.

This commit fixes this by invoking `getState` (which isn't an oneway method) immediately after `use` so that `ShadowsocksRunnerService` will wait for `BaseService` to start itself before destroying itself and its connection to `BaseService`. And thus its return value is not used.
2016-07-11 19:22:54 +08:00
Mygod dcf190c1f5 Bugfix for NumberPickerPreference 2016-07-11 17:51:24 +08:00
Mygod 74a0e397c1 Refine #752 and NumberPickerPreference 2016-07-11 17:49:17 +08:00
Max Lv f35a4b05b5 Fix #752 2016-07-10 19:22:51 +08:00
Max Lv 82e6266f09 Revert "Disable AutoFocus and Flash"
This reverts commit 9919ead15e.
2016-07-10 16:13:20 +08:00
Max Lv 9919ead15e Disable AutoFocus and Flash 2016-07-10 16:04:43 +08:00
Max Lv fce0ffe566 Refine #530 2016-07-09 09:00:00 +08:00
Max Lv 556d8d78bd Revert "Refine #530"
This reverts commit 56de231c4f.
2016-07-09 08:59:13 +08:00
Mygod 929b8c94ae Ignore exceptions while unbinding service 2016-07-08 12:58:11 +08:00
Max Lv a21d099a34 Fix #746 2016-07-08 11:42:10 +08:00
Mygod 07eb4d2a5c Refine utils.Key for readability 2016-07-05 19:31:58 +08:00
Mygod c480137dec Remove .aidl.Config and persisting SharedPreferences (#742)
Previously a profile can exist in the following forms:

* `.database.Profile` used for everything backend;
* `.ShadowsocksSettings` which uses Preferences to provide UI to tweak settings;
* `.aidl.Config` used for IPC;
* `<data dir>/shared_pref/com.github.shadowsocks_preferences.xml` which exists for no apparent reason.

Thus long code block can be seen whose purpose is simply converting the data from one form to another. This commit intends to remove the latter two by:

1. Using profile ID and take advantage of fs r/w lock SQLite uses for IPC and better extensibility;
2. Stop persisting redundant fields in the preferences file and update database directly.
2016-07-05 01:07:09 -05:00
Mygod 432ab6cc7a Fix the bug where UI is not updated after importing 2016-07-04 10:38:49 +08:00
Max Lv 6d78b496ec Fix a typo 2016-07-03 18:35:29 +08:00
Max Lv df09d39139 Add apply-all action 2016-07-03 17:27:50 +08:00
Mygod 0b3ee8b793 Refine #735
It's impolite to ask for permission over and over again.
2016-07-01 13:26:53 +08:00
Mygod 99fd8f1e69 Fix accessibility issue for title view 2016-07-01 12:56:42 +08:00
Mygod 333ff40621 Fix #737 by using support vector drawables 2016-07-01 12:42:26 +08:00
Max Lv bfd85ecb8e Refine black list 2016-06-30 11:01:41 +08:00
Max Lv e9c912b935 Fix #735 2016-06-29 09:53:21 +08:00
Max Lv 4f13acaffe Add missing files 2016-06-27 17:53:08 +08:00
Max Lv a537a7fc0a Integrate a Barcode Scanner 2016-06-27 15:54:22 +08:00
Mygod 27bf6a2237 Fix connection test not reset in background 2016-06-18 18:26:20 +08:00
Mygod 56de231c4f Refine #530 2016-06-17 17:59:12 +08:00
Max Lv 797b3fda12 Revert "Refine #530"
This reverts commit 292f22cc86.
2016-06-17 17:58:58 +08:00
Max Lv 292f22cc86 Refine #530 2016-06-17 17:37:52 +08:00
Mygod 89df2bc715 Hide stop action in notification if the quick settings tile is present 2016-06-17 14:40:33 +08:00
Mygod 18f03aeb1d Move tile service to a separate process to save memory 2016-06-17 14:24:59 +08:00
Mygod 8e3af71696 Change tile to a quick switch 2016-06-17 13:42:12 +08:00
Mygod 048219a788 Remove screen_name resource 2016-06-17 13:27:35 +08:00
Mygod b4d3103b8f Merge branch 'n' and update to API level 24
Fix #671.
2016-06-17 13:24:56 +08:00
Mygod d350088153 Refine updateCurrentProfile 2016-06-17 13:01:09 +08:00
Max Lv 21a34e7e4e Fix #714 2016-06-14 09:44:20 +08:00
Mygod 3f201eb29b Fix connection test button too small 2016-06-09 21:16:02 +08:00
Mygod 5afb8b9cd4 Fix connection test disappearing 2016-06-05 12:20:48 +08:00
Mygod 07798c7e56 Fix imported per-app proxy settings not updating UI 2016-06-05 12:06:27 +08:00
Mygod 86f32ea67c Add app.isNatEnabled for performance and readability
Warning: This is a boring commit.
2016-05-24 11:52:06 +08:00
Mygod 461a0bda3f Remove unnecessary app.settings param in ConfigUtils.load 2016-05-24 11:46:31 +08:00
Mygod c878d4daa6 Fix DeathRecipient leaking bug 2016-05-24 11:42:12 +08:00
Mygod 9be24d7408 Use SharedPreference.Editor.apply instead of commit 2016-05-24 11:39:43 +08:00
Mygod 28ea9dd807 Use app.* instead of ShadowsocksApplication.*
Because typing ShadowsocksApplication is quite troublesome.
2016-05-24 11:37:33 +08:00
Mygod c695847403 Remove package object 2016-05-24 11:23:46 +08:00
Mygod 535561cfe4 Manage auto connect via Android API 2016-05-24 10:53:34 +08:00
Mygod a1871f792d Fix building 2016-05-21 17:51:10 +08:00