Compare commits

..

1 Commits

Author SHA1 Message Date
chen08209
6fde588714 Fix android tile service 2025-10-02 14:17:59 +08:00
13 changed files with 37 additions and 27 deletions

View File

@@ -66,6 +66,7 @@
<activity
android:name=".TempActivity"
android:excludeFromRecents="true"
android:exported="true"
android:theme="@style/TransparentTheme">
<intent-filter>

View File

@@ -30,6 +30,6 @@ class TempActivity : Activity(),
}
}
}
finishAndRemoveTask()
finish()
}
}

View File

@@ -43,11 +43,6 @@ func handleInitClash(paramsString string) bool {
version = params.Version
if !isInit {
constant.SetHomeDir(params.HomeDir)
//currentConfig, _ = config.ParseRawConfig(config.DefaultRawConfig())
//startTime := time.Now()
//hub.ApplyConfig(currentConfig)
//elapsedTime := time.Since(startTime) / time.Millisecond
//log.Infoln("Initial clash env, total time: %dms", elapsedTime)
isInit = true
}
return isInit

View File

@@ -37,6 +37,8 @@ type TunHandler struct {
}
func (th *TunHandler) start(fd int, stack, address, dns string) {
runLock.Lock()
defer runLock.Unlock()
_ = th.limit.Acquire(context.TODO(), 4)
defer th.limit.Release(4)
th.initHook()

View File

@@ -466,9 +466,6 @@ class AppController {
Map<String, dynamic>? data,
bool handleError = false,
}) async {
if (globalState.isPre) {
return;
}
if (data != null) {
final tagName = data['tag_name'];
final body = data['body'];

View File

@@ -91,10 +91,17 @@ class CoreController {
return await _interface.updateConfig(updateParams);
}
Future<String> setupConfig(ClashConfig clashConfig) async {
Future<String> setupConfig(
ClashConfig clashConfig, {
VoidCallback? preloadInvoke,
}) async {
await globalState.genConfigFile(clashConfig);
final params = await globalState.getSetupParams();
return await _interface.setupConfig(params);
final res = _interface.setupConfig(params);
if (preloadInvoke != null) {
preloadInvoke();
}
return res;
}
Future<List<Group>> getProxiesGroups({

View File

@@ -157,7 +157,7 @@ abstract class CoreHandlerInterface with CoreInterface {
@override
Future<Result> getConfig(String path) async {
return await _invoke<Result>(method: ActionMethod.getConfig, data: path) ??
Result<Map<String, dynamic>>.success({});
Result.success({});
}
@override

View File

@@ -33,16 +33,18 @@ Future<void> _service(List<String> flags) async {
},
),
);
Future(() async {
app?.tip(appLocalizations.startVpn);
final version = await system.version;
await coreController.init(version);
final clashConfig = globalState.config.patchClashConfig.copyWith.tun(
enable: false,
);
await coreController.setupConfig(clashConfig);
await globalState.handleStart();
});
app?.tip(appLocalizations.startVpn);
final version = await system.version;
await coreController.init(version);
final clashConfig = globalState.config.patchClashConfig.copyWith.tun(
enable: false,
);
coreController.setupConfig(
clashConfig,
preloadInvoke: () {
globalState.handleStart();
},
);
}
@immutable

View File

@@ -192,7 +192,7 @@ extension ActionResultExt on ActionResult {
if (code == ResultType.success) {
return Result.success(data);
} else {
return Result.error(data);
return Result.error('$data');
}
}
}

View File

@@ -304,7 +304,13 @@ class GlobalState {
Future<void> genConfigFile(ClashConfig pathConfig) async {
final configFilePath = await appPath.configFilePath;
final config = await patchRawConfig(patchConfig: pathConfig);
var config = {};
try {
config = await patchRawConfig(patchConfig: pathConfig);
} catch (e) {
globalState.showNotifier(e.toString());
config = {};
}
final res = await Isolate.run<String>(() async {
try {
final res = json.encode(config);

View File

@@ -488,7 +488,7 @@ class _ListHeaderState extends State<ListHeader> {
return CommonCard(
enterAnimated: widget.enterAnimated,
key: widget.key,
radius: 16.ap,
radius: 18.ap,
type: CommonCardType.filled,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),

View File

@@ -79,7 +79,7 @@ class CommonCard extends StatelessWidget {
this.type = CommonCardType.plain,
this.onPressed,
this.selectWidget,
this.radius = 12,
this.radius = 14,
required this.child,
this.padding,
this.enterAnimated = false,

View File

@@ -1,7 +1,7 @@
name: fl_clash
description: A multi-platform proxy client based on ClashMeta, simple and easy to use, open-source and ad-free.
publish_to: 'none'
version: 0.8.90+2025092801
version: 0.8.90+2025100201
environment:
sdk: '>=3.8.0 <4.0.0'