fix tls server_name is null bug

This commit is contained in:
wanghongenpin
2024-06-21 18:30:28 +08:00
parent b45bbf3212
commit 726439c3bc
7 changed files with 102 additions and 57 deletions

View File

@@ -1,11 +1,15 @@
import 'package:flutter/services.dart';
import 'package:network_proxy/native/installed_apps.dart';
import 'package:network_proxy/network/util/process_info.dart';
class ProcessInfoPlugin {
static const MethodChannel _methodChannel = MethodChannel('com.proxy/processInfo');
static Future<AppInfo?> getProcessByPort(String host, int port) {
return _methodChannel.invokeMethod<Map>('getProcessByPort', {"host": host, "port": port}).then(
(value) => value == null ? null : AppInfo.formJson(value));
static Future<ProcessInfo?> getProcessByPort(String host, int port) {
return _methodChannel.invokeMethod<Map>('getProcessByPort', {"host": host, "port": port}).then((process) {
if (process == null) return null;
return ProcessInfo(process['packageName'], process['name'], process['packageName'],
icon: process['icon'], remoteHost: process['remoteHost'], remotePost: process['remotePost']);
});
}
}