diff --git a/lib/services/protocol_blocking_service.dart b/lib/services/protocol_blocking_service.dart index 4eea534..7bad745 100644 --- a/lib/services/protocol_blocking_service.dart +++ b/lib/services/protocol_blocking_service.dart @@ -127,8 +127,10 @@ class ProtocolBlockingService { _continuousMonitor!.stderr .transform(utf8.decoder) .listen((error) { - if (!error.contains('listening on')) { + if (!error.contains('listening on') && !error.contains('data link type') && !error.contains('verbose output suppressed')) { print('❌ tcpdump error: $error'); + } else { + print('â„šī¸ tcpdump info: $error'); } }); @@ -138,17 +140,28 @@ class ProtocolBlockingService { } static Future _processCapturedPacket(String packetLine) async { - // Skip timestamp/header lines, only process hex data lines - if (!packetLine.contains('0x') || packetLine.trim().isEmpty) { - return; + // Print all packet lines to see what we're getting + print('📋 RAW PACKET LINE: $packetLine'); + + // Check if it's from our monitored peers first + bool isFromPeer = false; + String? peerIP; + + for (final ip in _activePeerIPs) { + if (packetLine.contains(ip)) { + isFromPeer = true; + peerIP = ip; + break; + } } - // Check if it's from our monitored peers and analyze payload - for (final peerIP in _activePeerIPs) { - if (packetLine.contains(peerIP)) { - print('đŸŽ¯ PEER TRAFFIC FROM $peerIP - ANALYZING PAYLOAD'); + if (isFromPeer && peerIP != null) { + print('đŸŽ¯ PEER TRAFFIC FROM $peerIP'); + + // For hex data lines, do deep payload analysis + if (packetLine.contains('0x')) { + print('🔍 HEX DATA DETECTED - ANALYZING PAYLOAD'); await _analyzeFullPayload(packetLine, peerIP); - break; } } }