From 369e42d06a4cf790290326a1b6249851cf4c70fa Mon Sep 17 00:00:00 2001 From: Irene Date: Mon, 24 Aug 2026 10:22:16 +0900 Subject: [PATCH] fix: use /system/bin/sh for chmod to fix iperf3 binary permission on Android - The original chmod call used Process.run('chmod', ...) which fails on Android because chmod is not available in the app sandbox PATH - /system/bin/sh is always present on Android and can execute chmod on the extracted binary, setting executable permissions before the first run --- lib/data/services/iperf3_binary_path_provider.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/data/services/iperf3_binary_path_provider.dart b/lib/data/services/iperf3_binary_path_provider.dart index 9bb9baf..1939bc9 100644 --- a/lib/data/services/iperf3_binary_path_provider.dart +++ b/lib/data/services/iperf3_binary_path_provider.dart @@ -30,8 +30,11 @@ class Iperf3BinaryPathProvider { final file = File('${binaryDir.path}/iperf3'); await file.writeAsBytes(bytes.buffer.asUint8List()); - // chmod +x the binary - await Process.run('chmod', ['+x', file.path]); + // chmod +x the binary — /system/bin/sh is always present on Android + await Process.run( + '/system/bin/sh', + ['-c', 'chmod +x "\$1"', '_', file.path], + ); _cachedPath = file.path; }