refine the binary update

This commit is contained in:
Max Lv
2015-07-31 16:05:03 +08:00
parent c2c7cabbaf
commit fea9a6f919
4 changed files with 8 additions and 9 deletions
@@ -399,6 +399,11 @@ class Shadowsocks
def prepareStartService() {
showProgress(getString(R.string.connecting))
spawn {
if (!status.getBoolean(getVersionName, false)) {
status.edit.putBoolean(getVersionName, true).commit()
install()
}
if (isVpnEnabled) {
val intent = VpnService.prepare(this)
if (intent != null) {
@@ -476,13 +481,7 @@ class Shadowsocks
// Update the profile
if (!status.getBoolean(getVersionName, false)) {
val h = showProgress(getString(R.string.initializing))
status.edit.putBoolean(getVersionName, true).apply()
currentProfile = profileManager.create()
spawn {
install()
h.sendEmptyMessage(0)
}
}
// Initialize the profile