Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
1eda4c47
Commit
1eda4c47
authored
Nov 24, 2015
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed the switch for now
parent
c1730e4f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
9 additions
and
21 deletions
+9
-21
src/main/res/values-zh/strings.xml
src/main/res/values-zh/strings.xml
+0
-1
src/main/res/values/strings.xml
src/main/res/values/strings.xml
+0
-1
src/main/res/xml/pref_all.xml
src/main/res/xml/pref_all.xml
+0
-2
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+0
-1
src/main/scala/com/github/shadowsocks/ShadowsocksApplication.scala
...scala/com/github/shadowsocks/ShadowsocksApplication.scala
+0
-2
src/main/scala/com/github/shadowsocks/ShadowsocksNotification.scala
...cala/com/github/shadowsocks/ShadowsocksNotification.scala
+9
-13
src/main/scala/com/github/shadowsocks/utils/Constants.scala
src/main/scala/com/github/shadowsocks/utils/Constants.scala
+0
-1
No files found.
src/main/res/values-zh/strings.xml
View file @
1eda4c47
...
@@ -32,7 +32,6 @@
...
@@ -32,7 +32,6 @@
<string
name=
"bypass_apps_summary"
>
启用该选项,以使所选应用程序的流量不经过代理
</string>
<string
name=
"bypass_apps_summary"
>
启用该选项,以使所选应用程序的流量不经过代理
</string>
<string
name=
"auto_connect"
>
自动连接
</string>
<string
name=
"auto_connect"
>
自动连接
</string>
<string
name=
"auto_connect_summary"
>
随系统启动后台服务
</string>
<string
name=
"auto_connect_summary"
>
随系统启动后台服务
</string>
<string
name=
"notification_traffic"
>
在通知内显示当前上下行速率
</string>
<string
name=
"forward_success"
>
后台服务已开始运行。
</string>
<string
name=
"forward_success"
>
后台服务已开始运行。
</string>
<string
name=
"service_running"
>
影梭 → %s
</string>
<string
name=
"service_running"
>
影梭 → %s
</string>
<string
name=
"service_failed"
>
无法连接远程服务器
</string>
<string
name=
"service_failed"
>
无法连接远程服务器
</string>
...
...
src/main/res/values/strings.xml
View file @
1eda4c47
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
<string
name=
"nat_summary"
>
Use NAT mode instead of VPN mode
</string>
<string
name=
"nat_summary"
>
Use NAT mode instead of VPN mode
</string>
<string
name=
"nat_summary_no_root"
>
NAT mode is disabled without root
</string>
<string
name=
"nat_summary_no_root"
>
NAT mode is disabled without root
</string>
<string
name=
"stat"
>
Network Traffic
</string>
<string
name=
"stat"
>
Network Traffic
</string>
<string
name=
"notification_traffic"
>
Show traffic in notification
</string>
<string
name=
"stat_summary"
>
Sent: \t\t\t\t\t%3$s\t↑\t%1$s/s\nReceived: \t%4$s\t↓\t%2$s/s
</string>
<string
name=
"stat_summary"
>
Sent: \t\t\t\t\t%3$s\t↑\t%1$s/s\nReceived: \t%4$s\t↓\t%2$s/s
</string>
<string
name=
"stat_profiles"
>
\n%1$s↑\t%2$s↓
</string>
<string
name=
"stat_profiles"
>
\n%1$s↑\t%2$s↓
</string>
<string
name=
"traffic_summary"
>
%1$s/s↑\t%2$s/s↓
</string>
<string
name=
"traffic_summary"
>
%1$s/s↑\t%2$s/s↓
</string>
...
...
src/main/res/xml/pref_all.xml
View file @
1eda4c47
...
@@ -82,8 +82,6 @@
...
@@ -82,8 +82,6 @@
android:key=
"isAutoConnect"
android:key=
"isAutoConnect"
android:summary=
"@string/auto_connect_summary"
android:summary=
"@string/auto_connect_summary"
android:title=
"@string/auto_connect"
/>
android:title=
"@string/auto_connect"
/>
<SwitchPreference
android:key=
"notificationTraffic"
android:defaultValue=
"true"
android:title=
"@string/notification_traffic"
/>
<com.github.shadowsocks.preferences.NatSwitchPreference
android:key=
"isNAT"
<com.github.shadowsocks.preferences.NatSwitchPreference
android:key=
"isNAT"
android:title=
"@string/nat"
android:title=
"@string/nat"
...
...
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
1eda4c47
...
@@ -452,7 +452,6 @@ class Shadowsocks
...
@@ -452,7 +452,6 @@ class Shadowsocks
}
}
private
def
setPreferenceEnabled
(
enabled
:
Boolean
)
{
private
def
setPreferenceEnabled
(
enabled
:
Boolean
)
{
preferences
.
findPreference
(
Key
.
notificationTraffic
).
setEnabled
(
enabled
)
preferences
.
findPreference
(
Key
.
isNAT
).
setEnabled
(
enabled
)
preferences
.
findPreference
(
Key
.
isNAT
).
setEnabled
(
enabled
)
for
(
name
<-
Shadowsocks
.
PROXY_PREFS
)
{
for
(
name
<-
Shadowsocks
.
PROXY_PREFS
)
{
val
pref
=
preferences
.
findPreference
(
name
)
val
pref
=
preferences
.
findPreference
(
name
)
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksApplication.scala
View file @
1eda4c47
...
@@ -76,8 +76,6 @@ object ShadowsocksApplication {
...
@@ -76,8 +76,6 @@ object ShadowsocksApplication {
.
setLabel
(
getVersionName
)
.
setLabel
(
getVersionName
)
.
build
())
.
build
())
def
notificationTraffic
=
settings
.
getBoolean
(
Key
.
notificationTraffic
,
true
)
def
profileId
=
settings
.
getInt
(
Key
.
profileId
,
-
1
)
def
profileId
=
settings
.
getInt
(
Key
.
profileId
,
-
1
)
def
profileId
(
i
:
Int
)
=
settings
.
edit
.
putInt
(
Key
.
profileId
,
i
).
apply
def
profileId
(
i
:
Int
)
=
settings
.
edit
.
putInt
(
Key
.
profileId
,
i
).
apply
def
currentProfile
=
profileManager
.
getProfile
(
profileId
)
def
currentProfile
=
profileManager
.
getProfile
(
profileId
)
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksNotification.scala
View file @
1eda4c47
...
@@ -39,25 +39,21 @@ class ShadowsocksNotification(private val service: BaseService, profileName: Str
...
@@ -39,25 +39,21 @@ class ShadowsocksNotification(private val service: BaseService, profileName: Str
PendingIntent
.
getBroadcast
(
service
,
0
,
new
Intent
(
Action
.
CLOSE
),
0
))
PendingIntent
.
getBroadcast
(
service
,
0
,
new
Intent
(
Action
.
CLOSE
),
0
))
private
lazy
val
style
=
new
BigTextStyle
(
builder
)
private
lazy
val
style
=
new
BigTextStyle
(
builder
)
private
val
showOnUnlock
=
visible
&&
Utils
.
isLollipopOrAbove
private
val
showOnUnlock
=
visible
&&
Utils
.
isLollipopOrAbove
if
(
showOnUnlock
||
ShadowsocksApplication
.
notificationTraffic
)
{
update
()
update
()
lockReceiver
=
(
context
:
Context
,
intent
:
Intent
)
=>
update
(
intent
.
getAction
)
lockReceiver
=
(
context
:
Context
,
intent
:
Intent
)
=>
update
(
intent
.
getAction
)
val
screenFilter
=
new
IntentFilter
()
val
screenFilter
=
new
IntentFilter
()
screenFilter
.
addAction
(
Intent
.
ACTION_SCREEN_ON
)
screenFilter
.
addAction
(
Intent
.
ACTION_SCREEN_ON
)
screenFilter
.
addAction
(
Intent
.
ACTION_SCREEN_OFF
)
screenFilter
.
addAction
(
Intent
.
ACTION_SCREEN_OFF
)
if
(
showOnUnlock
)
screenFilter
.
addAction
(
Intent
.
ACTION_USER_PRESENT
)
screenFilter
.
addAction
(
Intent
.
ACTION_USER_PRESENT
)
service
.
registerReceiver
(
lockReceiver
,
screenFilter
)
service
.
registerReceiver
(
lockReceiver
,
screenFilter
)
}
else
setVisible
(
visible
).
show
()
def
update
(
action
:
String
=
Intent
.
ACTION_SCREEN_ON
)
=
if
(
service
.
getState
==
State
.
CONNECTED
)
{
def
update
(
action
:
String
=
Intent
.
ACTION_SCREEN_ON
)
=
if
(
service
.
getState
==
State
.
CONNECTED
)
{
if
(
action
==
Intent
.
ACTION_SCREEN_OFF
)
{
if
(
action
==
Intent
.
ACTION_SCREEN_OFF
)
{
if
(
showOnUnlock
)
setVisible
(
false
)
if
(
showOnUnlock
)
setVisible
(
false
)
unregisterCallback
// unregister callback to save battery
unregisterCallback
// unregister callback to save battery
}
else
if
(
action
==
Intent
.
ACTION_SCREEN_ON
)
{
}
else
if
(
action
==
Intent
.
ACTION_SCREEN_ON
)
{
if
(
ShadowsocksApplication
.
notificationTraffic
)
{
service
.
binder
.
registerCallback
(
callback
)
service
.
binder
.
registerCallback
(
callback
)
callbackRegistered
=
true
callbackRegistered
=
true
}
else
unregisterCallback
if
(!
keyGuard
.
inKeyguardRestrictedInputMode
)
setVisible
(
showOnUnlock
)
if
(!
keyGuard
.
inKeyguardRestrictedInputMode
)
setVisible
(
showOnUnlock
)
}
else
if
(
action
==
Intent
.
ACTION_USER_PRESENT
)
setVisible
(
showOnUnlock
)
}
else
if
(
action
==
Intent
.
ACTION_USER_PRESENT
)
setVisible
(
showOnUnlock
)
show
()
show
()
...
...
src/main/scala/com/github/shadowsocks/utils/Constants.scala
View file @
1eda4c47
...
@@ -68,7 +68,6 @@ object Key {
...
@@ -68,7 +68,6 @@ object Key {
val
profiles
=
"profiles"
val
profiles
=
"profiles"
val
isNAT
=
"isNAT"
val
isNAT
=
"isNAT"
val
route
=
"route"
val
route
=
"route"
val
notificationTraffic
=
"notificationTraffic"
val
stat
=
"stat"
val
stat
=
"stat"
val
isRunning
=
"isRunning"
val
isRunning
=
"isRunning"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment