new gfw list

This commit is contained in:
Max Lv
2013-05-06 13:32:45 +08:00
parent 9296f7c609
commit 9f2052e19b
4 changed files with 930 additions and 74 deletions
@@ -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)