Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07bbaf6b6f | ||
|
|
e8feb7c431 | ||
|
|
4d16820526 | ||
|
|
92294b49c6 | ||
|
|
8a188a37c9 | ||
|
|
48af16c265 |
13
README.md
13
README.md
@@ -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
|
||||
@@ -81,4 +85,7 @@ on Mobile:
|
||||
|
||||
```bash
|
||||
dart .\setup.dart
|
||||
```
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -78,6 +78,7 @@ Future<void> vpnService() async {
|
||||
TileListenerWithVpn(
|
||||
onStop: () async {
|
||||
await app?.tip(appLocalizations.stopVpn);
|
||||
await globalState.stopSystemProxy();
|
||||
clashCore.shutdown();
|
||||
exit(0);
|
||||
},
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user