INNER CODE UNIT · Dart
EbpfProxyData
ys1231/appproxy · lib/data/ebpf_proxy_data.dart:23
class EbpfProxyData {
EbpfProxyData._();
static const MethodChannel _channel = MethodChannel("cn.ys1231/appproxy/ebpf");
/// 原生进度/阶段回调:phase = download | starting | started
static void Function(String phase, int? percent)? onProgress;
static bool _handlerInstalled = false;
/// 安装来自原生的回调(幂等,首次调用任意方法时自动安装)
static void _ensureHandler() {
if (_handlerInstalled) return;
_handlerInstalled = true;
_channel.setMethodCallHandler((call) async {
if (call.method == 'onEbpfProgress') {
final args = Map<String, dynamic>.from(call.arguments as Map);
onProgress?.call(