Skip to content

About

Go server inside Android APK + WebView UI + SAF bridge (no JNI/NDK, no external permissions)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

goshell-android

Go server inside Android APK + WebView UI + SAF bridge — without JNI, without NDK, without external permissions.

A reusable template for Android apps that:

  • run any Go HTTP server as a foreground service (lib<app>-server.so),
  • render UI in WebView against http://127.0.0.1:<port>/,
  • access Storage Access Framework (user-chosen folders) via a LocalServerSocket("@<app>-saf") RPC bridge,
  • import/share files via ACTION_OPEN_DOCUMENT / ACTION_SEND (no READ_EXTERNAL_STORAGE, no MANAGE_EXTERNAL_STORAGE).

Quickstart

./scripts/init.sh myapp       # -> ~/gowrk/myapp/
cd ~/gowrk/myapp
make apk                      # -> build/myapp.apk
make install                  # -> termux-open build/myapp.apk

What you get

<app>/
├── android/app/src/main/       # манифест, java, res
│   ├── AndroidManifest.xml
│   ├── java/x2v0/<app>/        # BaseMainActivity, MainActivity, ServerService, ...
│   └── res/values/             # strings.xml, styles.xml
├── shell/go/                   # переиспользуемое ядро (repository, server, safblob)
├── go/                         # код приложения (cmd/server/main.go)
├── content/                    # стартовый контент
├── Makefile                    # build / so / apk / install / clean
└── wta.yaml                    # конфиг сборки APK

Layout of this repo

template/
├── android/app/src/main/       # shell Java + res + манифест ({{PKG_PATH}}, {{APP}})
├── go/                         # shell Go: pkg/{repository,server,rpc/safblob}
├── app/go/                     # app Go: cmd/server/main.go ({{MODULE}})
├── app/content/                # стартовый content/
├── Makefile.tmpl
└── wta.yaml.tmpl
scripts/
└── init.sh                     # scaffolding: template -> ~/gowrk/<app>/
examples/
├── notes/                      # минимальный пример
└── mdnote/                     # цель миграции
docs/
├── architecture.md
├── saf-protocol.md
└── permissions.md

Status

Работает: init.sh, make apk, make install (termux-open), WebView + Go, import (ACTION_OPEN_DOCUMENT -> getExternalFilesDir("content") + reload). См. GOALS.md.

License

MIT — see LICENSE.

About

Go server inside Android APK + WebView UI + SAF bridge (no JNI/NDK, no external permissions)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages