Skip to content

Commit 6e404ab

Browse files
committed
Fix windows some issues
Optimize overwrite handle Optimize access control page Optimize some details
1 parent 2395a4b commit 6e404ab

File tree

156 files changed

+9863
-3886
lines changed

Some content is hidden

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

156 files changed

+9863
-3886
lines changed

.github/workflows/build.yaml

Lines changed: 48 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
os: ubuntu-22.04
2323
arch: amd64
2424
- platform: macos
25-
os: macos-13
25+
os: macos-15-intel
2626
arch: amd64
2727
- platform: macos
2828
os: macos-latest
@@ -64,22 +64,25 @@ jobs:
6464
cache-dependency-path: |
6565
core/go.sum
6666
67-
- name: Setup Flutter Master
68-
if: startsWith(matrix.os, 'windows-11-arm') || startsWith(matrix.os, 'ubuntu-24.04-arm')
67+
- name: Setup Flutter
68+
if: ${{ !(startsWith(matrix.os, 'windows-11-arm') || startsWith(matrix.os, 'ubuntu-24.04-arm')) }}
6969
uses: subosito/flutter-action@v2
7070
with:
71-
channel: 'master'
71+
channel: stable
72+
flutter-version: 3.35.7
7273
cache: true
73-
- name: Setup Flutter
74-
if: ${{ !(startsWith(matrix.os, 'windows-11-arm') || startsWith(matrix.os, 'ubuntu-24.04-arm')) }}
74+
- name: Setup Flutter With Other
75+
if: startsWith(matrix.os, 'windows-11-arm') || startsWith(matrix.os, 'ubuntu-24.04-arm')
7576
uses: subosito/flutter-action@v2
7677
with:
77-
channel: 'stable'
78+
channel: master
79+
flutter-version: 3.35.7
7880
cache: true
79-
# flutter-version: 3.29.3
8081

8182
- name: Get Flutter Dependency
82-
run: flutter pub get
83+
run: |
84+
flutter --version
85+
flutter pub get
8386
8487
- name: Setup
8588
run: dart setup.dart ${{ matrix.platform }} ${{ matrix.arch && format('--arch {0}', matrix.arch) }} ${{ env.IS_STABLE == 'true' && '--env stable' || '' }}
@@ -104,34 +107,26 @@ jobs:
104107
- name: Generate
105108
if: ${{ env.IS_STABLE == 'true' }}
106109
run: |
107-
tags=($(git tag --merged $(git rev-parse HEAD) --sort=-creatordate))
108-
preTag=$(grep -oP '^## \K.*' CHANGELOG.md | head -n 1)
109-
currentTag=""
110-
for ((i = 0; i <= ${#tags[@]}; i++)); do
111-
if (( i < ${#tags[@]} )); then
112-
tag=${tags[$i]}
113-
else
114-
tag=""
115-
fi
116-
if [ -n "$currentTag" ]; then
117-
if [ "$(echo -e "$currentTag\n$preTag" | sort -V | head -n 1)" == "$currentTag" ]; then
118-
break
119-
fi
120-
fi
121-
if [ -n "$currentTag" ]; then
122-
echo "## $currentTag" >> NEW_CHANGELOG.md
123-
echo "" >> NEW_CHANGELOG.md
124-
if [ -n "$tag" ]; then
125-
git log --pretty=format:"%B" "$tag..$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> NEW_CHANGELOG.md
126-
else
127-
git log --pretty=format:"%B" "$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> NEW_CHANGELOG.md
128-
fi
129-
echo "" >> NEW_CHANGELOG.md
130-
fi
131-
currentTag=$tag
110+
last_ver=$(grep -m1 '^## ' CHANGELOG.md 2>/dev/null | sed 's/^## //')
111+
112+
tags=($(git tag --merged HEAD --sort=-creatordate))
113+
114+
temp="NEW_CHANGELOG.md" > "$temp"
115+
116+
for i in "${!tags[@]}"; do
117+
curr="${tags[i]}"
118+
[[ "$curr" == "$last_ver" ]] && break
119+
120+
prev="${tags[i+1]}"
121+
range="${prev:+$prev..}$curr"
122+
123+
echo -e "## $curr\n" >> "$temp"
124+
git log --no-merges --pretty=format:"%B" "$range" | \
125+
awk '!/Update changelog/ && NF {print "- " $0 "\n"}' >> "$temp"
132126
done
133-
cat CHANGELOG.md >> NEW_CHANGELOG.md
134-
cat NEW_CHANGELOG.md > CHANGELOG.md
127+
[ -f CHANGELOG.md ] && cat CHANGELOG.md >> "$temp"
128+
129+
mv "$temp" CHANGELOG.md
135130
136131
- name: Commit
137132
if: ${{ env.IS_STABLE == 'true' }}
@@ -181,31 +176,24 @@ jobs:
181176

182177
- name: Generate release.md
183178
run: |
184-
tags=($(git tag --merged $(git rev-parse HEAD) --sort=-creatordate))
185-
preTag=$(curl --silent "https://api.github.com/repos/chen08209/FlClash/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' || echo "")
186-
currentTag=""
187-
for ((i = 0; i <= ${#tags[@]}; i++)); do
188-
if (( i < ${#tags[@]} )); then
189-
tag=${tags[$i]}
190-
else
191-
tag=""
192-
fi
193-
if [ -n "$currentTag" ]; then
194-
if [ "$(echo -e "$currentTag\n$preTag" | sort -V | head -n 1)" == "$currentTag" ]; then
195-
break
196-
fi
197-
fi
198-
if [ -n "$currentTag" ]; then
199-
if [ -n "$tag" ]; then
200-
git log --pretty=format:"%B" "$tag..$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> release.md
201-
else
202-
git log --pretty=format:"%B" "$currentTag" | awk 'NF {print "- " $0} !NF {print ""}' >> release.md
203-
fi
204-
echo "" >> release.md
205-
fi
206-
currentTag=$tag
179+
tags=($(git tag --merged HEAD --sort=-creatordate))
180+
preTag=$(curl -s "https://api.github.com/repos/chen08209/FlClash/releases/latest" | \
181+
sed -nE 's/.*"tag_name": "([^"]+)".*/\1/p')
182+
183+
[ -z "$preTag" ] && preTag=""
184+
185+
out="release.md" > "$out"
186+
187+
for i in "${!tags[@]}"; do
188+
curr="${tags[i]}"
189+
[[ "$curr" == "$preTag" ]] && break
190+
191+
prev="${tags[i+1]}"
192+
range="${prev:+$prev..}$curr"
193+
194+
git log --no-merges --pretty=format:"%B" "$range" | \
195+
awk '!/Update changelog/ && NF {print "- " $0 "\n"}' >> "$out"
207196
done
208-
209197
- name: Push to telegram
210198
env:
211199
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
path = plugins/flutter_distributor
77
url = [email protected]:chen08209/flutter_distributor.git
88
branch = FlClash
9+
[submodule "plugins/tray_manager"]
10+
path = plugins/tray_manager
11+
url = [email protected]:chen08209/tray_manager.git
12+
branch = main
913

1014

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,17 @@ object State {
5454

5555
suspend fun handleSyncState() {
5656
runLock.withLock {
57-
Service.bind()
58-
runTime = Service.getRunTime()
59-
val runState = when (runTime == 0L) {
60-
true -> RunState.STOP
61-
false -> RunState.START
57+
try {
58+
Service.bind()
59+
runTime = Service.getRunTime()
60+
val runState = when (runTime == 0L) {
61+
true -> RunState.STOP
62+
false -> RunState.START
63+
}
64+
runStateFlow.tryEmit(runState)
65+
} catch (_: Exception) {
66+
runStateFlow.tryEmit(RunState.STOP)
6267
}
63-
runStateFlow.tryEmit(runState)
6468
}
6569
}
6670

@@ -92,8 +96,9 @@ object State {
9296
}
9397

9498
fun handleStartService() {
99+
val appPlugin = flutterEngine?.plugin<AppPlugin>()
95100
if (appPlugin != null) {
96-
appPlugin?.requestNotificationsPermission {
101+
appPlugin.requestNotificationsPermission {
97102
startService()
98103
}
99104
return
@@ -159,10 +164,7 @@ object State {
159164
if (servicePlugin == null) {
160165
return@launch
161166
}
162-
val options = servicePlugin?.handleGetVpnOptions()
163-
if (options == null) {
164-
return@launch
165-
}
167+
val options = servicePlugin?.handleGetVpnOptions() ?: return@launch
166168
appPlugin?.prepare(options.enable) {
167169
runTime = Service.startService(options, runTime)
168170
runStateFlow.tryEmit(RunState.START)
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2-
android:width="108dp"
3-
android:height="108dp"
4-
android:viewportWidth="240"
5-
android:viewportHeight="240">
6-
<group android:scaleX="0.924"
7-
android:scaleY="0.924"
8-
android:translateX="9.12"
9-
android:translateY="9.12">
10-
<group android:scaleX="0.63461536"
11-
android:scaleY="0.63461536"
12-
android:translateX="45.96154"
13-
android:translateY="43.846153">
14-
<path
15-
android:pathData="M60.65,89.6L154.18,35.6A18,18 107.59,0 1,178.77 42.19L178.77,42.19A18,18 107.59,0 1,172.18 66.78L78.65,120.78A18,18 106.67,0 1,54.06 114.19L54.06,114.19A18,18 106.67,0 1,60.65 89.6z"
16-
android:fillColor="#6666FB"/>
17-
<path
18-
android:pathData="M84.65,131.17L131.42,104.17A18,18 107.83,0 1,156 110.76L156,110.76A18,18 107.83,0 1,149.42 135.35L102.65,162.35A18,18 106.67,0 1,78.06 155.76L78.06,155.76A18,18 106.67,0 1,84.65 131.17z"
19-
android:fillColor="#336AB6"/>
20-
<path
21-
android:pathData="M108.65,172.74L108.65,172.74A18,18 116.03,0 1,133.24 179.33L133.24,179.33A18,18 116.03,0 1,126.65 203.92L126.65,203.92A18,18 116.03,0 1,102.06 197.33L102.06,197.33A18,18 116.03,0 1,108.65 172.74z"
22-
android:fillColor="#5CA8E9"/>
2+
android:width="108dp"
3+
android:height="108dp"
4+
android:viewportWidth="240"
5+
android:viewportHeight="240">
6+
<group android:scaleX="0.924"
7+
android:scaleY="0.924"
8+
android:translateX="9.12"
9+
android:translateY="9.12">
10+
<group android:scaleX="0.63461536"
11+
android:scaleY="0.63461536"
12+
android:translateX="45.96154"
13+
android:translateY="43.846153">
14+
<path
15+
android:pathData="M60.65,89.6L154.18,35.6A18,18 107.59,0 1,178.77 42.19L178.77,42.19A18,18 107.59,0 1,172.18 66.78L78.65,120.78A18,18 106.67,0 1,54.06 114.19L54.06,114.19A18,18 106.67,0 1,60.65 89.6z"
16+
android:fillColor="#6666FB"/>
17+
<path
18+
android:pathData="M84.65,131.17L131.42,104.17A18,18 107.83,0 1,156 110.76L156,110.76A18,18 107.83,0 1,149.42 135.35L102.65,162.35A18,18 106.67,0 1,78.06 155.76L78.06,155.76A18,18 106.67,0 1,84.65 131.17z"
19+
android:fillColor="#336AB6"/>
20+
<path
21+
android:pathData="M108.65,172.74L108.65,172.74A18,18 116.03,0 1,133.24 179.33L133.24,179.33A18,18 116.03,0 1,126.65 203.92L126.65,203.92A18,18 116.03,0 1,102.06 197.33L102.06,197.33A18,18 116.03,0 1,108.65 172.74z"
22+
android:fillColor="#5CA8E9"/>
23+
</group>
2324
</group>
24-
</group>
2525
</vector>

android/service/src/main/java/com/follow/clash/service/CommonService.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ class CommonService : Service(), IBaseService,
5050
}
5151

5252
override fun start() {
53-
loader.load()
53+
try {
54+
loader.load()
55+
} catch (_: Exception) {
56+
stop()
57+
}
5458
}
5559

5660
override fun stop() {

android/service/src/main/java/com/follow/clash/service/VpnService.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,13 @@ class VpnService : SystemVpnService(), IBaseService,
234234
}
235235

236236
override fun start() {
237-
loader.load()
238-
State.options?.let {
239-
handleStart(it)
237+
try {
238+
loader.load()
239+
State.options?.let {
240+
handleStart(it)
241+
}
242+
} catch (_: Exception) {
243+
stop()
240244
}
241245
}
242246

arb/intl_en.arb

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@
340340
"none": "none",
341341
"basicConfig": "Basic configuration",
342342
"basicConfigDesc": "Modify the basic configuration globally",
343+
"advancedConfig": "Advanced configuration",
344+
"advancedConfigDesc": "Provide diverse configuration options",
343345
"selectedCountTitle": "{count} items have been selected",
344346
"addRule": "Add rule",
345347
"ruleName": "Rule name",
@@ -390,7 +392,7 @@
390392
"existsTip": "Current {label} already exists",
391393
"deleteTip": "Are you sure you want to delete the current {label}?",
392394
"deleteMultipTip": "Are you sure you want to delete the selected {label}?",
393-
"nullTip": "No {label} at the moment",
395+
"nullTip": "No {label} yet",
394396
"script": "Script",
395397
"color": "Color",
396398
"rename": "Rename",
@@ -434,5 +436,35 @@
434436
"crashlytics": "Crash Analysis",
435437
"crashlyticsTip": "When enabled, automatically uploads crash logs without sensitive information when the app crashes",
436438
"appendSystemDns": "Append System DNS",
437-
"appendSystemDnsTip": "Forcefully append system DNS to the configuration"
439+
"appendSystemDnsTip": "Forcefully append system DNS to the configuration",
440+
"editRule": "Edit rule",
441+
"overrideMode": "Override mode",
442+
"standardModeDesc": "Standard mode, override basic configuration, provide simple rule addition capability",
443+
"scriptModeDesc": "Script mode, use external extension scripts, provide one-click override configuration capability",
444+
"addedRules": "Added rules",
445+
"controlGlobalAddedRules": "Control global added rules",
446+
"overrideScript": "Override script",
447+
"goToConfigureScript": "Go to configure script",
448+
"editGlobalRules": "Edit global rules",
449+
"externalFetch": "External fetch",
450+
"confirmForceCrashCore": "Are you sure you want to force crash the core?",
451+
"confirmClearAllData": "Are you sure you want to clear all data?",
452+
"loading": "Loading...",
453+
"loadTest": "Load test",
454+
"yearsAgo": "{count, plural, =1{1 year ago} other{{count} years ago}}",
455+
"monthsAgo": "{count, plural, =1{1 month ago} other{{count} months ago}}",
456+
"daysAgo": "{count, plural, =1{1 day ago} other{{count} days ago}}",
457+
"hoursAgo": "{count, plural, =1{1 hour ago} other{{count} hours ago}}",
458+
"minutesAgo": "{count, plural, =1{1 minute ago} other{{count} minutes ago}}",
459+
"justNow": "Just now",
460+
"noLongerRemind": "Don't remind again",
461+
"accessControlSettings": "Access Control Settings",
462+
"turnOn": "Turn On",
463+
"turnOff": "Turn Off",
464+
"coreConfigChangeDetected": "Core configuration change detected",
465+
"reload": "Reload",
466+
"vpnConfigChangeDetected": "VPN configuration change detected",
467+
"restart": "Restart",
468+
"speedStatistics": "Speed statistics",
469+
"resetPageChangesTip": "The current page has changes. Are you sure you want to reset?"
438470
}

arb/intl_ja.arb

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@
340340
"none": "なし",
341341
"basicConfig": "基本設定",
342342
"basicConfigDesc": "基本設定をグローバルに変更",
343+
"advancedConfig": "高度な設定",
344+
"advancedConfigDesc": "多様な設定を提供",
343345
"selectedCountTitle": "{count} 項目が選択されています",
344346
"addRule": "ルールを追加",
345347
"ruleName": "ルール名",
@@ -391,7 +393,7 @@
391393
"existsTip": "現在の{label}は既に存在しています",
392394
"deleteTip": "現在の{label}を削除してもよろしいですか?",
393395
"deleteMultipTip": "選択された{label}を削除してもよろしいですか?",
394-
"nullTip": "現在{label}はありません",
396+
"nullTip": "まだ{label}はありません",
395397
"script": "スクリプト",
396398
"color": "カラー",
397399
"rename": "リネーム",
@@ -435,5 +437,35 @@
435437
"crashlytics": "クラッシュ分析",
436438
"crashlyticsTip": "有効にすると、アプリがクラッシュした際に機密情報を含まないクラッシュログを自動的にアップロードします",
437439
"appendSystemDns": "システムDNSを追加",
438-
"appendSystemDnsTip": "設定にシステムDNSを強制的に追加します"
440+
"appendSystemDnsTip": "設定にシステムDNSを強制的に追加します",
441+
"editRule": "ルールを編集",
442+
"overrideMode": "上書きモード",
443+
"standardModeDesc": "標準モード、基本設定を上書きし、シンプルなルール追加機能を提供",
444+
"scriptModeDesc": "スクリプトモード、外部拡張スクリプトを使用し、ワンクリックで設定を上書きする機能を提供",
445+
"addedRules": "追加ルール",
446+
"controlGlobalAddedRules": "グローバル追加ルールを制御",
447+
"overrideScript": "上書きスクリプト",
448+
"goToConfigureScript": "スクリプト設定に移動",
449+
"editGlobalRules": "グローバルルールを編集",
450+
"externalFetch": "外部取得",
451+
"confirmForceCrashCore": "コアを強制的にクラッシュさせてもよろしいですか?",
452+
"confirmClearAllData": "すべてのデータをクリアしてもよろしいですか?",
453+
"loading": "読み込み中...",
454+
"loadTest": "読み込みテスト",
455+
"yearsAgo": "{count}年前",
456+
"monthsAgo": "{count}ヶ月前",
457+
"daysAgo": "{count}日前",
458+
"hoursAgo": "{count}時間前",
459+
"minutesAgo": "{count}分前",
460+
"justNow": "たった今",
461+
"noLongerRemind": "今後表示しない",
462+
"accessControlSettings": "アクセス制御設定",
463+
"turnOn": "オン",
464+
"turnOff": "オフ",
465+
"coreConfigChangeDetected": "コア設定の変更が検出されました",
466+
"reload": "リロード",
467+
"vpnConfigChangeDetected": "VPN設定の変更が検出されました",
468+
"restart": "再起動",
469+
"speedStatistics": "速度統計",
470+
"resetPageChangesTip": "現在のページに変更があります。リセットしてもよろしいですか?"
439471
}

0 commit comments

Comments
 (0)