mirror of
https://github.com/hiddify/hiddify-app.git
synced 2026-05-04 11:22:28 +00:00
refactor: update project configuration and clean up unused code
This commit is contained in:
@@ -1,79 +0,0 @@
|
||||
name: Manual Windows Build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
upload-artifact:
|
||||
type: boolean
|
||||
description: 'Upload build artifacts to release'
|
||||
default: true
|
||||
tag-name:
|
||||
type: string
|
||||
description: 'Release tag name'
|
||||
default: 'draft'
|
||||
channel:
|
||||
type: string
|
||||
description: 'Build channel (dev/prod)'
|
||||
default: 'dev'
|
||||
|
||||
env:
|
||||
IS_GITHUB_ACTIONS: 1
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
permissions: write-all
|
||||
env:
|
||||
PATH: ${{ env.PATH }}:$HOME/.pub-cache/bin
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: subosito/flutter-action@v2.16.0
|
||||
with:
|
||||
flutter-version: '3.38.5'
|
||||
channel: 'stable'
|
||||
cache: true
|
||||
|
||||
- name: Install fastforge
|
||||
run: |
|
||||
echo "Installing fastforge..."
|
||||
dart pub global activate fastforge
|
||||
shell: bash
|
||||
|
||||
|
||||
- name: Prepare Windows Build
|
||||
run: make windows-prepare
|
||||
shell: bash
|
||||
|
||||
- name: Build Windows Release
|
||||
run: |
|
||||
export PATH="$PATH:$HOME/.pub-cache/bin"
|
||||
make windows-release
|
||||
shell: bash
|
||||
env:
|
||||
CHANNEL: ${{ inputs.channel }}
|
||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
|
||||
- name: Upload Artifacts
|
||||
if: ${{ inputs.upload-artifact }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-builds
|
||||
path: dist/
|
||||
retention-days: 30
|
||||
|
||||
- name: Create Release
|
||||
if: ${{ inputs.upload-artifact }}
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: ${{ inputs.tag-name }}
|
||||
files: |
|
||||
dist/**/*.exe
|
||||
dist/**/*.msix
|
||||
dist/**/*.zip
|
||||
draft: true
|
||||
prerelease: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
+1
-1
Submodule hiddify-core updated: a909abda82...97e1b2fc93
@@ -3,7 +3,7 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 54;
|
||||
objectVersion = 60;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
@@ -590,10 +590,14 @@
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
|
||||
@@ -644,10 +648,14 @@
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
@@ -1178,6 +1186,7 @@
|
||||
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = M7Q8ASP66Z;
|
||||
ENABLE_BITCODE = NO;
|
||||
|
||||
@@ -28,8 +28,8 @@ import 'package:meta/meta.dart';
|
||||
/// - local: fallback to protocol, extracted from content by protocol()
|
||||
|
||||
class ProfileParser {
|
||||
static const infiniteTrafficThreshold = 92233720368;
|
||||
static const infiniteTimeThreshold = 92233720368;
|
||||
static const infiniteTrafficThreshold = 920_233_720_368;
|
||||
static const infiniteTimeThreshold = 92_233_720_368;
|
||||
static const allowedOverrideConfigs = [
|
||||
'connection-test-url',
|
||||
'direct-dns-address',
|
||||
@@ -284,7 +284,7 @@ class ProfileParser {
|
||||
final values = subInfoStr.split(';');
|
||||
final map = {for (final v in values) v.split('=').first.trim(): num.tryParse(v.split('=').second.trim())?.toInt()};
|
||||
if (map case {"upload": final upload?, "download": final download?, "total": final total, "expire": var expire}) {
|
||||
final total1 = (total == null || total == 0) ? infiniteTrafficThreshold : total;
|
||||
final total1 = (total == null || total == 0) ? infiniteTrafficThreshold + 1 : total;
|
||||
expire = (expire == null || expire == 0) ? infiniteTimeThreshold : expire;
|
||||
return SubscriptionInfo(
|
||||
upload: upload,
|
||||
|
||||
@@ -34,12 +34,12 @@ enum _SearchActions { next, prev }
|
||||
/// Supported editors for JSON Editor.
|
||||
enum Editors { tree, text }
|
||||
|
||||
Map<String, Map<String, dynamic>> getProtocolSchemaValues({String fragmentPackets = "tlshello"}) => {
|
||||
const Map<String, Map<String, dynamic>> protocolSchemaValues = {
|
||||
"xray": {
|
||||
"type": "xray",
|
||||
"tag": "xray-out",
|
||||
"xray_outbound_raw": {},
|
||||
"xray_fragment": {"packets": fragmentPackets, "interval": "1-10", "length": "1-10"},
|
||||
"xray_fragment": {"packets": "tlshello", "interval": "1-10", "length": "1-10"},
|
||||
},
|
||||
"warp": {
|
||||
"type": "warp",
|
||||
@@ -467,7 +467,6 @@ class _JsonEditorState extends State<JsonEditor> {
|
||||
Timer? _searchTimer;
|
||||
late dynamic _data;
|
||||
late final _themeColor = widget.themeColor ?? Theme.of(context).primaryColor;
|
||||
late final protocolSchemaValues = getProtocolSchemaValues();
|
||||
late Editors _editor = widget.editors.first;
|
||||
bool _onError = false;
|
||||
bool? allExpanded;
|
||||
|
||||
@@ -433,7 +433,7 @@ abstract class ConfigOptions {
|
||||
enableClashApi: ref.watch(enableClashApi),
|
||||
clashApiPort: ref.watch(clashApiPort),
|
||||
enableTun: mode == ServiceMode.tun,
|
||||
enableTunService: mode == ServiceMode.tunService,
|
||||
// enableTunService: mode == false, //ServiceMode.tunService,
|
||||
setSystemProxy: mode == ServiceMode.systemProxy,
|
||||
bypassLan: ref.watch(bypassLan),
|
||||
allowConnectionFromLan: ref.watch(allowConnectionFromLan),
|
||||
|
||||
@@ -169,8 +169,18 @@ class HiddifyCoreService with InfraLogger {
|
||||
);
|
||||
ref.read(coreRestartSignalProvider.notifier).restart();
|
||||
if (res.messageType != MessageType.ALREADY_STARTED && res.messageType != MessageType.EMPTY) {
|
||||
statusController.add(currentState = const CoreStatus.stopped(alert: CoreAlert.startFailed));
|
||||
return left(const ConnectionFailure.unexpected("failed to start background core"));
|
||||
final alert = res.message.contains("denied") ? CoreAlert.requestVPNPermission : CoreAlert.startFailed;
|
||||
currentState = CoreStatus.stopped(
|
||||
alert: alert,
|
||||
message: "failed to start core ${res.messageType} ${res.message}",
|
||||
);
|
||||
|
||||
statusController.add(currentState);
|
||||
|
||||
return left(
|
||||
currentState.getCoreAlert() ??
|
||||
ConnectionFailure.unexpected("failed to start core ${res.messageType} ${res.message}"),
|
||||
);
|
||||
}
|
||||
} on GrpcError catch (e) {
|
||||
loggy.error("failed to start bg core: $e");
|
||||
|
||||
@@ -8,8 +8,9 @@ import 'package:hiddify/utils/platform_utils.dart';
|
||||
enum ServiceMode {
|
||||
proxy("proxy"),
|
||||
systemProxy("system-proxy"),
|
||||
tun("vpn"),
|
||||
tunService("vpn-service");
|
||||
tun("vpn")
|
||||
// tunService("vpn-service")
|
||||
;
|
||||
|
||||
const ServiceMode(this.key);
|
||||
|
||||
@@ -38,22 +39,22 @@ enum ServiceMode {
|
||||
proxy => t.pages.settings.inbound.serviceModes.proxy,
|
||||
systemProxy => t.pages.settings.inbound.serviceModes.systemProxy,
|
||||
tun => t.pages.settings.inbound.serviceModes.tun,
|
||||
tunService => t.pages.settings.inbound.serviceModes.tunService,
|
||||
// tunService => t.pages.settings.inbound.serviceModes.tunService,
|
||||
};
|
||||
|
||||
String presentShort(TranslationsEn t) => switch (this) {
|
||||
proxy => t.pages.settings.inbound.shortServiceModes.proxy,
|
||||
systemProxy => t.pages.settings.inbound.shortServiceModes.systemProxy,
|
||||
tun => t.pages.settings.inbound.shortServiceModes.tun,
|
||||
tunService => t.pages.settings.inbound.shortServiceModes.tunService,
|
||||
// tunService => t.pages.settings.inbound.shortServiceModes.tunService,
|
||||
};
|
||||
}
|
||||
|
||||
@JsonEnum(valueField: 'key')
|
||||
enum BalancerStrategy {
|
||||
roundRobin("round-robin"),
|
||||
consistentHash("consistent-hash"),
|
||||
stickySession("sticky-session");
|
||||
consistentHash("consistent-hashing"),
|
||||
stickySession("sticky-sessions");
|
||||
|
||||
const BalancerStrategy(this.key);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class SingboxConfigOption with _$SingboxConfigOption {
|
||||
required bool enableClashApi,
|
||||
required int clashApiPort,
|
||||
required bool enableTun,
|
||||
required bool enableTunService,
|
||||
// required bool enableTunService,
|
||||
required bool setSystemProxy,
|
||||
required bool bypassLan,
|
||||
required bool allowConnectionFromLan,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
display_name: Hiddify
|
||||
publisher_display_name: Hiddify
|
||||
identity_name: Hiddify.HiddifyNext
|
||||
msix_version: 4.0.5.0
|
||||
identity_name: Hiddify.App
|
||||
msix_version: 4.0.5.0
|
||||
logo_path: windows\runner\resources\app_icon.ico
|
||||
capabilities: internetClient, internetClientServer, privateNetworkClientServer
|
||||
languages: ar, en-us, es-es, fa-ir, fr-fr, id-id, pt-br, ru-ru, tr-tr, zh-cn, zh-tw
|
||||
|
||||
Reference in New Issue
Block a user