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
24c1497a
Commit
24c1497a
authored
Nov 19, 2015
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flashing
parent
5e1f5cd4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
19 deletions
+19
-19
src/main/scala/com/github/shadowsocks/BaseService.scala
src/main/scala/com/github/shadowsocks/BaseService.scala
+3
-5
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+6
-4
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
.../scala/com/github/shadowsocks/ShadowsocksNatService.scala
+4
-4
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
.../scala/com/github/shadowsocks/ShadowsocksVpnService.scala
+4
-4
src/main/scala/com/github/shadowsocks/utils/TrafficMonitor.scala
...n/scala/com/github/shadowsocks/utils/TrafficMonitor.scala
+1
-1
src/main/scala/com/github/shadowsocks/utils/TrafficMonitorThread.scala
...a/com/github/shadowsocks/utils/TrafficMonitorThread.scala
+1
-1
No files found.
src/main/scala/com/github/shadowsocks/BaseService.scala
View file @
24c1497a
...
...
@@ -39,8 +39,6 @@
package
com.github.shadowsocks
import
java.util.Locale
import
android.app.Notification
import
android.content.Context
import
android.os.
{
Handler
,
RemoteCallbackList
}
...
...
@@ -96,7 +94,7 @@ trait BaseService {
}
def
startRunner
(
config
:
Config
)
{
this
.
config
=
config
;
this
.
config
=
config
TrafficMonitor
.
reset
()
trafficMonitorThread
=
new
TrafficMonitorThread
(
this
)
...
...
@@ -129,7 +127,7 @@ trait BaseService {
handler
.
post
(()
=>
{
if
(
callbackCount
>
0
)
{
val
n
=
callbacks
.
beginBroadcast
()
for
(
i
<-
0
to
n
-
1
)
{
for
(
i
<-
0
until
n
)
{
try
{
callbacks
.
getBroadcastItem
(
i
).
trafficUpdated
(
txRate
,
rxRate
,
txTotal
,
rxTotal
)
}
catch
{
...
...
@@ -146,7 +144,7 @@ trait BaseService {
handler
.
post
(()
=>
if
(
state
!=
s
)
{
if
(
callbackCount
>
0
)
{
val
n
=
callbacks
.
beginBroadcast
()
for
(
i
<-
0
to
n
-
1
)
{
for
(
i
<-
0
until
n
)
{
try
{
callbacks
.
getBroadcastItem
(
i
).
stateChanged
(
s
,
msg
)
}
catch
{
...
...
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
24c1497a
...
...
@@ -40,7 +40,7 @@ package com.github.shadowsocks
import
java.io.
{
FileOutputStream
,
IOException
,
InputStream
,
OutputStream
}
import
java.util
import
java.util.
{
Locale
,
Timer
,
TimerTask
}
import
java.util.
Locale
import
android.app.backup.BackupManager
import
android.app.
{
Activity
,
ProgressDialog
}
...
...
@@ -55,7 +55,7 @@ import android.support.v4.content.ContextCompat
import
android.support.v7.app.AppCompatActivity
import
android.support.v7.widget.Toolbar
import
android.util.Log
import
android.view.
{
View
Group
,
View
,
ViewParent
}
import
android.view.
{
View
,
ViewGroup
,
ViewParent
}
import
android.widget._
import
com.github.jorgecastilloprz.FABProgressCircle
import
com.github.shadowsocks.aidl.
{
IShadowsocksService
,
IShadowsocksServiceCallback
}
...
...
@@ -73,8 +73,7 @@ object Typefaces {
cache
synchronized
{
if
(!
cache
.
containsKey
(
assetPath
))
{
try
{
val
t
:
Typeface
=
Typeface
.
createFromAsset
(
c
.
getAssets
,
assetPath
)
cache
.
put
(
assetPath
,
t
)
cache
.
put
(
assetPath
,
Typeface
.
createFromAsset
(
c
.
getAssets
,
assetPath
))
}
catch
{
case
e
:
Exception
=>
Log
.
e
(
TAG
,
"Could not get typeface '"
+
assetPath
+
"' because "
+
e
.
getMessage
)
...
...
@@ -471,6 +470,9 @@ class Shadowsocks
// Check if current profile changed
if
(
ShadowsocksApplication
.
profileId
!=
currentProfile
.
id
)
reloadProfile
()
callback
.
trafficUpdated
(
TrafficMonitor
.
getTxRate
,
TrafficMonitor
.
getRxRate
,
TrafficMonitor
.
getTxTotal
,
TrafficMonitor
.
getRxTotal
)
}
private
def
setPreferenceEnabled
(
enabled
:
Boolean
)
{
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksNatService.scala
View file @
24c1497a
...
...
@@ -74,10 +74,10 @@ class ShadowsocksNatService extends Service with BaseService {
var
apps
:
Array
[
ProxiedApp
]
=
null
val
myUid
=
Process
.
myUid
()
var
sslocalPid
:
Int
=
0
;
var
sstunnelPid
:
Int
=
0
;
var
redsocksPid
:
Int
=
0
;
var
pdnsdPid
:
Int
=
0
;
var
sslocalPid
:
Int
=
0
var
sstunnelPid
:
Int
=
0
var
redsocksPid
:
Int
=
0
var
pdnsdPid
:
Int
=
0
private
val
dnsAddressCache
=
new
SparseArray
[
String
]
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksVpnService.scala
View file @
24c1497a
...
...
@@ -70,10 +70,10 @@ class ShadowsocksVpnService extends VpnService with BaseService {
var
vpnThread
:
ShadowsocksVpnThread
=
null
var
closeReceiver
:
BroadcastReceiver
=
null
var
sslocalPid
:
Int
=
0
;
var
sstunnelPid
:
Int
=
0
;
var
tun2socksPid
:
Int
=
0
;
var
pdnsdPid
:
Int
=
0
;
var
sslocalPid
:
Int
=
0
var
sstunnelPid
:
Int
=
0
var
tun2socksPid
:
Int
=
0
var
pdnsdPid
:
Int
=
0
def
isByass
(
net
:
SubnetUtils
)
:
Boolean
=
{
val
info
=
net
.
getInfo
...
...
src/main/scala/com/github/shadowsocks/utils/TrafficMonitor.scala
View file @
24c1497a
package
com.github.shadowsocks.utils
import
java.lang.
{
Math
,
System
}
import
java.lang.
System
import
java.text.DecimalFormat
import
com.github.shadowsocks.
{
R
,
ShadowsocksApplication
}
...
...
src/main/scala/com/github/shadowsocks/utils/TrafficMonitorThread.scala
View file @
24c1497a
...
...
@@ -39,7 +39,7 @@
package
com.github.shadowsocks.utils
import
java.io.
{
File
,
FileDescriptor
,
IOException
}
import
java.io.
{
File
,
IOException
}
import
java.util.concurrent.Executors
import
android.net.
{
LocalServerSocket
,
LocalSocket
,
LocalSocketAddress
}
...
...
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