Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89f073cc49 | ||
|
|
07ac8fb839 | ||
|
|
57b75ad971 | ||
|
|
1d6a0b0f2b | ||
|
|
abcbc98ce3 | ||
|
|
2722b1aa78 | ||
|
|
4bfc5ee070 | ||
|
|
c842f7fd41 |
@@ -1,10 +1,31 @@
|
||||
Please answer these questions before submitting your issue. Thanks!
|
||||
Please read FAQ in wiki then answer these questions before submitting your issue. Thanks!
|
||||
|
||||
### What version of Shadowsocks are you using?
|
||||
### Environment
|
||||
|
||||
* Android version: *e.g. "7.0.0_r14", more detailed description is preferred*
|
||||
* Device: *e.g. Google Pixel XL*
|
||||
* Shadowsocks version: *version code "v3.0.0" or commit ID "a073f85"*
|
||||
|
||||
### What Android OS version and device are you using?
|
||||
### Configuration
|
||||
|
||||
_Put an `x` inside the [ ] that applies._
|
||||
|
||||
* [ ] IPv4 server address
|
||||
* [ ] IPv6 server address
|
||||
* [ ] Client IPv4 availability
|
||||
* [ ] Client IPv6 availability
|
||||
* Local port: 1080
|
||||
* Encrypt method:
|
||||
* [ ] One-time authentication
|
||||
* Route:
|
||||
* [ ] IPv6 route
|
||||
* [ ] Per-App Proxy
|
||||
* [ ] Bypass mode
|
||||
* [ ] UDP Forwarding
|
||||
* KCP Parameters: (leave blank if not enabled)
|
||||
* [ ] Auto Connect
|
||||
* [ ] TCP Fast Open
|
||||
* [ ] NAT mode
|
||||
|
||||
### What did you do?
|
||||
|
||||
@@ -14,5 +35,3 @@ Please answer these questions before submitting your issue. Thanks!
|
||||
|
||||
### What did you see instead?
|
||||
|
||||
|
||||
### What is your config in detail (with all sensitive info masked)?
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
### Type of changes
|
||||
|
||||
_Put an `x` inside the [ ] that applies._
|
||||
|
||||
* [ ] Bugfix
|
||||
* [ ] New feature
|
||||
* [ ] Translation
|
||||
* [ ] General refinement
|
||||
* Other:
|
||||
|
||||
### Details
|
||||
|
||||
Please provide more details about changes if necessary.
|
||||
|
||||
@@ -49,7 +49,7 @@ A [shadowsocks](http://shadowsocks.org) client for Android, written in Scala.
|
||||
### LICENSE
|
||||
|
||||
Copyright (C) 2016 by Max Lv <<max.c.lv@gmail.com>>
|
||||
Copyright (C) 2016 by Mygod Studio <<mygodstudio@gmail.com>>
|
||||
Copyright (C) 2016 by Mygod Studio <<contact-shadowsocks-android@mygod.be>>
|
||||
|
||||
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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools" package="com.github.shadowsocks"
|
||||
android:versionCode="162"
|
||||
android:versionName="3.2.2">
|
||||
android:versionCode="164"
|
||||
android:versionName="3.2.4">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
|
||||
@@ -275,7 +275,7 @@ img {
|
||||
<body>
|
||||
<p>A <a href="http://shadowsocks.org">Shadowsocks</a> client for Android, written in Scala.</p>
|
||||
<p>Copyright (C) 2016 by Max Lv <a href="mailto:max.c.lv@gmail.com">max.c.lv@gmail.com</a></p>
|
||||
<p>Copyright (C) 2016 by Mygod Studio <a href="mygodstudio@gmail.com">mygodstudio@gmail.com</a></p>
|
||||
<p>Copyright (C) 2016 by Mygod Studio <a href="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
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
|
||||
+1
-1
Submodule src/main/jni/pdnsd updated: eb5c47e5bd...f6b0a56c74
@@ -44,5 +44,8 @@
|
||||
<item name="android:fadeScrollbars">true</item>
|
||||
<item name="android:scrollbars">vertical</item>
|
||||
</style>
|
||||
<style name="NumberPickerStyle">
|
||||
<item name="android:textSize">14sp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -2,34 +2,34 @@
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res/com.github.shadowsocks">
|
||||
|
||||
<tk.mygod.preference.PreferenceCategory
|
||||
<be.mygod.preference.PreferenceCategory
|
||||
android:title="@string/proxy_cat">
|
||||
|
||||
<tk.mygod.preference.EditTextPreference
|
||||
<be.mygod.preference.EditTextPreference
|
||||
android:key="profileName"
|
||||
android:persistent="false"
|
||||
android:summary="%s"
|
||||
android:title="@string/profile_name"/>
|
||||
<tk.mygod.preference.EditTextPreference
|
||||
<be.mygod.preference.EditTextPreference
|
||||
android:key="proxy"
|
||||
android:persistent="false"
|
||||
android:summary="%s"
|
||||
android:title="@string/proxy"/>
|
||||
<tk.mygod.preference.NumberPickerPreference
|
||||
<be.mygod.preference.NumberPickerPreference
|
||||
app:min="1"
|
||||
app:max="65535"
|
||||
android:key="remotePortNum"
|
||||
android:persistent="false"
|
||||
android:summary="%d"
|
||||
android:title="@string/remote_port"/>
|
||||
<tk.mygod.preference.NumberPickerPreference
|
||||
<be.mygod.preference.NumberPickerPreference
|
||||
app:min="1025"
|
||||
app:max="65535"
|
||||
android:key="localPortNum"
|
||||
android:persistent="false"
|
||||
android:summary="%d"
|
||||
android:title="@string/port"/>
|
||||
<tk.mygod.preference.EditTextPreference
|
||||
<be.mygod.preference.EditTextPreference
|
||||
android:inputType="textPassword"
|
||||
android:key="sitekey"
|
||||
android:persistent="false"
|
||||
@@ -48,9 +48,9 @@
|
||||
android:summary="@string/onetime_auth_summary"
|
||||
android:title="@string/onetime_auth"/>
|
||||
|
||||
</tk.mygod.preference.PreferenceCategory>
|
||||
</be.mygod.preference.PreferenceCategory>
|
||||
|
||||
<tk.mygod.preference.PreferenceCategory
|
||||
<be.mygod.preference.PreferenceCategory
|
||||
android:title="@string/feature_cat">
|
||||
|
||||
<android.support.v7.preference.DropDownPreference
|
||||
@@ -76,9 +76,9 @@
|
||||
android:summary="@string/udp_dns_summary"
|
||||
android:title="@string/udp_dns"/>
|
||||
|
||||
</tk.mygod.preference.PreferenceCategory>
|
||||
</be.mygod.preference.PreferenceCategory>
|
||||
|
||||
<tk.mygod.preference.PreferenceCategory
|
||||
<be.mygod.preference.PreferenceCategory
|
||||
android:title="@string/kcp">
|
||||
|
||||
<SwitchPreference
|
||||
@@ -87,7 +87,7 @@
|
||||
android:summary="@string/kcp_summary"
|
||||
android:title="@string/kcp"/>
|
||||
|
||||
<tk.mygod.preference.NumberPickerPreference
|
||||
<be.mygod.preference.NumberPickerPreference
|
||||
app:min="1"
|
||||
app:max="65535"
|
||||
android:key="kcpPort"
|
||||
@@ -95,15 +95,15 @@
|
||||
android:summary="@string/kcp_port_summary"
|
||||
android:title="@string/kcp_port"/>
|
||||
|
||||
<tk.mygod.preference.EditTextPreference
|
||||
<be.mygod.preference.EditTextPreference
|
||||
android:key="kcpcli"
|
||||
android:persistent="false"
|
||||
android:summary="%s"
|
||||
android:title="@string/kcpcli"/>
|
||||
|
||||
</tk.mygod.preference.PreferenceCategory>
|
||||
</be.mygod.preference.PreferenceCategory>
|
||||
|
||||
<tk.mygod.preference.PreferenceCategory android:title="@string/misc_cat">
|
||||
<be.mygod.preference.PreferenceCategory android:title="@string/misc_cat">
|
||||
|
||||
<SwitchPreference
|
||||
android:key="isAutoConnect"
|
||||
@@ -126,7 +126,7 @@
|
||||
android:summary="@string/flush_dnscache_summary"/>
|
||||
<Preference android:key="about" android:title="@string/about"/>
|
||||
|
||||
</tk.mygod.preference.PreferenceCategory>
|
||||
</be.mygod.preference.PreferenceCategory>
|
||||
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tk.mygod.preference
|
||||
package be.mygod.preference
|
||||
|
||||
import android.content.Context
|
||||
import android.support.v7.preference.{EditTextPreference => Parent}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tk.mygod.preference
|
||||
package be.mygod.preference
|
||||
|
||||
import android.content.Context
|
||||
import android.support.v14.preference.PreferenceDialogFragment
|
||||
+3
-27
@@ -1,40 +1,16 @@
|
||||
package tk.mygod.preference
|
||||
package be.mygod.preference
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.TypedArray
|
||||
import android.support.v7.preference.DialogPreference
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import android.view.ViewGroup.LayoutParams
|
||||
import android.view.ContextThemeWrapper
|
||||
import android.widget.NumberPicker
|
||||
import android.widget.EditText
|
||||
import com.github.shadowsocks.R
|
||||
|
||||
class MyNumberPicker(private val context: Context, attrs: AttributeSet = null)
|
||||
extends NumberPicker(context, attrs) {
|
||||
override def addView(child: View) {
|
||||
super.addView(child)
|
||||
updateView(child)
|
||||
}
|
||||
override def addView(child: View, params: LayoutParams) {
|
||||
super.addView(child, params)
|
||||
updateView(child)
|
||||
}
|
||||
override def addView(child: View, index: Int, params: LayoutParams) {
|
||||
super.addView(child, index, params)
|
||||
updateView(child)
|
||||
}
|
||||
def updateView(child: View) {
|
||||
if (child.isInstanceOf[EditText]) {
|
||||
child.asInstanceOf[EditText].setTextSize(dp2px(6))
|
||||
}
|
||||
}
|
||||
def dp2px(dp: Float): Int = (dp*getResources().getDisplayMetrics().density).toInt
|
||||
}
|
||||
|
||||
class NumberPickerPreference(private val context: Context, attrs: AttributeSet = null)
|
||||
extends DialogPreference(context, attrs) with SummaryPreference {
|
||||
private[preference] val picker = new MyNumberPicker(context)
|
||||
private[preference] val picker = new NumberPicker(new ContextThemeWrapper(context, R.style.NumberPickerStyle))
|
||||
private var value: Int = _
|
||||
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tk.mygod.preference
|
||||
package be.mygod.preference
|
||||
|
||||
import android.content.Context
|
||||
import android.support.v14.preference.PreferenceDialogFragment
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tk.mygod.preference
|
||||
package be.mygod.preference
|
||||
|
||||
import android.content.Context
|
||||
import android.support.v7.preference.{PreferenceViewHolder, PreferenceCategory => Base}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tk.mygod.preference
|
||||
package be.mygod.preference
|
||||
|
||||
import android.app.DialogFragment
|
||||
import android.os.Bundle
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tk.mygod.preference
|
||||
package be.mygod.preference
|
||||
|
||||
import java.lang.reflect.Field
|
||||
import java.util.List
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package tk.mygod.preference
|
||||
package be.mygod.preference
|
||||
|
||||
import android.support.v7.preference.Preference
|
||||
|
||||
@@ -70,6 +70,7 @@ trait BaseService extends Service {
|
||||
var callbacksCount: Int = _
|
||||
lazy val handler = new Handler(getMainLooper)
|
||||
lazy val restartHanlder = new Handler(getMainLooper)
|
||||
lazy val protectPath = getApplicationInfo.dataDir + "/protect_path"
|
||||
|
||||
private val closeReceiver: BroadcastReceiver = (context: Context, intent: Intent) => {
|
||||
Toast.makeText(context, R.string.stopping, Toast.LENGTH_SHORT).show()
|
||||
|
||||
@@ -187,17 +187,17 @@ class ShadowsocksNatService extends BaseService {
|
||||
|
||||
val conf = profile.route match {
|
||||
case Route.BYPASS_CHN | Route.BYPASS_LAN_CHN | Route.GFWLIST => {
|
||||
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
|
||||
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, "", getApplicationInfo.dataDir,
|
||||
"127.0.0.1", profile.localPort + 53, "1.2.4.8, 114.114.114.114",
|
||||
getBlackList, reject, profile.localPort + 63, reject)
|
||||
}
|
||||
case Route.CHINALIST => {
|
||||
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
|
||||
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, "", getApplicationInfo.dataDir,
|
||||
"127.0.0.1", profile.localPort + 53, "8.8.8.8, 208.67.222.222",
|
||||
"", reject, profile.localPort + 63, reject)
|
||||
}
|
||||
case _ => {
|
||||
ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
|
||||
ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, "", getApplicationInfo.dataDir,
|
||||
"127.0.0.1", profile.localPort + 53, profile.localPort + 63, reject)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.github.shadowsocks.ShadowsocksApplication.app
|
||||
import com.github.shadowsocks.database.Profile
|
||||
import com.github.shadowsocks.preferences.KcpCliPreferenceDialogFragment
|
||||
import com.github.shadowsocks.utils.{Key, TcpFastOpen, Utils}
|
||||
import tk.mygod.preference._
|
||||
import be.mygod.preference._
|
||||
|
||||
object ShadowsocksSettings {
|
||||
// Constants
|
||||
|
||||
@@ -193,7 +193,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
||||
val cmd = ArrayBuffer(getApplicationInfo.dataDir + "/kcptun"
|
||||
, "-r", profile.host + ":" + profile.kcpPort
|
||||
, "-l", "127.0.0.1:" + (profile.localPort + 90)
|
||||
, "--path", getApplicationInfo.dataDir + "/protect_path")
|
||||
, "--path", protectPath)
|
||||
try cmd ++= Utils.translateCommandline(profile.kcpcli) catch {
|
||||
case exc: Exception => throw KcpcliParseException(exc)
|
||||
}
|
||||
@@ -302,19 +302,20 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
||||
|
||||
def startDnsDaemon() {
|
||||
val reject = if (profile.ipv6) "224.0.0.0/3" else "224.0.0.0/3, ::/0"
|
||||
val protect = "protect = \"" + protectPath +"\";"
|
||||
val conf = profile.route match {
|
||||
case Route.BYPASS_CHN | Route.BYPASS_LAN_CHN | Route.GFWLIST => {
|
||||
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
|
||||
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, protect, getApplicationInfo.dataDir,
|
||||
"0.0.0.0", profile.localPort + 53, "114.114.114.114, 119.29.29.29, 1.2.4.8",
|
||||
getBlackList, reject, profile.localPort + 63, reject)
|
||||
}
|
||||
case Route.CHINALIST => {
|
||||
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
|
||||
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, protect, getApplicationInfo.dataDir,
|
||||
"0.0.0.0", profile.localPort + 53, "8.8.8.8, 8.8.4.4, 208.67.222.222",
|
||||
"", reject, profile.localPort + 63, reject)
|
||||
}
|
||||
case _ => {
|
||||
ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, getApplicationInfo.dataDir,
|
||||
ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, protect, getApplicationInfo.dataDir,
|
||||
"0.0.0.0", profile.localPort + 53, profile.localPort + 63, reject)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package com.github.shadowsocks.preferences
|
||||
import android.app.AlertDialog
|
||||
import android.content.DialogInterface
|
||||
import eu.chainfire.libsuperuser.Shell
|
||||
import tk.mygod.preference.EditTextPreferenceDialogFragment
|
||||
import be.mygod.preference.EditTextPreferenceDialogFragment
|
||||
|
||||
import scala.collection.JavaConverters._
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ object ConfigUtils {
|
||||
"""
|
||||
|global {
|
||||
| perm_cache = 2048;
|
||||
| %s
|
||||
| cache_dir = "%s";
|
||||
| server_ip = %s;
|
||||
| server_port = %d;
|
||||
@@ -101,6 +102,7 @@ object ConfigUtils {
|
||||
"""
|
||||
|global {
|
||||
| perm_cache = 2048;
|
||||
| %s
|
||||
| cache_dir = "%s";
|
||||
| server_ip = %s;
|
||||
| server_port = %d;
|
||||
|
||||
@@ -77,8 +77,7 @@ object Utils {
|
||||
new String(Base64.encode(mdg.digest, 0))
|
||||
}
|
||||
|
||||
def dpToPx(context: Context, dp: Int): Int =
|
||||
Math.round(dp * (context.getResources.getDisplayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT))
|
||||
def dpToPx(context: Context, dp: Int): Int = Math.round(dp * context.getResources.getDisplayMetrics.density)
|
||||
|
||||
/*
|
||||
* round or floor depending on whether you are using offsets(floor) or
|
||||
|
||||
Reference in New Issue
Block a user