You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add gRPC remote access, deployment, and E2E sections to README
Sections moved from the jni repository: gRPC architecture diagrams,
jniservice deployment (adb/Magisk/APK), connecting instructions,
E2E test verification table, and security disclaimer.
gRPC proxy layer for [AndroidGoLab/jni](https://github.com/AndroidGoLab/jni).
4
4
5
5
Exposes Android JNI bindings over gRPC so that a host machine can control an
6
-
Android device remotely.
6
+
Android device remotely. Includes `jniservice` (the on-device gRPC server),
7
+
`jnicli` (the command-line client), and `jniserviceadmin` (ACL management).
7
8
8
9
## Components
9
10
10
-
-**cmd/jnicli**— CLI client that talks to jniservice over gRPC
11
-
-**cmd/jniservice**— gRPC server that runs on the Android device (APK or Magisk module)
12
-
-**cmd/jniserviceadmin**— Admin CLI for ACL management
13
-
-**grpc/**— gRPC server and client wrappers
14
-
-**proto/**— Protobuf service definitions
15
-
-**handlestore/**— Object handle mapping for cross-process JNI references
16
-
-**tools/cmd/callbackgen**— Code generator for Java callback adapter classes
11
+
-**cmd/jnicli**-- CLI client that talks to jniservice over gRPC
12
+
-**cmd/jniservice**-- gRPC server that runs on the Android device (APK or Magisk module)
13
+
-**cmd/jniserviceadmin**-- Admin CLI for ACL management
14
+
-**grpc/**-- gRPC server and client wrappers
15
+
-**proto/**-- Protobuf service definitions
16
+
-**handlestore/**-- Object handle mapping for cross-process JNI references
17
+
-**tools/cmd/callbackgen**-- Code generator for Java callback adapter classes
17
18
18
-
## Quick start
19
+
## gRPC Remote Access
20
+
21
+
The gRPC layer turns any Android phone into a remotely accessible API server. A companion service (`jniservice`) runs on the device -- either as an APK (non-rooted) or a Magisk module (rooted, auto-starts on boot). Clients on any machine connect over the network using `jnicli`.
Each client registers with a unique certificate (mTLS). Method access is controlled by per-service ACLs -- the device owner approves which services each client can use through an on-screen dialog:
44
+
45
+
```mermaid
46
+
flowchart LR
47
+
subgraph Client
48
+
CLI["jnicli"]
49
+
end
50
+
51
+
subgraph "jniservice (on device)"
52
+
TLS["mTLS gateway"]
53
+
ACL["Per-service ACL"]
54
+
SVC["31 Android API\nservices"]
55
+
RAW["Raw JNI surface"]
56
+
PROXY["Callback proxy\n(Camera2, etc.)"]
57
+
end
58
+
59
+
CLI -->|client cert| TLS
60
+
TLS --> ACL
61
+
ACL -->|"camera.*"| SVC
62
+
ACL -->|"admin only"| RAW
63
+
SVC --> Android["Android\nFramework"]
64
+
RAW --> Android
65
+
PROXY --> Android
66
+
```
67
+
68
+
**Available services** include camera, location, bluetooth, WiFi, telephony, battery, power, alarm, vibrator, audio, NFC, notifications, and more (31 services total, ~2000 RPCs). Callback-based APIs (like Camera2) work through a bidirectional streaming proxy with build-time generated adapter classes.
69
+
70
+
## Running jniservice on Android
71
+
72
+
jniservice is a gRPC server that exposes the JNI surface and Android APIs over the network.
73
+
74
+
### Development (via adb)
75
+
76
+
```bash
77
+
make deploy # build, push, start, forward port
78
+
make deploy HOST_PORT=50052 # use different host port
79
+
make stop-server # stop the server
80
+
```
81
+
82
+
### Rooted devices (Magisk module)
83
+
84
+
Auto-starts on boot. Self-contained -- no `make deploy` needed after install.
> **Security disclaimer:** This is a hobby/research project. The mTLS + ACL system provides basic access control, but it has not been audited and should not be relied upon for security-critical deployments. The self-signed CA, handle-based object references, and raw JNI surface all have inherent attack surface. Use it on trusted networks for development, testing, and experimentation.
147
+
31
148
## Dependencies
32
149
33
-
This module depends on `github.com/AndroidGoLab/jni` for core JNI bindings.
150
+
This module depends on [github.com/AndroidGoLab/jni](https://github.com/AndroidGoLab/jni) for core JNI bindings and code generation tools.
34
151
When developing locally, use a `go.work` file pointing to both repos.
0 commit comments