Skip to content

Latest commit

 

History

History
147 lines (98 loc) · 6.85 KB

CONTRIBUTING.md

File metadata and controls

147 lines (98 loc) · 6.85 KB

Contributing

Every contribution to Hiddify Next is welcome, whether it is reporting a bug, submitting a fix, proposing new features, or just asking a question. To make contributing to Hiddify Next as easy as possible, you will find more details for the development flow in this documentation.

Please note, we have a Code of Conduct, please follow it in all your interactions with the project.

Feedback, Issues and Questions

If you encounter any issue, or you have an idea to improve, please:

  • Search through existing open and closed GitHub Issues for the answer first. If you find a relevant topic, please comment on the issue.
  • If none of the issues are relevant, please add a new issue following the templates and provide as much relevant information as possible.

Adding new Features

When contributing a complex change to the Hiddify Next repository, please discuss the change you wish to make within a GitHub issue with the owners of this repository before making the change.

Development

Hiddify Next uses Flutter and Go, make sure that you have the correct version installed before starting development. You can use the following commands to check your installed version:

$ flutter --version

# example response
Flutter 3.13.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 367f9ea16b (4 weeks ago) • 2023-09-12 23:27:53 -0500
Engine • revision 9064459a8b
Tools • Dart 3.1.2 • DevTools 2.25.0


$ go version

# example response
go version go1.21.1 darwin/arm64

Working with the Go Code

if you're not interested in building/contributing to the Go code, you can skip this section

The Go code for Hiddify Next can be found in the libcore folder, as a git submodule and in core repository. The entrypoints for the desktop version are available in the libcore/custom folder and for the mobile version they can be found in the libcore/mobile folder.

For the desktop version, we have to compile the Go code into a C shared library. We are providing a Makefile to generate the C shared libraries for all operating systems. The following Make commands will build libcore and copy the resulting output in libcore/bin:

  • make windows-amd64
  • make linux-amd64
  • make macos-universal

For the mobile version, we are using the gomobile tools. The following Make commands will build libcore for Android and iOS and copy the resulting output in libcore/bin:

  • make android
  • make ios

Working with the Flutter Code

We recommend using Visual Studio Code extensions for development.

Setting up the Environment

We have extensive use of code generation in the form of freezed, riverpod, etc. So it's generate these before running the code. Execute the following make commands in order:

# fetch dependencies
$ make get

# generate translations
$ make translate

# fetch geo assets
$ make get-geo-assets

# generate dart code using build_runner
$ make gen

Assuming you have not built the libcore and want to use existing releases, you should run the following command (based on your target platform):

  • make windows-libs
  • make linux-libs
  • make macos-libs
  • make android-libs
  • make ios-libs

If you want to build the libcore from source, prefix the above command with build- like make build-windows-libs.

Run Release Build on a Device

To run the release build on a device for testing, we have to get the Device ID first by running the following command:

$ flutter devices

# example response
3 connected devices:

2211143G (mobile) • 35492ae2 • android-arm64  • Android 13 (API 33)
Windows (desktop) • windows  • windows-x64    • Microsoft Windows [Version 10.0.22000.2482]
Chrome (web)      • chrome   • web-javascript • Google Chrome 117.0.5938.149

Then we can use one of the listed devices and execute the following command to build and run the app on this device:

flutter run --release --target lib/main_dev.dart --device-id=35492ae2

Release

We use flutter_distributor for packaging. GitHub action is triggered on every release tag and will create a new GitHub release. After setting up the environment, use the following make commands to build the release version:

  • make windows-release
  • make linux-release
  • make macos-release
  • make android-release
  • make ios-release

Collaboration and Contact Information

We need your collaboration in order to develop this project. If you have experience in these areas, please do not hesitate to contact us.

  • Flutter Developing
  • Swift Developing
  • Kotlin Developing
  • Go Developing

Email Telegram Channel Telegram Group Youtube Twitter