mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-02-27 09:17:12 +00:00
chore: Cleanup code
This commit is contained in:
@@ -71,10 +71,10 @@ func DialContext(ctx context.Context, network, address string, options ...Option
|
||||
}
|
||||
|
||||
func ListenPacket(ctx context.Context, network, address string, options ...Option) (net.PacketConn, error) {
|
||||
if features.Contains("cmfa") && DefaultSocketHook != nil{
|
||||
if features.CMFA && DefaultSocketHook != nil {
|
||||
return listenPacketHooked(ctx, network, address)
|
||||
}
|
||||
|
||||
|
||||
cfg := applyOptions(options...)
|
||||
|
||||
lc := &net.ListenConfig{}
|
||||
@@ -119,10 +119,10 @@ func GetTcpConcurrent() bool {
|
||||
}
|
||||
|
||||
func dialContext(ctx context.Context, network string, destination netip.Addr, port string, opt *option) (net.Conn, error) {
|
||||
if features.Contains("cmfa") && DefaultSocketHook != nil{
|
||||
if features.CMFA && DefaultSocketHook != nil {
|
||||
return dialContextHooked(ctx, network, destination, port)
|
||||
}
|
||||
|
||||
|
||||
address := net.JoinHostPort(destination.String(), port)
|
||||
|
||||
netDialer := opt.netDialer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build android,cmfa
|
||||
//go:build android && cmfa
|
||||
|
||||
package dialer
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build !cmfa
|
||||
//go:build !(android && cmfa)
|
||||
|
||||
package dialer
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build android,cmfa
|
||||
//go:build android && cmfa
|
||||
|
||||
package mmdb
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package process
|
||||
import (
|
||||
"errors"
|
||||
"net/netip"
|
||||
"github.com/metacubex/mihomo/constant"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -20,7 +19,3 @@ const (
|
||||
func FindProcessName(network string, srcIP netip.Addr, srcPort int) (uint32, string, error) {
|
||||
return findProcessName(network, srcIP, srcPort)
|
||||
}
|
||||
|
||||
func FindPackageName(metadata *constant.Metadata) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build android,cmfa
|
||||
//go:build android && cmfa
|
||||
|
||||
package process
|
||||
|
||||
9
component/process/process_common.go
Normal file
9
component/process/process_common.go
Normal file
@@ -0,0 +1,9 @@
|
||||
//go:build !(android && cmfa)
|
||||
|
||||
package process
|
||||
|
||||
import "github.com/metacubex/mihomo/constant"
|
||||
|
||||
func FindPackageName(metadata *constant.Metadata) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
Reference in New Issue
Block a user