Skip to content

Commit da08a67

Browse files
committed
Add android separates the core process
Support core status check and force restart Optimize proxies page and access page Update flutter and pub dependencies Optimize more details
1 parent e956373 commit da08a67

File tree

263 files changed

+83155
-78358
lines changed

Some content is hidden

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

263 files changed

+83155
-78358
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- platform: android
1717
os: ubuntu-latest
1818
- platform: windows
19-
os: windows-latest
19+
os: Windows-2022
2020
arch: amd64
2121
- platform: linux
2222
os: ubuntu-22.04
@@ -52,6 +52,7 @@ jobs:
5252
if: startsWith(matrix.platform,'android')
5353
run: |
5454
echo "${{ secrets.KEYSTORE }}" | base64 --decode > android/app/keystore.jks
55+
echo "${{ secrets.SERVICE_JSON }}" | base64 --decode > android/app/google-services.json
5556
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/local.properties
5657
echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> android/local.properties
5758
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/local.properties

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Support the following actions
5454

5555
com.follow.clash.action.STOP
5656

57-
com.follow.clash.action.CHANGE
57+
com.follow.clash.action.TOGGLE
5858
```
5959

6060
## Download

README_zh_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ on Mobile:
5454

5555
com.follow.clash.action.STOP
5656

57-
com.follow.clash.action.CHANGE
57+
com.follow.clash.action.TOGGLE
5858
```
5959

6060
## Download

analysis_options.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ include: package:flutter_lints/flutter.yaml
22
analyzer:
33
exclude:
44
- lib/l10n/intl/**
5+
errors:
6+
invalid_annotation_target: ignore
57

68
linter:
79
rules:

android/app/build.gradle.kts

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
12
import java.util.Properties
23

34
plugins {
45
id("com.android.application")
56
id("kotlin-android")
67
id("dev.flutter.flutter-gradle-plugin")
8+
id("com.google.gms.google-services")
9+
id("com.google.firebase.crashlytics")
710
}
811

912
val localPropertiesFile = rootProject.file("local.properties")
@@ -17,29 +20,26 @@ val mStoreFile: File = file("keystore.jks")
1720
val mStorePassword: String? = localProperties.getProperty("storePassword")
1821
val mKeyAlias: String? = localProperties.getProperty("keyAlias")
1922
val mKeyPassword: String? = localProperties.getProperty("keyPassword")
20-
val isRelease = mStoreFile.exists()
21-
&& mStorePassword != null
22-
&& mKeyAlias != null
23-
&& mKeyPassword != null
23+
val isRelease =
24+
mStoreFile.exists() && mStorePassword != null && mKeyAlias != null && mKeyPassword != null
25+
2426

2527
android {
2628
namespace = "com.follow.clash"
27-
compileSdk = 35
28-
ndkVersion = "28.0.13004108"
29+
compileSdk = libs.versions.compileSdk.get().toInt()
30+
ndkVersion = libs.versions.ndkVersion.get()
31+
32+
2933

3034
compileOptions {
3135
sourceCompatibility = JavaVersion.VERSION_17
3236
targetCompatibility = JavaVersion.VERSION_17
3337
}
3438

35-
kotlinOptions {
36-
jvmTarget = JavaVersion.VERSION_17.toString()
37-
}
38-
3939
defaultConfig {
4040
applicationId = "com.follow.clash"
4141
minSdk = flutter.minSdkVersion
42-
targetSdk = flutter.targetSdkVersion
42+
targetSdk = libs.versions.targetSdk.get().toInt()
4343
versionCode = flutter.versionCode
4444
versionName = flutter.versionName
4545
}
@@ -55,6 +55,12 @@ android {
5555
}
5656
}
5757

58+
packaging {
59+
jniLibs {
60+
useLegacyPackaging = true
61+
}
62+
}
63+
5864
buildTypes {
5965
debug {
6066
isMinifyEnabled = false
@@ -63,31 +69,40 @@ android {
6369

6470
release {
6571
isMinifyEnabled = true
66-
isDebuggable = false
67-
72+
isShrinkResources = true
6873
signingConfig = if (isRelease) {
6974
signingConfigs.getByName("release")
7075
} else {
7176
signingConfigs.getByName("debug")
7277
}
7378

7479
proguardFiles(
75-
getDefaultProguardFile("proguard-android-optimize.txt"),
76-
"proguard-rules.pro"
80+
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
7781
)
7882
}
7983
}
8084
}
8185

86+
kotlin {
87+
compilerOptions {
88+
jvmTarget.set(JvmTarget.JVM_17)
89+
}
90+
}
91+
8292
flutter {
8393
source = "../.."
8494
}
8595

96+
8697
dependencies {
87-
implementation(project(":core"))
88-
implementation("androidx.core:core-splashscreen:1.0.1")
89-
implementation("com.google.code.gson:gson:2.10.1")
90-
implementation("com.android.tools.smali:smali-dexlib2:3.0.9") {
98+
implementation(project(":service"))
99+
implementation(project(":common"))
100+
implementation(libs.core.splashscreen)
101+
implementation(libs.gson)
102+
implementation(libs.smali.dexlib2) {
91103
exclude(group = "com.google.guava", module = "guava")
92104
}
105+
implementation(platform(libs.firebase.bom))
106+
implementation(libs.firebase.crashlytics.ndk)
107+
implementation(libs.firebase.analytics)
93108
}

android/app/google-services.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"project_info": {
3+
"project_number": "000000000000",
4+
"project_id": "dev"
5+
},
6+
"client": [
7+
{
8+
"client_info": {
9+
"mobilesdk_app_id": "1:000000000000:android:0000000000000000",
10+
"android_client_info": {
11+
"package_name": "com.follow.clash"
12+
}
13+
},
14+
"oauth_client": [],
15+
"api_key": [
16+
{
17+
"current_key": "0"
18+
}
19+
],
20+
"services": {
21+
"appinvite_service": {
22+
"other_platform_oauth_client": []
23+
}
24+
}
25+
},
26+
{
27+
"client_info": {
28+
"mobilesdk_app_id": "1:000000000000:android:0000000000000000",
29+
"android_client_info": {
30+
"package_name": "com.follow.clash.debug"
31+
}
32+
},
33+
"oauth_client": [],
34+
"api_key": [
35+
{
36+
"current_key": "0"
37+
}
38+
],
39+
"services": {
40+
"appinvite_service": {
41+
"other_platform_oauth_client": []
42+
}
43+
}
44+
}
45+
]
46+
}

android/app/proguard-rules.pro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11

2-
-keep class com.follow.clash.models.**{ *; }
2+
-keep class com.follow.clash.models.**{ *; }
3+
4+
-keep class com.follow.clash.service.models.**{ *; }

android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
android:label="FlClash Debug"
1010
tools:replace="android:label">
1111
<service
12-
android:name=".services.FlClashTileService"
12+
android:name=".TileService"
1313
android:label="FlClash Debug"
1414
tools:replace="android:label"
1515
tools:targetApi="24" />

android/app/src/main/AndroidManifest.xml

Lines changed: 18 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
23
xmlns:tools="http://schemas.android.com/tools">
34

@@ -13,40 +14,36 @@
1314

1415
<uses-permission android:name="android.permission.INTERNET" />
1516
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
16-
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
1717
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
1818
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
1919
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
20-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
21-
2220
<uses-permission
2321
android:name="android.permission.QUERY_ALL_PACKAGES"
2422
tools:ignore="QueryAllPackagesPermission" />
23+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
24+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
2525

2626
<application
27-
android:name=".FlClashApplication"
27+
android:name=".Application"
2828
android:banner="@mipmap/ic_banner"
2929
android:hardwareAccelerated="true"
3030
android:icon="@mipmap/ic_launcher"
3131
android:label="FlClash">
3232
<activity
33-
android:name="com.follow.clash.MainActivity"
33+
android:name=".MainActivity"
3434
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
3535
android:exported="true"
3636
android:hardwareAccelerated="true"
3737
android:launchMode="singleTop"
3838
android:theme="@style/LaunchTheme"
3939
android:windowSoftInputMode="adjustResize">
40-
<!-- Specifies an Android theme to apply to this Activity as soon as
41-
the Android process has started. This theme is visible to the user
42-
while the Flutter UI initializes. After that, this theme continues
43-
to determine the Window background behind the Flutter UI. -->
4440
<meta-data
4541
android:name="io.flutter.embedding.android.NormalTheme"
4642
android:resource="@style/NormalTheme" />
4743

4844
<intent-filter>
4945
<action android:name="android.intent.action.MAIN" />
46+
5047
<category android:name="android.intent.category.LAUNCHER" />
5148
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
5249
</intent-filter>
@@ -67,12 +64,9 @@
6764
</intent-filter>
6865
</activity>
6966

70-
<meta-data
71-
android:name="io.flutter.embedding.android.EnableImpeller"
72-
android:value="false" />
73-
7467
<activity
7568
android:name=".TempActivity"
69+
android:excludeFromRecents="true"
7670
android:exported="true"
7771
android:theme="@style/TransparentTheme">
7872
<intent-filter>
@@ -85,17 +79,16 @@
8579
</intent-filter>
8680
<intent-filter>
8781
<category android:name="android.intent.category.DEFAULT" />
88-
<action android:name="${applicationId}.action.CHANGE" />
82+
<action android:name="${applicationId}.action.TOGGLE" />
8983
</intent-filter>
9084
</activity>
9185

9286
<service
93-
android:name=".services.FlClashTileService"
87+
android:name=".TileService"
9488
android:exported="true"
9589
android:icon="@drawable/ic"
9690
android:label="FlClash"
97-
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
98-
tools:targetApi="n">
91+
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
9992
<intent-filter>
10093
<action android:name="android.service.quicksettings.action.QS_TILE" />
10194
</intent-filter>
@@ -104,49 +97,17 @@
10497
android:value="true" />
10598
</service>
10699

107-
<provider
108-
android:name=".FilesProvider"
109-
android:authorities="${applicationId}.files"
100+
<receiver
101+
android:name=".BroadcastReceiver"
102+
android:enabled="true"
110103
android:exported="true"
111-
android:grantUriPermissions="true"
112-
android:permission="android.permission.MANAGE_DOCUMENTS"
113-
android:process=":background">
114-
<intent-filter>
115-
<action android:name="android.content.action.DOCUMENTS_PROVIDER" />
116-
</intent-filter>
117-
</provider>
118-
119-
<provider
120-
android:name="androidx.core.content.FileProvider"
121-
android:authorities="${applicationId}.fileProvider"
122-
android:exported="false"
123-
android:grantUriPermissions="true">
124-
<meta-data
125-
android:name="android.support.FILE_PROVIDER_PATHS"
126-
android:resource="@xml/file_paths" />
127-
</provider>
128-
129-
<service
130-
android:name=".services.FlClashVpnService"
131-
android:exported="false"
132-
android:foregroundServiceType="dataSync"
133-
android:permission="android.permission.BIND_VPN_SERVICE">
104+
android:permission="${applicationId}.permission.RECEIVE_BROADCASTS">
134105
<intent-filter>
135-
<action android:name="android.net.VpnService" />
106+
<action android:name="${applicationId}.intent.action.START" />
107+
<action android:name="${applicationId}.intent.action.STOP" />
108+
<action android:name="${applicationId}.intent.action.TOGGLE" />
136109
</intent-filter>
137-
<property
138-
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
139-
android:value="vpn" />
140-
</service>
141-
142-
<service
143-
android:name=".services.FlClashService"
144-
android:exported="false"
145-
android:foregroundServiceType="dataSync">
146-
<property
147-
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
148-
android:value="service" />
149-
</service>
110+
</receiver>
150111

151112
<meta-data
152113
android:name="flutterEmbedding"

0 commit comments

Comments
 (0)