Skip to content

Commit

Permalink
Merge remote-tracking branch 'shadowsocks/master' into noad
Browse files Browse the repository at this point in the history
  • Loading branch information
kaneawk committed Jun 4, 2017
2 parents dff2298 + 8208ac1 commit 68c7870
Show file tree
Hide file tree
Showing 22 changed files with 120 additions and 71 deletions.
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lazy val commonSettings = Seq(
javacOptions ++= "-source" :: "1.7" :: "-target" :: "1.7" :: Nil,
scalacOptions ++= "-target:jvm-1.7" :: "-Xexperimental" :: Nil,
ndkArgs := "-j" :: java.lang.Runtime.getRuntime.availableProcessors.toString :: Nil,
ndkAbiFilter := Seq("armeabi-v7a", "arm64-v8a", "x86"),

proguardVersion := "5.3.3",
proguardCache := Seq(),
Expand Down
35 changes: 21 additions & 14 deletions mobile/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,53 @@ enablePlugins(AndroidGms)
android.useSupportVectors

name := "shadowsocks"
version := "4.1.6"
versionCode := Some(186)
version := "4.1.8"
versionCode := Some(188)

proguardOptions ++=
"-dontwarn com.evernote.android.job.gcm.**" ::
"-dontwarn com.evernote.android.job.util.GcmAvailableHelper" ::
"-dontwarn com.google.android.gms.internal.**" ::
"-dontwarn com.j256.ormlite.**" ::
"-dontwarn okhttp3.**" ::
"-dontwarn okio.**" ::
"-dontwarn org.xbill.**" ::
"-keep public class com.evernote.android.job.v21.PlatformJobService" ::
"-keep public class com.evernote.android.job.v14.PlatformAlarmService" ::
"-keep public class com.evernote.android.job.v14.PlatformAlarmReceiver" ::
"-keep public class com.evernote.android.job.JobBootReceiver" ::
"-keep public class com.evernote.android.job.JobRescheduleService" ::
"-keep class com.github.shadowsocks.JniHelper { *; }" ::
Nil

val playServicesVersion = "10.2.1"
val playServicesVersion = "10.2.6"
resolvers += Resolver.jcenterRepo
libraryDependencies ++=
"com.futuremind.recyclerfastscroll" % "fastscroll" % "0.2.5" ::
"com.evernote" % "android-job" % "1.1.9" ::
"com.evernote" % "android-job" % "1.1.10" ::
"com.github.jorgecastilloprz" % "fabprogresscircle" % "1.01" ::
"com.google.android.gms" % "play-services-analytics" % playServicesVersion ::
"com.google.android.gms" % "play-services-gcm" % playServicesVersion ::
"com.google.firebase" % "firebase-config" % playServicesVersion ::
"com.j256.ormlite" % "ormlite-android" % "5.0" ::
"com.mikepenz" % "crossfader" % "1.5.0" ::
"com.mikepenz" % "fastadapter" % "2.5.2" ::
"com.mikepenz" % "iconics-core" % "2.8.3" ::
"com.mikepenz" % "materialdrawer" % "5.9.0" ::
"com.mikepenz" % "iconics-core" % "2.8.4" ::
"com.mikepenz" % "materialdrawer" % "5.9.1" ::
"com.mikepenz" % "materialize" % "1.0.1" ::
"com.squareup.okhttp3" % "okhttp" % "3.7.0" ::
"com.squareup.okhttp3" % "okhttp" % "3.8.0" ::
"com.twofortyfouram" % "android-plugin-api-for-locale" % "1.0.2" ::
"dnsjava" % "dnsjava" % "2.1.8" ::
"eu.chainfire" % "libsuperuser" % "1.0.0.201704021214" ::
"net.glxn.qrgen" % "android" % "2.0" ::
Nil

packagingOptions := PackagingOptions(excludes =
"META-INF/maven/com.squareup.okio/okio/pom.properties" ::
"META-INF/maven/com.squareup.okio/okio/pom.xml" ::
"META-INF/maven/com.squareup.okhttp3/okhttp/pom.properties" ::
"META-INF/maven/com.squareup.okhttp3/okhttp/pom.xml" ::
Nil)

lazy val goClean = TaskKey[Unit]("go-clean", "Clean go build dependencies")
goClean := {
IO.delete(baseDirectory(base => base / "src/overture/.deps").value)
IO.delete(baseDirectory(base => base / "src/main/jni/overture").value)
}

lazy val goBuild = TaskKey[Unit]("go-build", "Build go and overture")
goBuild := {
Process(Seq("mobile/src/overture/make.bash", minSdkVersion.value)) ! streams.value.log match {
Expand Down
4 changes: 2 additions & 2 deletions mobile/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ SHADOWSOCKS_SOURCES := local.c \
LOCAL_MODULE := ss-local
LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/src/, $(SHADOWSOCKS_SOURCES))
LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_LOCAL \
-DUSE_CRYPTO_MBEDTLS -DANDROID -DHAVE_CONFIG_H \
-DUSE_CRYPTO_MBEDTLS -DHAVE_CONFIG_H \
-DCONNECT_IN_PROGRESS=EINPROGRESS \
-I$(LOCAL_PATH)/include/shadowsocks-libev \
-I$(LOCAL_PATH)/include \
Expand Down Expand Up @@ -294,7 +294,7 @@ SHADOWSOCKS_SOURCES := tunnel.c \
LOCAL_MODULE := ss-tunnel
LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/src/, $(SHADOWSOCKS_SOURCES))
LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_TUNNEL \
-DUSE_CRYPTO_MBEDTLS -DANDROID -DHAVE_CONFIG_H -DSSTUNNEL_JNI \
-DUSE_CRYPTO_MBEDTLS -DHAVE_CONFIG_H -DSSTUNNEL_JNI \
-DCONNECT_IN_PROGRESS=EINPROGRESS \
-I$(LOCAL_PATH)/libancillary \
-I$(LOCAL_PATH)/include \
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/main/jni/badvpn
2 changes: 1 addition & 1 deletion mobile/src/main/jni/libev
Submodule libev updated 25 files
+9 −13 Changes
+3 −3 Makefile.am
+921 −0 Makefile.in
+14 −0 TODO
+9,790 −0 aclocal.m4
+347 −0 compile
+1,420 −0 config.guess
+125 −0 config.h.in
+1,799 −0 config.sub
+14,133 −0 configure
+1 −1 configure.ac
+791 −0 depcomp
+6 −2 ev.3
+104 −56 ev.c
+4 −4 ev.h
+6 −1 ev.pod
+8 −3 ev_epoll.c
+8 −4 ev_kqueue.c
+6 −3 ev_poll.c
+8 −4 ev_port.c
+4 −2 ev_select.c
+508 −0 install-sh
+9,661 −0 ltmain.sh
+215 −0 missing
+162 −0 mkinstalldirs
2 changes: 1 addition & 1 deletion mobile/src/main/jni/libevent
2 changes: 1 addition & 1 deletion mobile/src/main/jni/redsocks
Submodule redsocks updated 2 files
+1 −1 log.c
+2 −2 main.c
4 changes: 2 additions & 2 deletions mobile/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<resources>
<string name="quick_toggle">"켜기/끄기"</string>

<!-- global/misc category -->
<string name="misc_cat">"기타"</string>
<!-- misc -->
<string name="profile">"프로필"</string>
<string name="profile_summary">"다른 프로필로 전환하거나 새 프로필 추가"</string>
<string name="nat">"NAT 모드 (지원 중단)"</string>
Expand Down Expand Up @@ -45,4 +44,5 @@
<string name="tcp_fastopen_summary">"루트 권한이 필요합니다"</string>
<string name="tcp_fastopen_summary_unsupported">"지원하지 않는 버전의 커널입니다: %s &lt; 3.7.1"</string>
<string name="udp_dns">"DNS 포워딩"</string>
<string name="udp_dns_summary">"모든 DNS 요청을 외부로 포워딩 합니다"</string>
</resources>
79 changes: 57 additions & 22 deletions mobile/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,28 @@
<resources>
<string name="quick_toggle">"Подключение"</string>

<!-- global/misc category -->
<string name="misc_cat">"Разное"</string>
<!-- misc -->
<string name="profile">"Профиль"</string>
<string name="profile_summary">"Переключить на другой профиль или добавить новые"</string>
<string name="nat">"Режим NAT (не рекомендуется)"</string>
<string name="nat_summary">"Использовать режим NAT вместо VPN. Требует ROOT прав."</string>
<string name="stat_summary">"Отправлено: \t\t\t\t\t%3$s\t↑\t%1$s/s
<string name="remote_dns">"Удалённый DNS"</string>
<string name="stat_summary">"Отправлено: \t%3$s\t↑\t%1$s/s
Получено: \t%4$s\t↓\t%2$s/s"</string>
<string name="stat_profiles">"
%1$s↑\t%2$s↓"</string>
<string name="traffic_summary">"%1$s/s↑\t%2$s/s↓"</string>
<string name="connection_test_pending">"Проверить подключение"</string>
<plurals name="bytes">
<item quantity="one">"байт"</item>
<item quantity="few">"байта"</item>
<item quantity="many">"байт"</item>
<item quantity="other">"байт"</item>
</plurals>
<string name="connection_test_pending">"Проверить соединение"</string>
<string name="connection_test_testing">"Проверка…"</string>
<string name="connection_test_available">"Успешно: %dms задержка"</string>
<string name="connection_test_error">"Сбой проверки интернет подключения: %s"</string>
<string name="connection_test_fail">"Интернет Недоступен"</string>
<string name="connection_test_available">"Успешно: задержка %d мс"</string>
<string name="connection_test_error">"Сбой проверки интернет-соединения: %s"</string>
<string name="connection_test_fail">"Интернет недоступен"</string>
<string name="connection_test_error_status_code">"Код ошибки: #%d"</string>

<!-- proxy category -->
Expand All @@ -30,7 +36,7 @@

<!-- feature category -->
<string name="ipv6">"IPv6 Маршрут"</string>
<string name="ipv6_summary">"Перенаправлять IPv6 траффик на удалённый сервер"</string>
<string name="ipv6_summary">"Перенаправлять трафик IPv6 на удалённый сервер"</string>
<string name="route_list">"Маршрут"</string>
<string name="route_entry_gfwlist">"Список GFW"</string>
<string name="proxied_apps">"Прокси для выбранных приложений"</string>
Expand All @@ -42,22 +48,23 @@
<string name="auto_connect_summary">"Запускать Shadowsocks при включении"</string>
<string name="tcp_fastopen_summary">"Переключение требует наличия ROOT прав"</string>
<string name="tcp_fastopen_summary_unsupported">"Неподдерживаемая версия ядра: %s &lt; 3.7.1"</string>
<string name="udp_dns">"Проброс DNS"</string>
<string name="udp_dns_summary">"Пробрасывать DNS пакеты на удалённый сервер"</string>
<string name="udp_dns">"Перенаправление DNS"</string>
<string name="udp_dns_summary">"Перенаправлять все DNS-запросы на удалённый сервер"</string>

<!-- notification category -->
<string name="forward_success">"Shadowsocks запущен."</string>
<string name="invalid_server">"Неправильное имя сервера"</string>
<string name="service_failed">"Ошибка при подключении к удалённому серверу"</string>
<string name="nat_deprecated">"ВНИМАНИЕ:режим NAT не работает в Android 5.0"</string>
<string name="nat_deprecated">"ВНИМАНИЕ: режим NAT не рекомендуется, начиная с Android 5.0"</string>
<string name="nat_no_root">"Режим NAT требует наличия ROOT прав"</string>
<string name="switch_to_vpn">"Переключить на режим VPN"</string>
<string name="stop">"Остановить"</string>
<string name="stopping">"Останавливается…"</string>
<string name="reboot_required">"Сбой запуска VPN сервиса. Требуется перезагрузка Вашего устройства."</string>
<string name="reboot_required">"Не удалось запустить службу VPN. Возможно, требуется перезагрузить ваше устройство."</string>

<!-- alert category -->
<string name="close">"Закрыть"</string>
<string name="profile_empty">"Пожалуйста, выберите профиль"</string>
<string name="proxy_empty">"Прокси/Пароль не должны быть пустыми"</string>
<string name="connect">"Подключить"</string>
<string name="recovering">"Сброс…"</string>
Expand All @@ -69,6 +76,7 @@
<string name="recovery">"Сброс"</string>
<string name="about">"О приложении"</string>
<string name="about_title">"Shadowsocks %s"</string>
<string name="edit">"Изменить"</string>
<string name="share">"Поделиться"</string>
<string name="add_profile">"Добавить Профиль"</string>
<string name="action_apply_all">"Применить настройки для всех профилей"</string>
Expand All @@ -78,19 +86,26 @@
<string name="action_export_err">"Сбой экспорта."</string>
<string name="action_import_msg">"Успешный импорт!"</string>
<string name="action_import_err">"Сбой импорта."</string>

<!-- profile -->
<string name="profile_config">"Настройка профиля"</string>
<string name="delete">"Удалить"</string>
<string name="delete_confirm_prompt">"Вы уверены, что хотите удалить этот профиль?"</string>
<string name="share_qr_nfc">"QR-код/NFC"</string>
<string name="add_profile_dialog">"Добавить этот Профиль Shadowsocks?"</string>
<string name="add_profile_methods_scan_qr_code">"Сканировать QR код"</string>
<string name="add_profile_methods_manual_settings">"Настройка вручную"</string>
<string name="add_profile_methods_scan_qr_code">"Сканировать QR-код"</string>
<string name="add_profile_methods_manual_settings">"Ручные настройки"</string>
<string name="add_profile_scanner_not_installed">"Пожалуйста, установите любое ZXing-совместимое приложение для сканирования QR-кодов."</string>
<plurals name="removed">
<item quantity="one">"Удалён"</item>
<item quantity="few">"%d элементы удалены"</item>
<item quantity="many">"%d элементы удалены"</item>
<item quantity="other">"%d элементы удалены"</item>
<item quantity="one">"Удалено"</item>
<item quantity="few">"Удалено %d элемента"</item>
<item quantity="many">"Удалено %d элементов"</item>
<item quantity="other">"Удалено %d элементов"</item>
</plurals>
<string name="undo">"Вернуть"</string>

<!-- tasker -->
<string name="toggle_service_state">"Запустить сервисStart the service"</string>
<string name="toggle_service_state">"Запустить службу"</string>
<string name="start_service_default">"Подключиться к текущему серверу"</string>
<string name="start_service">"Подключиться к %s"</string>
<string name="stop_service">"Переключить на %s"</string>
Expand All @@ -99,10 +114,30 @@
<!-- status -->
<string name="sent">"Отправлено:"</string>
<string name="received">"Получено:"</string>
<string name="connecting">"Соединение..."</string>
<string name="vpn_connected">"Подключено, нажмите для проверки соединения"</string>
<string name="nat_connected">"Подключено"</string>
<string name="not_connected">"Не подключено"</string>

<!-- acl -->
<string name="custom_rules">"Пользовательские правила"</string>
<string name="action_selection">"Выделение..."</string>
<string name="action_add_rule">"Добавить правило..."</string>
<string name="edit_rule">"Редактировать правило"</string>
<string name="route_entry_all">"Все"</string>
<string name="route_entry_bypass_lan">"Обход LAN"</string>
<string name="route_entry_bypass_chn">"Обходной Китай"</string>
<string name="route_entry_bypass_lan_chn">"Обход LAN и Китай"</string>
<string name="route_entry_bypass_lan">"Все, кроме LAN"</string>
<string name="route_entry_bypass_chn">"Все, кроме Китая"</string>
<string name="route_entry_bypass_lan_chn">"Все, кроме LAN и Китая"</string>
<string name="route_entry_chinalist">"Список Китай"</string>
<string name="proxied_apps_summary_v21">"Установить прокси для выбранных приложений"</string>
<string name="acl_rule_templates_generic">"Подсеть/Регулярное выражение (PCRE) имени хоста"</string>
<string name="acl_rule_templates_domain">"Доменное имя и все его поддомены"</string>

<!-- plugin -->
<string name="plugin">"Плагин"</string>
<string name="plugin_configure">"Настроить..."</string>
<string name="plugin_disabled">"Отключён"</string>
<string name="plugin_unknown">"Неизвестный плагин %s"</string>
<string name="plugin_untrusted">"Предупреждение: этот плагин получен из недоверенного источника."</string>
<string name="profile_plugin">"Плагин: %s"</string>
</resources>
13 changes: 10 additions & 3 deletions mobile/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<resources>
<string name="quick_toggle">"切換"</string>

<!-- global/misc category -->
<string name="misc_cat">"其他"</string>
<!-- misc -->
<string name="profile">"設定檔"</string>
<string name="profile_summary">"切換至其他設定檔或新增新設定檔"</string>
<string name="nat">"NAT 模式 (已過時)"</string>
Expand Down Expand Up @@ -124,4 +123,12 @@
<string name="proxied_apps_summary_v21">"為已選擇的應用程式設定 Proxy"</string>
<string name="acl_rule_templates_generic">"子網路/主機名稱 PCRE 模式"</string>
<string name="acl_rule_templates_domain">"網域及其所有子網域"</string>
</resources>

<!-- plugin -->
<string name="plugin">"插件"</string>
<string name="plugin_configure">"配置..."</string>
<string name="plugin_disabled">"未啟用"</string>
<string name="plugin_unknown">"未知插件 %s"</string>
<string name="plugin_untrusted">"警告:該插件似乎不是來自一個已知的可信任源。"</string>
<string name="profile_plugin">"插件: %s"</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ trait BaseService extends Service {

protected final def buildOvertureConfig(file: String): String = {
val config = new JSONObject()
.put("BindAddress", ":" + (profile.localPort + 53))
.put("BindAddress", "127.0.0.1:" + (profile.localPort + 53))
.put("RedirectIPv6Record", true)
.put("DomainBase64Decode", true)
.put("HostsFile", "hosts")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import com.github.shadowsocks.ShadowsocksApplication.app
import scala.collection.JavaConversions._
import scala.collection.immutable.Stream

class StreamLogger(is: InputStream, tag: String) extends Thread {
class StreamLogger(is: InputStream, tag: String, logger: (String, String) => Int) extends Thread {
override def run(): Unit = autoClose(new BufferedReader(new InputStreamReader(is)))(br =>
try Stream.continually(br.readLine()).takeWhile(_ != null).foreach(Log.i(tag, _)) catch {
try Stream.continually(br.readLine()).takeWhile(_ != null).foreach(logger(tag, _)) catch {
case _: IOException =>
})
}
Expand Down Expand Up @@ -68,8 +68,8 @@ class GuardedProcess(cmd: String*) {
.directory(app.getFilesDir)
.start()

val is = process.getInputStream
new StreamLogger(is, TAG).start()
new StreamLogger(process.getInputStream(), TAG, Log.i).start()
new StreamLogger(process.getErrorStream(), TAG, Log.e).start()

if (callback == null) callback = onRestartCallback else callback()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ class MainActivity extends Activity with ServiceBoundContext with Drawer.OnDrawe
displayFragment(new AboutFragment)
case DRAWER_FAQ => launchUrl(getString(R.string.faq_url))
case DRAWER_CUSTOM_RULES => displayFragment(new CustomRulesFragment)
case _ => // ignore
}
true // unexpected cases will throw exception
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ final class ProfilesFragment extends ToolbarFragment with Toolbar.OnMenuItemClic
case R.id.action_scan_qr_code =>
def installScanner() = {
Toast.makeText(getActivity, R.string.add_profile_scanner_not_installed, Toast.LENGTH_LONG).show()
try startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=tw.com.quickmark"))) catch {
try startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.google.zxing.client.android"))) catch {
case exc: ActivityNotFoundException => exc.printStackTrace()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class ShadowsocksApplication extends Application {
checkChineseLocale(getResources.getConfiguration)

FirebaseApp.initializeApp(this)
remoteConfig.setDefaults(R.xml.default_configs);
remoteConfig.setDefaults(R.xml.default_configs)
remoteConfig.fetch().addOnCompleteListener(task => if (task.isSuccessful) remoteConfig.activateFetched())

JobManager.create(this).addJobCreator(DonaldTrump)
Expand Down
Loading

0 comments on commit 68c7870

Please sign in to comment.