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
c92d66d9
Commit
c92d66d9
authored
Jul 12, 2016
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Refine #530 again and again" and probably fix #530
This reverts commit
b833cb62
.
parent
b833cb62
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
8 deletions
+7
-8
src/main/AndroidManifest.xml
src/main/AndroidManifest.xml
+0
-1
src/main/aidl/com/github/shadowsocks/aidl/IShadowsocksService.aidl
...aidl/com/github/shadowsocks/aidl/IShadowsocksService.aidl
+1
-0
src/main/scala/com/github/shadowsocks/BaseService.scala
src/main/scala/com/github/shadowsocks/BaseService.scala
+2
-0
src/main/scala/com/github/shadowsocks/ShadowsocksRunnerService.scala
...ala/com/github/shadowsocks/ShadowsocksRunnerService.scala
+4
-7
No files found.
src/main/AndroidManifest.xml
View file @
c92d66d9
...
...
@@ -118,7 +118,6 @@
<service
android:name=
".ShadowsocksRunnerService"
android:process=
":bg"
android:exported=
"false"
>
</service>
...
...
src/main/aidl/com/github/shadowsocks/aidl/IShadowsocksService.aidl
View file @
c92d66d9
...
...
@@ -9,4 +9,5 @@ interface IShadowsocksService {
oneway
void
unregisterCallback
(
IShadowsocksServiceCallback
cb
);
oneway
void
use
(
in
int
profileId
);
void
useSync
(
in
int
profileId
);
}
src/main/scala/com/github/shadowsocks/BaseService.scala
View file @
c92d66d9
...
...
@@ -114,6 +114,8 @@ trait BaseService extends Service {
case
_
=>
Log
.
w
(
BaseService
.
this
.
getClass
.
getSimpleName
,
"Illegal state when invoking use: "
+
state
)
}
})
override
def
useSync
(
profileId
:
Int
)
=
use
(
profileId
)
}
def
checkProfile
(
profile
:
Profile
)
=
if
(
TextUtils
.
isEmpty
(
profile
.
host
)
||
TextUtils
.
isEmpty
(
profile
.
password
))
{
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksRunnerService.scala
View file @
c92d66d9
...
...
@@ -54,17 +54,14 @@ class ShadowsocksRunnerService extends Service with ServiceBoundContext {
}
override
def
onServiceConnected
()
{
if
(
bgService
!=
null
)
{
handler
.
postDelayed
(()
=>
if
(
bgService
!=
null
)
{
if
(
app
.
isNatEnabled
)
startBackgroundService
()
else
if
(
VpnService
.
prepare
(
ShadowsocksRunnerService
.
this
)
==
null
)
startBackgroundService
()
}
handler
.
postDelayed
(()
=>
stopSelf
()
,
1000
)
stopSelf
()
}
,
1000
)
}
def
startBackgroundService
()
=
{
bgService
.
use
(
app
.
profileId
)
bgService
.
getState
// ensure the oneway call to use is finished
}
def
startBackgroundService
()
=
bgService
.
useSync
(
app
.
profileId
)
override
def
onCreate
()
{
super
.
onCreate
()
...
...
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