Optimize ip detection

Support android vpn ipv6 inbound switch

Support log export

Optimize more details
This commit is contained in:
chen08209
2024-09-20 14:32:57 +08:00
parent 3f0f7f051b
commit 82767325e5
55 changed files with 34939 additions and 30259 deletions

View File

@@ -151,10 +151,8 @@ class AppState with ChangeNotifier {
addRequest(Connection value) {
_requests = List.from(_requests)..add(value);
final maxLength = Platform.isAndroid ? 1000 : 60;
if (_requests.length > maxLength) {
_requests = _requests.sublist(_requests.length - maxLength);
}
const maxLength = 1000;
_requests = _requests.safeSublist(_requests.length - maxLength);
notifyListeners();
}
@@ -354,10 +352,8 @@ class AppFlowingState with ChangeNotifier {
addLog(Log log) {
_logs = List.from(_logs)..add(log);
final maxLength = Platform.isAndroid ? 1000 : 60;
if (_logs.length > maxLength) {
_logs = _logs.sublist(_logs.length - maxLength);
}
const maxLength = 1000;
_logs = _logs.safeSublist(_logs.length - maxLength);
notifyListeners();
}
@@ -373,9 +369,7 @@ class AppFlowingState with ChangeNotifier {
addTraffic(Traffic traffic) {
_traffics = List.from(_traffics)..add(traffic);
const maxLength = 60;
if (_traffics.length > maxLength) {
_traffics = _traffics.sublist(_traffics.length - maxLength);
}
_traffics = _traffics.safeSublist(_traffics.length - maxLength);
notifyListeners();
}