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
c7fc4095
Commit
c7fc4095
authored
Aug 16, 2016
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove compatibility code for Jelly Bean
parent
41d585ae
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
8 additions
and
36 deletions
+8
-36
src/main/res/values-ru/strings.xml
src/main/res/values-ru/strings.xml
+1
-2
src/main/res/values-zh-rCN/strings.xml
src/main/res/values-zh-rCN/strings.xml
+1
-2
src/main/res/values-zh/strings.xml
src/main/res/values-zh/strings.xml
+1
-2
src/main/res/values/strings.xml
src/main/res/values/strings.xml
+1
-2
src/main/res/xml/pref_all.xml
src/main/res/xml/pref_all.xml
+1
-1
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+0
-3
src/main/scala/com/github/shadowsocks/ShadowsocksSettings.scala
...in/scala/com/github/shadowsocks/ShadowsocksSettings.scala
+2
-4
src/main/scala/com/github/shadowsocks/utils/Utils.scala
src/main/scala/com/github/shadowsocks/utils/Utils.scala
+1
-20
No files found.
src/main/res/values-ru/strings.xml
View file @
c7fc4095
...
@@ -92,8 +92,7 @@
...
@@ -92,8 +92,7 @@
<string
name=
"share_message_nfc_disabled"
>
Сканировать QR код\nAndroid Beam отключен
</string>
<string
name=
"share_message_nfc_disabled"
>
Сканировать QR код\nAndroid Beam отключен
</string>
<string
name=
"turn_on_nfc"
>
Включить NFC
&
Android Beam
</string>
<string
name=
"turn_on_nfc"
>
Включить NFC
&
Android Beam
</string>
<string
name=
"flush_dnscache"
>
Очистить кэш DNS
</string>
<string
name=
"flush_dnscache"
>
Очистить кэш DNS
</string>
<string
name=
"flush_dnscache_summary"
>
Работает только в режиме NAT
</string>
<string
name=
"flush_dnscache_summary"
>
Работает только в режиме NAT. Требует наличия ROOT прав.
</string>
<string
name=
"flush_dnscache_summary_root"
>
Работает только в режиме NAT. Требует наличия ROOT прав.
</string>
<string
name=
"flush_dnscache_no_root"
>
Очистка кэша DNS не работает без налиичя ROOT прав
</string>
<string
name=
"flush_dnscache_no_root"
>
Очистка кэша DNS не работает без налиичя ROOT прав
</string>
<string
name=
"flushing"
>
Очистка
</string>
<string
name=
"flushing"
>
Очистка
</string>
<string
name=
"add_profile"
>
Добавить Профиль
</string>
<string
name=
"add_profile"
>
Добавить Профиль
</string>
...
...
src/main/res/values-zh-rCN/strings.xml
View file @
c7fc4095
...
@@ -58,8 +58,7 @@
...
@@ -58,8 +58,7 @@
<string
name=
"about"
>
关于
</string>
<string
name=
"about"
>
关于
</string>
<string
name=
"about_title"
>
影梭(shadowsocks)%s
</string>
<string
name=
"about_title"
>
影梭(shadowsocks)%s
</string>
<string
name=
"flush_dnscache"
>
刷新 DNS 缓存
</string>
<string
name=
"flush_dnscache"
>
刷新 DNS 缓存
</string>
<string
name=
"flush_dnscache_summary"
>
只需在 NAT 模式下使用
</string>
<string
name=
"flush_dnscache_summary"
>
只需在 NAT 模式下使用,需要 ROOT 权限
</string>
<string
name=
"flush_dnscache_summary_root"
>
只需在 NAT 模式下使用,需要 ROOT 权限
</string>
<string
name=
"flush_dnscache_no_root"
>
在没有 ROOT 权限的情况下无法刷新 DNS 缓存
</string>
<string
name=
"flush_dnscache_no_root"
>
在没有 ROOT 权限的情况下无法刷新 DNS 缓存
</string>
<string
name=
"flushing"
>
刷新中……
</string>
<string
name=
"flushing"
>
刷新中……
</string>
<string
name=
"share"
>
分享
</string>
<string
name=
"share"
>
分享
</string>
...
...
src/main/res/values-zh/strings.xml
View file @
c7fc4095
...
@@ -59,8 +59,7 @@
...
@@ -59,8 +59,7 @@
<string
name=
"about"
>
關於
</string>
<string
name=
"about"
>
關於
</string>
<string
name=
"about_title"
>
Shadowsocks %s
</string>
<string
name=
"about_title"
>
Shadowsocks %s
</string>
<string
name=
"flush_dnscache"
>
清除 DNS 快取
</string>
<string
name=
"flush_dnscache"
>
清除 DNS 快取
</string>
<string
name=
"flush_dnscache_summary"
>
僅在 NAT 模式可用
</string>
<string
name=
"flush_dnscache_summary"
>
僅在 NAT 模式可用,需要 ROOT 權限
</string>
<string
name=
"flush_dnscache_summary_root"
>
僅在 NAT 模式可用,需要 ROOT 權限
</string>
<string
name=
"flush_dnscache_no_root"
>
在無 ROOT 權限時清除 DNS 快取無法進行
</string>
<string
name=
"flush_dnscache_no_root"
>
在無 ROOT 權限時清除 DNS 快取無法進行
</string>
<string
name=
"flushing"
>
清除中……
</string>
<string
name=
"flushing"
>
清除中……
</string>
<string
name=
"share"
>
分享
</string>
<string
name=
"share"
>
分享
</string>
...
...
src/main/res/values/strings.xml
View file @
c7fc4095
...
@@ -98,8 +98,7 @@
...
@@ -98,8 +98,7 @@
<string
name=
"share_message_nfc_disabled"
>
Scan QR code\nAndroid Beam is disabled
</string>
<string
name=
"share_message_nfc_disabled"
>
Scan QR code\nAndroid Beam is disabled
</string>
<string
name=
"turn_on_nfc"
>
Turn on NFC
&
Android Beam
</string>
<string
name=
"turn_on_nfc"
>
Turn on NFC
&
Android Beam
</string>
<string
name=
"flush_dnscache"
>
Flush DNS cache
</string>
<string
name=
"flush_dnscache"
>
Flush DNS cache
</string>
<string
name=
"flush_dnscache_summary"
>
Only useful in NAT mode
</string>
<string
name=
"flush_dnscache_summary"
>
Only useful in NAT mode. Requires ROOT permission.
</string>
<string
name=
"flush_dnscache_summary_root"
>
Only useful in NAT mode. Requires ROOT permission.
</string>
<string
name=
"flush_dnscache_no_root"
>
Flush DNS cache cannot proceed without ROOT permission
</string>
<string
name=
"flush_dnscache_no_root"
>
Flush DNS cache cannot proceed without ROOT permission
</string>
<string
name=
"flushing"
>
Flushing
</string>
<string
name=
"flushing"
>
Flushing
</string>
<string
name=
"add_profile"
>
Add Profile
</string>
<string
name=
"add_profile"
>
Add Profile
</string>
...
...
src/main/res/xml/pref_all.xml
View file @
c7fc4095
...
@@ -117,7 +117,7 @@
...
@@ -117,7 +117,7 @@
android:summary=
"@string/recovery_summary"
/>
android:summary=
"@string/recovery_summary"
/>
<Preference
android:key=
"flush_dnscache"
<Preference
android:key=
"flush_dnscache"
android:title=
"@string/flush_dnscache"
android:title=
"@string/flush_dnscache"
android:summary=
"@string/flush_dnscache_summary
_root
"
/>
android:summary=
"@string/flush_dnscache_summary"
/>
<Preference
android:key=
"about"
android:title=
"@string/about"
/>
<Preference
android:key=
"about"
android:title=
"@string/about"
/>
</PreferenceCategory>
</PreferenceCategory>
...
...
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
c7fc4095
...
@@ -500,11 +500,8 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
...
@@ -500,11 +500,8 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
clearDialog
()
clearDialog
()
}
}
private
var
_isDestroyed
:
Boolean
=
_
override
def
isDestroyed
=
if
(
Build
.
VERSION
.
SDK_INT
>=
17
)
super
.
isDestroyed
else
_isDestroyed
override
def
onDestroy
()
{
override
def
onDestroy
()
{
super
.
onDestroy
()
super
.
onDestroy
()
_isDestroyed
=
true
detachService
()
detachService
()
new
BackupManager
(
this
).
dataChanged
()
new
BackupManager
(
this
).
dataChanged
()
handler
.
removeCallbacksAndMessages
(
null
)
handler
.
removeCallbacksAndMessages
(
null
)
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksSettings.scala
View file @
c7fc4095
...
@@ -5,7 +5,7 @@ import java.util.Locale
...
@@ -5,7 +5,7 @@ import java.util.Locale
import
android.content.SharedPreferences.OnSharedPreferenceChangeListener
import
android.content.SharedPreferences.OnSharedPreferenceChangeListener
import
android.content.
{
Intent
,
SharedPreferences
}
import
android.content.
{
Intent
,
SharedPreferences
}
import
android.net.Uri
import
android.net.Uri
import
android.os.
{
Build
,
Bundle
}
import
android.os.
Bundle
import
android.preference.
{
Preference
,
PreferenceFragment
,
SwitchPreference
}
import
android.preference.
{
Preference
,
PreferenceFragment
,
SwitchPreference
}
import
android.support.v7.app.AlertDialog
import
android.support.v7.app.AlertDialog
import
android.webkit.
{
WebView
,
WebViewClient
}
import
android.webkit.
{
WebView
,
WebViewClient
}
...
@@ -160,9 +160,7 @@ class ShadowsocksSettings extends PreferenceFragment with OnSharedPreferenceChan
...
@@ -160,9 +160,7 @@ class ShadowsocksSettings extends PreferenceFragment with OnSharedPreferenceChan
true
true
})
})
val
flush
=
findPreference
(
"flush_dnscache"
)
findPreference
(
"flush_dnscache"
).
setOnPreferenceClickListener
(
_
=>
{
if
(
Build
.
VERSION
.
SDK_INT
<
17
)
flush
.
setSummary
(
R
.
string
.
flush_dnscache_summary
)
flush
.
setOnPreferenceClickListener
(
_
=>
{
app
.
track
(
TAG
,
"flush_dnscache"
)
app
.
track
(
TAG
,
"flush_dnscache"
)
activity
.
flushDnsCache
()
activity
.
flushDnsCache
()
true
true
...
...
src/main/scala/com/github/shadowsocks/utils/Utils.scala
View file @
c7fc4095
...
@@ -46,7 +46,6 @@ import android.content.pm.PackageManager
...
@@ -46,7 +46,6 @@ import android.content.pm.PackageManager
import
android.content.
{
Context
,
Intent
}
import
android.content.
{
Context
,
Intent
}
import
android.graphics._
import
android.graphics._
import
android.os.Build
import
android.os.Build
import
android.provider.Settings
import
android.util.
{
Base64
,
DisplayMetrics
,
Log
}
import
android.util.
{
Base64
,
DisplayMetrics
,
Log
}
import
android.view.View.MeasureSpec
import
android.view.View.MeasureSpec
import
android.view.
{
Gravity
,
View
,
Window
}
import
android.view.
{
Gravity
,
View
,
Window
}
...
@@ -128,25 +127,7 @@ object Utils {
...
@@ -128,25 +127,7 @@ object Utils {
// Blocked > 3 seconds
// Blocked > 3 seconds
def
toggleAirplaneMode
(
context
:
Context
)
=
{
def
toggleAirplaneMode
(
context
:
Context
)
=
{
val
result
=
Shell
.
SU
.
run
(
FLUSH_DNS
)
val
result
=
Shell
.
SU
.
run
(
FLUSH_DNS
)
if
(
result
!=
null
&&
!
result
.
isEmpty
)
true
else
if
(
Build
.
VERSION
.
SDK_INT
<
17
)
{
result
!=
null
&&
!
result
.
isEmpty
toggleBelowApiLevel17
(
context
)
true
}
else
false
}
//noinspection ScalaDeprecation
private
def
toggleBelowApiLevel17
(
context
:
Context
)
{
// Android 4.2 below
Settings
.
System
.
putInt
(
context
.
getContentResolver
,
Settings
.
System
.
AIRPLANE_MODE_ON
,
1
)
val
enableIntent
=
new
Intent
(
Intent
.
ACTION_AIRPLANE_MODE_CHANGED
)
enableIntent
.
putExtra
(
"state"
,
true
)
context
.
sendBroadcast
(
enableIntent
)
Thread
.
sleep
(
3000
)
Settings
.
System
.
putInt
(
context
.
getContentResolver
,
Settings
.
System
.
AIRPLANE_MODE_ON
,
0
)
val
disableIntent
=
new
Intent
(
Intent
.
ACTION_AIRPLANE_MODE_CHANGED
)
disableIntent
.
putExtra
(
"state"
,
false
)
context
.
sendBroadcast
(
disableIntent
)
}
}
def
resolve
(
host
:
String
,
addrType
:
Int
)
:
Option
[
String
]
=
{
def
resolve
(
host
:
String
,
addrType
:
Int
)
:
Option
[
String
]
=
{
...
...
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