Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c920c0daa4 | ||
|
|
8e3854b496 | ||
|
|
ad42167b2e | ||
|
|
3bf0963c5a | ||
|
|
c3315d35ed | ||
|
|
103dc10a0a | ||
|
|
36c94b8d83 | ||
|
|
df72b29302 | ||
|
|
11d827c6ba | ||
|
|
dc46cd971a | ||
|
|
876e92f275 | ||
|
|
41747c976b | ||
|
|
8277b07d24 | ||
|
|
b982867130 | ||
|
|
491710679a | ||
|
|
24c6aca85c | ||
|
|
293e9b5dff | ||
|
|
3ac77e1f8d | ||
|
|
fd2c67d0b8 | ||
|
|
684698c8e4 | ||
|
|
6a02d4b985 | ||
|
|
7219ce429c | ||
|
|
caf5731ff6 | ||
|
|
437d8c3026 | ||
|
|
44b47e6cd3 |
+6
-6
@@ -2,8 +2,8 @@ enablePlugins(AndroidApp)
|
|||||||
android.useSupportVectors
|
android.useSupportVectors
|
||||||
|
|
||||||
name := "shadowsocks"
|
name := "shadowsocks"
|
||||||
version := "4.0.1"
|
version := "4.0.4"
|
||||||
versionCode := Some(176)
|
versionCode := Some(179)
|
||||||
|
|
||||||
proguardOptions ++=
|
proguardOptions ++=
|
||||||
"-keep class com.github.shadowsocks.JniHelper { *; }" ::
|
"-keep class com.github.shadowsocks.JniHelper { *; }" ::
|
||||||
@@ -15,21 +15,21 @@ proguardOptions ++=
|
|||||||
|
|
||||||
resConfigs := Seq("ja", "ru", "zh-rCN", "zh-rTW")
|
resConfigs := Seq("ja", "ru", "zh-rCN", "zh-rTW")
|
||||||
|
|
||||||
val playServicesVersion = "10.0.1"
|
val playServicesVersion = "10.2.0"
|
||||||
resolvers += Resolver.jcenterRepo
|
resolvers += Resolver.jcenterRepo
|
||||||
libraryDependencies ++=
|
libraryDependencies ++=
|
||||||
"com.futuremind.recyclerfastscroll" % "fastscroll" % "0.2.5" ::
|
"com.futuremind.recyclerfastscroll" % "fastscroll" % "0.2.5" ::
|
||||||
"com.evernote" % "android-job" % "1.1.5" ::
|
"com.evernote" % "android-job" % "1.1.6" ::
|
||||||
"com.github.jorgecastilloprz" % "fabprogresscircle" % "1.01" ::
|
"com.github.jorgecastilloprz" % "fabprogresscircle" % "1.01" ::
|
||||||
"com.google.android.gms" % "play-services-ads" % playServicesVersion ::
|
"com.google.android.gms" % "play-services-ads" % playServicesVersion ::
|
||||||
"com.google.android.gms" % "play-services-analytics" % playServicesVersion ::
|
"com.google.android.gms" % "play-services-analytics" % playServicesVersion ::
|
||||||
"com.google.android.gms" % "play-services-gcm" % playServicesVersion ::
|
"com.google.android.gms" % "play-services-gcm" % playServicesVersion ::
|
||||||
"com.j256.ormlite" % "ormlite-android" % "5.0" ::
|
"com.j256.ormlite" % "ormlite-android" % "5.0" ::
|
||||||
"com.mikepenz" % "crossfader" % "1.5.0" ::
|
"com.mikepenz" % "crossfader" % "1.5.0" ::
|
||||||
"com.mikepenz" % "fastadapter" % "2.1.6" ::
|
"com.mikepenz" % "fastadapter" % "2.1.7" ::
|
||||||
"com.mikepenz" % "iconics-core" % "2.8.2" ::
|
"com.mikepenz" % "iconics-core" % "2.8.2" ::
|
||||||
"com.mikepenz" % "materialdrawer" % "5.8.1" ::
|
"com.mikepenz" % "materialdrawer" % "5.8.1" ::
|
||||||
"com.mikepenz" % "materialize" % "1.0.0" ::
|
"com.mikepenz" % "materialize" % "1.0.1" ::
|
||||||
"com.squareup.okhttp3" % "okhttp" % "3.6.0" ::
|
"com.squareup.okhttp3" % "okhttp" % "3.6.0" ::
|
||||||
"com.twofortyfouram" % "android-plugin-api-for-locale" % "1.0.2" ::
|
"com.twofortyfouram" % "android-plugin-api-for-locale" % "1.0.2" ::
|
||||||
"dnsjava" % "dnsjava" % "2.1.8" ::
|
"dnsjava" % "dnsjava" % "2.1.8" ::
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ img {
|
|||||||
<body>
|
<body>
|
||||||
<p>A <a href="http://shadowsocks.org">Shadowsocks</a> client for Android, written in Scala.</p>
|
<p>A <a href="http://shadowsocks.org">Shadowsocks</a> client for Android, written in Scala.</p>
|
||||||
<p>Copyright (C) 2017 by Max Lv <a href="mailto:max.c.lv@gmail.com">max.c.lv@gmail.com</a></p>
|
<p>Copyright (C) 2017 by Max Lv <a href="mailto:max.c.lv@gmail.com">max.c.lv@gmail.com</a></p>
|
||||||
<p>Copyright (C) 2017 by Mygod Studio <a href="contact-shadowsocks-android@mygod.be">contact-shadowsocks-android@mygod.be</a></p>
|
<p>Copyright (C) 2017 by Mygod Studio <a href="mailto:contact-shadowsocks-android@mygod.be">contact-shadowsocks-android@mygod.be</a></p>
|
||||||
<p>This program is free software: you can redistribute it and/or modify
|
<p>This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
|||||||
@@ -117,6 +117,22 @@ LOCAL_SRC_FILES := $(addprefix libancillary/, $(ANCILLARY_SOURCE))
|
|||||||
|
|
||||||
include $(BUILD_STATIC_LIBRARY)
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
########################################################
|
||||||
|
## libbloom
|
||||||
|
########################################################
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
BLOOM_SOURCE := bloom.c murmur2/MurmurHash2.c
|
||||||
|
|
||||||
|
LOCAL_MODULE := libbloom
|
||||||
|
LOCAL_CFLAGS += -O2 -I$(LOCAL_PATH)/shadowsocks-libev/libbloom \
|
||||||
|
-I$(LOCAL_PATH)/shadowsocks-libev/libbloom/murmur2
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/libbloom/, $(BLOOM_SOURCE))
|
||||||
|
|
||||||
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
## libipset
|
## libipset
|
||||||
########################################################
|
########################################################
|
||||||
@@ -250,7 +266,7 @@ SHADOWSOCKS_SOURCES := local.c \
|
|||||||
cache.c udprelay.c utils.c netutils.c json.c jconf.c \
|
cache.c udprelay.c utils.c netutils.c json.c jconf.c \
|
||||||
acl.c http.c tls.c rule.c \
|
acl.c http.c tls.c rule.c \
|
||||||
crypto.c aead.c stream.c base64.c \
|
crypto.c aead.c stream.c base64.c \
|
||||||
plugin.c \
|
plugin.c ppbloom.c \
|
||||||
android.c
|
android.c
|
||||||
|
|
||||||
LOCAL_MODULE := ss-local
|
LOCAL_MODULE := ss-local
|
||||||
@@ -264,13 +280,14 @@ LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_LOCAL \
|
|||||||
-I$(LOCAL_PATH)/mbedtls/include \
|
-I$(LOCAL_PATH)/mbedtls/include \
|
||||||
-I$(LOCAL_PATH)/pcre \
|
-I$(LOCAL_PATH)/pcre \
|
||||||
-I$(LOCAL_PATH)/libudns \
|
-I$(LOCAL_PATH)/libudns \
|
||||||
-I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \
|
|
||||||
-I$(LOCAL_PATH)/libsodium/src/libsodium/include \
|
-I$(LOCAL_PATH)/libsodium/src/libsodium/include \
|
||||||
-I$(LOCAL_PATH)/libsodium/src/libsodium/include/sodium \
|
-I$(LOCAL_PATH)/libsodium/src/libsodium/include/sodium \
|
||||||
|
-I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \
|
||||||
-I$(LOCAL_PATH)/shadowsocks-libev/libipset/include \
|
-I$(LOCAL_PATH)/shadowsocks-libev/libipset/include \
|
||||||
|
-I$(LOCAL_PATH)/shadowsocks-libev/libbloom \
|
||||||
-I$(LOCAL_PATH)/libev
|
-I$(LOCAL_PATH)/libev
|
||||||
|
|
||||||
LOCAL_STATIC_LIBRARIES := libev libmbedtls libipset libcork libudns \
|
LOCAL_STATIC_LIBRARIES := libev libmbedtls libipset libcork libbloom libudns \
|
||||||
libsodium libancillary libpcre
|
libsodium libancillary libpcre
|
||||||
|
|
||||||
LOCAL_LDLIBS := -llog
|
LOCAL_LDLIBS := -llog
|
||||||
@@ -286,7 +303,7 @@ include $(CLEAR_VARS)
|
|||||||
SHADOWSOCKS_SOURCES := tunnel.c \
|
SHADOWSOCKS_SOURCES := tunnel.c \
|
||||||
cache.c udprelay.c utils.c netutils.c json.c jconf.c \
|
cache.c udprelay.c utils.c netutils.c json.c jconf.c \
|
||||||
crypto.c aead.c stream.c base64.c \
|
crypto.c aead.c stream.c base64.c \
|
||||||
plugin.c \
|
plugin.c ppbloom.c \
|
||||||
android.c
|
android.c
|
||||||
|
|
||||||
LOCAL_MODULE := ss-tunnel
|
LOCAL_MODULE := ss-tunnel
|
||||||
@@ -297,14 +314,15 @@ LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_TUNNEL \
|
|||||||
-I$(LOCAL_PATH)/libancillary \
|
-I$(LOCAL_PATH)/libancillary \
|
||||||
-I$(LOCAL_PATH)/include \
|
-I$(LOCAL_PATH)/include \
|
||||||
-I$(LOCAL_PATH)/libudns \
|
-I$(LOCAL_PATH)/libudns \
|
||||||
-I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \
|
|
||||||
-I$(LOCAL_PATH)/libsodium/src/libsodium/include \
|
-I$(LOCAL_PATH)/libsodium/src/libsodium/include \
|
||||||
-I$(LOCAL_PATH)/libsodium/src/libsodium/include/sodium \
|
-I$(LOCAL_PATH)/libsodium/src/libsodium/include/sodium \
|
||||||
-I$(LOCAL_PATH)/mbedtls/include \
|
-I$(LOCAL_PATH)/mbedtls/include \
|
||||||
-I$(LOCAL_PATH)/libev \
|
-I$(LOCAL_PATH)/libev \
|
||||||
|
-I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \
|
||||||
|
-I$(LOCAL_PATH)/shadowsocks-libev/libbloom \
|
||||||
-I$(LOCAL_PATH)/include/shadowsocks-libev
|
-I$(LOCAL_PATH)/include/shadowsocks-libev
|
||||||
|
|
||||||
LOCAL_STATIC_LIBRARIES := libev libmbedtls libsodium libcork libudns libancillary
|
LOCAL_STATIC_LIBRARIES := libev libmbedtls libsodium libcork libbloom libudns libancillary
|
||||||
|
|
||||||
LOCAL_LDLIBS := -llog
|
LOCAL_LDLIBS := -llog
|
||||||
|
|
||||||
|
|||||||
Submodule mobile/src/main/jni/shadowsocks-libev updated: f4b1641636...857bb8def7
@@ -84,11 +84,6 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe
|
|||||||
private var txRateText: TextView = _
|
private var txRateText: TextView = _
|
||||||
private var rxRateText: TextView = _
|
private var rxRateText: TextView = _
|
||||||
|
|
||||||
private var currentFragment: ToolbarFragment = _
|
|
||||||
private lazy val profilesFragment = new ProfilesFragment()
|
|
||||||
private lazy val customRulesFragment = new CustomRulesFragment()
|
|
||||||
private lazy val globalSettingsFragment = new GlobalSettingsFragment()
|
|
||||||
private lazy val aboutFragment = new AboutFragment()
|
|
||||||
private lazy val customTabsIntent = new CustomTabsIntent.Builder()
|
private lazy val customTabsIntent = new CustomTabsIntent.Builder()
|
||||||
.setToolbarColor(ContextCompat.getColor(this, R.color.material_primary_500))
|
.setToolbarColor(ContextCompat.getColor(this, R.color.material_primary_500))
|
||||||
.build()
|
.build()
|
||||||
@@ -255,7 +250,7 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe
|
|||||||
val tf = Typefaces.get(this, "fonts/Iceland.ttf")
|
val tf = Typefaces.get(this, "fonts/Iceland.ttf")
|
||||||
if (tf != null) title.setTypeface(tf)
|
if (tf != null) title.setTypeface(tf)
|
||||||
|
|
||||||
if (savedInstanceState == null) displayFragment(profilesFragment)
|
if (savedInstanceState == null) displayFragment(new ProfilesFragment)
|
||||||
statusText = findViewById(R.id.status).asInstanceOf[TextView]
|
statusText = findViewById(R.id.status).asInstanceOf[TextView]
|
||||||
txText = findViewById(R.id.tx).asInstanceOf[TextView]
|
txText = findViewById(R.id.tx).asInstanceOf[TextView]
|
||||||
txRateText = findViewById(R.id.txRate).asInstanceOf[TextView]
|
txRateText = findViewById(R.id.txRate).asInstanceOf[TextView]
|
||||||
@@ -364,14 +359,13 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe
|
|||||||
}
|
}
|
||||||
|
|
||||||
private def displayFragment(fragment: ToolbarFragment) {
|
private def displayFragment(fragment: ToolbarFragment) {
|
||||||
currentFragment = fragment
|
|
||||||
getFragmentManager.beginTransaction().replace(R.id.fragment_holder, fragment).commitAllowingStateLoss()
|
getFragmentManager.beginTransaction().replace(R.id.fragment_holder, fragment).commitAllowingStateLoss()
|
||||||
drawer.closeDrawer()
|
drawer.closeDrawer()
|
||||||
}
|
}
|
||||||
|
|
||||||
override def onItemClick(view: View, position: Int, drawerItem: IDrawerItem[_, _ <: ViewHolder]): Boolean = {
|
override def onItemClick(view: View, position: Int, drawerItem: IDrawerItem[_, _ <: ViewHolder]): Boolean = {
|
||||||
drawerItem.getIdentifier match {
|
drawerItem.getIdentifier match {
|
||||||
case DRAWER_PROFILES => displayFragment(profilesFragment)
|
case DRAWER_PROFILES => displayFragment(new ProfilesFragment)
|
||||||
case DRAWER_RECOVERY =>
|
case DRAWER_RECOVERY =>
|
||||||
app.track("GlobalConfigFragment", "reset")
|
app.track("GlobalConfigFragment", "reset")
|
||||||
if (bgService != null) bgService.use(-1)
|
if (bgService != null) bgService.use(-1)
|
||||||
@@ -384,12 +378,12 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe
|
|||||||
app.copyAssets()
|
app.copyAssets()
|
||||||
handler.sendEmptyMessage(0)
|
handler.sendEmptyMessage(0)
|
||||||
}
|
}
|
||||||
case DRAWER_GLOBAL_SETTINGS => displayFragment(globalSettingsFragment)
|
case DRAWER_GLOBAL_SETTINGS => displayFragment(new GlobalSettingsFragment)
|
||||||
case DRAWER_ABOUT =>
|
case DRAWER_ABOUT =>
|
||||||
app.track(TAG, "about")
|
app.track(TAG, "about")
|
||||||
displayFragment(aboutFragment)
|
displayFragment(new AboutFragment)
|
||||||
case DRAWER_FAQ => launchUrl(getString(R.string.faq_url))
|
case DRAWER_FAQ => launchUrl(getString(R.string.faq_url))
|
||||||
case DRAWER_CUSTOM_RULES => displayFragment(customRulesFragment)
|
case DRAWER_CUSTOM_RULES => displayFragment(new CustomRulesFragment)
|
||||||
}
|
}
|
||||||
true // unexpected cases will throw exception
|
true // unexpected cases will throw exception
|
||||||
}
|
}
|
||||||
@@ -408,12 +402,14 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe
|
|||||||
setListeningForBandwidth(true)
|
setListeningForBandwidth(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
override def onBackPressed(): Unit =
|
override def onBackPressed(): Unit = if (drawer.isDrawerOpen) drawer.closeDrawer() else {
|
||||||
if (drawer.isDrawerOpen) drawer.closeDrawer() else if (!currentFragment.onBackPressed())
|
val currentFragment = getFragmentManager.findFragmentById(R.id.fragment_holder).asInstanceOf[ToolbarFragment]
|
||||||
if (currentFragment != profilesFragment) {
|
if (!currentFragment.onBackPressed())
|
||||||
displayFragment(profilesFragment)
|
if (currentFragment.isInstanceOf[ProfilesFragment]) super.onBackPressed() else {
|
||||||
|
displayFragment(new ProfilesFragment)
|
||||||
drawer.setSelection(DRAWER_PROFILES)
|
drawer.setSelection(DRAWER_PROFILES)
|
||||||
} else super.onBackPressed()
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override def onStop() {
|
override def onStop() {
|
||||||
setListeningForBandwidth(false)
|
setListeningForBandwidth(false)
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class ShadowsocksNatService extends BaseService {
|
|||||||
"-t", "10",
|
"-t", "10",
|
||||||
"-b", "127.0.0.1",
|
"-b", "127.0.0.1",
|
||||||
"-l", (profile.localPort + 63).toString,
|
"-l", (profile.localPort + 63).toString,
|
||||||
"-L", profile.remoteDns + ":53",
|
"-L", profile.remoteDns.trim + ":53",
|
||||||
"-c", buildShadowsocksConfig("ss-tunnel-nat.conf"))
|
"-c", buildShadowsocksConfig("ss-tunnel-nat.conf"))
|
||||||
|
|
||||||
if (profile.udpdns) cmd.append("-u")
|
if (profile.udpdns) cmd.append("-u")
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
|||||||
"-t", "10",
|
"-t", "10",
|
||||||
"-b", "127.0.0.1",
|
"-b", "127.0.0.1",
|
||||||
"-l", (profile.localPort + 63).toString,
|
"-l", (profile.localPort + 63).toString,
|
||||||
"-L" , profile.remoteDns + ":53",
|
"-L" , profile.remoteDns.trim + ":53",
|
||||||
"-c", buildShadowsocksConfig("ss-tunnel-vpn.conf")).start()
|
"-c", buildShadowsocksConfig("ss-tunnel-vpn.conf")).start()
|
||||||
|
|
||||||
def startDnsDaemon() {
|
def startDnsDaemon() {
|
||||||
@@ -219,7 +219,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
|||||||
.setMtu(VPN_MTU)
|
.setMtu(VPN_MTU)
|
||||||
.addAddress(PRIVATE_VLAN.formatLocal(Locale.ENGLISH, "1"), 24)
|
.addAddress(PRIVATE_VLAN.formatLocal(Locale.ENGLISH, "1"), 24)
|
||||||
|
|
||||||
builder.addDnsServer(profile.remoteDns)
|
builder.addDnsServer(profile.remoteDns.trim)
|
||||||
|
|
||||||
if (profile.ipv6) {
|
if (profile.ipv6) {
|
||||||
builder.addAddress(PRIVATE_VLAN6.formatLocal(Locale.ENGLISH, "1"), 126)
|
builder.addAddress(PRIVATE_VLAN6.formatLocal(Locale.ENGLISH, "1"), 126)
|
||||||
@@ -251,6 +251,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
|||||||
val subnet = Subnet.fromString(cidr)
|
val subnet = Subnet.fromString(cidr)
|
||||||
builder.addRoute(subnet.address.getHostAddress, subnet.prefixSize)
|
builder.addRoute(subnet.address.getHostAddress, subnet.prefixSize)
|
||||||
})
|
})
|
||||||
|
builder.addRoute(profile.remoteDns.trim, 32)
|
||||||
}
|
}
|
||||||
|
|
||||||
conn = builder.establish()
|
conn = builder.establish()
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.github.shadowsocks.acl
|
package com.github.shadowsocks.acl
|
||||||
|
|
||||||
import java.net.InetAddress
|
import java.net.InetAddress
|
||||||
|
import java.util.Objects
|
||||||
|
|
||||||
import com.github.shadowsocks.utils.Utils
|
import com.github.shadowsocks.utils.Utils
|
||||||
|
|
||||||
@@ -26,6 +27,12 @@ class Subnet(val address: InetAddress, val prefixSize: Int) extends Comparable[S
|
|||||||
}
|
}
|
||||||
prefixSize compare that.prefixSize
|
prefixSize compare that.prefixSize
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override def equals(other: Any): Boolean = other match {
|
||||||
|
case that: Subnet => address == that.address && prefixSize == that.prefixSize
|
||||||
|
case _ => false
|
||||||
|
}
|
||||||
|
override def hashCode: Int = Objects.hash(address, prefixSize: Integer)
|
||||||
}
|
}
|
||||||
|
|
||||||
object Subnet {
|
object Subnet {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import com.github.shadowsocks.database.Profile
|
|||||||
|
|
||||||
object Parser {
|
object Parser {
|
||||||
val TAG = "ShadowParser"
|
val TAG = "ShadowParser"
|
||||||
private val pattern = "(?i)^ss://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]$".r
|
private val pattern = "(?i)ss://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]".r
|
||||||
private val userInfoPattern = "^(.+?):(.*)$".r
|
private val userInfoPattern = "^(.+?):(.*)$".r
|
||||||
private val legacyPattern = "^((.+?):(.*)@(.+?):(\\d+?))$".r
|
private val legacyPattern = "^((.+?):(.*)@(.+?):(\\d+?))$".r
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ object Parser {
|
|||||||
pattern.findAllMatchIn(if (data == null) "" else data).map(m => {
|
pattern.findAllMatchIn(if (data == null) "" else data).map(m => {
|
||||||
val uri = Uri.parse(m.matched)
|
val uri = Uri.parse(m.matched)
|
||||||
uri.getUserInfo match {
|
uri.getUserInfo match {
|
||||||
case null => uri.getHost match {
|
case null => new String(Base64.decode(uri.getHost, Base64.NO_PADDING), "UTF-8") match {
|
||||||
case legacyPattern(_, method, password, host, port) => // legacy uri
|
case legacyPattern(_, method, password, host, port) => // legacy uri
|
||||||
val profile = new Profile
|
val profile = new Profile
|
||||||
profile.method = method.toLowerCase
|
profile.method = method.toLowerCase
|
||||||
@@ -49,7 +49,7 @@ object Parser {
|
|||||||
null
|
null
|
||||||
}
|
}
|
||||||
case userInfo =>
|
case userInfo =>
|
||||||
new String(Base64.decode(userInfo, Base64.NO_PADDING | Base64.NO_WRAP | Base64.URL_SAFE)) match {
|
new String(Base64.decode(userInfo, Base64.NO_PADDING | Base64.NO_WRAP | Base64.URL_SAFE), "UTF-8") match {
|
||||||
case userInfoPattern(method, password) =>
|
case userInfoPattern(method, password) =>
|
||||||
val profile = new Profile
|
val profile = new Profile
|
||||||
profile.method = method
|
profile.method = method
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
* 0.0.2:
|
||||||
|
* Add `getOrDefault` to `PluginOptions`;
|
||||||
|
* Update support library version to 25.1.1.
|
||||||
|
* 0.0.1: Initial release.
|
||||||
+3
-4
@@ -1,5 +1,7 @@
|
|||||||
# shadowsocks-android plugin framework
|
# shadowsocks-android plugin framework
|
||||||
|
|
||||||
|
[Documentation](doc.md) | [Change log](CHANGES.md)
|
||||||
|
|
||||||
Support library for easier development on [shadowsocks
|
Support library for easier development on [shadowsocks
|
||||||
plugin](https://github.com/shadowsocks/shadowsocks-org/issues/28) for Android. Also includes some
|
plugin](https://github.com/shadowsocks/shadowsocks-org/issues/28) for Android. Also includes some
|
||||||
useful resources to easily get consistent styling with the main app.
|
useful resources to easily get consistent styling with the main app.
|
||||||
@@ -19,9 +21,6 @@ This library is designed with Java interoperability in mind so theoretically you
|
|||||||
library with other languages and/or build tools but there isn't documentation for that yet. This
|
library with other languages and/or build tools but there isn't documentation for that yet. This
|
||||||
guide is written for Scala + SBT. Contributions are welcome.
|
guide is written for Scala + SBT. Contributions are welcome.
|
||||||
|
|
||||||
The following is just a simple guide to get you started, for more technical details, see
|
|
||||||
[doc.md](https://github.com/shadowsocks/shadowsocks-android/blob/develop/plugin/doc.md).
|
|
||||||
|
|
||||||
### Package name
|
### Package name
|
||||||
|
|
||||||
There are no arbitrary restrictions/requirements on package name, component name and content
|
There are no arbitrary restrictions/requirements on package name, component name and content
|
||||||
@@ -37,7 +36,7 @@ First you need to add this library to your dependencies. This library is written
|
|||||||
and it's most convenient to use it with SBT:
|
and it's most convenient to use it with SBT:
|
||||||
|
|
||||||
```scala
|
```scala
|
||||||
libraryDependencies += "com.github.shadowsocks" %% "plugin" % "0.0.1"
|
libraryDependencies += "com.github.shadowsocks" %% "plugin" % "0.0.2"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Native binary configuration
|
### Native binary configuration
|
||||||
|
|||||||
+2
-2
@@ -196,7 +196,7 @@ This feature hasn't been implemented yet.
|
|||||||
Plugins are certified using package signatures and shadowsocks-android will consider these
|
Plugins are certified using package signatures and shadowsocks-android will consider these
|
||||||
signatures as trusted:
|
signatures as trusted:
|
||||||
|
|
||||||
* Signatures by [trusted sources](https://github.com/shadowsocks/shadowsocks-android/blob/develop/mobile/src/main/scala/com/github/shadowsocks/plugin/PluginManager.scala#L22)
|
* Signatures by [trusted sources](/mobile/src/main/scala/com/github/shadowsocks/plugin/PluginManager.scala#L22)
|
||||||
which includes:
|
which includes:
|
||||||
- @madeye, i.e. the signer of the main repo;
|
- @madeye, i.e. the signer of the main repo;
|
||||||
- The main repo doesn't contain any other trusted signatures. Third-party forks should add their
|
- The main repo doesn't contain any other trusted signatures. Third-party forks should add their
|
||||||
@@ -226,5 +226,5 @@ Plugin app must include this in their application tag: (which should be automati
|
|||||||
|
|
||||||
```
|
```
|
||||||
<meta-data android:name="com.github.shadowsocks.plugin.version"
|
<meta-data android:name="com.github.shadowsocks.plugin.version"
|
||||||
android:value="0.0.1"/>
|
android:value="0.0.2"/>
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -6,6 +6,6 @@
|
|||||||
<application
|
<application
|
||||||
android:theme="@style/Theme.Shadowsocks">
|
android:theme="@style/Theme.Shadowsocks">
|
||||||
<meta-data android:name="com.github.shadowsocks.plugin.version"
|
<meta-data android:name="com.github.shadowsocks.plugin.version"
|
||||||
android:value="0.0.1"/>
|
android:value="0.0.2"/>
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
addSbtPlugin("org.scala-android" % "sbt-android" % "1.7.4")
|
addSbtPlugin("org.scala-android" % "sbt-android" % "1.7.5")
|
||||||
|
|
||||||
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.1.10")
|
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.1.10")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user