new gfw list
This commit is contained in:
@@ -313,6 +313,28 @@ class Shadowsocks extends UnifiedSherlockPreferenceActivity with CompoundButton.
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
|
||||
if (isServiceStarted) {
|
||||
switchButton.setChecked(true)
|
||||
if (ShadowVpnService.isServiceStarted) {
|
||||
val style = new Style.Builder()
|
||||
.setBackgroundColorValue(Style.holoBlueLight)
|
||||
.setDuration(Style.DURATION_INFINITE)
|
||||
.build()
|
||||
switchButton.setEnabled(false)
|
||||
Crouton.makeText(Shadowsocks.this, R.string.vpn_status, style).show()
|
||||
}
|
||||
} else {
|
||||
switchButton.setChecked(false)
|
||||
if (settings.getBoolean("isRunning", false)) {
|
||||
new Thread {
|
||||
override def run() {
|
||||
crash_recovery()
|
||||
handler.sendEmptyMessage(MSG_CRASH_RECOVER)
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override def onCreateOptionsMenu(menu: Menu): Boolean = {
|
||||
@@ -362,29 +384,6 @@ class Shadowsocks extends UnifiedSherlockPreferenceActivity with CompoundButton.
|
||||
protected override def onResume() {
|
||||
super.onResume()
|
||||
val settings: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)
|
||||
if (getIntent.getAction != Shadowsocks.REQUEST_CONNECT) {
|
||||
if (isServiceStarted) {
|
||||
switchButton.setChecked(true)
|
||||
if (ShadowVpnService.isServiceStarted) {
|
||||
val style = new Style.Builder()
|
||||
.setBackgroundColorValue(Style.holoBlueLight)
|
||||
.setDuration(Style.DURATION_INFINITE)
|
||||
.build()
|
||||
switchButton.setEnabled(false)
|
||||
Crouton.makeText(Shadowsocks.this, R.string.vpn_status, style).show()
|
||||
}
|
||||
} else {
|
||||
switchButton.setChecked(false)
|
||||
if (settings.getBoolean("isRunning", false)) {
|
||||
new Thread {
|
||||
override def run() {
|
||||
crash_recovery()
|
||||
handler.sendEmptyMessage(MSG_CRASH_RECOVER)
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
setPreferenceEnabled()
|
||||
switchButton.setOnCheckedChangeListener(this)
|
||||
PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this)
|
||||
|
||||
Reference in New Issue
Block a user