1. 11 Jul, 2016 4 commits
    • Mygod's avatar
      Bugfix for NAT mode · 159e1dff
      Mygod authored
      159e1dff
    • Mygod's avatar
      Refine #530 again · 84ac2b06
      Mygod authored
      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.
      84ac2b06
    • Mygod's avatar
      Bugfix for NumberPickerPreference · dcf190c1
      Mygod authored
      dcf190c1
    • Mygod's avatar
      Refine #752 and NumberPickerPreference · 74a0e397
      Mygod authored
      74a0e397
  2. 10 Jul, 2016 3 commits
  3. 09 Jul, 2016 3 commits
  4. 08 Jul, 2016 4 commits
  5. 06 Jul, 2016 3 commits
  6. 05 Jul, 2016 2 commits
    • Mygod's avatar
      Refine utils.Key for readability · 07eb4d2a
      Mygod authored
      07eb4d2a
    • Mygod's avatar
      Remove .aidl.Config and persisting SharedPreferences (#742) · c480137d
      Mygod authored
      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.
      c480137d
  7. 04 Jul, 2016 4 commits
  8. 03 Jul, 2016 3 commits
  9. 01 Jul, 2016 14 commits