Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 57efab093f | |||
| 9c92a64811 | |||
| 7ddc82d5cd | |||
| c286ba18a8 | |||
| 867b5fc880 | |||
| e8a7fa5320 | |||
| f2f9e55286 |
@@ -17,7 +17,6 @@ import (
|
|||||||
v2filesystem "v2ray.com/core/common/platform/filesystem"
|
v2filesystem "v2ray.com/core/common/platform/filesystem"
|
||||||
v2stats "v2ray.com/core/features/stats"
|
v2stats "v2ray.com/core/features/stats"
|
||||||
v2serial "v2ray.com/core/infra/conf/serial"
|
v2serial "v2ray.com/core/infra/conf/serial"
|
||||||
_ "v2ray.com/core/main/distro/all"
|
|
||||||
v2internet "v2ray.com/core/transport/internet"
|
v2internet "v2ray.com/core/transport/internet"
|
||||||
|
|
||||||
v2applog "v2ray.com/core/app/log"
|
v2applog "v2ray.com/core/app/log"
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package libv2ray
|
||||||
|
|
||||||
|
import (
|
||||||
|
// The following are necessary as they register handlers in their init functions.
|
||||||
|
|
||||||
|
// Required features. Can't remove unless there is replacements.
|
||||||
|
_ "v2ray.com/core/app/dispatcher"
|
||||||
|
_ "v2ray.com/core/app/proxyman/inbound"
|
||||||
|
_ "v2ray.com/core/app/proxyman/outbound"
|
||||||
|
|
||||||
|
// Other optional features.
|
||||||
|
_ "v2ray.com/core/app/dns"
|
||||||
|
_ "v2ray.com/core/app/log"
|
||||||
|
_ "v2ray.com/core/app/policy"
|
||||||
|
_ "v2ray.com/core/app/router"
|
||||||
|
_ "v2ray.com/core/app/stats"
|
||||||
|
|
||||||
|
// Inbound and outbound proxies.
|
||||||
|
_ "v2ray.com/core/proxy/blackhole"
|
||||||
|
_ "v2ray.com/core/proxy/dns"
|
||||||
|
_ "v2ray.com/core/proxy/dokodemo"
|
||||||
|
_ "v2ray.com/core/proxy/freedom"
|
||||||
|
_ "v2ray.com/core/proxy/http"
|
||||||
|
_ "v2ray.com/core/proxy/mtproto"
|
||||||
|
_ "v2ray.com/core/proxy/shadowsocks"
|
||||||
|
_ "v2ray.com/core/proxy/socks"
|
||||||
|
_ "v2ray.com/core/proxy/trojan"
|
||||||
|
_ "v2ray.com/core/proxy/vless/inbound"
|
||||||
|
_ "v2ray.com/core/proxy/vless/outbound"
|
||||||
|
_ "v2ray.com/core/proxy/vmess/inbound"
|
||||||
|
_ "v2ray.com/core/proxy/vmess/outbound"
|
||||||
|
|
||||||
|
// Transport
|
||||||
|
_ "v2ray.com/core/transport/internet/http"
|
||||||
|
_ "v2ray.com/core/transport/internet/kcp"
|
||||||
|
_ "v2ray.com/core/transport/internet/quic"
|
||||||
|
_ "v2ray.com/core/transport/internet/tcp"
|
||||||
|
_ "v2ray.com/core/transport/internet/tls"
|
||||||
|
_ "v2ray.com/core/transport/internet/udp"
|
||||||
|
_ "v2ray.com/core/transport/internet/websocket"
|
||||||
|
|
||||||
|
// Transport headers
|
||||||
|
_ "v2ray.com/core/transport/internet/headers/http"
|
||||||
|
_ "v2ray.com/core/transport/internet/headers/noop"
|
||||||
|
_ "v2ray.com/core/transport/internet/headers/srtp"
|
||||||
|
_ "v2ray.com/core/transport/internet/headers/tls"
|
||||||
|
_ "v2ray.com/core/transport/internet/headers/utp"
|
||||||
|
_ "v2ray.com/core/transport/internet/headers/wechat"
|
||||||
|
_ "v2ray.com/core/transport/internet/headers/wireguard"
|
||||||
|
|
||||||
|
// JSON config support. Choose only one from the two below.
|
||||||
|
// The following line loads JSON from v2ctl
|
||||||
|
// _ "v2ray.com/core/main/json"
|
||||||
|
// The following line loads JSON internally
|
||||||
|
_ "v2ray.com/core/main/jsonem"
|
||||||
|
// Load config from file or http(s)
|
||||||
|
// _ "v2ray.com/core/main/confloader/external"
|
||||||
|
)
|
||||||
@@ -96,6 +96,7 @@ dependencies {
|
|||||||
implementation 'me.dm7.barcodescanner:core:1.9.8'
|
implementation 'me.dm7.barcodescanner:core:1.9.8'
|
||||||
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
|
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
|
||||||
implementation 'com.github.jorgecastilloprz:fabprogresscircle:1.01@aar'
|
implementation 'com.github.jorgecastilloprz:fabprogresscircle:1.01@aar'
|
||||||
|
implementation 'me.drakeet.support:toastcompat:1.1.0'
|
||||||
|
|
||||||
implementation(name: 'libv2ray', ext: 'aar')
|
implementation(name: 'libv2ray', ext: 'aar')
|
||||||
//implementation(name: 'tun2socks', ext: 'aar')
|
//implementation(name: 'tun2socks', ext: 'aar')
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.os.Build
|
|||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import com.v2ray.ang.AngApplication
|
import com.v2ray.ang.AngApplication
|
||||||
import me.dozen.dpreference.DPreference
|
import me.dozen.dpreference.DPreference
|
||||||
|
import me.drakeet.support.toast.ToastCompat
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
import java.net.URLConnection
|
import java.net.URLConnection
|
||||||
|
|
||||||
@@ -22,13 +23,13 @@ val Context.v2RayApplication: AngApplication
|
|||||||
val Context.defaultDPreference: DPreference
|
val Context.defaultDPreference: DPreference
|
||||||
get() = v2RayApplication.defaultDPreference
|
get() = v2RayApplication.defaultDPreference
|
||||||
|
|
||||||
inline fun Context.toast(message: Int): Toast = Toast
|
inline fun Context.toast(message: Int): Toast = ToastCompat
|
||||||
.makeText(this, message, Toast.LENGTH_SHORT)
|
.makeText(this, message, Toast.LENGTH_SHORT)
|
||||||
.apply {
|
.apply {
|
||||||
show()
|
show()
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun Context.toast(message: CharSequence): Toast = Toast
|
inline fun Context.toast(message: CharSequence): Toast = ToastCompat
|
||||||
.makeText(this, message, Toast.LENGTH_SHORT)
|
.makeText(this, message, Toast.LENGTH_SHORT)
|
||||||
.apply {
|
.apply {
|
||||||
show()
|
show()
|
||||||
|
|||||||
@@ -50,15 +50,16 @@ class WidgetProvider : AppWidgetProvider() {
|
|||||||
Utils.startVServiceFromToggle(context)
|
Utils.startVServiceFromToggle(context)
|
||||||
}
|
}
|
||||||
} else if (AppConfig.BROADCAST_ACTION_ACTIVITY == intent.action) {
|
} else if (AppConfig.BROADCAST_ACTION_ACTIVITY == intent.action) {
|
||||||
val manager = AppWidgetManager.getInstance(context)
|
AppWidgetManager.getInstance(context)?.let { manager ->
|
||||||
when (intent.getIntExtra("key", 0)) {
|
when (intent.getIntExtra("key", 0)) {
|
||||||
AppConfig.MSG_STATE_RUNNING, AppConfig.MSG_STATE_START_SUCCESS -> {
|
AppConfig.MSG_STATE_RUNNING, AppConfig.MSG_STATE_START_SUCCESS -> {
|
||||||
updateWidgetBackground(context, manager, manager.getAppWidgetIds(ComponentName(context, WidgetProvider::class.java)),
|
updateWidgetBackground(context, manager, manager.getAppWidgetIds(ComponentName(context, WidgetProvider::class.java)),
|
||||||
true)
|
true)
|
||||||
}
|
}
|
||||||
AppConfig.MSG_STATE_NOT_RUNNING, AppConfig.MSG_STATE_START_FAILURE, AppConfig.MSG_STATE_STOP_SUCCESS -> {
|
AppConfig.MSG_STATE_NOT_RUNNING, AppConfig.MSG_STATE_START_FAILURE, AppConfig.MSG_STATE_STOP_SUCCESS -> {
|
||||||
updateWidgetBackground(context, manager, manager.getAppWidgetIds(ComponentName(context, WidgetProvider::class.java)),
|
updateWidgetBackground(context, manager, manager.getAppWidgetIds(ComponentName(context, WidgetProvider::class.java)),
|
||||||
false)
|
false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user