Commit 6a0f26a0 authored by chenhuaqing's avatar chenhuaqing

remove unused code

parent ca111ace
......@@ -55,19 +55,19 @@
</intent-filter>
</service>
<service
android:name="com.github.shadowsocks.bg.TransproxyService"
android:process=":bg"
android:directBootAware="true"
android:exported="false">
</service>
<!-- <service-->
<!-- android:name="com.github.shadowsocks.bg.TransproxyService"-->
<!-- android:process=":bg"-->
<!-- android:directBootAware="true"-->
<!-- android:exported="false">-->
<!-- </service>-->
<service
android:name="com.github.shadowsocks.bg.ProxyService"
android:process=":bg"
android:directBootAware="true"
android:exported="false">
</service>
<!-- <service-->
<!-- android:name="com.github.shadowsocks.bg.ProxyService"-->
<!-- android:process=":bg"-->
<!-- android:directBootAware="true"-->
<!-- android:exported="false">-->
<!-- </service>-->
<service
android:name="com.github.shadowsocks.subscription.SubscriptionService"
......
......@@ -27,12 +27,8 @@ import android.content.ServiceConnection
import android.os.IBinder
import android.os.RemoteException
import com.github.shadowsocks.bg.BaseService
import com.github.shadowsocks.bg.ProxyService
import com.github.shadowsocks.bg.TransproxyService
import com.github.shadowsocks.bg.VpnService
import com.github.shadowsocks.preference.DataStore
import com.github.shadowsocks.utils.Action
import com.github.shadowsocks.utils.Key
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
......@@ -42,12 +38,13 @@ import kotlinx.coroutines.launch
*/
class ShadowsocksConnection(private var listenForDeath: Boolean = false) : ServiceConnection, IBinder.DeathRecipient {
companion object {
val serviceClass get() = when (DataStore.serviceMode) {
Key.modeProxy -> ProxyService::class
Key.modeVpn -> VpnService::class
Key.modeTransproxy -> TransproxyService::class
else -> throw UnknownError()
}.java
val serviceClass get() = VpnService::class.java
// when (DataStore.serviceMode) {
// Key.modeProxy -> ProxyService::class
// Key.modeVpn -> VpnService::class
// Key.modeTransproxy -> TransproxyService::class
// else -> throw UnknownError()
// }.java
}
interface Callback {
......
......@@ -29,11 +29,11 @@ import java.io.File
import java.io.IOException
object Executable {
const val REDSOCKS = "libredsocks.so"
// const val REDSOCKS = "libredsocks.so"
const val SS_LOCAL = "libsslocal.so"
const val TUN2SOCKS = "libtun2socks.so"
private val EXECUTABLES = setOf(SS_LOCAL, REDSOCKS, TUN2SOCKS)
private val EXECUTABLES = setOf(SS_LOCAL, TUN2SOCKS)
fun killAll() {
for (process in File("/proc").listFiles { _, name -> TextUtils.isDigitsOnly(name) } ?: return) {
......
......@@ -37,23 +37,23 @@ class TransproxyService : Service(), BaseService.Interface {
super<BaseService.Interface>.onStartCommand(intent, flags, startId)
private fun startRedsocksDaemon() {
File(Core.deviceStorage.noBackupFilesDir, "redsocks.conf").writeText("""base {
log_debug = off;
log_info = off;
log = stderr;
daemon = off;
redirector = iptables;
}
redsocks {
local_ip = ${DataStore.listenAddress};
local_port = ${DataStore.portTransproxy};
ip = 127.0.0.1;
port = ${DataStore.portProxy};
type = socks5;
}
""")
data.processes!!.start(listOf(
File(applicationInfo.nativeLibraryDir, Executable.REDSOCKS).absolutePath, "-c", "redsocks.conf"))
// File(Core.deviceStorage.noBackupFilesDir, "redsocks.conf").writeText("""base {
// log_debug = off;
// log_info = off;
// log = stderr;
// daemon = off;
// redirector = iptables;
//}
//redsocks {
// local_ip = ${DataStore.listenAddress};
// local_port = ${DataStore.portTransproxy};
// ip = 127.0.0.1;
// port = ${DataStore.portProxy};
// type = socks5;
//}
//""")
// data.processes!!.start(listOf(
// File(applicationInfo.nativeLibraryDir, Executable.REDSOCKS).absolutePath, "-c", "redsocks.conf"))
}
override suspend fun startProcesses() {
......
......@@ -22,19 +22,19 @@ BUILD_SHARED_EXECUTABLE := $(LOCAL_PATH)/build-shared-executable.mk
## libevent
########################################################
include $(CLEAR_VARS)
LIBEVENT_SOURCES := \
buffer.c bufferevent.c event.c \
bufferevent_sock.c bufferevent_ratelim.c \
evthread.c log.c evutil.c evutil_rand.c evutil_time.c evmap.c epoll.c poll.c signal.c select.c
LOCAL_MODULE := event
LOCAL_SRC_FILES := $(addprefix libevent/, $(LIBEVENT_SOURCES))
LOCAL_CFLAGS := -I$(LOCAL_PATH)/libevent \
-I$(LOCAL_PATH)/libevent/include \
include $(BUILD_STATIC_LIBRARY)
# include $(CLEAR_VARS)
#
# LIBEVENT_SOURCES := \
# buffer.c bufferevent.c event.c \
# bufferevent_sock.c bufferevent_ratelim.c \
# evthread.c log.c evutil.c evutil_rand.c evutil_time.c evmap.c epoll.c poll.c signal.c select.c
#
# LOCAL_MODULE := event
# LOCAL_SRC_FILES := $(addprefix libevent/, $(LIBEVENT_SOURCES))
# LOCAL_CFLAGS := -I$(LOCAL_PATH)/libevent \
# -I$(LOCAL_PATH)/libevent/include \
#
# include $(BUILD_STATIC_LIBRARY)
########################################################
## libancillary
......@@ -55,23 +55,23 @@ include $(BUILD_STATIC_LIBRARY)
## redsocks
########################################################
include $(CLEAR_VARS)
REDSOCKS_SOURCES := base.c http-connect.c \
log.c md5.c socks5.c \
base64.c http-auth.c http-relay.c main.c \
parser.c redsocks.c socks4.c utils.c
LOCAL_STATIC_LIBRARIES := libevent
LOCAL_MODULE := redsocks
LOCAL_SRC_FILES := $(addprefix redsocks/, $(REDSOCKS_SOURCES))
LOCAL_CFLAGS := -std=gnu99 -DUSE_IPTABLES \
-I$(LOCAL_PATH)/redsocks \
-I$(LOCAL_PATH)/libevent/include \
-I$(LOCAL_PATH)/libevent
include $(BUILD_SHARED_EXECUTABLE)
# include $(CLEAR_VARS)
#
# REDSOCKS_SOURCES := base.c http-connect.c \
# log.c md5.c socks5.c \
# base64.c http-auth.c http-relay.c main.c \
# parser.c redsocks.c socks4.c utils.c
#
# LOCAL_STATIC_LIBRARIES := libevent
#
# LOCAL_MODULE := redsocks
# LOCAL_SRC_FILES := $(addprefix redsocks/, $(REDSOCKS_SOURCES))
# LOCAL_CFLAGS := -std=gnu99 -DUSE_IPTABLES \
# -I$(LOCAL_PATH)/redsocks \
# -I$(LOCAL_PATH)/libevent/include \
# -I$(LOCAL_PATH)/libevent
#
# include $(BUILD_SHARED_EXECUTABLE)
########################################################
## tun2socks
......
......@@ -137,12 +137,13 @@ class MainActivity : AppCompatActivity(), ShadowsocksConnection.Callback, OnPref
profile.token = "e38daf39db56471cb8bfe2776b24059c"
profile.remotePort = 8390
profile.proxyApps = true
val proxyGames = mutableListOf(
val proxyGames = mutableSetOf(
"com.sec.android.app.sbrowser",
"com.nexon.maplem.global",
"jp.co.cygames.umamusume",
"com.ea.gp.apexlegendsmobilefps",
"jp.konami.duellinks", "com.riotgames.league.wildrift"
"jp.konami.duellinks",
"com.riotgames.league.wildrift"
)
proxyGames.addAll(profile.individual.split("\n"))
profile.individual = proxyGames.joinToString("\n")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment