# Exclave

A fork of SagerNet, the universal proxy toolchain for Android written in Kotlin.

## Download

  [<img src="images/get-it-on-github.png" alt="Get it on GitHub" height="80">](https://github.com/dyhkwong/Exclave/releases) [<img src="images/get-it-on-f-droid.png" alt="Get it on F-Droid" height="80">](https://f-droid.org/packages/com.github.dyhkwong.sagernet)

- [NaïveProxy plugin](https://github.com/klzgrad/naiveproxy/releases) (use upstream releases directly)

- [Hysteria 2 plugin](https://github.com/dyhkwong/Exclave/releases?q=hysteria-plugin-2)

- [Mieru plugin](https://github.com/dyhkwong/Exclave/releases?q=mieru-plugin-3) or [use upstream releases directly](https://github.com/enfein/NekoBoxPlugins/releases)

- [Brook plugin](https://github.com/dyhkwong/Exclave/releases?q=brook-plugin)

- [Juicity plugin](https://github.com/dyhkwong/Exclave/releases?q=juicity-plugin)

- [Other plugins](https://github.com/dyhkwong/Exclave/releases/tag/0.12.0-0-legacy-plugins)

## License

When `library/core` is compiled with `with_clash` tag, Exclave is licensed under the GNU General Public License as published by the Free Software Foundation, version 3.

```
Copyright (C) 2023-2025 by dyhkwong
Copyright (C) 2021 by nekohasekai <contact-sagernet@sekai.icu>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
```

When `library/core` is compiled without `with_clash` tag, Exclave is licensed under the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Plugins are licensed under the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

```
Copyright (C) 2023-2025 by dyhkwong
Copyright (C) 2021 by nekohasekai <contact-sagernet@sekai.icu>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
```

The native libraries of plugins are executables that run in separate processes. Therefore, the native libraries of plugins are not subject to the restrictions of the GNU General Public License. The license of the corresponding upstream project applies to the native libraries of plugins.

## Translation

Is Exclave not in your language, or the translation is incorrect or incomplete? Get involved in the translations on [Hosted Weblate](https://hosted.weblate.org/projects/exclave/).

## Report issues

Please report issues [here](https://github.com/dyhkwong/Exclave/issues). Do not report issues to upstream because the core used is heavily modified.

- Encrypt with [this GPG public key](https://github.com/dyhkwong.gpg) before posting if the issue contains sensitive information.

- For crashes, log file is required. Switch to "debug" level before logging.

- For memory leak and high system resource usage, pprof profile is required. Long press "about" and restart the app to trigger pprof settings.

## FAQs and explanation of terms

[Wiki](https://github.com/dyhkwong/Exclave/wiki). The wiki may contain potentially distressing or otherwise sensitive content. Viewer discretion is advised.

## Build
- Install and configure Git, JDK, Android SDK, Android NDK, Go and [this Go Mobile fork](https://github.com/sagernet/gomobile).
- `git clone` this project and submodule `library/core`. Also clone the corresponding plugin submodules if needed.
- Replace `release.keystore` (can be generated by Java `keytool`) with your own.
- Append these lines to your `local.properties`
```
KEYSTORE_PASS=your_keystore_pass
ALIAS_NAME=your_alias_name
ALIAS_PASS=your_alias_pass
```
- Build the app:
  - Build libcore: `./run lib core`
  - Download assets `./gradlew :app:downloadAssets` or update assets `./gradlew :app:updateAssets`
  - Build app: `./gradlew :app:assembleOssRelease`
  - APK files are located in `app/build/outputs/apk/`.
- Build a plugin:
  - `plugin_name` is `brook`/`hysteria2`/`juicity`/`mieru`/`naive`.
  - Build plugin binaries: `./run plugin [plugin_name]`
  - Build plugin APK:`./gradlew :plugin:[plugin_name]:assembleOssRelease`
  - Plugin APK files are located in `plugin/[plugin_name]/build/outputs/apk/`.
