GlobalConfigFileController.dart 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import 'dart:io';
  2. import 'package:get/get.dart';
  3. import 'package:naiyouwl/clash_generated_bindings.dart';
  4. class GlobalConfigFileController extends GetxController{
  5. static bool isStartClash = false;
  6. late Directory configDir;
  7. late final Clash clash;
  8. late final String clashConfigPath;
  9. late final String clashForMePath;
  10. late final String profilesPath;
  11. var systemProxy = false.obs;
  12. // var clashConfig = Config.defaultConfig().obs;
  13. // var clashForMe = ClashForMeConfig.defaultConfig().obs;
  14. //
  15. // Future<void> init() async {
  16. // await getApplicationSupportDirectory().then((dir) => configDir = dir);
  17. //
  18. // profilesPath = "${configDir.path}${Constants.profilesPath}";
  19. // clashForMePath = "${configDir.path}${Constants.clashForMe}";
  20. // clashConfigPath = "${configDir.path}${Constants.clashConfig}";
  21. //
  22. // await _initClash();
  23. // _initConfig();
  24. // _initAction();
  25. // }
  26. //
  27. // _initConfig() async {
  28. // ClashForMeConfig? tempCfm = ClashForMeConfig.formYamlFile(clashForMePath);
  29. // tempCfm = await _profilesInitCheck(tempCfm);
  30. // if (tempCfm != null) {
  31. // clashForMe.value = tempCfm;
  32. // }
  33. //
  34. // clashConfig.value = Config.formYamlFile(clashConfigPath);
  35. // }
  36. }