Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flatpak building initial support #445

Open
wants to merge 41 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
13ac20f
Add push release files to fdroid-repo
txyyh Jul 19, 2024
f6b97f8
Add download guide to README
txyyh Jul 19, 2024
3ba8355
Rename workflow deploy repo name
txyyh Jul 29, 2024
fcbbbdc
Rename readme fingerprint
txyyh Jul 29, 2024
9df1ff4
Merge pull request #140 from txyyh/main
chen08209 Jul 29, 2024
f39b9cf
Add proxy-only traffic statistics
chen08209 Jul 26, 2024
8cdaf30
Fix linux core build error
chen08209 Jul 31, 2024
00a78b5
Fix android tile service issues
chen08209 Aug 1, 2024
7fc54c5
Optimize provider page
chen08209 Aug 4, 2024
e3c9035
Update access control page
chen08209 Aug 5, 2024
5ef020d
Update timeout time
chen08209 Aug 11, 2024
68dd262
Update version
chen08209 Aug 11, 2024
813198a
Update flutter version
chen08209 Aug 11, 2024
8dafe3b
Support profiles sort
chen08209 Aug 13, 2024
75af47a
Change flutter version
chen08209 Aug 15, 2024
c38a671
Optimize app logic
chen08209 Aug 15, 2024
f6d9ed1
Fix windows tray issues
chen08209 Aug 23, 2024
402221a
fix android tip error
chen08209 Aug 26, 2024
b685165
Add Hosts override
chen08209 Aug 25, 2024
ac39739
Add DNS override
chen08209 Aug 26, 2024
79efa67
Fix tun update issues
chen08209 Aug 26, 2024
50bf417
Optimize DNS strategy
chen08209 Sep 5, 2024
97714e8
Fix submit error
chen08209 Sep 8, 2024
80f8aa2
Fix submit error 2
chen08209 Sep 8, 2024
4e766d9
Fix delete profile error
chen08209 Sep 9, 2024
5d6bd64
Support desktop hotkey
chen08209 Sep 8, 2024
3eb26e8
Fix build error
chen08209 Sep 17, 2024
043648f
Fix build error2
chen08209 Sep 17, 2024
fb01d87
Update README.md
chen08209 Sep 17, 2024
511b7c5
Update README.md 2
chen08209 Sep 17, 2024
5566f2b
Update README.md 2
chen08209 Sep 17, 2024
2c5f852
Update readme
chen08209 Sep 17, 2024
3902ea0
Update readme
chen08209 Sep 17, 2024
30dc3f4
Fix android system dns issues
chen08209 Sep 18, 2024
d522a64
Fix android system dns issues
chen08209 Sep 18, 2024
342596a
Optimize ip detection
chen08209 Sep 20, 2024
23e3baf
Optimize ip detection
chen08209 Sep 20, 2024
9a6129f
Fix windows admin auto launch issues
chen08209 Sep 26, 2024
8d4931c
Fix windows admin auto launch issues
chen08209 Sep 26, 2024
e298ce1
Add flatpak building initial support
uaoao Oct 8, 2024
7db9cb1
Merge branch 'chen08209:main' into flatpak
uaoao Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
flutter-version: 3.22.x
channel: 'stable'
cache: true

Expand Down Expand Up @@ -136,8 +136,29 @@ jobs:
gitchangelog "${pre}.." >> release.md 2>&1 || echo "Error in gitchangelog"
echo -e "\n\n</details>" >> release.md
fi

- name: Release
uses: softprops/action-gh-release@v2
with:
files: ./dist/*
body_path: './release.md'
body_path: './release.md'

- name: Create Fdroid Source Dir
run: |
mkdir -p ./tmp
cp ./dist/*android-arm64-v8a* ./tmp/ || true
echo "Files copied successfully"

- name: Push to fdroid repo
uses: cpina/[email protected]
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
source-directory: ./tmp/
destination-github-username: chen08209
destination-repository-name: FlClash-fdroid-repo
user-name: 'github-actions[bot]'
user-email: 'github-actions[bot]@users.noreply.github.com'
target-branch: action-pr
commit-message: Update from ${{ github.ref_name }}
target-directory: /tmp/
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "core/Clash.Meta"]
path = core/Clash.Meta
url = [email protected]:chen08209/Clash.Meta.git
branch = FlClash
branch = FlClash-Alpha
[submodule "plugins/flutter_distributor"]
path = plugins/flutter_distributor
url = [email protected]:chen08209/flutter_distributor.git
Expand Down
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@

## FlClash

<p style="text-align: left;">
<img alt="stars" src="https://img.shields.io/github/stars/chen08209/FlClash?style=flat-square&logo=github"/>
<img alt="downloads" src="https://img.shields.io/github/downloads/chen08209/FlClash/total"/>
<a href="LICENSE">
<img alt="license" src="https://img.shields.io/github/license/chen08209/FlClash"/>
</a>
</p>
[![Downloads](https://img.shields.io/github/downloads/chen08209/FlClash/total?style=flat-square&logo=github)](https://github.com/chen08209/FlClash/releases/)[![Last Version](https://img.shields.io/github/release/chen08209/FlClash/all.svg?style=flat-square)](https://github.com/chen08209/FlClash/releases/)[![License](https://img.shields.io/github/license/chen08209/FlClash?style=flat-square)](LICENSE)

[![Channel](https://img.shields.io/badge/Telegram-Channel-blue?style=flat-square&logo=telegram)](https://t.me/FlClash)

A multi-platform proxy client based on ClashMeta, simple and easy to use, open-source and ad-free.

Expand All @@ -38,9 +34,9 @@ on Mobile:

✨ Support subscription link, Dark mode

## Contact
## Download

[Telegram](https://t.me/+G-veVtwBOl4wODc1)
<a href="https://chen08209.github.io/FlClash-fdroid-repo/repo?fingerprint=789D6D32668712EF7672F9E58DEEB15FBD6DCEEC5AE7A4371EA72F2AAE8A12FD"><img alt="Get it on F-Droid" src="snapshots/get-it-on-fdroid.svg" width="200px"/></a> <a href="https://github.com/chen08209/FlClash/releases"><img alt="Get it on GitHub" src="snapshots/get-it-on-github.svg" width="200px"/></a>

## Build

Expand Down Expand Up @@ -96,9 +92,6 @@ on Mobile:
```bash
dart .\setup.dart
```




## Star

Expand Down
15 changes: 6 additions & 9 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@

## FlClash

<p style="text-align: left;">
<img alt="stars" src="https://img.shields.io/github/stars/chen08209/FlClash?style=flat-square&logo=github"/>
<img alt="downloads" src="https://img.shields.io/github/downloads/chen08209/FlClash/total"/>
<a href="LICENSE">
<img alt="license" src="https://img.shields.io/github/license/chen08209/FlClash"/>
</a>
</p>
[![Downloads](https://img.shields.io/github/downloads/chen08209/FlClash/total?style=flat-square&logo=github)](https://github.com/chen08209/FlClash/releases/)[![Last Version](https://img.shields.io/github/release/chen08209/FlClash/all.svg?style=flat-square)](https://github.com/chen08209/FlClash/releases/)[![License](https://img.shields.io/github/license/chen08209/FlClash?style=flat-square)](LICENSE)

[![Channel](https://img.shields.io/badge/Telegram-Channel-blue?style=flat-square&logo=telegram)](https://t.me/FlClash)


基于ClashMeta的多平台代理客户端,简单易用,开源无广告。

Expand All @@ -38,9 +35,9 @@ on Mobile:

✨ 支持一键导入订阅, 深色模式

## Contact
## Download

[Telegram](https://t.me/+G-veVtwBOl4wODc1)
<a href="https://chen08209.github.io/FlClash-fdroid-repo/repo?fingerprint=789D6D32668712EF7672F9E58DEEB15FBD6DCEEC5AE7A4371EA72F2AAE8A12FD"><img alt="Get it on F-Droid" src="snapshots/get-it-on-fdroid.svg" width="200px"/></a> <a href="https://github.com/chen08209/FlClash/releases"><img alt="Get it on GitHub" src="snapshots/get-it-on-github.svg" width="200px"/></a>

## Build

Expand Down
18 changes: 10 additions & 8 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ def isRelease = defStoreFile.exists() && defStorePassword != null && defKeyAlias
android {
namespace "com.follow.clash"
compileSdkVersion 34
ndkVersion "25.1.8937393"
ndkVersion "27.1.12297006"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
signingConfigs {
if (isRelease){
if (isRelease) {
release {
storeFile defStoreFile
storePassword defStorePassword
Expand All @@ -74,10 +74,9 @@ android {
applicationIdSuffix '.debug'
}
release {
minifyEnabled true
if(isRelease){
if (isRelease) {
signingConfig signingConfigs.release
}else{
} else {
signingConfig signingConfigs.debug
}
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
Expand All @@ -102,6 +101,9 @@ flutter {
dependencies {
implementation 'androidx.core:core-splashscreen:1.0.1'
implementation 'com.google.code.gson:gson:2.10'
implementation("com.android.tools.smali:smali-dexlib2:3.0.7") {
exclude group: "com.google.guava", module: "guava"
}
}


Expand Down
86 changes: 65 additions & 21 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,30 @@
xmlns:tools="http://schemas.android.com/tools">

<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
android:name="android.hardware.camera"
android:required="false" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"
tools:ignore="SystemPermissionTypo" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"
tools:ignore="SystemPermissionTypo" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission
android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />

<application
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:networkSecurityConfig="@xml/network_security_config"
android:extractNativeLibs="true"
android:enableOnBackInvokedCallback="true"
android:label="FlClash"
tools:targetApi="tiramisu">
android:hardwareAccelerated="true"
android:label="FlClash">
<activity
android:name="com.follow.clash.MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
Expand Down Expand Up @@ -56,27 +55,37 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="clash"/>
<data android:scheme="clashmeta"/>
<data android:scheme="flclash"/>
<data android:scheme="clash" />
<data android:scheme="clashmeta" />
<data android:scheme="flclash" />

<data android:host="install-config"/>
<data android:host="install-config" />
</intent-filter>
</activity>

<!-- <meta-data-->
<!-- android:name="io.flutter.embedding.android.EnableImpeller"-->
<!-- android:value="true" />-->
<!-- <meta-data-->
<!-- android:name="io.flutter.embedding.android.EnableImpeller"-->
<!-- android:value="true" />-->

<activity
android:name=".TempActivity"
android:theme="@style/TransparentTheme" />
android:exported="true"
android:theme="@style/TransparentTheme">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="com.follow.clash.action.START" />
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="com.follow.clash.action.STOP" />
</intent-filter>
</activity>

<service
android:name=".services.FlClashTileService"
android:exported="true"
android:icon="@drawable/ic_stat_name"
android:foregroundServiceType="specialUse"
android:icon="@drawable/ic_stat_name"
android:label="FlClash"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
Expand All @@ -86,6 +95,29 @@
android:name="android.service.quicksettings.TOGGLEABLE_TILE"
android:value="true" />
</service>

<provider
android:name=".FilesProvider"
android:authorities="${applicationId}.files"
android:exported="true"
android:grantUriPermissions="true"
android:permission="android.permission.MANAGE_DOCUMENTS"
android:process=":background">
<intent-filter>
<action android:name="android.content.action.DOCUMENTS_PROVIDER" />
</intent-filter>
</provider>

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>

<service
android:name=".services.FlClashVpnService"
android:exported="false"
Expand All @@ -94,6 +126,18 @@
<intent-filter>
<action android:name="android.net.VpnService" />
</intent-filter>
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="vpn" />
</service>

<service
android:name=".services.FlClashService"
android:exported="false"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="service" />
</service>

<meta-data
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.follow.clash


import com.follow.clash.models.VpnOptions

interface BaseServiceInterface {
fun start(options: VpnOptions): Int
fun stop()
fun startForeground(title: String, content: String)
}
Loading