mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-05-20 16:15:47 +08:00
fix tls server_name is null bug
This commit is contained in:
@@ -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']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user