mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-05-20 16:15:47 +08:00
扫码连接终端
This commit is contained in:
@@ -45,17 +45,16 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.network.proxy"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion 19
|
||||
minSdkVersion 21
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
multiDexEnabled true
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
|
||||
<application
|
||||
android:label="ProxyPin"
|
||||
|
||||
@@ -10,9 +10,10 @@ import io.flutter.plugin.common.MethodChannel
|
||||
|
||||
|
||||
class MainActivity : FlutterActivity() {
|
||||
private val CHANNEL = "com.proxy/proxyVpn"
|
||||
|
||||
private val VPN_REQUEST_CODE: Int = 24
|
||||
companion object {
|
||||
const val VPN_CHANNEL = "com.proxy/proxyVpn"
|
||||
const val VPN_REQUEST_CODE: Int = 24
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -21,7 +22,14 @@ class MainActivity : FlutterActivity() {
|
||||
|
||||
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
|
||||
super.configureFlutterEngine(flutterEngine)
|
||||
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL)
|
||||
vpnMethodChannel(flutterEngine)
|
||||
}
|
||||
|
||||
/**
|
||||
* vpn方法通道
|
||||
*/
|
||||
private fun vpnMethodChannel(flutterEngine: FlutterEngine) {
|
||||
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, VPN_CHANNEL)
|
||||
.setMethodCallHandler { call, result ->
|
||||
when (call.method) {
|
||||
"startVpn" -> {
|
||||
|
||||
Reference in New Issue
Block a user