Skip to content

Commit f5544f1

Browse files
committed
Fix windows service verify issues
1 parent eeb5437 commit f5544f1

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

lib/main.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ Future<void> main() async {
2929
await globalState.initApp(version);
3030
await android?.init();
3131
await window?.init(version);
32-
globalState.isPre = const String.fromEnvironment("APP_ENV") != 'stable';
33-
globalState.coreSHA256 = const String.fromEnvironment("CORE_SHA256");
3432
HttpOverrides.global = FlClashHttpOverrides();
3533
runApp(ProviderScope(
3634
child: const Application(),

lib/state.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ class GlobalState {
5252
}
5353

5454
initApp(int version) async {
55+
coreSHA256 = const String.fromEnvironment("CORE_SHA256");
56+
isPre = const String.fromEnvironment("APP_ENV") != 'stable';
5557
appState = AppState(
5658
version: version,
5759
viewSize: Size.zero,

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: fl_clash
22
description: A multi-platform proxy client based on ClashMeta, simple and easy to use, open-source and ad-free.
33
publish_to: 'none'
4-
version: 0.8.83+202505011
4+
version: 0.8.84+202505012
55
environment:
66
sdk: '>=3.1.0 <4.0.0'
77

services/helper/src/service/hub.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ static PROCESS: Lazy<Arc<Mutex<Option<std::process::Child>>>> =
3939
Lazy::new(|| Arc::new(Mutex::new(None)));
4040

4141
fn start(start_params: StartParams) -> impl Reply {
42-
if sha256_file(start_params.path.as_str()).unwrap_or("".to_string()) != env!("TOKEN") {
43-
return "Only FlClashCore is allowed to run.".to_string();
42+
let sha256 = sha256_file(start_params.path.as_str()).unwrap_or("".to_string());
43+
if sha256 != env!("TOKEN") {
44+
return format!("The SHA256 hash of the program requesting execution is: {}. The helper program only allows execution of applications with the SHA256 hash: {}.", sha256, env!("TOKEN"),);
4445
}
4546
stop();
4647
let mut process = PROCESS.lock().unwrap();

0 commit comments

Comments
 (0)