Skip to content

Commit f679d1e

Browse files
committed
Optimize request ua
Change android icon Optimize dashboard
1 parent f2aa885 commit f679d1e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+572
-303
lines changed

android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
android:icon="@mipmap/ic_launcher"
2525
android:networkSecurityConfig="@xml/network_security_config"
2626
android:extractNativeLibs="true"
27+
android:enableOnBackInvokedCallback="true"
2728
android:label="FlClash"
28-
tools:targetApi="n">
29+
tools:targetApi="tiramisu">
2930
<activity
3031
android:name="com.follow.clash.MainActivity"
3132
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
@@ -74,7 +75,7 @@
7475
<service
7576
android:name=".services.FlClashTileService"
7677
android:exported="true"
77-
android:icon="@drawable/icon"
78+
android:icon="@drawable/ic_stat_name"
7879
android:foregroundServiceType="specialUse"
7980
android:label="FlClash"
8081
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
-61.1 KB
Loading

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.follow.clash
22

33
import android.content.Context
4+
import android.util.Log
45
import androidx.lifecycle.MutableLiveData
56
import com.follow.clash.plugins.AppPlugin
67
import com.follow.clash.plugins.ProxyPlugin
@@ -56,6 +57,8 @@ object GlobalState {
5657
serviceEngine?.dartExecutor?.executeDartEntrypoint(
5758
vpnService,
5859
)
60+
61+
Log.e("FlClashVpnService", "initServiceEngine ===>")
5962
}
6063
}
6164
}

android/app/src/main/kotlin/com/follow/clash/plugins/ProxyPlugin.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import android.content.pm.PackageManager
1010
import android.net.VpnService
1111
import android.os.Build
1212
import android.os.IBinder
13+
import android.util.Log
1314
import androidx.core.app.ActivityCompat
1415
import androidx.core.content.ContextCompat
1516
import com.follow.clash.GlobalState
@@ -131,7 +132,13 @@ class ProxyPlugin : FlutterPlugin, MethodChannel.MethodCallHandler, ActivityAwar
131132
}
132133
if (GlobalState.runState.value == RunState.START) return
133134
GlobalState.runState.value = RunState.START
134-
flutterMethodChannel.invokeMethod("started", flClashVpnService?.start(port, props))
135+
val intent = VpnService.prepare(context)
136+
if (intent != null) {
137+
stopVpn()
138+
return
139+
}
140+
val fd = flClashVpnService?.start(port, props)
141+
flutterMethodChannel.invokeMethod("started", fd)
135142
}
136143

137144
private fun stopVpn() {

android/app/src/main/kotlin/com/follow/clash/services/FlClashVpnService.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import android.os.Build
1313
import android.os.IBinder
1414
import android.os.Parcel
1515
import android.os.RemoteException
16+
import android.util.Log
1617
import androidx.core.app.NotificationCompat
1718
import com.follow.clash.GlobalState
1819
import com.follow.clash.MainActivity
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="240"
5+
android:viewportHeight="240"
6+
android:tint="#FFFFFF">
7+
<group android:scaleX="2.0264318"
8+
android:scaleY="2.0264318"
9+
android:translateX="-123.17181"
10+
android:translateY="-123.17181">
11+
<group android:scaleX="0.61"
12+
android:scaleY="0.61"
13+
android:translateX="46.8"
14+
android:translateY="46.8">
15+
<path
16+
android:pathData="M67.67,115.76L144.04,39.39A18,18 0,0 1,169.5 39.39L169.5,39.39A18,18 0,0 1,169.5 64.85L93.13,141.21A18,18 0,0 1,67.67 141.21L67.67,141.21A18,18 0,0 1,67.67 115.76z"
17+
android:fillColor="#6666FF"/>
18+
<path
19+
android:pathData="M98.79,146.87L136.97,108.69A18,18 72.93,0 1,162.43 108.69L162.43,108.69A18,18 72.93,0 1,162.43 134.14L124.24,172.33A18,18 76.87,0 1,98.79 172.33L98.79,172.33A18,18 76.87,0 1,98.79 146.87z"
20+
android:fillColor="#326CBF"/>
21+
<path
22+
android:pathData="M129.9,177.98L129.9,177.98A18,18 107.07,0 1,155.36 177.98L155.36,177.98A18,18 107.07,0 1,155.36 203.44L155.36,203.44A18,18 107.07,0 1,129.9 203.44L129.9,203.44A18,18 107.07,0 1,129.9 177.98z"
23+
android:fillColor="#56afee"/>
24+
</group>
25+
</group>
26+
</vector>
-231 Bytes
Loading
-209 Bytes
Loading
-358 Bytes
Loading
-629 Bytes
Loading

0 commit comments

Comments
 (0)