new: add10000 to all ports for prevenging permission error. add warp from github repository except for china
This commit is contained in:
@@ -83,19 +83,19 @@ abstract class ConfigOptions {
|
|||||||
|
|
||||||
static final mixedPort = PreferencesNotifier.create<int, int>(
|
static final mixedPort = PreferencesNotifier.create<int, int>(
|
||||||
"mixed-port",
|
"mixed-port",
|
||||||
2334,
|
12334,
|
||||||
validator: (value) => isPort(value.toString()),
|
validator: (value) => isPort(value.toString()),
|
||||||
);
|
);
|
||||||
|
|
||||||
static final tproxyPort = PreferencesNotifier.create<int, int>(
|
static final tproxyPort = PreferencesNotifier.create<int, int>(
|
||||||
"tproxy-port",
|
"tproxy-port",
|
||||||
2335,
|
12335,
|
||||||
validator: (value) => isPort(value.toString()),
|
validator: (value) => isPort(value.toString()),
|
||||||
);
|
);
|
||||||
|
|
||||||
static final localDnsPort = PreferencesNotifier.create<int, int>(
|
static final localDnsPort = PreferencesNotifier.create<int, int>(
|
||||||
"local-dns-port",
|
"local-dns-port",
|
||||||
6450,
|
16450,
|
||||||
validator: (value) => isPort(value.toString()),
|
validator: (value) => isPort(value.toString()),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ abstract class ConfigOptions {
|
|||||||
|
|
||||||
static final clashApiPort = PreferencesNotifier.create<int, int>(
|
static final clashApiPort = PreferencesNotifier.create<int, int>(
|
||||||
"clash-api-port",
|
"clash-api-port",
|
||||||
6756,
|
16756,
|
||||||
validator: (value) => isPort(value.toString()),
|
validator: (value) => isPort(value.toString()),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import 'package:hiddify/core/notification/in_app_notification_controller.dart';
|
|||||||
import 'package:hiddify/core/preferences/preferences_provider.dart';
|
import 'package:hiddify/core/preferences/preferences_provider.dart';
|
||||||
import 'package:hiddify/core/router/router.dart';
|
import 'package:hiddify/core/router/router.dart';
|
||||||
import 'package:hiddify/features/common/qr_code_scanner_screen.dart';
|
import 'package:hiddify/features/common/qr_code_scanner_screen.dart';
|
||||||
|
import 'package:hiddify/features/config_option/data/config_option_repository.dart';
|
||||||
import 'package:hiddify/features/config_option/notifier/warp_option_notifier.dart';
|
import 'package:hiddify/features/config_option/notifier/warp_option_notifier.dart';
|
||||||
|
|
||||||
import 'package:hiddify/features/config_option/overview/warp_options_widgets.dart';
|
import 'package:hiddify/features/config_option/overview/warp_options_widgets.dart';
|
||||||
@@ -275,7 +276,11 @@ class AddProfileModal extends HookConsumerWidget {
|
|||||||
await _warp.generateWarp2Config();
|
await _warp.generateWarp2Config();
|
||||||
toast?.start();
|
toast?.start();
|
||||||
// }
|
// }
|
||||||
await _profile.add("#profile-title: Hiddify WARP\nwarp://p1@auto#National&&detour=warp://p2@auto#WoW"); //
|
if (ref.read(ConfigOptions.region.notifier).raw() == "cn") {
|
||||||
|
await _profile.add("#profile-title: Hiddify WARP\nwarp://p1@auto#National&&detour=warp://p2@auto#WoW"); //
|
||||||
|
} else {
|
||||||
|
await _profile.add("https://raw.githubusercontent.com/hiddify/hiddify-next/main/test.configs/warp"); //
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,8 +78,7 @@ class AddProfile extends _$AddProfile with AppLogger {
|
|||||||
var name = parsed.name;
|
var name = parsed.name;
|
||||||
var oldItem = await _profilesRepo.getByName(name);
|
var oldItem = await _profilesRepo.getByName(name);
|
||||||
if (name == "Hiddify WARP" && oldItem != null) {
|
if (name == "Hiddify WARP" && oldItem != null) {
|
||||||
_profilesRepo.setAsActive(oldItem.id).run();
|
_profilesRepo.deleteById(oldItem.id).run();
|
||||||
return unit;
|
|
||||||
}
|
}
|
||||||
while (await _profilesRepo.getByName(name) != null) {
|
while (await _profilesRepo.getByName(name) != null) {
|
||||||
name += '${randomInt(0, 9).run()}';
|
name += '${randomInt(0, 9).run()}';
|
||||||
|
|||||||
Reference in New Issue
Block a user