Skip to content

Commit 9315bb4

Browse files
committed
Fix android tile service
1 parent 201062d commit 9315bb4

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

android/app/src/main/kotlin/com/follow/clash/State.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ object State {
9292

9393
suspend fun destroyServiceEngine() {
9494
runLock.withLock {
95+
GlobalState.log("Destroy service engine")
9596
withContext(Dispatchers.Main) {
9697
runCatching {
9798
serviceFlutterEngine?.destroy()
@@ -103,10 +104,12 @@ object State {
103104

104105
suspend fun startServiceWithEngine() {
105106
runLock.withLock {
106-
if (serviceFlutterEngine != null || runStateFlow.value == RunState.PENDING || runStateFlow.value == RunState.START) {
107+
if (runStateFlow.value == RunState.PENDING || runStateFlow.value == RunState.START) {
107108
return
108109
}
110+
GlobalState.log("Create service engine")
109111
withContext(Dispatchers.Main) {
112+
serviceFlutterEngine?.destroy()
110113
serviceFlutterEngine = FlutterEngine(GlobalState.application)
111114
serviceFlutterEngine?.plugins?.add(ServicePlugin())
112115
serviceFlutterEngine?.plugins?.add(AppPlugin())

core/hub.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ var (
3333
)
3434

3535
func handleInitClash(paramsString string) bool {
36+
runLock.Lock()
37+
defer runLock.Unlock()
3638
var params = InitParams{}
3739
err := json.Unmarshal([]byte(paramsString), &params)
3840
if err != nil {
@@ -41,6 +43,11 @@ func handleInitClash(paramsString string) bool {
4143
version = params.Version
4244
if !isInit {
4345
constant.SetHomeDir(params.HomeDir)
46+
//currentConfig, _ = config.ParseRawConfig(config.DefaultRawConfig())
47+
//startTime := time.Now()
48+
//hub.ApplyConfig(currentConfig)
49+
//elapsedTime := time.Since(startTime) / time.Millisecond
50+
//log.Infoln("Initial clash env, total time: %dms", elapsedTime)
4451
isInit = true
4552
}
4653
return isInit

lib/controller.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ class AppController {
962962
final res = await futureFunction();
963963
return res;
964964
} catch (e) {
965-
commonPrint.log('$futureFunction ===> $e', logLevel: LogLevel.warning);
965+
commonPrint.log('$title===> $e', logLevel: LogLevel.warning);
966966
if (realSilence) {
967967
globalState.showNotifier(e.toString());
968968
} else {

lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ Future<void> _service(List<String> flags) async {
4040
final clashConfig = globalState.config.patchClashConfig.copyWith.tun(
4141
enable: false,
4242
);
43-
await globalState.handleStart();
4443
await coreController.setupConfig(clashConfig);
44+
await globalState.handleStart();
4545
});
4646
}
4747

lib/views/proxies/providers.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ class ProviderItem extends StatelessWidget {
147147
crossAxisAlignment: CrossAxisAlignment.start,
148148
children: [
149149
const SizedBox(height: 4),
150-
Text(_buildProviderDesc()),
150+
if (provider.updateAt.microsecondsSinceEpoch > 0)
151+
Text(_buildProviderDesc()),
151152
const SizedBox(height: 4),
152153
if (provider.subscriptionInfo != null)
153154
SubscriptionInfoView(subscriptionInfo: provider.subscriptionInfo),

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.89+2025092701
4+
version: 0.8.90+2025092801
55
environment:
66
sdk: '>=3.8.0 <4.0.0'
77

0 commit comments

Comments
 (0)