Skip to content

Commit acd89cc

Browse files
committed
refine VPN mode
1 parent 382af46 commit acd89cc

File tree

4 files changed

+0
-12
lines changed

4 files changed

+0
-12
lines changed

src/main/res/values-zh/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
<string name="forward_stop">后台服务已停止。</string>
4545
<string name="service_failed">请检查你的网络状态后并重试。</string>
4646
<string name="stop">停止服务</string>
47-
<string name="vpn_status">推荐通过通知栏关闭 VPN 服务</string>
4847
<string name="vpn_error">无法启动 VPN 服务:\"%s\"。看来和你的设备存在兼容性问题,请使用 Root 模式。</string>
4948
<string name="ok_iknow">确定</string>
5049
<string name="port_alert">端口号应大于1024</string>

src/main/res/values/strings.xml

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
<string name="forward_stop">Shadowsocks stopped.</string>
5858
<string name="service_failed">Please check your network status and try again.</string>
5959
<string name="stop">Stop the service</string>
60-
<string name="vpn_status">Recommend to disable the VPN service through the notification bar.</string>
6160
<string name="vpn_error">Unable to start VPN service: "%s". It seems to be a compatibility issue with your device. Please consider using ROOT mode instead.</string>
6261

6362
<!-- alert category -->

src/main/scala/com/github/shadowsocks/Shadowsocks.scala

-1
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,6 @@ class Shadowsocks
919919
if (isVpnEnabled) {
920920
val style = new Style.Builder().setBackgroundColorValue(Style.holoBlueLight).build()
921921
val config = new Configuration.Builder().setDuration(Configuration.DURATION_LONG).build()
922-
Crouton.makeText(Shadowsocks.this, R.string.vpn_status, style).setConfiguration(config).show()
923922
changeSwitch(checked = false)
924923
}
925924
true

src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala

-9
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,8 @@ class ShadowsocksVpnService extends VpnService with BaseService {
118118

119119
def startVpn() {
120120

121-
val openIntent = new Intent(this, classOf[Shadowsocks])
122-
openIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
123-
val configIntent = PendingIntent.getActivity(this, 0, openIntent, 0)
124-
125121
val builder = new Builder()
126122
builder
127-
.setConfigureIntent(configIntent)
128123
.setSession(config.profileName)
129124
.setMtu(VPN_MTU)
130125
.addAddress(PRIVATE_VLAN.format("1"), 24)
@@ -221,17 +216,13 @@ class ShadowsocksVpnService extends VpnService with BaseService {
221216
}
222217

223218
def notifyAlert(title: String, info: String) {
224-
val openIntent = new Intent(this, classOf[Shadowsocks])
225-
openIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
226-
val contentIntent = PendingIntent.getActivity(this, 0, openIntent, 0)
227219
val builder = new NotificationCompat.Builder(this)
228220
builder
229221
.setSmallIcon(R.drawable.ic_stat_shadowsocks)
230222
.setWhen(0)
231223
.setTicker(title)
232224
.setContentTitle(getString(R.string.app_name))
233225
.setContentText(info)
234-
.setContentIntent(contentIntent)
235226
.setAutoCancel(true)
236227
notificationManager.notify(1, builder.build)
237228
}

0 commit comments

Comments
 (0)