cauto 1 жил өмнө
parent
commit
ffc9b32163

BIN
core/flutter-clash-binding


+ 0 - 105
core/flutter-clash-binding.h

@@ -1,105 +0,0 @@
-/* Code generated by cmd/cgo; DO NOT EDIT. */
-
-/* package github.com/kingtous/flutter-clash-binding */
-
-
-#line 1 "cgo-builtin-export-prolog"
-
-#include <stddef.h>
-
-#ifndef GO_CGO_EXPORT_PROLOGUE_H
-#define GO_CGO_EXPORT_PROLOGUE_H
-
-#ifndef GO_CGO_GOSTRING_TYPEDEF
-typedef struct { const char *p; ptrdiff_t n; } _GoString_;
-#endif
-
-#endif
-
-/* Start of preamble from import "C" comments.  */
-
-
-#line 3 "lib.go"
-
-#include "stdint.h"
-
-#line 1 "cgo-generated-wrapper"
-
-
-/* End of preamble from import "C" comments.  */
-
-
-/* Start of boilerplate cgo prologue.  */
-#line 1 "cgo-gcc-export-header-prolog"
-
-#ifndef GO_CGO_PROLOGUE_H
-#define GO_CGO_PROLOGUE_H
-
-typedef signed char GoInt8;
-typedef unsigned char GoUint8;
-typedef short GoInt16;
-typedef unsigned short GoUint16;
-typedef int GoInt32;
-typedef unsigned int GoUint32;
-typedef long long GoInt64;
-typedef unsigned long long GoUint64;
-typedef GoInt64 GoInt;
-typedef GoUint64 GoUint;
-typedef size_t GoUintptr;
-typedef float GoFloat32;
-typedef double GoFloat64;
-#ifdef _MSC_VER
-#include <complex.h>
-typedef _Fcomplex GoComplex64;
-typedef _Dcomplex GoComplex128;
-#else
-typedef float _Complex GoComplex64;
-typedef double _Complex GoComplex128;
-#endif
-
-/*
-  static assertion to make sure the file is being used on architecture
-  at least with matching size of GoInt.
-*/
-typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
-
-#ifndef GO_CGO_GOSTRING_TYPEDEF
-typedef _GoString_ GoString;
-#endif
-typedef void *GoMap;
-typedef void *GoChan;
-typedef struct { void *t; void *v; } GoInterface;
-typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
-
-#endif
-
-/* End of boilerplate cgo prologue.  */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern GoInt clash_init(char* home_dir);
-extern GoInt set_config(char* config_path);
-extern GoInt set_home_dir(char* home);
-extern char* get_config();
-extern GoInt set_ext_controller(GoUint64 port);
-extern void clear_ext_options();
-extern GoInt is_config_valid(char* config_path);
-extern char* get_all_connections();
-extern void close_all_connections();
-extern GoUint8 close_connection(char* id);
-extern GoUint8 parse_options();
-extern char* get_traffic();
-extern void init_native_api_bridge(void* api);
-extern void start_log(long long port);
-extern void stop_log();
-extern long change_proxy(char* selector_name, char* proxy_name);
-extern long change_config_field(char* s);
-extern void async_test_delay(char* proxy_name, char* url, long timeout, long long port);
-extern char* get_proxies();
-extern char* get_configs();
-
-#ifdef __cplusplus
-}
-#endif

BIN
core/libclash.dylib


+ 0 - 105
core/libclash.h

@@ -1,105 +0,0 @@
-/* Code generated by cmd/cgo; DO NOT EDIT. */
-
-/* package github.com/kingtous/flutter-clash-binding */
-
-
-#line 1 "cgo-builtin-export-prolog"
-
-#include <stddef.h>
-
-#ifndef GO_CGO_EXPORT_PROLOGUE_H
-#define GO_CGO_EXPORT_PROLOGUE_H
-
-#ifndef GO_CGO_GOSTRING_TYPEDEF
-typedef struct { const char *p; ptrdiff_t n; } _GoString_;
-#endif
-
-#endif
-
-/* Start of preamble from import "C" comments.  */
-
-
-#line 3 "lib.go"
-
-#include "stdint.h"
-
-#line 1 "cgo-generated-wrapper"
-
-
-/* End of preamble from import "C" comments.  */
-
-
-/* Start of boilerplate cgo prologue.  */
-#line 1 "cgo-gcc-export-header-prolog"
-
-#ifndef GO_CGO_PROLOGUE_H
-#define GO_CGO_PROLOGUE_H
-
-typedef signed char GoInt8;
-typedef unsigned char GoUint8;
-typedef short GoInt16;
-typedef unsigned short GoUint16;
-typedef int GoInt32;
-typedef unsigned int GoUint32;
-typedef long long GoInt64;
-typedef unsigned long long GoUint64;
-typedef GoInt64 GoInt;
-typedef GoUint64 GoUint;
-typedef size_t GoUintptr;
-typedef float GoFloat32;
-typedef double GoFloat64;
-#ifdef _MSC_VER
-#include <complex.h>
-typedef _Fcomplex GoComplex64;
-typedef _Dcomplex GoComplex128;
-#else
-typedef float _Complex GoComplex64;
-typedef double _Complex GoComplex128;
-#endif
-
-/*
-  static assertion to make sure the file is being used on architecture
-  at least with matching size of GoInt.
-*/
-typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
-
-#ifndef GO_CGO_GOSTRING_TYPEDEF
-typedef _GoString_ GoString;
-#endif
-typedef void *GoMap;
-typedef void *GoChan;
-typedef struct { void *t; void *v; } GoInterface;
-typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
-
-#endif
-
-/* End of boilerplate cgo prologue.  */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern GoInt clash_init(char* home_dir);
-extern GoInt set_config(char* config_path);
-extern GoInt set_home_dir(char* home);
-extern char* get_config();
-extern GoInt set_ext_controller(GoUint64 port);
-extern void clear_ext_options();
-extern GoInt is_config_valid(char* config_path);
-extern char* get_all_connections();
-extern void close_all_connections();
-extern GoUint8 close_connection(char* id);
-extern GoUint8 parse_options();
-extern char* get_traffic();
-extern void init_native_api_bridge(void* api);
-extern void start_log(long long port);
-extern void stop_log();
-extern long change_proxy(char* selector_name, char* proxy_name);
-extern long change_config_field(char* s);
-extern void async_test_delay(char* proxy_name, char* url, long timeout, long long port);
-extern char* get_proxies();
-extern char* get_configs();
-
-#ifdef __cplusplus
-}
-#endif

+ 30 - 12
lib/app/data/model/LoginMode.dart

@@ -3,24 +3,42 @@ import 'package:dart_json_mapper/dart_json_mapper.dart';
 import 'UserMode.dart';
 @jsonSerializable
 class LoginMode {
+  @JsonProperty(name: 'access_token')
   String? accessToken;
+
+  @JsonProperty(name: 'user')
   User? user;
+
+  @JsonProperty(name: 'tutorial')
   String? tutorial;
-  String? swoftdownload;
-  String? affurl;
+
+  @JsonProperty(name: 'swoftdownload')
+  String? swoftDownload;
+
+  @JsonProperty(name: 'affurl')
+  String? affUrl;
+
+  @JsonProperty(name: 'user_login_url')
   String? userLoginUrl;
+
+  @JsonProperty(name: 'user_buy')
   String? userBuy;
+
+  @JsonProperty(name: 'user_ticket')
   String? userTicket;
+
+  @JsonProperty(name: 'clash_config')
   String? clashConfig;
 
-  LoginMode(
-      {this.accessToken,
-        this.user,
-        this.tutorial,
-        this.swoftdownload,
-        this.affurl,
-        this.userLoginUrl,
-        this.userBuy,
-        this.userTicket,
-        this.clashConfig});
+  LoginMode({
+    this.accessToken,
+    this.user,
+    this.tutorial,
+    this.swoftDownload,
+    this.affUrl,
+    this.userLoginUrl,
+    this.userBuy,
+    this.userTicket,
+    this.clashConfig,
+  });
 }

+ 0 - 3
lib/app/data/model/NodeMode.dart

@@ -1,7 +1,4 @@
 import 'package:dart_json_mapper/dart_json_mapper.dart';
-
-import 'package:dart_json_mapper/dart_json_mapper.dart';
-
 @jsonSerializable
 class NodeMode {
   final int id;

+ 36 - 14
lib/app/data/model/SysConfig.dart

@@ -2,28 +2,50 @@ import 'package:dart_json_mapper/dart_json_mapper.dart';
 
 @jsonSerializable
 class SysConfig {
-  String? affurl;
+  @JsonProperty(name: 'affurl')
+  String? affUrl;
+
+  @JsonProperty(name: 'user_login_url')
   String? userLoginUrl;
+
+  @JsonProperty(name: 'user_login_url_ke')
   String? userLoginUrlKe;
+
+  @JsonProperty(name: 'user_buy')
   String? userBuy;
+
+  @JsonProperty(name: 'user_ticket')
   String? userTicket;
+
+  @JsonProperty(name: 'user_reg')
   String? userReg;
+
+  @JsonProperty(name: 'user_reset')
   String? userReset;
+
+  @JsonProperty(name: 'user_tutorial')
   String? userTutorial;
-  String? userRofile;
+
+  @JsonProperty(name: 'user_rofile')
+  String? userProfile;
+
+  @JsonProperty(name: 'user_download')
   String? userDownload;
+
+  @JsonProperty(name: 'tag')
   int? tag;
 
-  SysConfig(
-      {this.affurl,
-        this.userLoginUrl,
-        this.userLoginUrlKe,
-        this.userBuy,
-        this.userTicket,
-        this.userReg,
-        this.userReset,
-        this.userTutorial,
-        this.userRofile,
-        this.userDownload,
-        this.tag});
+  SysConfig({
+    this.affUrl,
+    this.userLoginUrl,
+    this.userLoginUrlKe,
+    this.userBuy,
+    this.userTicket,
+    this.userReg,
+    this.userReset,
+    this.userTutorial,
+    this.userProfile,
+    this.userDownload,
+    this.tag,
+  });
 }

+ 78 - 30
lib/app/data/model/UserMode.dart

@@ -3,54 +3,102 @@ import 'package:dart_json_mapper/dart_json_mapper.dart';
 
 @jsonSerializable
 class User {
+  @JsonProperty(name: 'id')
   int? id;
+
+  @JsonProperty(name: 'nickname')
   String? nickname;
+
+  @JsonProperty(name: 'account')
   String? account;
+
+  @JsonProperty(name: 'port')
   int? port;
-  String? passwd;
+
+  @JsonProperty(name: 'passwd')
+  String? password;
+
+  @JsonProperty(name: 'uuid')
   String? uuid;
+
+  @JsonProperty(name: 'transfer_enable')
   int? transferEnable;
+
+  @JsonProperty(name: 'unusedTraffic')
   String? unusedTraffic;
+
+  @JsonProperty(name: 'u')
   int? u;
+
+  @JsonProperty(name: 'd')
   int? d;
+
+  @JsonProperty(name: 't')
   int? t;
+
+  @JsonProperty(name: 'enable')
   int? enable;
+
+  @JsonProperty(name: 'speed_limit')
   int? speedLimit;
+
+  @JsonProperty(name: 'credit')
   int? credit;
+
+  @JsonProperty(name: 'expired_at')
   String? expiredAt;
-  String? banTime;
+
+  @JsonProperty(name: 'ban_time')
+  dynamic? banTime; // it's dynamic because it can be null or some other type
+
+  @JsonProperty(name: 'level')
   String? level;
-  String? group;
+
+  @JsonProperty(name: 'group')
+  dynamic? group;
+
+  @JsonProperty(name: 'last_login')
   int? lastLogin;
-  String? resetTime;
+
+  @JsonProperty(name: 'reset_time')
+  dynamic? resetTime;
+
+  @JsonProperty(name: 'invite_num')
   int? inviteNum;
-  String? userGroupId;
+
+  @JsonProperty(name: 'user_group_id')
+  dynamic? userGroupId;
+
+  @JsonProperty(name: 'status')
   int? status;
+
+  @JsonProperty(name: 'code')
   String? code;
 
-  User(
-      {this.id,
-        this.nickname,
-        this.account,
-        this.port,
-        this.passwd,
-        this.uuid,
-        this.transferEnable,
-        this.unusedTraffic,
-        this.u,
-        this.d,
-        this.t,
-        this.enable,
-        this.speedLimit,
-        this.credit,
-        this.expiredAt,
-        this.banTime,
-        this.level,
-        this.group,
-        this.lastLogin,
-        this.resetTime,
-        this.inviteNum,
-        this.userGroupId,
-        this.status,
-        this.code});
+  User({
+    this.id,
+    this.nickname,
+    this.account,
+    this.port,
+    this.password,
+    this.uuid,
+    this.transferEnable,
+    this.unusedTraffic,
+    this.u,
+    this.d,
+    this.t,
+    this.enable,
+    this.speedLimit,
+    this.credit,
+    this.expiredAt,
+    this.banTime,
+    this.level,
+    this.group,
+    this.lastLogin,
+    this.resetTime,
+    this.inviteNum,
+    this.userGroupId,
+    this.status,
+    this.code,
+  });
 }

+ 39 - 29
lib/app/service/clash_service.dart

@@ -27,8 +27,8 @@ late NativeLibrary clashFFI;
 
 class ClashService extends GetxService with TrayListener {
   // 需要一起改端口
-  static const clashBaseUrl = "http://127.0.0.1:$clashExtPort";
-  static const clashExtPort = 22346;
+  static const clashBaseUrl = "http://127.0.0.1:";
+  var  clashExtPort = 22346;
 
   // 运行时
   late Directory _clashDirectory;
@@ -81,13 +81,17 @@ class ClashService extends GetxService with TrayListener {
 
   Future<ClashService> init() async {
     _clashDirectory = await getApplicationSupportDirectory();
-
+    final httpPort = await getUnusedPort();
+    final socksPort = await getUnusedPort();
+    final mixedPort = await getUnusedPort();
+    final export = await getUnusedPort();
     final _ = SpUtil.getData('yaml', defValue: currentYaml.value);
-    initializedHttpPort = SpUtil.getData('http-port', defValue: 7899);
-    initializedSockPort = SpUtil.getData('socks-port', defValue: 7877);
-    initializedMixedPort = SpUtil.getData('mixed-port', defValue: 7811);
+    initializedHttpPort = SpUtil.getData('http-port', defValue: httpPort);
+    initializedSockPort = SpUtil.getData('socks-port', defValue: socksPort);
+    initializedMixedPort = SpUtil.getData('mixed-port', defValue: mixedPort);
     currentYaml.value = _;
-    Request.setBaseUrl(clashBaseUrl);
+    clashExtPort = export;
+    Request.setBaseUrl(clashBaseUrl +"$clashExtPort");
     final clashConfigPath = p.join(_clashDirectory.path, "clash");
     _clashDirectory = Directory(clashConfigPath);
     if (kDebugMode) {
@@ -154,6 +158,12 @@ class ClashService extends GetxService with TrayListener {
     // });
     return this;
   }
+  Future<int> getUnusedPort() async {
+    var server = await ServerSocket.bind(InternetAddress.loopbackIPv4, 0);
+    int port = server.port;
+    await server.close();
+    return port;
+  }
 
   void getConfigs() {
     yamlConfigs.clear();
@@ -279,31 +289,31 @@ ${generateRules()}
     //   await Future.delayed(const Duration(milliseconds: 500));
     // }
     // get traffic
-    // Timer.periodic(const Duration(seconds: 1), (t) {
-    //   final trafficPtr = clashFFI.get_traffic().cast<Utf8>();
-    //   final traffic = trafficPtr.toDartString();
-    //   if (kDebugMode) {
-    //     debugPrint(traffic);
-    //   }
-    //   try {
-    //     final trafficJson = jsonDecode(traffic);
-    //     uploadRate.value = trafficJson['Up'].toDouble() / 1024; // KB
-    //     downRate.value = trafficJson['Down'].toDouble() / 1024; // KB
-    //     // fix: 只有KDE不会导致Tray自动消失
-    //     // final desktop = Platform.environment['XDG_CURRENT_DESKTOP'];
-    //     // updateTray();
-    //   } catch (e) {
-    //     Get.printError(info: '$e');
-    //   }
-    //   // malloc.free(trafficPtr);
-    // });
+    Timer.periodic(const Duration(seconds: 1), (t) {
+      final trafficPtr = clashFFI.get_traffic().cast<Utf8>();
+      final traffic = trafficPtr.toDartString();
+      // if (kDebugMode) {
+      //   debugPrint(traffic);
+      // }
+      try {
+        final trafficJson = jsonDecode(traffic);
+        uploadRate.value = trafficJson['Up'].toDouble() / 1024; // KB
+        downRate.value = trafficJson['Down'].toDouble() / 1024; // KB
+        // fix: 只有KDE不会导致Tray自动消失
+        // final desktop = Platform.environment['XDG_CURRENT_DESKTOP'];
+        // updateTray();
+      } catch (e) {
+        Get.printError(info: '$e');
+      }
+      // malloc.free(trafficPtr);
+    });
     // // system proxy
     // // listen port
     await reload();
-    // checkPort();
-    // if (isSystemProxy()) {
-    //   setSystemProxy();
-    // }
+    checkPort();
+    if (isSystemProxy()) {
+      setSystemProxy();
+    }
   }
 
   @override

+ 0 - 566
lib/clash_generated_bindings.dart

@@ -1,566 +0,0 @@
-// AUTO GENERATED FILE, DO NOT EDIT.
-//
-// Generated by `package:ffigen`.
-// ignore_for_file: type=lint
-import 'dart:ffi' as ffi;
-
-class NativeLibrary {
-  /// Holds the symbol lookup function.
-  final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
-      _lookup;
-
-  /// The symbols are looked up in [dynamicLibrary].
-  NativeLibrary(ffi.DynamicLibrary dynamicLibrary)
-      : _lookup = dynamicLibrary.lookup;
-
-  /// The symbols are looked up with [lookup].
-  NativeLibrary.fromLookup(
-      ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
-          lookup)
-      : _lookup = lookup;
-
-  int clash_init(
-    ffi.Pointer<ffi.Char> home_dir,
-  ) {
-    return _clash_init(
-      home_dir,
-    );
-  }
-
-  late final _clash_initPtr =
-      _lookup<ffi.NativeFunction<GoInt Function(ffi.Pointer<ffi.Char>)>>(
-          'clash_init');
-  late final _clash_init =
-      _clash_initPtr.asFunction<int Function(ffi.Pointer<ffi.Char>)>();
-
-  int set_config(
-    ffi.Pointer<ffi.Char> config_path,
-  ) {
-    return _set_config(
-      config_path,
-    );
-  }
-
-  late final _set_configPtr =
-      _lookup<ffi.NativeFunction<GoInt Function(ffi.Pointer<ffi.Char>)>>(
-          'set_config');
-  late final _set_config =
-      _set_configPtr.asFunction<int Function(ffi.Pointer<ffi.Char>)>();
-
-  int set_home_dir(
-    ffi.Pointer<ffi.Char> home,
-  ) {
-    return _set_home_dir(
-      home,
-    );
-  }
-
-  late final _set_home_dirPtr =
-      _lookup<ffi.NativeFunction<GoInt Function(ffi.Pointer<ffi.Char>)>>(
-          'set_home_dir');
-  late final _set_home_dir =
-      _set_home_dirPtr.asFunction<int Function(ffi.Pointer<ffi.Char>)>();
-
-  ffi.Pointer<ffi.Char> get_config() {
-    return _get_config();
-  }
-
-  late final _get_configPtr =
-      _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
-          'get_config');
-  late final _get_config =
-      _get_configPtr.asFunction<ffi.Pointer<ffi.Char> Function()>();
-
-  int set_ext_controller(
-    int port,
-  ) {
-    return _set_ext_controller(
-      port,
-    );
-  }
-
-  late final _set_ext_controllerPtr =
-      _lookup<ffi.NativeFunction<GoInt Function(GoUint64)>>(
-          'set_ext_controller');
-  late final _set_ext_controller =
-      _set_ext_controllerPtr.asFunction<int Function(int)>();
-
-  void clear_ext_options() {
-    return _clear_ext_options();
-  }
-
-  late final _clear_ext_optionsPtr =
-      _lookup<ffi.NativeFunction<ffi.Void Function()>>('clear_ext_options');
-  late final _clear_ext_options =
-      _clear_ext_optionsPtr.asFunction<void Function()>();
-
-  int is_config_valid(
-    ffi.Pointer<ffi.Char> config_path,
-  ) {
-    return _is_config_valid(
-      config_path,
-    );
-  }
-
-  late final _is_config_validPtr =
-      _lookup<ffi.NativeFunction<GoInt Function(ffi.Pointer<ffi.Char>)>>(
-          'is_config_valid');
-  late final _is_config_valid =
-      _is_config_validPtr.asFunction<int Function(ffi.Pointer<ffi.Char>)>();
-
-  ffi.Pointer<ffi.Char> get_all_connections() {
-    return _get_all_connections();
-  }
-
-  late final _get_all_connectionsPtr =
-      _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
-          'get_all_connections');
-  late final _get_all_connections =
-      _get_all_connectionsPtr.asFunction<ffi.Pointer<ffi.Char> Function()>();
-
-  void close_all_connections() {
-    return _close_all_connections();
-  }
-
-  late final _close_all_connectionsPtr =
-      _lookup<ffi.NativeFunction<ffi.Void Function()>>('close_all_connections');
-  late final _close_all_connections =
-      _close_all_connectionsPtr.asFunction<void Function()>();
-
-  int close_connection(
-    ffi.Pointer<ffi.Char> id,
-  ) {
-    return _close_connection(
-      id,
-    );
-  }
-
-  late final _close_connectionPtr =
-      _lookup<ffi.NativeFunction<GoUint8 Function(ffi.Pointer<ffi.Char>)>>(
-          'close_connection');
-  late final _close_connection =
-      _close_connectionPtr.asFunction<int Function(ffi.Pointer<ffi.Char>)>();
-
-  int parse_options() {
-    return _parse_options();
-  }
-
-  late final _parse_optionsPtr =
-      _lookup<ffi.NativeFunction<GoUint8 Function()>>('parse_options');
-  late final _parse_options = _parse_optionsPtr.asFunction<int Function()>();
-
-  ffi.Pointer<ffi.Char> get_traffic() {
-    return _get_traffic();
-  }
-
-  late final _get_trafficPtr =
-      _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
-          'get_traffic');
-  late final _get_traffic =
-      _get_trafficPtr.asFunction<ffi.Pointer<ffi.Char> Function()>();
-
-  void init_native_api_bridge(
-    ffi.Pointer<ffi.Void> api,
-  ) {
-    return _init_native_api_bridge(
-      api,
-    );
-  }
-
-  late final _init_native_api_bridgePtr =
-      _lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
-          'init_native_api_bridge');
-  late final _init_native_api_bridge = _init_native_api_bridgePtr
-      .asFunction<void Function(ffi.Pointer<ffi.Void>)>();
-
-  void start_log(
-    int port,
-  ) {
-    return _start_log(
-      port,
-    );
-  }
-
-  late final _start_logPtr =
-      _lookup<ffi.NativeFunction<ffi.Void Function(ffi.LongLong)>>('start_log');
-  late final _start_log = _start_logPtr.asFunction<void Function(int)>();
-
-  void stop_log() {
-    return _stop_log();
-  }
-
-  late final _stop_logPtr =
-      _lookup<ffi.NativeFunction<ffi.Void Function()>>('stop_log');
-  late final _stop_log = _stop_logPtr.asFunction<void Function()>();
-
-  int change_proxy(
-    ffi.Pointer<ffi.Char> selector_name,
-    ffi.Pointer<ffi.Char> proxy_name,
-  ) {
-    return _change_proxy(
-      selector_name,
-      proxy_name,
-    );
-  }
-
-  late final _change_proxyPtr = _lookup<
-      ffi.NativeFunction<
-          ffi.Long Function(
-              ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>('change_proxy');
-  late final _change_proxy = _change_proxyPtr
-      .asFunction<int Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>();
-
-  int change_config_field(
-    ffi.Pointer<ffi.Char> s,
-  ) {
-    return _change_config_field(
-      s,
-    );
-  }
-
-  late final _change_config_fieldPtr =
-      _lookup<ffi.NativeFunction<ffi.Long Function(ffi.Pointer<ffi.Char>)>>(
-          'change_config_field');
-  late final _change_config_field =
-      _change_config_fieldPtr.asFunction<int Function(ffi.Pointer<ffi.Char>)>();
-
-  void async_test_delay(
-    ffi.Pointer<ffi.Char> proxy_name,
-    ffi.Pointer<ffi.Char> url,
-    int timeout,
-    int port,
-  ) {
-    return _async_test_delay(
-      proxy_name,
-      url,
-      timeout,
-      port,
-    );
-  }
-
-  late final _async_test_delayPtr = _lookup<
-      ffi.NativeFunction<
-          ffi.Void Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>,
-              ffi.Long, ffi.LongLong)>>('async_test_delay');
-  late final _async_test_delay = _async_test_delayPtr.asFunction<
-      void Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>, int, int)>();
-
-  ffi.Pointer<ffi.Char> get_proxies() {
-    return _get_proxies();
-  }
-
-  late final _get_proxiesPtr =
-      _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
-          'get_proxies');
-  late final _get_proxies =
-      _get_proxiesPtr.asFunction<ffi.Pointer<ffi.Char> Function()>();
-
-  ffi.Pointer<ffi.Char> get_configs() {
-    return _get_configs();
-  }
-
-  late final _get_configsPtr =
-      _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
-          'get_configs');
-  late final _get_configs =
-      _get_configsPtr.asFunction<ffi.Pointer<ffi.Char> Function()>();
-}
-
-final class __mbstate_t extends ffi.Union {
-  @ffi.Array.multi([128])
-  external ffi.Array<ffi.Char> __mbstate8;
-
-  @ffi.LongLong()
-  external int _mbstateL;
-}
-
-final class __darwin_pthread_handler_rec extends ffi.Struct {
-  external ffi
-      .Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>
-      __routine;
-
-  external ffi.Pointer<ffi.Void> __arg;
-
-  external ffi.Pointer<__darwin_pthread_handler_rec> __next;
-}
-
-final class _opaque_pthread_attr_t extends ffi.Struct {
-  @ffi.Long()
-  external int __sig;
-
-  @ffi.Array.multi([56])
-  external ffi.Array<ffi.Char> __opaque;
-}
-
-final class _opaque_pthread_cond_t extends ffi.Struct {
-  @ffi.Long()
-  external int __sig;
-
-  @ffi.Array.multi([40])
-  external ffi.Array<ffi.Char> __opaque;
-}
-
-final class _opaque_pthread_condattr_t extends ffi.Struct {
-  @ffi.Long()
-  external int __sig;
-
-  @ffi.Array.multi([8])
-  external ffi.Array<ffi.Char> __opaque;
-}
-
-final class _opaque_pthread_mutex_t extends ffi.Struct {
-  @ffi.Long()
-  external int __sig;
-
-  @ffi.Array.multi([56])
-  external ffi.Array<ffi.Char> __opaque;
-}
-
-final class _opaque_pthread_mutexattr_t extends ffi.Struct {
-  @ffi.Long()
-  external int __sig;
-
-  @ffi.Array.multi([8])
-  external ffi.Array<ffi.Char> __opaque;
-}
-
-final class _opaque_pthread_once_t extends ffi.Struct {
-  @ffi.Long()
-  external int __sig;
-
-  @ffi.Array.multi([8])
-  external ffi.Array<ffi.Char> __opaque;
-}
-
-final class _opaque_pthread_rwlock_t extends ffi.Struct {
-  @ffi.Long()
-  external int __sig;
-
-  @ffi.Array.multi([192])
-  external ffi.Array<ffi.Char> __opaque;
-}
-
-final class _opaque_pthread_rwlockattr_t extends ffi.Struct {
-  @ffi.Long()
-  external int __sig;
-
-  @ffi.Array.multi([16])
-  external ffi.Array<ffi.Char> __opaque;
-}
-
-final class _opaque_pthread_t extends ffi.Struct {
-  @ffi.Long()
-  external int __sig;
-
-  external ffi.Pointer<__darwin_pthread_handler_rec> __cleanup_stack;
-
-  @ffi.Array.multi([8176])
-  external ffi.Array<ffi.Char> __opaque;
-}
-
-final class _GoString_ extends ffi.Struct {
-  external ffi.Pointer<ffi.Char> p;
-
-  @ptrdiff_t()
-  external int n;
-}
-
-typedef ptrdiff_t = __darwin_ptrdiff_t;
-typedef __darwin_ptrdiff_t = ffi.Long;
-
-final class GoInterface extends ffi.Struct {
-  external ffi.Pointer<ffi.Void> t;
-
-  external ffi.Pointer<ffi.Void> v;
-}
-
-final class GoSlice extends ffi.Struct {
-  external ffi.Pointer<ffi.Void> data;
-
-  @GoInt()
-  external int len;
-
-  @GoInt()
-  external int cap;
-}
-
-typedef GoInt = GoInt64;
-typedef GoInt64 = ffi.LongLong;
-typedef GoUint64 = ffi.UnsignedLongLong;
-typedef GoUint8 = ffi.UnsignedChar;
-
-const int __DARWIN_ONLY_64_BIT_INO_T = 1;
-
-const int __DARWIN_ONLY_UNIX_CONFORMANCE = 1;
-
-const int __DARWIN_ONLY_VERS_1050 = 1;
-
-const int __DARWIN_UNIX03 = 1;
-
-const int __DARWIN_64_BIT_INO_T = 1;
-
-const int __DARWIN_VERS_1050 = 1;
-
-const int __DARWIN_NON_CANCELABLE = 0;
-
-const String __DARWIN_SUF_EXTSN = '\$DARWIN_EXTSN';
-
-const int __DARWIN_C_ANSI = 4096;
-
-const int __DARWIN_C_FULL = 900000;
-
-const int __DARWIN_C_LEVEL = 900000;
-
-const int __STDC_WANT_LIB_EXT1__ = 1;
-
-const int __DARWIN_NO_LONG_LONG = 0;
-
-const int _DARWIN_FEATURE_64_BIT_INODE = 1;
-
-const int _DARWIN_FEATURE_ONLY_64_BIT_INODE = 1;
-
-const int _DARWIN_FEATURE_ONLY_VERS_1050 = 1;
-
-const int _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE = 1;
-
-const int _DARWIN_FEATURE_UNIX_CONFORMANCE = 3;
-
-const int __has_ptrcheck = 0;
-
-const int __DARWIN_NULL = 0;
-
-const int __PTHREAD_SIZE__ = 8176;
-
-const int __PTHREAD_ATTR_SIZE__ = 56;
-
-const int __PTHREAD_MUTEXATTR_SIZE__ = 8;
-
-const int __PTHREAD_MUTEX_SIZE__ = 56;
-
-const int __PTHREAD_CONDATTR_SIZE__ = 8;
-
-const int __PTHREAD_COND_SIZE__ = 40;
-
-const int __PTHREAD_ONCE_SIZE__ = 8;
-
-const int __PTHREAD_RWLOCK_SIZE__ = 192;
-
-const int __PTHREAD_RWLOCKATTR_SIZE__ = 16;
-
-const int __DARWIN_WCHAR_MAX = 2147483647;
-
-const int __DARWIN_WCHAR_MIN = -2147483648;
-
-const int __DARWIN_WEOF = -1;
-
-const int _FORTIFY_SOURCE = 2;
-
-const int NULL = 0;
-
-const int USER_ADDR_NULL = 0;
-
-const int __WORDSIZE = 64;
-
-const int INT8_MAX = 127;
-
-const int INT16_MAX = 32767;
-
-const int INT32_MAX = 2147483647;
-
-const int INT64_MAX = 9223372036854775807;
-
-const int INT8_MIN = -128;
-
-const int INT16_MIN = -32768;
-
-const int INT32_MIN = -2147483648;
-
-const int INT64_MIN = -9223372036854775808;
-
-const int UINT8_MAX = 255;
-
-const int UINT16_MAX = 65535;
-
-const int UINT32_MAX = 4294967295;
-
-const int UINT64_MAX = -1;
-
-const int INT_LEAST8_MIN = -128;
-
-const int INT_LEAST16_MIN = -32768;
-
-const int INT_LEAST32_MIN = -2147483648;
-
-const int INT_LEAST64_MIN = -9223372036854775808;
-
-const int INT_LEAST8_MAX = 127;
-
-const int INT_LEAST16_MAX = 32767;
-
-const int INT_LEAST32_MAX = 2147483647;
-
-const int INT_LEAST64_MAX = 9223372036854775807;
-
-const int UINT_LEAST8_MAX = 255;
-
-const int UINT_LEAST16_MAX = 65535;
-
-const int UINT_LEAST32_MAX = 4294967295;
-
-const int UINT_LEAST64_MAX = -1;
-
-const int INT_FAST8_MIN = -128;
-
-const int INT_FAST16_MIN = -32768;
-
-const int INT_FAST32_MIN = -2147483648;
-
-const int INT_FAST64_MIN = -9223372036854775808;
-
-const int INT_FAST8_MAX = 127;
-
-const int INT_FAST16_MAX = 32767;
-
-const int INT_FAST32_MAX = 2147483647;
-
-const int INT_FAST64_MAX = 9223372036854775807;
-
-const int UINT_FAST8_MAX = 255;
-
-const int UINT_FAST16_MAX = 65535;
-
-const int UINT_FAST32_MAX = 4294967295;
-
-const int UINT_FAST64_MAX = -1;
-
-const int INTPTR_MAX = 9223372036854775807;
-
-const int INTPTR_MIN = -9223372036854775808;
-
-const int UINTPTR_MAX = -1;
-
-const int INTMAX_MAX = 9223372036854775807;
-
-const int UINTMAX_MAX = -1;
-
-const int INTMAX_MIN = -9223372036854775808;
-
-const int PTRDIFF_MIN = -9223372036854775808;
-
-const int PTRDIFF_MAX = 9223372036854775807;
-
-const int SIZE_MAX = -1;
-
-const int RSIZE_MAX = 9223372036854775807;
-
-const int WCHAR_MAX = 2147483647;
-
-const int WCHAR_MIN = -2147483648;
-
-const int WINT_MIN = -2147483648;
-
-const int WINT_MAX = 2147483647;
-
-const int SIG_ATOMIC_MIN = -2147483648;
-
-const int SIG_ATOMIC_MAX = 2147483647;

+ 1 - 1
macos/Podfile.lock

@@ -94,4 +94,4 @@ SPEC CHECKSUMS:
 
 PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
 
-COCOAPODS: 1.12.1
+COCOAPODS: 1.13.0

+ 0 - 2
macos/Runner/DebugProfile.entitlements

@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-	<key>com.apple.security.app-sandbox</key>
-	<true/>
 	<key>com.apple.security.cs.allow-jit</key>
 	<true/>
 	<key>com.apple.security.network.client</key>

+ 0 - 2
macos/Runner/Release.entitlements

@@ -2,8 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-	<key>com.apple.security.app-sandbox</key>
-	<true/>
 	<key>com.apple.security.network.client</key>
 	<true/>
 </dict>