Merge branch 'main' of hiddify-github:hiddify/hiddify-next

This commit is contained in:
Hiddify
2023-10-07 23:12:49 +02:00
15 changed files with 280 additions and 65 deletions

96
.github/ISSUE_TEMPLATE/bug_report.yaml vendored Normal file
View File

@@ -0,0 +1,96 @@
name: Bug Report
description: Report a bug encountered while using Hiddify Next
labels: ['bug']
body:
- type: markdown
attributes:
value: |
If you have a feature idea or need help, please go to [our Telegram group](https://t.me/hiddify_board).
Please make sure to provide a descriptive, deterministic, and reproducible report. It saves time for both the developers and users who are looking for solutions. Providing as much information as possible, including screenshots and logs, is highly appreciated. This will help us to better understand the issue and respond more effectively.
Please DO NOT use this template to ask questions. There are other appropriate channels to ask questions. This template is strictly for reporting bugs.
- type: checkboxes
id: confirm-search
attributes:
label: Search first
description: Please search [existing issues](https://github.com/hiddify/hiddify-next/issues) before reporting.
options:
- label: I searched and no similar issues were found
required: true
- type: textarea
id: problem
attributes:
label: What Happened?
description: |
Please provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner.
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Reproduce the Bug
description: |
Please tell us the steps to reproduce the bug.
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected Behavior
description: |
Please tell us what's the behavior you expect.
validations:
required: false
- type: input
id: version
attributes:
label: Version
description: What version of Hiddify Next are you using?
placeholder: v1.3.8 etc
validations:
required: true
- type: dropdown
id: platform
attributes:
label: Platform/OS
description: What platform are you seeing the problem on?
multiple: true
options:
- Android
- Windows
- macOS
- Linux
- iOS
validations:
required: true
- type: textarea
id: additional
attributes:
label: Additional Context
description: |
If applicable, add screenshots, screen recordings or additional context to help explain your problem.
validations:
required: false
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: checkboxes
id: ask-pr
attributes:
label: Are you willing to submit a PR? If you know how to fix the bug.
description: |
If you are not familiar with programming, you can skip this step.
If you are a developer and know how to fix the bug, you can submit a PR to fix it.
Your contributions are greatly appreciated and play a vital role in helping to improve the project!
options:
- label: I'm willing to submit a PR (Thank you!)

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Questions & Help
url: https://t.me/hiddify_board
about: Ask a question about Hiddify Next

View File

@@ -0,0 +1,10 @@
name: Feature Request
description: Request a new feature
title: '[FR] '
body:
- type: textarea
attributes:
label: Feature description
description: Please provide a clear and concise description of what you want to happen and what problem will this solve.
validations:
required: true

21
.github/release_message.md vendored Normal file
View File

@@ -0,0 +1,21 @@
<!--<p dir="ltr" style="font-size: 20px">"$RELEASE_VERSION"</p> -->
<div align=left>
<a href="https://play.google.com/store/apps/details?id=app.hiddify.com"><img width=20% src="https://github.com/hiddify/hiddify-next/blob/main/assets/images/google-play-badge.png"></a>
</div>
or download from below based on your OS:
- **Android:** [Universal](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-universal.apk) - [Arm64](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-arm64.apk) - [Arm7](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-arm7.apk) - [x86_64](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-x86_64.apk)
- **Windows:** [x64 Setup](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-windows-x64-setup.exe) - [x64 Portable](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-windows-x64-portable.zip)
- **Linux:** [x64 AppImage](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-linux-x64.AppImage.zip)
- **macOS (v10.14+):** [Universal (x64, M series)](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-macos-universal.dmg)
- **Build from source:** [Build & contribute guide](contribute.md)
**List of all changes:** [ChangeLog](https://github.com/hiddify/hiddify-next/blob/main/changelog.md)

View File

@@ -5,7 +5,8 @@
<div align="center"> <div align="center">
[![GP-Intalls](https://img.shields.io/endpoint?color=green&logo=google-play&logoColor=green&url=https%3A%2F%2Fplay.cuzi.workers.dev%2Fplay%3Fi%3Dapp.hiddify.com%26l%3DGoogle%2520Play%26m%3D%24shortinstalls&style=flat-square)](https://play.cuzi.workers.dev/play?i=app.hiddify.com&l=GooglePlay&m=$installs)[![Downloads](https://img.shields.io/github/downloads/hiddify/hiddify-next/total?style=flat-square&logo=github)](https://img.shields.io/github/downloads/Hiddify/Hiddify-Next/total)[![Last Version](https://img.shields.io/github/release/hiddify/hiddify-next/all.svg?style=flat-square)](https://github.com/hiddify/hiddify-server/)[![Last Release Date](https://img.shields.io/github/release-date/hiddify/hiddify-next.svg?style=flat-square)](https://github.com/hiddify/hiddify-next/)![commits](https://img.shields.io/github/commit-activity/m/hiddify/hiddify-next?style=flat-square)[![Youtube](https://img.shields.io/youtube/channel/views/UCxrmeMvVryNfB4XL35lXQNg?label=Youtube&style=flat-square&logo=youtube)](https://www.youtube.com/@hiddify)[![Telegram Channel](https://img.shields.io/endpoint?label=Channel&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fhiddify&color=blue)](https://telegram.dog/hiddify)[![Telegram Group](https://img.shields.io/endpoint?color=neon&label=Support%20Group&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fhiddify_board)](https://telegram.dog/hiddify_board) [![GP-Intalls](https://img.shields.io/endpoint?color=green&logo=google-play&logoColor=green&url=https%3A%2F%2Fplay.cuzi.workers.dev%2Fplay%3Fi%3Dapp.hiddify.com%26l%3DGoogle%2520Play%26m%3D%24shortinstalls&style=flat-square)](https://play.cuzi.workers.dev/play?i=app.hiddify.com&l=GooglePlay&m=$installs) [![Downloads](https://img.shields.io/github/downloads/hiddify/hiddify-next/total?style=flat-square&logo=github)](https://img.shields.io/github/downloads/Hiddify/Hiddify-Next/total)[![Last Version](https://img.shields.io/github/release/hiddify/hiddify-next/all.svg?style=flat-square)](https://github.com/hiddify/hiddify-server/)[![Last Release Date](https://img.shields.io/github/release-date/hiddify/hiddify-next.svg?style=flat-square)](https://github.com/hiddify/hiddify-next/)![commits](https://img.shields.io/github/commit-activity/m/hiddify/hiddify-next?style=flat-square)
[![Youtube](https://img.shields.io/youtube/channel/views/UCxrmeMvVryNfB4XL35lXQNg?label=Youtube&style=flat-square&logo=youtube)](https://www.youtube.com/@hiddify)[![Telegram Channel](https://img.shields.io/endpoint?label=Channel&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fhiddify&color=blue)](https://telegram.dog/hiddify)[![Telegram Group](https://img.shields.io/endpoint?color=neon&label=Support%20Group&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fhiddify_board)](https://telegram.dog/hiddify_board)
</div> </div>
@@ -51,7 +52,7 @@ Clash, Sing-box and Shadowsocks
For latest releases (including pre-releases), visit [releases page](https://github.com/hiddify/hiddify-next/releases) For latest releases (including pre-releases), visit [releases page](https://github.com/hiddify/hiddify-next/releases)
- Android: [Universal](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-universal.apk) - [Arm64](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-arm64.apk) - [Arm7](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-arm7.apk) - [x86_64](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-x86_64.apk) - Android: [Universal](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-universal.apk) - [Arm64](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-arm64.apk) - [Arm7](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-arm7.apk) - [x86_64](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-x86_64.apk)
- Windows: [x64 Setup](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-windows-x64-setup.exe) - [x64 Portable](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-windows-x64-portable.zip) - Windows: [x64 Setup](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-windows-x64-setup.exe) - [x64 Portable](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-windows-x64-portable.zip)
@@ -59,34 +60,13 @@ For latest releases (including pre-releases), visit [releases page](https://gith
- macOS (v10.14+): [Universal (x64, M series)](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-macos-universal.dmg) - macOS (v10.14+): [Universal (x64, M series)](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-macos-universal.dmg)
## Build from source - Build from source: [Build & contribute guide](contribute.md)
Hiddify Next relies on [core library](https://github.com/hiddify/hiddify-next-core) made with GO. if you're interested in building/contributing to that as well follow instructions there. <div align=center>
<a href="https://play.google.com/store/apps/details?id=app.hiddify.com"><img width=20% src="./assets/images/google-play-badge.png"></a>
</div>
### requirements:
- Flutter v3.13+
- Make
- Android SDK
This project uses [flutter_distributor](https://github.com/leanflutter/flutter_distributor) for packaging.
```shell
# fetch dependencies and build generated files
$ make get translate gen
# fetch geo assets
$ make get-geo-assets
for platform in [windows linux macos android]:
# fetch native libraries for respective platforms, follow core lib instructions for building
$ make $platform-libs
$ make release-$platform
# example:
$ make windows-libs
$ make windows-release
```
## Acknowledgements ## Acknowledgements
@@ -115,7 +95,7 @@ We need your collaboration in order to develop this project. If you are speciali
</br> </br>
[![Email](https://img.shields.io/badge/Gmail-contribute@hiddify.com-green?style=flat-square&logo=gmail)](mailto:contribute@hiddify.com) [![Email](https://img.shields.io/badge/Email-contribute@hiddify.com-005FF9?style=flat-square&logo=mail.ru)](mailto:contribute@hiddify.com)
[![Telegram Channel](https://img.shields.io/endpoint?label=Channel&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fhiddify&color=blue)](https://telegram.dog/hiddify) [![Telegram Channel](https://img.shields.io/endpoint?label=Channel&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fhiddify&color=blue)](https://telegram.dog/hiddify)
[![Telegram Group](https://img.shields.io/endpoint?color=neon&label=Support%20Group&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fhiddify_board)](https://telegram.dog/hiddify_board) [![Telegram Group](https://img.shields.io/endpoint?color=neon&label=Support%20Group&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fhiddify_board)](https://telegram.dog/hiddify_board)
[![Youtube](https://img.shields.io/youtube/channel/views/UCxrmeMvVryNfB4XL35lXQNg?label=Youtube&style=flat-square&logo=youtube)](https://www.youtube.com/@hiddify) [![Youtube](https://img.shields.io/youtube/channel/views/UCxrmeMvVryNfB4XL35lXQNg?label=Youtube&style=flat-square&logo=youtube)](https://www.youtube.com/@hiddify)
@@ -130,7 +110,7 @@ We need your collaboration in order to develop this project. If you are speciali
</p> </p>
<p align=center> <p align=center>
<a href="https://github.com/hiddify/hiddify-server/graphs/contributors"> <a href="https://github.com/hiddify/hiddify-next/graphs/contributors">
<img src="https://contrib.rocks/image?repo=hiddify/hiddify-next" /> <img src="https://contrib.rocks/image?repo=hiddify/hiddify-next" />
</a> </a>
</p> </p>

View File

@@ -9,7 +9,8 @@
<div align="center"> <div align="center">
[![GP-Intalls](https://img.shields.io/endpoint?color=green&logo=google-play&logoColor=green&url=https%3A%2F%2Fplay.cuzi.workers.dev%2Fplay%3Fi%3Dapp.hiddify.com%26l%3DGoogle%2520Play%26m%3D%24shortinstalls&style=flat-square)](https://play.cuzi.workers.dev/play?i=app.hiddify.com&l=GooglePlay&m=$installs)[![Downloads](https://img.shields.io/github/downloads/hiddify/hiddify-next/total?style=flat-square&logo=github)](https://img.shields.io/github/downloads/Hiddify/Hiddify-Next/total)[![Last Version](https://img.shields.io/github/release/hiddify/hiddify-next/all.svg?style=flat-square)](https://github.com/hiddify/hiddify-server/)[![Last Release Date](https://img.shields.io/github/release-date/hiddify/hiddify-next.svg?style=flat-square)](https://github.com/hiddify/hiddify-next/)![commits](https://img.shields.io/github/commit-activity/m/hiddify/hiddify-next?style=flat-square)[![Youtube](https://img.shields.io/youtube/channel/views/UCxrmeMvVryNfB4XL35lXQNg?label=Youtube&style=flat-square&logo=youtube)](https://www.youtube.com/@hiddify)[![Telegram Channel](https://img.shields.io/endpoint?label=Channel&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fhiddify&color=blue)](https://telegram.dog/hiddify)[![Telegram Group](https://img.shields.io/endpoint?color=neon&label=Support%20Group&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fhiddify_board)](https://telegram.dog/hiddify_board) [![GP-Intalls](https://img.shields.io/endpoint?color=green&logo=google-play&logoColor=green&url=https%3A%2F%2Fplay.cuzi.workers.dev%2Fplay%3Fi%3Dapp.hiddify.com%26l%3DGoogle%2520Play%26m%3D%24shortinstalls&style=flat-square)](https://play.cuzi.workers.dev/play?i=app.hiddify.com&l=GooglePlay&m=$installs) [![Downloads](https://img.shields.io/github/downloads/hiddify/hiddify-next/total?style=flat-square&logo=github)](https://img.shields.io/github/downloads/Hiddify/Hiddify-Next/total)[![Last Version](https://img.shields.io/github/release/hiddify/hiddify-next/all.svg?style=flat-square)](https://github.com/hiddify/hiddify-server/)[![Last Release Date](https://img.shields.io/github/release-date/hiddify/hiddify-next.svg?style=flat-square)](https://github.com/hiddify/hiddify-next/)![commits](https://img.shields.io/github/commit-activity/m/hiddify/hiddify-next?style=flat-square)
[![Youtube](https://img.shields.io/youtube/channel/views/UCxrmeMvVryNfB4XL35lXQNg?label=Youtube&style=flat-square&logo=youtube)](https://www.youtube.com/@hiddify)[![Telegram Channel](https://img.shields.io/endpoint?label=Channel&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fhiddify&color=blue)](https://telegram.dog/hiddify)[![Telegram Group](https://img.shields.io/endpoint?color=neon&label=Support%20Group&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fhiddify_board)](https://telegram.dog/hiddify_board)
</div> </div>
@@ -18,14 +19,16 @@
## 🚀 امکانات اصلی: ## 🚀 امکانات اصلی:
⭐ استفاده بسیار آسان ⭐ استفاده بسیار آسان با رابط کاربری ساده
✈️ پشتیبانی از چند پلتفرم: اندروید، ویندوز، لینوکس و مک (برای iOS پول رکوئست استقبال می‌شود)
⚙️ بر پایه هسته سینگ‌باکس ⚙️ بر پایه هسته سینگ‌باکس
🔍 انتخاب خودکار بهترین سرور و کانفیگ 🔍 انتخاب خودکار بهترین سرور و کانفیگ
🚫 پشتیبانی از رنج وسیعی از پروتکل‌ها 🟡 پشتیبانی از رنج وسیعی از پروتکل‌ها
V2ray, Xray, Vless, Vmess, Reality, TUIC, Hysteria, Shadowtls, SSH Sing-box, V2ray, Xray, Vless, Vmess, Reality, TUIC, Hysteria, Shadowtls, SSH, Clash, Clash meta
🟡 پشتیبانی لینک‌های سابسکریپشن‌ مختلف: 🟡 پشتیبانی لینک‌های سابسکریپشن‌ مختلف:
کلش، سینگ‌باکس و شدوساکس کلش، سینگ‌باکس و شدوساکس
@@ -44,9 +47,69 @@ V2ray, Xray, Vless, Vmess, Reality, TUIC, Hysteria, Shadowtls, SSH
⭐ کانفیگ متناسب برای ایران، چین، روسیه و‌ سایر کشورها ⭐ کانفیگ متناسب برای ایران، چین، روسیه و‌ سایر کشورها
💻 انتشار نسخه اندروید در [گوگل پلی](https://play.google.com/store/apps/details?id=app.hiddify.com) 💻 انتشار نسخه اندروید در [گوگلپلی](https://play.google.com/store/apps/details?id=app.hiddify.com)
ت ## دانلود
برای دریافت آخرین نسخه (شامل نسخه‌های پیش‌انتشار) از [صفحه انتشار](https://github.com/hiddify/hiddify-next/releases) بازدید نمایید.
- اندروید: [Universal](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-universal.apk) - [Arm64](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-arm64.apk) - [Arm7](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-arm7.apk) - [x86_64](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-android-x86_64.apk)
- ویندوز: [x64 Setup](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-windows-x64-setup.exe) - [x64 Portable](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-windows-x64-portable.zip)
- لینوکس: [x64 AppImage](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-linux-x64.AppImage.zip)
- مک (نسخه 10.14 به بالا): [Universal (x64, M series)](https://github.com/hiddify/hiddify-next/releases/latest/download/hiddify-macos-universal.dmg)
- بیلد از منبع: [راهنمای بیلد و مشارکت در پروژه](https://github.com/hiddify/hiddify-next/blob/main/contribute.md)
<div align=center>
<a href="https://play.google.com/store/apps/details?id=app.hiddify.com"><img width=20% src="./assets/images/google-play-badge.png"></a>
</div>
. ## سپاسگزاری
- [سینگ‌باکس](https://github.com/SagerNet/sing-box)
- [کلش](https://github.com/Dreamacro/clash)
- [کلش‌متا](https://github.com/MetaCubeX/Clash.Meta)
- [اف‌کلش](https://github.com/Fclash/Fclash)
- [سایر](./pubspec.yaml)
## حمایت از پروژه
ساده‌ترین راه حمایت از ما کلیک کردن روی ستاره (⭐) بالای همین صفحه است.
ما برای سرویس هایمان به کمک مالی هم نیاز داریم. تمامی فعالیت‌های ما به صورت داوطلبانه انجام می‌شود و حمایت‌های مالی صرف توسعه پروژه می‌شود. اطلاعات و آدرس‌های حمایت‌ از ما را در [این لینک](https://github.com/hiddify/hiddify-server/wiki/support) مشاهده فرمایید.
## راه‌های همکاری و ارتباط با ما
اگر در هر یک از زمینه‌های زیر توانایی دارید، لطفا با ما در تماس باشید.
* برنامه‌نویسی فلاتر
* برنامه‌نویسی سوئیفت
* برنامه‌نویسی کاتلین
* برنامه‌نویسی Go
</br>
<div align=center>
[![Email](https://img.shields.io/badge/Email-contribute@hiddify.com-005FF9?style=flat-square&logo=mail.ru)](mailto:contribute@hiddify.com)
[![Telegram Channel](https://img.shields.io/endpoint?label=Channel&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fhiddify&color=blue)](https://telegram.dog/hiddify)
[![Telegram Group](https://img.shields.io/endpoint?color=neon&label=Support%20Group&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fhiddify_board)](https://telegram.dog/hiddify_board)
[![Youtube](https://img.shields.io/youtube/channel/views/UCxrmeMvVryNfB4XL35lXQNg?label=Youtube&style=flat-square&logo=youtube)](https://www.youtube.com/@hiddify)
[![Twitter](https://img.shields.io/twitter/follow/hiddify_com?color=%231DA1F2&logo=twitter&logoColor=1DA1F2&style=flat-square)](https://twitter.com/intent/follow?screen_name=hiddify_com)
</div>
<p align=center>
از همه کسانی که در این پروژه مشارکت می‌کنند سپاسگزاریم. بعضی از آن‌ها اینجا هستند و خیلی های دیگه خارج از گیتهاب. همگی خیلی برای ما ارزشمندند. ♥
</p>
<p align=center>
<a href="https://github.com/hiddify/hiddify-next/graphs/contributors">
<img src="https://contrib.rocks/image?repo=hiddify/hiddify-next" />
</a>
</p>
<p align=center>
ساخته شده با <a rel="" target="_blank" href="https://contrib.rocks">Contrib.Rocks</a>
</p>

View File

@@ -59,7 +59,6 @@ class MainActivity : FlutterFragmentActivity(), ServiceConnection.Callback {
fun startService() { fun startService() {
if (!ServiceNotification.checkPermission()) { if (!ServiceNotification.checkPermission()) {
// Log.d(TAG, "missing notification permission")
grantNotificationPermission() grantNotificationPermission()
return return
} }
@@ -81,15 +80,26 @@ class MainActivity : FlutterFragmentActivity(), ServiceConnection.Callback {
} }
} }
private suspend fun prepare() = withContext(Dispatchers.Main) {
try {
val intent = VpnService.prepare(this@MainActivity)
if (intent != null) {
startActivityForResult(intent, VPN_PERMISSION_REQUEST_CODE)
true
} else {
false
}
} catch (e: Exception) {
onServiceAlert(Alert.RequestVPNPermission, e.message)
false
}
}
override fun onServiceStatusChanged(status: Status) { override fun onServiceStatusChanged(status: Status) {
Log.d(TAG, "service status changed: $status")
serviceStatus.postValue(status) serviceStatus.postValue(status)
} }
override fun onServiceAlert(type: Alert, message: String?) { override fun onServiceAlert(type: Alert, message: String?) {
Log.d(TAG, "service alert: $type")
serviceAlerts.postValue(ServiceEvent(Status.Stopped, type, message)) serviceAlerts.postValue(ServiceEvent(Status.Stopped, type, message))
} }
@@ -154,22 +164,6 @@ class MainActivity : FlutterFragmentActivity(), ServiceConnection.Callback {
} }
} }
private suspend fun prepare() = withContext(Dispatchers.Main) {
try {
val intent = VpnService.prepare(this@MainActivity)
if (intent != null) {
// prepareLauncher.launch(intent)
startActivityForResult(intent, VPN_PERMISSION_REQUEST_CODE)
true
} else {
false
}
} catch (e: Exception) {
onServiceAlert(Alert.RequestVPNPermission, e.message)
false
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data) super.onActivityResult(requestCode, resultCode, data)
if (requestCode == VPN_PERMISSION_REQUEST_CODE) { if (requestCode == VPN_PERMISSION_REQUEST_CODE) {

View File

@@ -172,5 +172,9 @@ object DefaultNetworkListener {
} }
} }
private fun unregister() = Application.connectivity.unregisterNetworkCallback(Callback) private fun unregister() {
runCatching {
Application.connectivity.unregisterNetworkCallback(Callback)
}
}
} }

View File

@@ -7,7 +7,7 @@ class ProxyService : Service(), PlatformInterfaceWrapper {
private val service = BoxService(this, this) private val service = BoxService(this, this)
override fun onStartCommand(intent: Intent, flags: Int, startId: Int) = override fun onStartCommand(intent: Intent?, flags: Int, startId: Int) =
service.onStartCommand(intent, flags, startId) service.onStartCommand(intent, flags, startId)
override fun onBind(intent: Intent) = service.onBind(intent) override fun onBind(intent: Intent) = service.onBind(intent)

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

28
contribute.md Normal file
View File

@@ -0,0 +1,28 @@
## Build from source
Hiddify Next relies on [core library](https://github.com/hiddify/hiddify-next-core) made with GO. if you're interested in building/contributing to that as well follow instructions there.
### requirements:
- Flutter v3.13+
- Make
- Android SDK
This project uses [flutter_distributor](https://github.com/leanflutter/flutter_distributor) for packaging.
```shell
# fetch dependencies and build generated files
$ make get translate gen
# fetch geo assets
$ make get-geo-assets
for platform in [windows linux macos android]:
# fetch native libraries for respective platforms, follow core lib instructions for building
$ make $platform-libs
$ make release-$platform
# example:
$ make windows-libs
$ make windows-release
```

View File

@@ -63,10 +63,11 @@ class AppUpdateNotifier extends _$AppUpdateNotifier with AppLogger {
return state = AppUpdateState.error(err); return state = AppUpdateState.error(err);
}, },
(remote) { (remote) {
if (remote.version == _ignoreReleasePref.getValue()) { if (remote.version.compareTo(currentVersion) > 0) {
loggy.debug("ignored release [${remote.version}]"); if (remote.version == _ignoreReleasePref.getValue()) {
return state = AppUpdateStateIgnored(remote); loggy.debug("ignored release [${remote.version}]");
} else if (remote.version.compareTo(currentVersion) > 0) { return state = AppUpdateStateIgnored(remote);
}
loggy.debug("new version available: $remote"); loggy.debug("new version available: $remote");
return state = AppUpdateState.available(remote); return state = AppUpdateState.available(remote);
} }

View File

@@ -13,9 +13,10 @@ class WindowController extends _$WindowController
@override @override
Future<bool> build() async { Future<bool> build() async {
await windowManager.ensureInitialized(); await windowManager.ensureInitialized();
const size = Size(868, 668);
const windowOptions = WindowOptions( const windowOptions = WindowOptions(
size: Size(868, 768), size: size,
minimumSize: Size(868, 648), minimumSize: size,
center: true, center: true,
); );
await windowManager.setPreventClose(true); await windowManager.setPreventClose(true);

View File

@@ -1,5 +1,6 @@
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gap/gap.dart'; import 'package:gap/gap.dart';
import 'package:hiddify/core/core_providers.dart'; import 'package:hiddify/core/core_providers.dart';
import 'package:hiddify/core/prefs/prefs.dart'; import 'package:hiddify/core/prefs/prefs.dart';
@@ -18,6 +19,8 @@ class IntroPage extends HookConsumerWidget with PresLogger {
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
final t = ref.watch(translationsProvider); final t = ref.watch(translationsProvider);
final isStarting = useState(false);
return Scaffold( return Scaffold(
body: CustomScrollView( body: CustomScrollView(
shrinkWrap: true, shrinkWrap: true,
@@ -68,6 +71,8 @@ class IntroPage extends HookConsumerWidget with PresLogger {
), ),
child: FilledButton( child: FilledButton(
onPressed: () async { onPressed: () async {
if (isStarting.value) return;
isStarting.value = true;
if (!ref.read(enableAnalyticsProvider)) { if (!ref.read(enableAnalyticsProvider)) {
loggy.info("disabling analytics per user request"); loggy.info("disabling analytics per user request");
try { try {
@@ -84,7 +89,12 @@ class IntroPage extends HookConsumerWidget with PresLogger {
.read(introCompletedProvider.notifier) .read(introCompletedProvider.notifier)
.update(true); .update(true);
}, },
child: Text(t.intro.start), child: isStarting.value
? LinearProgressIndicator(
backgroundColor: Colors.transparent,
color: Theme.of(context).colorScheme.onSurface,
)
: Text(t.intro.start),
), ),
), ),
], ],

View File

@@ -15,6 +15,8 @@ bool canSendEvent(dynamic throwable) {
UnexpectedFailure(:final error) => canSendEvent(error), UnexpectedFailure(:final error) => canSendEvent(error),
DioException _ => false, DioException _ => false,
SocketException _ => false, SocketException _ => false,
HttpException _ => false,
HandshakeException _ => false,
ExpectedFailure _ => false, ExpectedFailure _ => false,
ExpectedMeasuredFailure _ => false, ExpectedMeasuredFailure _ => false,
_ => true, _ => true,