Skip to content

Commit 625cc98

Browse files
committed
Update to current installation instructions
1 parent 5edaf45 commit 625cc98

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ This is the SDK for [PenumbraOS](https://github.com/PenumbraOS/), the full devel
55
> [!CAUTION]
66
> This is extremely experimental and currently is usable by developers only. See [Installation](#installation) for in-progress instructions on how to set it up.
77
8+
## Current functionality
9+
10+
The PenumbraOS SDK exposes the following restricted interfaces on the Ai Pin:
11+
12+
- [HTTP](sdk/src/main/java/com/penumbraos/sdk/api/HttpClient.kt) - Custom API implementation. Hopefully will add `OkHttp` handler soon
13+
- [WebSocket](sdk/src/main/java/com/penumbraos/sdk/api/WebSocketClient.kt) - Custom API implementation. Hopefully will add `OkHttp` handler soon
14+
- [Touchpad](sdk/src/main/java/com/penumbraos/sdk/api/TouchpadClient.kt)
15+
- [Speech Recognition](sdk/src/main/java/com/penumbraos/sdk/api/SttClient.kt)
16+
817
## Architecture
918

1019
Due to the locked down nature of the Humane Ai Pin, actually achieving access to "privileged" operations is very convoluted (`untrusted_app` cannot even access the network). The PenumbraOS SDK is designed to mitigate the setup issues and make a repeatable solution suitable for end users. The general spawn capabilities are provided by the [`pinitd`](https://github.com/PenumbraOS/pinitd/) init system.
@@ -17,9 +26,9 @@ This is the actual exposed API surface to developers, run from within your `untr
1726

1827
Quite literally just a bridge between the SDK and the privileged world. `untrusted_app` on the Pin is restricted to making binder connections to exclusively the `nfc` and `radio` SELinux domains. Since `radio` is everything having to do with cellular which is always in use, `nfc` becomes the obvious choice. [`pinitd`](https://github.com/PenumbraOS/pinitd/) is used to spawn a process as the `nfc` user and domain, and `app_process` is used to set up the JVM and run the actual service. Located in `/bridge`.
1928

20-
### Bridge Privileged Daemon
29+
### Bridge System Service
2130

22-
The gateway to all actual privileged operations. Currently, all operations are exclusively things that can run in the `shell` domain (which is where the `pinitd` controller operates), so `bridge_priv_rs` also runs in `shell`. Spawns a TCP server for access from Bridge backed by a simple Protobuf protocol. Future optimization may necessitate direct TCP streams forwarded through Binder, but that would add complexity that is unnecessary at this time. Located in `/bridge_priv_rs`.
31+
The gateway to all actual privileged operations. Currently, all operations are exclusively things that can run in the `system` domain, so `bridge-system` also runs in `system`. Communicates with `bridge-core` over Binder. Located in `/bridge-system`.
2332

2433
## Installation
2534

@@ -33,24 +42,25 @@ This is an active work in progress and may be difficult to set up. Please reach
3342
3. Start `pinitd`. At the time of writing this is accomplished by running:
3443

3544
```bash
36-
settings delete global hidden_api_blacklist_exemptions && am force-stop com.android.settings
37-
am start -n com.penumbraos.pinitd/.ManualLaunchActivity
45+
/data/local/tmp/bin/pinitd-cli debug-manual-start
3846
```
3947

4048
but this will change in the future.
4149

4250
4. Enable the required services:
4351

4452
```bash
45-
./data/local/tmp/bin/pinitd-cli enable bridge-priv-service
46-
./data/local/tmp/bin/pinitd-cli enable bridge-service
47-
./data/local/tmp/bin/pinitd-cli enable mabl
53+
/data/local/tmp/bin/pinitd-cli enable bridge-service
54+
/data/local/tmp/bin/pinitd-cli enable bridge-system-service
55+
/data/local/tmp/bin/pinitd-cli enable mabl
4856
```
4957

50-
5. Once `pinitd` is running and the services are enabled, you can start the bridge services. `bridge-service` depends on everything else (including MABL), so it will automatically launch all services as necessary on startup.
58+
5. Once `pinitd` is running and the services are enabled, you can start the bridge services. ~~`bridge-service` depends on everything else (including MABL), so it will automatically launch all services as necessary on startup.~~
5159

5260
```bash
53-
./data/local/tmp/bin/pinitd-cli start bridge-service
61+
/data/local/tmp/bin/pinitd-cli start bridge-service
62+
sleep 5
63+
/data/local/tmp/bin/pinitd-cli start bridge-system-service
5464
```
5565

5666
6. At this point, everything should be operational and the custom app should be able to talk to the PenumbraOS SDK. To avoid the app starting issue, you can use the "Apply changes" button in Android Studio to update your app without relaunching.

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
adb shell mkdir /data/local/tmp/bin
1+
adb shell mkdir -p /sdcard/penumbra/etc/pinitd/system/
22
adb push config/pinitd/* /sdcard/penumbra/etc/pinitd/system/
33

44
./gradlew :bridge-core:installDebug

config/pinitd/bridge_service.unit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ Uid=1027
77
;If doing active debugging, use the follow script and uncomment the following line to manually run bridge:
88
;nc 127.0.0.1 1234
99
;/system/bin/app_process -cp $(pm path com.penumbraos.bridge | sed 's/^package://') /system/bin --application com.penumbraos.bridge.Entrypoint
10-
Exec=toybox nc -s 127.0.0.1 -p 1234 -L /system/bin/sh -l;
11-
;ExecJvmClass=com.penumbraos.bridge/com.penumbraos.bridge.Entrypoint
10+
;Exec=toybox nc -s 127.0.0.1 -p 1234 -L /system/bin/sh -l;
11+
ExecJvmClass=com.penumbraos.bridge/com.penumbraos.bridge.Entrypoint
1212
SeInfo=platform:nfc

0 commit comments

Comments
 (0)