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
9cf8c4c4
Commit
9cf8c4c4
authored
Jan 11, 2016
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop the broken support of autostart below Lolipop
Close #525
parent
bfbbb90a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
12 deletions
+4
-12
src/main/scala/com/github/shadowsocks/ShadowsocksRunnerActivity.scala
...la/com/github/shadowsocks/ShadowsocksRunnerActivity.scala
+1
-2
src/main/scala/com/github/shadowsocks/utils/Utils.scala
src/main/scala/com/github/shadowsocks/utils/Utils.scala
+3
-10
No files found.
src/main/scala/com/github/shadowsocks/ShadowsocksRunnerActivity.scala
View file @
9cf8c4c4
...
...
@@ -43,11 +43,10 @@ import android.app.{Activity, KeyguardManager}
import
android.content.
{
Intent
,
IntentFilter
,
Context
,
BroadcastReceiver
}
import
android.net.VpnService
import
android.os.
{
Bundle
,
Handler
}
import
android.support.v7.app.AppCompatActivity
import
android.util.Log
import
com.github.shadowsocks.utils.ConfigUtils
class
ShadowsocksRunnerActivity
extends
A
ppCompatA
ctivity
with
ServiceBoundContext
{
class
ShadowsocksRunnerActivity
extends
Activity
with
ServiceBoundContext
{
val
handler
=
new
Handler
()
// Variables
...
...
src/main/scala/com/github/shadowsocks/utils/Utils.scala
View file @
9cf8c4c4
...
...
@@ -55,7 +55,7 @@ import android.util.{DisplayMetrics, Base64, Log}
import
android.view.View.MeasureSpec
import
android.view.
{
Gravity
,
View
,
Window
}
import
android.widget.Toast
import
com.github.shadowsocks.
{
ShadowsocksRunner
Activity
,
ShadowsocksRunner
Service
,
ShadowsocksApplication
,
BuildConfig
}
import
com.github.shadowsocks.
{
ShadowsocksRunnerService
,
ShadowsocksApplication
,
BuildConfig
}
import
org.xbill.DNS._
...
...
@@ -405,15 +405,8 @@ object Utils {
val
isInstalled
:
Boolean
=
ShadowsocksApplication
.
settings
.
getBoolean
(
ShadowsocksApplication
.
getVersionName
,
false
)
if
(!
isInstalled
)
return
if
(
Utils
.
isLollipopOrAbove
)
{
val
intent
=
new
Intent
(
context
,
classOf
[
ShadowsocksRunnerService
])
context
.
startService
(
intent
)
}
else
{
val
intent
=
new
Intent
(
context
,
classOf
[
ShadowsocksRunnerActivity
])
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
)
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TOP
)
context
.
startActivity
(
intent
)
}
val
intent
=
new
Intent
(
context
,
classOf
[
ShadowsocksRunnerService
])
context
.
startService
(
intent
)
}
def
stopSsService
(
context
:
Context
)
:
Unit
=
{
...
...
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