feat: switch iperf3 to JNI with 3.19 source

- Switch from bundled iperf3 binary (Process.start) to JNI compilation
- iperf3 3.21 source API was incompatible (start_time, iperf_strerror, etc.)
- iperf3 3.19 source is proven to work (used by CellularLab)
- CMakeLists.txt updated: config.h generated into cpp/iperf/ for correct include paths
- iperf_jni.c fixed for 3.19 API (no start_time on iperf_test)
- getTestProgress() returns g_test->duration as fallback (no real-time elapsed tracking yet)
- NDK CMake pinned to 3.22.1
- UI layer updated: removed Iperf3BinaryPathProvider references
- Tests updated: TestRunViewModelTest matches new service interface
- pubspec.yaml: removed iperf3 assets bundle, added http dependency
- AndroidManifest: INTERNET permission (needed for hostname resolution)
This commit is contained in:
2026-08-25 13:46:33 +09:00
parent 27e8e50469
commit d551f41b41
63 changed files with 24243 additions and 167 deletions
@@ -1,10 +1,13 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:iperf3gui/data/services/iperf3_service.dart';
import 'package:iperf3gui/data/services/iperf3_binary_path_provider.dart';
import 'package:iperf3gui/domain/models/test_configuration.dart';
import 'package:iperf3gui/ui/features/test_run/test_run_view_model.dart';
/// Main test run screen.
///
/// iperf3 is now compiled as a native shared library (libiperf3jni.so)
/// and accessed via JNI. No binary extraction or chmod needed.
class TestRunScreen extends StatelessWidget {
const TestRunScreen({super.key});
@@ -12,9 +15,7 @@ class TestRunScreen extends StatelessWidget {
Widget build(BuildContext context) {
return ChangeNotifierProvider(
create: (_) => TestRunViewModel(
iperf3Service: Iperf3Service(
binaryPath: Iperf3BinaryPathProvider.path,
),
iperf3Service: Iperf3Service(),
),
child: const _TestRunContent(),
);