[PR #326] Quich and lazy way to load and run cloak as dynamic library #318

Open
opened 2026-02-26 12:34:36 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/cbeuw/Cloak/pull/326
Author: @a-sakharov
Created: 1/20/2026
Status: 🔄 Open

Base: masterHead: master


📝 Commits (6)

  • 0013b7e Quich and lazy way to load and run cloak as dynamic library
  • d0517df Library mode (external main) now can be enabled with build flag
  • 4e2ef40 Fix tabs/spaces
  • b72c2c3 Move libs building code to separate script
  • 2156217 Enable special android log system from default to special tag "android_log"
  • 463103e Do not build protector_android by default for android. It's totally NOT necessary to be used

📊 Changes

7 files changed (+69 additions, -8 deletions)

View changed files

buildlibs.sh (+15 -0)
cmd/ck-client/external-main.go (+23 -0)
📝 cmd/ck-client/log.go (+2 -2)
📝 cmd/ck-client/log_android.go (+2 -2)
📝 cmd/ck-client/protector.go (+2 -2)
📝 cmd/ck-client/protector_android.go (+2 -2)
cmd/ck-server/external-main.go (+23 -0)

📄 Description

Cloak is great, but it's now pretty limited in plaforms it can run at. This is step to run cloak on android as standalone app, not as part of shadowsocks.
Android system forbids you to use exec, but it's still possible to do fork+dlopen, and this changes looks like absolutely minimum to support this launch way


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cbeuw/Cloak/pull/326 **Author:** [@a-sakharov](https://github.com/a-sakharov) **Created:** 1/20/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (6) - [`0013b7e`](https://github.com/cbeuw/Cloak/commit/0013b7ea7d3da05a90f625659a653f71d43e79e8) Quich and lazy way to load and run cloak as dynamic library - [`d0517df`](https://github.com/cbeuw/Cloak/commit/d0517dfe401230dedd037dd96f9229c80f2694aa) Library mode (external main) now can be enabled with build flag - [`4e2ef40`](https://github.com/cbeuw/Cloak/commit/4e2ef402abb4990bd2910611f0a884adf4a2a3cf) Fix tabs/spaces - [`b72c2c3`](https://github.com/cbeuw/Cloak/commit/b72c2c3203e0e2a0d03d5be546c5ddb75583777d) Move libs building code to separate script - [`2156217`](https://github.com/cbeuw/Cloak/commit/2156217106ca28d6a6bc688298b07ee097835e63) Enable special android log system from default to special tag "android_log" - [`463103e`](https://github.com/cbeuw/Cloak/commit/463103ef4bb7d102c41c989fac65ffa787a61b37) Do not build protector_android by default for android. It's totally NOT necessary to be used ### 📊 Changes **7 files changed** (+69 additions, -8 deletions) <details> <summary>View changed files</summary> ➕ `buildlibs.sh` (+15 -0) ➕ `cmd/ck-client/external-main.go` (+23 -0) 📝 `cmd/ck-client/log.go` (+2 -2) 📝 `cmd/ck-client/log_android.go` (+2 -2) 📝 `cmd/ck-client/protector.go` (+2 -2) 📝 `cmd/ck-client/protector_android.go` (+2 -2) ➕ `cmd/ck-server/external-main.go` (+23 -0) </details> ### 📄 Description Cloak is great, but it's now pretty limited in plaforms it can run at. This is step to run cloak on android as standalone app, not as part of shadowsocks. Android system forbids you to use exec, but it's still possible to do fork+dlopen, and this changes looks like absolutely minimum to support this launch way --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Cloak#318
No description provided.