Compare commits

...

6 Commits

Author SHA1 Message Date
chen08209
07bbaf6b6f Update version 2024-05-01 23:40:04 +08:00
chen08209
e8feb7c431 Set Android notification low importance 2024-05-01 23:40:03 +08:00
chen08209
4d16820526 Fix the issue that VpnService can't be closed correctly in special cases 2024-05-01 23:40:00 +08:00
chen08209
92294b49c6 Fix the problem that TileService is not destroyed correctly in some cases
Adjust tab animation defaults
2024-05-01 23:39:59 +08:00
chen08209
8a188a37c9 Add Telegram in README_zh_CN.md 2024-05-01 21:52:07 +08:00
chen08209
48af16c265 Add Telegram 2024-05-01 21:50:26 +08:00
8 changed files with 30 additions and 15 deletions

View File

@@ -10,12 +10,12 @@ A multi-platform proxy client based on ClashMeta, simple and easy to use, open-s
on Desktop:
<p style="text-align: center;">
<img src="snapshots/desktop.gif">
<img alt="desktop" src="snapshots/desktop.gif">
</p>
on Mobile:
<p style="text-align: center;">
<img src="snapshots/mobile.gif">
<img alt="mobile" src="snapshots/mobile.gif">
</p>
## Features
@@ -28,6 +28,10 @@ on Mobile:
✨ Support subscription link, Dark mode
## Contact
[Telegram](https://t.me/+G-veVtwBOl4wODc1)
## Build
1. Update submodules
@@ -82,3 +86,6 @@ on Mobile:
```bash
dart .\setup.dart
```

View File

@@ -10,12 +10,12 @@
on Desktop:
<p style="text-align: center;">
<img src="snapshots/desktop.gif">
<img alt="desktop" src="snapshots/desktop.gif">
</p>
on Mobile:
<p style="text-align: center;">
<img src="snapshots/mobile.gif">
<img alt="mobile" src="snapshots/mobile.gif">
</p>
## Features
@@ -28,6 +28,10 @@ on Mobile:
✨ 支持一键导入订阅, 深色模式
## Contact
[Telegram](https://t.me/+G-veVtwBOl4wODc1)
## Build
1. 更新 submodules

View File

@@ -10,6 +10,7 @@ import io.flutter.embedding.engine.FlutterEngine
class MainActivity : FlutterActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
GlobalState.flutterEngine?.destroy()
super.configureFlutterEngine(flutterEngine)
flutterEngine.plugins.add(AppPlugin())
flutterEngine.plugins.add(ProxyPlugin())

View File

@@ -37,14 +37,12 @@ class FlClashTileService : TileService() {
}
}
override fun onStartListening() {
super.onStartListening()
GlobalState.runState.value?.let { updateTile(it) }
GlobalState.runState.observeForever(observer)
}
@SuppressLint("StartActivityAndCollapseDeprecated")
private fun activityTransfer() {
val intent = Intent(this, TempActivity::class.java)
@@ -88,7 +86,7 @@ class FlClashTileService : TileService() {
if(currentTilePlugin == null){
initFlutterEngine()
}else{
currentTilePlugin?.handleStart()
currentTilePlugin.handleStart()
}
} else if(GlobalState.runState.value == RunState.START){
GlobalState.runState.value = RunState.PENDING
@@ -97,7 +95,6 @@ class FlClashTileService : TileService() {
}
override fun onDestroy() {
GlobalState.runState.removeObserver(observer)
super.onDestroy()

View File

@@ -25,7 +25,8 @@ class FlClashVpnService : VpnService() {
private val CHANNEL = "FlClash"
var fd: Int? = null;
var fd: Int? = null
private val notificationId: Int = 1
private val passList = listOf(
"*zhihu.com",
@@ -100,11 +101,12 @@ class FlClashVpnService : VpnService() {
fun startForeground(title: String, content: String) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel =
NotificationChannel(CHANNEL, "FlClash", NotificationManager.IMPORTANCE_DEFAULT)
NotificationChannel(CHANNEL, "FlClash", NotificationManager.IMPORTANCE_LOW)
val manager = getSystemService(NotificationManager::class.java)
manager.createNotificationChannel(channel)
val intent = Intent(this, MainActivity::class.java)
val pendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
PendingIntent.getActivity(
this,
@@ -120,7 +122,9 @@ class FlClashVpnService : VpnService() {
PendingIntent.FLAG_UPDATE_CURRENT
)
}
val icon = IconCompat.createWithResource(this, this.applicationInfo.icon)
val notification = with(NotificationCompat.Builder(this, CHANNEL)) {
setSmallIcon(icon)
setContentTitle(title)
@@ -132,12 +136,13 @@ class FlClashVpnService : VpnService() {
build()
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
startForeground(1, notification, FOREGROUND_SERVICE_TYPE_SPECIAL_USE)
startForeground(notificationId, notification, FOREGROUND_SERVICE_TYPE_SPECIAL_USE)
} else {
startForeground(1, notification)
startForeground(notificationId, notification)
}
}
}
private fun stopForeground() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
stopForeground(Service.STOP_FOREGROUND_REMOVE)

View File

@@ -78,6 +78,7 @@ Future<void> vpnService() async {
TileListenerWithVpn(
onStop: () async {
await app?.tip(appLocalizations.stopVpn);
await globalState.stopSystemProxy();
clashCore.shutdown();
exit(0);
},

View File

@@ -87,7 +87,7 @@ class Config extends ChangeNotifier {
_isMinimizeOnExit = true,
_isAccessControl = false,
_accessControl = AccessControl(),
_isAnimateToPage = false;
_isAnimateToPage = true;
deleteProfileById(String id) {
_profiles = profiles.where((element) => element.id != id).toList();

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.7.0
version: 0.7.1
environment:
sdk: '>=3.1.0 <4.0.0'