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
1e96a13a
Commit
1e96a13a
authored
Jan 31, 2017
by
Mygod
Committed by
Max Lv
Feb 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement SIP004
https://github.com/shadowsocks/shadowsocks-org/issues/30
parent
b71b27fb
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
27 additions
and
29 deletions
+27
-29
mobile/src/main/jni/Android.mk
mobile/src/main/jni/Android.mk
+12
-3
mobile/src/main/jni/shadowsocks-libev
mobile/src/main/jni/shadowsocks-libev
+1
-1
mobile/src/main/res/values/arrays.xml
mobile/src/main/res/values/arrays.xml
+6
-0
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+0
-2
mobile/src/main/res/xml/pref_profile.xml
mobile/src/main/res/xml/pref_profile.xml
+0
-4
mobile/src/main/scala/com/github/shadowsocks/BaseService.scala
...e/src/main/scala/com/github/shadowsocks/BaseService.scala
+0
-1
mobile/src/main/scala/com/github/shadowsocks/database/DBHelper.scala
...main/scala/com/github/shadowsocks/database/DBHelper.scala
+6
-9
mobile/src/main/scala/com/github/shadowsocks/database/Profile.scala
.../main/scala/com/github/shadowsocks/database/Profile.scala
+2
-7
mobile/src/main/scala/com/github/shadowsocks/utils/Constants.scala
...c/main/scala/com/github/shadowsocks/utils/Constants.scala
+0
-1
mobile/src/main/scala/com/github/shadowsocks/utils/Parser.scala
.../src/main/scala/com/github/shadowsocks/utils/Parser.scala
+0
-1
No files found.
mobile/src/main/jni/Android.mk
View file @
1e96a13a
...
...
@@ -26,6 +26,7 @@ include $(CLEAR_VARS)
SODIUM_SOURCE
:=
\
crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c
\
crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c
\
crypto_auth/crypto_auth.c
\
crypto_auth/hmacsha256/auth_hmacsha256_api.c
\
crypto_auth/hmacsha256/cp/hmac_hmacsha256.c
\
...
...
@@ -48,6 +49,7 @@ SODIUM_SOURCE := \
crypto_core/hsalsa20/core_hsalsa20_api.c
\
crypto_core/salsa20/ref/core_salsa20.c
\
crypto_core/salsa20/core_salsa20_api.c
\
crypto_core/hchacha20/core_hchacha20.c
\
crypto_generichash/crypto_generichash.c
\
crypto_generichash/blake2/generichash_blake2_api.c
\
crypto_generichash/blake2/ref/blake2-impl.h
\
...
...
@@ -120,6 +122,7 @@ SODIUM_SOURCE += \
crypto_scalarmult/curve25519/ref10/x25519_ref10.c
SODIUM_SOURCE
+=
\
crypto_pwhash/crypto_pwhash.c
\
crypto_pwhash/argon2/argon2-core.c
\
crypto_pwhash/argon2/argon2.c
\
crypto_pwhash/argon2/argon2-encoding.c
\
...
...
@@ -329,8 +332,10 @@ include $(BUILD_SHARED_EXECUTABLE)
include
$(CLEAR_VARS)
SHADOWSOCKS_SOURCES
:=
local.c cache.c udprelay.c encrypt.c
\
utils.c netutils.c json.c jconf.c acl.c http.c tls.c rule.c
\
SHADOWSOCKS_SOURCES
:=
local.c
\
cache.c udprelay.c utils.c netutils.c json.c jconf.c
\
acl.c http.c tls.c rule.c
\
crypto.c aead.c stream.c
\
plugin.c
\
android.c
...
...
@@ -364,7 +369,11 @@ include $(BUILD_SHARED_EXECUTABLE)
include
$(CLEAR_VARS)
SHADOWSOCKS_SOURCES
:=
tunnel.c cache.c udprelay.c encrypt.c utils.c netutils.c json.c jconf.c android.c plugin.c
SHADOWSOCKS_SOURCES
:=
tunnel.c
\
cache.c udprelay.c utils.c netutils.c json.c jconf.c
\
crypto.c aead.c stream.c
\
plugin.c
\
android.c
LOCAL_MODULE
:=
ss-tunnel
LOCAL_SRC_FILES
:=
$(
addprefix
shadowsocks-libev/src/,
$(SHADOWSOCKS_SOURCES)
)
...
...
shadowsocks-libev
@
c0030f0d
Subproject commit
1c2b6170b9ec5443d4a3e211425bc0d5f8e18119
Subproject commit
c0030f0d7d74d1197877e093366bbd2713296aaa
mobile/src/main/res/values/arrays.xml
View file @
1e96a13a
...
...
@@ -17,6 +17,9 @@
<item>
SALSA20
</item>
<item>
CHACHA20
</item>
<item>
CHACHA20-IETF
</item>
<item>
AES-128-GCM
</item>
<item>
AES-192-GCM
</item>
<item>
AES-256-GCM
</item>
</string-array>
<string-array
name=
"enc_method_value"
>
...
...
@@ -36,6 +39,9 @@
<item>
salsa20
</item>
<item>
chacha20
</item>
<item>
chacha20-ietf
</item>
<item>
aes-128-gcm
</item>
<item>
aes-192-gcm
</item>
<item>
aes-256-gcm
</item>
</string-array>
<string-array
name=
"route_entry"
>
...
...
mobile/src/main/res/values/strings.xml
View file @
1e96a13a
...
...
@@ -36,8 +36,6 @@
<!-- feature category -->
<string
name=
"ipv6"
>
IPv6 Route
</string>
<string
name=
"ipv6_summary"
>
Redirect IPv6 traffic to remote
</string>
<string
name=
"onetime_auth"
>
One-time Authentication
</string>
<string
name=
"onetime_auth_summary"
>
Enable one-time authentication
</string>
<string
name=
"route_list"
>
Route
</string>
<string
name=
"route_entry_all"
>
All
</string>
<string
name=
"route_entry_bypass_lan"
>
Bypass LAN
</string>
...
...
mobile/src/main/res/xml/pref_profile.xml
View file @
1e96a13a
...
...
@@ -36,10 +36,6 @@
android:entryValues=
"@array/enc_method_value"
android:summary=
"%s"
android:title=
"@string/enc_method"
/>
<SwitchPreference
android:key=
"isAuth"
android:summary=
"@string/onetime_auth_summary"
android:title=
"@string/onetime_auth"
/>
</be.mygod.preference.PreferenceCategory>
...
...
mobile/src/main/scala/com/github/shadowsocks/BaseService.scala
View file @
1e96a13a
...
...
@@ -325,7 +325,6 @@ trait BaseService extends Service {
.
put
(
"server_port"
,
profile
.
remotePort
)
.
put
(
"password"
,
profile
.
password
)
.
put
(
"method"
,
profile
.
method
)
if
(
profile
.
auth
)
config
.
put
(
"auth"
,
true
)
if
(
pluginPath
!=
null
)
config
.
put
(
"plugin"
,
Commandline
.
toString
(
buildPluginCommandLine
()))
.
put
(
"plugin_opts"
,
plugin
.
toString
)
...
...
mobile/src/main/scala/com/github/shadowsocks/database/DBHelper.scala
View file @
1e96a13a
...
...
@@ -77,9 +77,6 @@ class DBHelper(val context: Context)
}
else
if
(
oldVersion
<
19
)
{
profileDao
.
executeRawNoArgs
(
"UPDATE `profile` SET route = 'all' WHERE route IS NULL;"
)
}
if
(
oldVersion
<
10
)
{
profileDao
.
executeRawNoArgs
(
"ALTER TABLE `profile` ADD COLUMN auth SMALLINT;"
)
}
if
(
oldVersion
<
11
)
{
profileDao
.
executeRawNoArgs
(
"ALTER TABLE `profile` ADD COLUMN ipv6 SMALLINT;"
)
}
...
...
@@ -89,9 +86,9 @@ class DBHelper(val context: Context)
TableUtils
.
createTable
(
connectionSource
,
classOf
[
Profile
])
profileDao
.
executeRawNoArgs
(
"INSERT INTO `profile`(id, name, host, localPort, remotePort, password, method, route, proxyApps, bypass,"
+
" udpdns,
auth,
ipv6, individual) "
+
"SELECT id, name, host, localPort, remotePort, password, method, route, 1 - global, bypass, udpdns,
auth
,"
+
" i
pv6, i
ndividual FROM `tmp`;"
)
" udpdns, ipv6, individual) "
+
"SELECT id, name, host, localPort, remotePort, password, method, route, 1 - global, bypass, udpdns,
ipv6
,"
+
" individual FROM `tmp`;"
)
profileDao
.
executeRawNoArgs
(
"DROP TABLE `tmp`;"
)
profileDao
.
executeRawNoArgs
(
"COMMIT;"
)
}
else
if
(
oldVersion
<
13
)
{
...
...
@@ -127,10 +124,10 @@ class DBHelper(val context: Context)
profileDao
.
executeRawNoArgs
(
"ALTER TABLE `profile` RENAME TO `tmp`;"
)
TableUtils
.
createTable
(
connectionSource
,
classOf
[
Profile
])
profileDao
.
executeRawNoArgs
(
"INSERT INTO `profile`(id, name, host, localPort, remotePort, password, method, route, remoteDns,
proxyApps,
"
+
"
bypass, udpdns, auth
, ipv6, individual, tx, rx, date, userOrder, plugin) "
+
"INSERT INTO `profile`(id, name, host, localPort, remotePort, password, method, route, remoteDns, "
+
"
proxyApps, bypass, udpdns
, ipv6, individual, tx, rx, date, userOrder, plugin) "
+
"SELECT id, name, host, localPort, CASE WHEN kcp = 1 THEN kcpPort ELSE remotePort END, password, method, "
+
"route, remoteDns, proxyApps, bypass, udpdns,
auth,
ipv6, individual, tx, rx, date, userOrder, "
+
"route, remoteDns, proxyApps, bypass, udpdns, ipv6, individual, tx, rx, date, userOrder, "
+
"CASE WHEN kcp = 1 THEN 'kcptun ' || kcpcli ELSE NULL END FROM `tmp`;"
)
profileDao
.
executeRawNoArgs
(
"DROP TABLE `tmp`;"
)
profileDao
.
executeRawNoArgs
(
"COMMIT;"
)
...
...
mobile/src/main/scala/com/github/shadowsocks/database/Profile.scala
View file @
1e96a13a
...
...
@@ -68,9 +68,6 @@ class Profile {
@DatabaseField
var
udpdns
:
Boolean
=
_
@DatabaseField
var
auth
:
Boolean
=
_
@DatabaseField
var
ipv6
:
Boolean
=
_
...
...
@@ -96,8 +93,8 @@ class Profile {
def
nameIsEmpty
:
Boolean
=
name
==
null
||
name
.
isEmpty
def
getName
:
String
=
if
(
nameIsEmpty
)
formattedAddress
else
name
override
def
toString
:
String
=
"ss://"
+
Base64
.
encodeToString
(
"%s
%s
:%s@%s:%d"
.
formatLocal
(
Locale
.
ENGLISH
,
method
,
if
(
auth
)
"-auth"
else
""
,
password
,
host
,
remotePort
).
getBytes
,
Base64
.
NO_PADDING
|
Base64
.
NO_WRAP
)
+
override
def
toString
:
String
=
"ss://"
+
Base64
.
encodeToString
(
"%s:%s@%s:%d"
.
formatLocal
(
Locale
.
ENGLISH
,
method
,
password
,
host
,
remotePort
).
getBytes
,
Base64
.
NO_PADDING
|
Base64
.
NO_WRAP
)
+
(
if
(
TextUtils
.
isEmpty
(
name
))
""
else
'#'
+
URLEncoder
.
encode
(
name
,
"utf-8"
))
def
isMethodUnsafe
:
Boolean
=
"table"
.
equalsIgnoreCase
(
method
)
||
"rc4"
.
equalsIgnoreCase
(
method
)
...
...
@@ -114,7 +111,6 @@ class Profile {
.
putBoolean
(
Key
.
proxyApps
,
proxyApps
)
.
putBoolean
(
Key
.
bypass
,
bypass
)
.
putBoolean
(
Key
.
udpdns
,
udpdns
)
.
putBoolean
(
Key
.
auth
,
auth
)
.
putBoolean
(
Key
.
ipv6
,
ipv6
)
.
putString
(
Key
.
individual
,
individual
)
.
putString
(
Key
.
plugin
,
plugin
)
...
...
@@ -132,7 +128,6 @@ class Profile {
proxyApps
=
pref
.
getBoolean
(
Key
.
proxyApps
,
false
)
bypass
=
pref
.
getBoolean
(
Key
.
bypass
,
false
)
udpdns
=
pref
.
getBoolean
(
Key
.
udpdns
,
false
)
auth
=
pref
.
getBoolean
(
Key
.
auth
,
false
)
ipv6
=
pref
.
getBoolean
(
Key
.
ipv6
,
false
)
individual
=
pref
.
getString
(
Key
.
individual
,
null
)
plugin
=
pref
.
getString
(
Key
.
plugin
,
null
)
...
...
mobile/src/main/scala/com/github/shadowsocks/utils/Constants.scala
View file @
1e96a13a
...
...
@@ -141,7 +141,6 @@ object Key {
val
proxyApps
=
"isProxyApps"
val
bypass
=
"isBypassApps"
val
udpdns
=
"isUdpDns"
val
auth
=
"isAuth"
val
ipv6
=
"isIpv6"
val
host
=
"proxy"
...
...
mobile/src/main/scala/com/github/shadowsocks/utils/Parser.scala
View file @
1e96a13a
...
...
@@ -36,7 +36,6 @@ object Parser {
case
Some
(
ss
)
=>
val
profile
=
new
Profile
profile
.
method
=
ss
.
group
(
2
).
toLowerCase
if
(
ss
.
group
(
3
)
!=
null
)
profile
.
auth
=
true
profile
.
password
=
ss
.
group
(
4
)
profile
.
host
=
ss
.
group
(
5
)
profile
.
remotePort
=
ss
.
group
(
6
).
toInt
...
...
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