diff --git a/src/main/scala/com/github/shadowsocks/database/MenuAdapter.scala b/src/main/scala/com/github/shadowsocks/database/MenuAdapter.scala index 8365eb9a..cf8f52f8 100644 --- a/src/main/scala/com/github/shadowsocks/database/MenuAdapter.scala +++ b/src/main/scala/com/github/shadowsocks/database/MenuAdapter.scala @@ -45,7 +45,7 @@ import android.view.View import android.view.ViewGroup import android.widget.BaseAdapter import android.widget.TextView -import com.github.shadowsocks.{Shadowsocks, R} +import com.github.shadowsocks.{R} import android.view.View.{OnLongClickListener, OnClickListener} case class Item(id: Int, title: String, iconRes: Int, diff --git a/src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala b/src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala index 230e3a11..9914bd76 100644 --- a/src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala +++ b/src/main/scala/com/github/shadowsocks/utils/ConfigUtils.scala @@ -1,6 +1,45 @@ +/* + * Shadowsocks - A shadowsocks client for Android + * Copyright (C) 2014 + * + * 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 + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + * ___====-_ _-====___ + * _--^^^#####// \\#####^^^--_ + * _-^##########// ( ) \\##########^-_ + * -############// |\^^/| \\############- + * _/############// (@::@) \\############\_ + * /#############(( \\// ))#############\ + * -###############\\ (oo) //###############- + * -#################\\ / VV \ //#################- + * -###################\\/ \//###################- + * _#/|##########/\######( /\ )######/\##########|\#_ + * |/ |#/\#/\#/\/ \#/\##\ | | /##/\#/ \/\#/\#/\#| \| + * ` |/ V V ` V \#\| | | |/#/ V ' V V \| ' + * ` ` ` ` / | | | | \ ' ' ' ' + * ( | | | | ) + * __\ | | | | /__ + * (vvv(VVV)(VVV)vvv) + * + * HERE BE DRAGONS + * + */ + package com.github.shadowsocks.utils -import android.content.{Intent, SharedPreferences, Context} +import android.content.{SharedPreferences, Context} import com.github.shadowsocks.ShadowsocksApplication import com.google.tagmanager.Container import scalaj.http.{HttpOptions, Http} @@ -70,7 +109,8 @@ object ConfigUtils { def getPublicConfig(context: Context, container: Container, config: Config): Config = { val url = container.getString("proxy_url") val sig = Utils.getSignature(context) - val list = Http.post(url) + val list = Http + .post(url) .params("sig" -> sig) .option(HttpOptions.connTimeout(1000)) .option(HttpOptions.readTimeout(5000)) @@ -113,8 +153,7 @@ object ConfigUtils { } val proxiedAppString = settings.getString(Key.proxied, "") - new Config(isGlobalProxy, isGFWList, isBypassApps, isTrafficStat, isUdpDns, profileName, proxy, sitekey, - encMethod, proxiedAppString, remotePort, localPort) - + new Config(isGlobalProxy, isGFWList, isBypassApps, isTrafficStat, isUdpDns, profileName, proxy, + sitekey, encMethod, proxiedAppString, remotePort, localPort) } } \ No newline at end of file diff --git a/src/main/scala/com/github/shadowsocks/utils/Console.scala b/src/main/scala/com/github/shadowsocks/utils/Console.scala index 82d2c087..3deef3b8 100644 --- a/src/main/scala/com/github/shadowsocks/utils/Console.scala +++ b/src/main/scala/com/github/shadowsocks/utils/Console.scala @@ -1,9 +1,47 @@ +/* + * Shadowsocks - A shadowsocks client for Android + * Copyright (C) 2014 + * + * 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 + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + * ___====-_ _-====___ + * _--^^^#####// \\#####^^^--_ + * _-^##########// ( ) \\##########^-_ + * -############// |\^^/| \\############- + * _/############// (@::@) \\############\_ + * /#############(( \\// ))#############\ + * -###############\\ (oo) //###############- + * -#################\\ / VV \ //#################- + * -###################\\/ \//###################- + * _#/|##########/\######( /\ )######/\##########|\#_ + * |/ |#/\#/\#/\/ \#/\##\ | | /##/\#/ \/\#/\#/\#| \| + * ` |/ V V ` V \#\| | | |/#/ V ' V V \| ' + * ` ` ` ` / | | | | \ ' ' ' ' + * ( | | | | ) + * __\ | | | | /__ + * (vvv(VVV)(VVV)vvv) + * + * HERE BE DRAGONS + * + */ + package com.github.shadowsocks.utils import eu.chainfire.libsuperuser.Shell import eu.chainfire.libsuperuser.Shell.{OnCommandResultListener, SU, Builder} import java.util -import android.util.Log object Console { diff --git a/src/main/scala/com/github/shadowsocks/utils/Constants.scala b/src/main/scala/com/github/shadowsocks/utils/Constants.scala index 39a08f76..d42b51a7 100644 --- a/src/main/scala/com/github/shadowsocks/utils/Constants.scala +++ b/src/main/scala/com/github/shadowsocks/utils/Constants.scala @@ -39,9 +39,6 @@ package com.github.shadowsocks.utils -import android.content.{Intent, SharedPreferences} -import com.github.shadowsocks.aidl.Config - object Executable { val REDSOCKS = "redsocks" val PDNSD = "pdnsd" diff --git a/src/main/scala/com/github/shadowsocks/utils/Utils.scala b/src/main/scala/com/github/shadowsocks/utils/Utils.scala index 7dfbf537..ab37428d 100644 --- a/src/main/scala/com/github/shadowsocks/utils/Utils.scala +++ b/src/main/scala/com/github/shadowsocks/utils/Utils.scala @@ -38,25 +38,22 @@ */ package com.github.shadowsocks.utils -import android.content.{Intent, SharedPreferences, Context} +import android.content.{Intent, Context} import android.content.pm.ApplicationInfo import android.content.pm.PackageManager import android.graphics.drawable.{BitmapDrawable, Drawable} import android.util.{Base64, Log} import java.io._ -import java.net.{URLEncoder, UnknownHostException, InetAddress, NetworkInterface} +import java.net.{UnknownHostException, InetAddress, NetworkInterface} import org.apache.http.conn.util.InetAddressUtils -import scala.collection.mutable.ArrayBuffer import org.xbill.DNS._ import android.graphics._ import android.app.ActivityManager import android.os.Build import android.provider.Settings import scala.Some -import scalaj.http.{Http, HttpOptions} -import com.google.tagmanager.Container import java.security.MessageDigest -import com.github.shadowsocks.{BuildConfig, Exec, ShadowsocksApplication} +import com.github.shadowsocks.{BuildConfig} object Utils {