symbiolink 0.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- symbiolink-0.4.2/.gitignore +31 -0
- symbiolink-0.4.2/LICENSE +21 -0
- symbiolink-0.4.2/PKG-INFO +434 -0
- symbiolink-0.4.2/README.md +407 -0
- symbiolink-0.4.2/docs/ARCHITECTURE.md +154 -0
- symbiolink-0.4.2/docs/CHECKLIST.md +110 -0
- symbiolink-0.4.2/docs/FEASIBILITY.md +162 -0
- symbiolink-0.4.2/docs/PROTOCOL.md +197 -0
- symbiolink-0.4.2/phone/devices/n79.py +62 -0
- symbiolink-0.4.2/pyproject.toml +75 -0
- symbiolink-0.4.2/src/symbiolink/__init__.py +6 -0
- symbiolink-0.4.2/src/symbiolink/cli.py +342 -0
- symbiolink-0.4.2/src/symbiolink/data/70-symbiolink.rules +11 -0
- symbiolink-0.4.2/src/symbiolink/data/SymbioLink.sis +0 -0
- symbiolink-0.4.2/src/symbiolink/device.py +193 -0
- symbiolink-0.4.2/src/symbiolink/mirror.py +493 -0
- symbiolink-0.4.2/src/symbiolink/proto.py +114 -0
- symbiolink-0.4.2/src/symbiolink/symcast.py +77 -0
- symbiolink-0.4.2/src/symbiolink/transport.py +283 -0
- symbiolink-0.4.2/tests/conftest.py +4 -0
- symbiolink-0.4.2/tests/fake_phone.py +406 -0
- symbiolink-0.4.2/tests/test_phone_server.py +309 -0
- symbiolink-0.4.2/tests/test_proto.py +337 -0
- symbiolink-0.4.2/tests/test_symcast.py +91 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# build output
|
|
2
|
+
build/
|
|
3
|
+
dist/
|
|
4
|
+
phone/native/out/
|
|
5
|
+
phone/native/_symbiolink/group/ABLD.BAT
|
|
6
|
+
phone/native/_symbiolink/group/*.uid.*
|
|
7
|
+
phone/native/_symbiolink/group/data/
|
|
8
|
+
phone/native/_symbiolink/group/gcce/
|
|
9
|
+
phone/native/symbiolink_usb/group/ABLD.BAT
|
|
10
|
+
phone/native/symbiolink_usb/group/*.uid.*
|
|
11
|
+
*.o
|
|
12
|
+
*.dso
|
|
13
|
+
*.sis
|
|
14
|
+
*.sisx
|
|
15
|
+
# the phone installer bundled in the Python package (scripts/build_sis.sh)
|
|
16
|
+
!src/symbiolink/data/SymbioLink.sis
|
|
17
|
+
|
|
18
|
+
# signing keys: never commit these
|
|
19
|
+
cert/
|
|
20
|
+
|
|
21
|
+
# python
|
|
22
|
+
__pycache__/
|
|
23
|
+
*.pyc
|
|
24
|
+
|
|
25
|
+
# editors / tools
|
|
26
|
+
.freebuff/
|
|
27
|
+
.idea/
|
|
28
|
+
.vscode/
|
|
29
|
+
|
|
30
|
+
# uv
|
|
31
|
+
.venv/
|
symbiolink-0.4.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Manoj Anasuri
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: symbiolink
|
|
3
|
+
Version: 0.4.2
|
|
4
|
+
Summary: adb + scrcpy for Symbian S60 3rd Edition phones: symdb CLI and symcast screen mirror over Wi-Fi or USB
|
|
5
|
+
Project-URL: Homepage, https://github.com/manojanasuri16/SymbioLink
|
|
6
|
+
Project-URL: Repository, https://github.com/manojanasuri16/SymbioLink
|
|
7
|
+
Project-URL: Issues, https://github.com/manojanasuri16/SymbioLink/issues
|
|
8
|
+
Author-email: Manoj Anasuri <manojanasuri16@gmail.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: adb,n79,n82,nokia,pys60,retro,s60,scrcpy,screen-mirror,symbian
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Environment :: X11 Applications :: Qt
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Topic :: Communications
|
|
22
|
+
Classifier: Topic :: System :: Hardware
|
|
23
|
+
Classifier: Topic :: Utilities
|
|
24
|
+
Requires-Python: >=3.9
|
|
25
|
+
Requires-Dist: pyqt5>=5.15
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# SymbioLink
|
|
29
|
+
|
|
30
|
+
*Symbian, from "symbiosis": the PC and the phone working together.*
|
|
31
|
+
|
|
32
|
+
**ADB and scrcpy for Symbian phones.** A Linux-first device bridge for Nokia
|
|
33
|
+
S60 / Symbian handsets: a device-side server, an `adb`-style command line tool
|
|
34
|
+
(`symdb`) and a screen mirroring and keypad client (`symcast`, PyQt5).
|
|
35
|
+
|
|
36
|
+
> **Needs a hacked phone for full functionality.** SymbioLink is built for
|
|
37
|
+
> phones with platform security relaxed (**Open4All** via RomPatcher+, or a
|
|
38
|
+
> developer certificate). The package asks for `SwEvent` (key control) and
|
|
39
|
+
> `CommDD` (USB cable), which a stock phone will not grant: an unhacked phone
|
|
40
|
+
> refuses to install it ("Access not granted" / "Certificate error").
|
|
41
|
+
> How to hack an S60v3 phone:
|
|
42
|
+
> [Unlock guide on RetroArchive](https://manojanasuri16.github.io/RetroArchive/guides/unlock-n79/)
|
|
43
|
+
> and [symbian-unlock-guide](https://github.com/manojanasuri16/symbian-unlock-guide).
|
|
44
|
+
> If the phone is hacked but Open4All is off when you install, you get the
|
|
45
|
+
> same refusal: switch it on in RomPatcher+ and install again.
|
|
46
|
+
|
|
47
|
+
Built for S60 3rd Edition phones (Symbian OS 9.1-9.3). Capabilities are
|
|
48
|
+
reported by the device, hardware details live in device profiles, and API
|
|
49
|
+
differences live in platform adapters, so nothing is tied to one model.
|
|
50
|
+
|
|
51
|
+
*Tested on: Nokia N79 (FP2) and Nokia N82 (FP1).*
|
|
52
|
+
|
|
53
|
+
> **Status: 0.4.2 (Wi-Fi and USB cable verified on real phones).** On
|
|
54
|
+
> firmware 10.045 (RM-348), 2026-11-29, the server, the PC client and the
|
|
55
|
+
> `symcast` viewer were run against the phone over both transports: connect,
|
|
56
|
+
> device info, file transfer, live mirror and keypad input. The limits that
|
|
57
|
+
> remain (about 10 fps, no process or app list, no silent install, one client at
|
|
58
|
+
> a time, no authentication) are listed below and in
|
|
59
|
+
> [docs/CHECKLIST.md](docs/CHECKLIST.md). Nothing in this repository claims a
|
|
60
|
+
> phone result that was not observed.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Why
|
|
65
|
+
|
|
66
|
+
Android has `adb` and `scrcpy`. Symbian has nothing equivalent: file transfer
|
|
67
|
+
tools, remote-control tools and screenshot utilities existed, but they are
|
|
68
|
+
closed, dead or tied to one model. SymbioLink aims at the same workflow:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
symdb devices
|
|
72
|
+
symdb connect 192.168.1.20
|
|
73
|
+
symdb shell info
|
|
74
|
+
symdb push photo.jpg C:\Data\
|
|
75
|
+
symdb pull C:\Data\notes.txt .
|
|
76
|
+
symdb screencap screen.jpg
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
and `symcast` for live mirroring and keypad control.
|
|
80
|
+
|
|
81
|
+
## What works today
|
|
82
|
+
|
|
83
|
+
| Area | State | Notes |
|
|
84
|
+
|---|---|---|
|
|
85
|
+
| SL/1 protocol (PC + phone + tests) | **working** | 37 offline tests pass (14 PC-side, 23 phone-side) |
|
|
86
|
+
| Device server (PyS60 1.4.5), 0.4.2 | **working** | Wi-Fi and USB; one client at a time |
|
|
87
|
+
| `_symbiolink.pyd` (native screen capture, HAL facts, capability list, key injection), UID `0xE7A3D5F7` | **working** | keys and stream verified on the phone |
|
|
88
|
+
| `symbiolink_usb.exe` USB relay (phone side), UID `0xE7A3D5F8` | **working** | CDC-ACM port to the server, PC Suite mode |
|
|
89
|
+
| USB transport (PC side, `--usb`) | **working** | needs the udev rule; ~0.65 s to auto-detect |
|
|
90
|
+
| Wi-Fi TCP transport | **working** | 47020/TCP; the pattern RetroSend uses on this phone |
|
|
91
|
+
| Connect, hello, caps, info, battery | **working** | over Wi-Fi and USB |
|
|
92
|
+
| File push, pull, ls, mkdir, rm | **working** | 100 KB round trip byte-identical; a SIS pushed over the bridge installed |
|
|
93
|
+
| Live screen stream (`screen.stream`) and `symcast` mirror | **working** | ~8.8 fps over USB, ~7.4 fps over Wi-Fi at quality 50 (cap about 10 fps) |
|
|
94
|
+
| Key and text input (`input.key`, `input.text`) | **working** | keyboard and clickable keypad in `symcast`; needs Open4All (see Requirements) |
|
|
95
|
+
| `symcast` screenshot (Ctrl+S), help overlay, reconnect (Ctrl+R) | **working** | |
|
|
96
|
+
| UDP discovery | **implemented** | phone broadcasts, PC reads the source address |
|
|
97
|
+
| `symcast --record` (MJPEG AVI via ffmpeg) | **implemented, not yet run on a phone** | |
|
|
98
|
+
| Touch injection | **blocked** | needs a touchscreen device (S60 5th Edition / Symbian^3) |
|
|
99
|
+
| App list, process list, SIS install from the bridge | **blocked** | needs native helpers (`RApaLsSession`, `TFindProcess`); the install UI is the only route |
|
|
100
|
+
|
|
101
|
+
## Requirements
|
|
102
|
+
|
|
103
|
+
**Phone**
|
|
104
|
+
|
|
105
|
+
- An S60 3rd Edition phone (FP1 or FP2; see *Tested on* above) for the reference path
|
|
106
|
+
(FP1 and 5th Edition need their own platform adapter - see
|
|
107
|
+
[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md#platforms)). Verified on firmware
|
|
108
|
+
10.045 (RM-348).
|
|
109
|
+
- **Python for S60 1.4.5** installed (`PythonForS60_1_4_5_3rdEd.sis` plus
|
|
110
|
+
`PythonScriptShell_1_4_5_3rdEd.SIS`).
|
|
111
|
+
- Wi-Fi, for the Wi-Fi transport. The phone picks the access point when the
|
|
112
|
+
server binds its socket. The USB transport does not need Wi-Fi.
|
|
113
|
+
- For USB: the phone's connection mode set to **PC Suite**.
|
|
114
|
+
- The SymbioLink `.sis` installed **on the same drive as Python for S60**
|
|
115
|
+
(usually the memory card). A cross-drive install needs the `rscfix` helper,
|
|
116
|
+
which is not built yet.
|
|
117
|
+
- **A hacked phone: Open4All (or a developer certificate) active when you
|
|
118
|
+
install.** The package asks for `SwEvent` (key input) and `CommDD` (USB
|
|
119
|
+
relay), system capabilities a stock phone refuses, so on an unhacked phone
|
|
120
|
+
the whole install is refused. See the box at the top for the unlock guide.
|
|
121
|
+
|
|
122
|
+
| Works on | Hacked S60v3 phone (Open4All) | Stock phone |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| Install SymbioLink | yes | no (installer refuses) |
|
|
125
|
+
| Wi-Fi: mirror, screenshots, files, info | yes | - |
|
|
126
|
+
| Key and text input | yes | - |
|
|
127
|
+
| USB cable | yes | - |
|
|
128
|
+
|
|
129
|
+
**PC**
|
|
130
|
+
|
|
131
|
+
- Linux with Python 3.9+. `pipx install symbiolink` brings PyQt5 (for
|
|
132
|
+
`symcast`) along; `symdb` itself uses only the standard library.
|
|
133
|
+
- For USB: the udev rule installed (`symdb setup-udev --install`, see First run).
|
|
134
|
+
Without it the phone's second serial port does not appear and `--usb` finds
|
|
135
|
+
nothing.
|
|
136
|
+
- Only to rebuild the phone package yourself: the Symbian toolchain
|
|
137
|
+
[symbian-s60v3-toolchain](https://github.com/manojanasuri16/symbian-s60v3-toolchain)
|
|
138
|
+
(GnuPoc + CodeSourcery GCCE 3.4.3 + S60 3.2 SDK) and Python 2.7 for ensymble.
|
|
139
|
+
The PC package already ships a built `SymbioLink.sis`.
|
|
140
|
+
|
|
141
|
+
## Installation
|
|
142
|
+
|
|
143
|
+
### As a global CLI (recommended)
|
|
144
|
+
|
|
145
|
+
```sh
|
|
146
|
+
pipx install symbiolink
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
This puts `symdb` and `symcast` on your PATH, in their own environment. With uv
|
|
150
|
+
instead:
|
|
151
|
+
|
|
152
|
+
```sh
|
|
153
|
+
uv tool install symbiolink
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
The package also carries the phone installer (`SymbioLink.sis`) and the Linux
|
|
157
|
+
udev rule, so nothing else has to be downloaded.
|
|
158
|
+
|
|
159
|
+
<details>
|
|
160
|
+
<summary>Install straight from GitHub with pipx</summary>
|
|
161
|
+
|
|
162
|
+
```sh
|
|
163
|
+
pipx install git+https://github.com/manojanasuri16/SymbioLink.git
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Useful for the latest `master` without waiting for a PyPI release.
|
|
167
|
+
</details>
|
|
168
|
+
|
|
169
|
+
<details>
|
|
170
|
+
<summary>Run from a clone (for development)</summary>
|
|
171
|
+
|
|
172
|
+
```sh
|
|
173
|
+
git clone https://github.com/manojanasuri16/SymbioLink.git
|
|
174
|
+
cd SymbioLink
|
|
175
|
+
uv sync
|
|
176
|
+
uv run symdb --version
|
|
177
|
+
uv run symcast --fake
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Pip alternative: `pip install -e .` inside a virtual environment.
|
|
181
|
+
</details>
|
|
182
|
+
|
|
183
|
+
## First run
|
|
184
|
+
|
|
185
|
+
1. **Hack the phone** (Open4All on), see the box at the top. Without it the
|
|
186
|
+
installer refuses SymbioLink.
|
|
187
|
+
2. **Install Python for S60 1.4.5** on the phone (the interpreter and the
|
|
188
|
+
script shell SIS for S60 3rd Edition), as every PyS60 app needs.
|
|
189
|
+
3. **Get SymbioLink onto the phone.** The first install has to go by memory
|
|
190
|
+
card or Bluetooth, because `symdb` can only talk to the phone once the app
|
|
191
|
+
runs:
|
|
192
|
+
```sh
|
|
193
|
+
symdb sis-path # prints where the bundled SymbioLink.sis is
|
|
194
|
+
```
|
|
195
|
+
Copy that file to the memory card (USB mass storage mode or a card reader)
|
|
196
|
+
or send it over Bluetooth, then open it in **Files** on the phone. Later
|
|
197
|
+
updates can go over the bridge itself:
|
|
198
|
+
```sh
|
|
199
|
+
symdb install-app # pushes it to C:\Data\SymbioLink.sis
|
|
200
|
+
```
|
|
201
|
+
then open **Files > Phone memory > SymbioLink.sis** on the phone. If an
|
|
202
|
+
older SymbioLink is refused or does not start cleanly, uninstall it first
|
|
203
|
+
(0.2.0 moved the `_symbiolink.pyd` UID to `0xE7A3D5F7`; the app UID is still
|
|
204
|
+
`0xE7A3D601`, `symbiolink_usb.exe` is `0xE7A3D5F8`). The package is self-signed,
|
|
205
|
+
valid 2008-2037, so it also installs when the phone clock is wrong.
|
|
206
|
+
4. **For the USB cable (Linux, once):**
|
|
207
|
+
```sh
|
|
208
|
+
symdb setup-udev # shows the rule and the sudo commands
|
|
209
|
+
symdb setup-udev --install # runs them (asks first; -y to skip)
|
|
210
|
+
```
|
|
211
|
+
5. **Open SymbioLink on the phone** and leave it running (it shows the port,
|
|
212
|
+
the client state and the last command; `Select` toggles the UDP
|
|
213
|
+
announcement, `Back` exits; the USB relay `symbiolink_usb.exe` starts with the app,
|
|
214
|
+
**Start USB relay** in the menu restarts it). Then mirror it:
|
|
215
|
+
```sh
|
|
216
|
+
symcast --usb # phone in PC Suite mode, over the cable
|
|
217
|
+
symcast 192.168.1.20 # or over Wi-Fi
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Usage
|
|
221
|
+
|
|
222
|
+
Over Wi-Fi:
|
|
223
|
+
|
|
224
|
+
```sh
|
|
225
|
+
symdb devices --discover # phones broadcasting on the LAN
|
|
226
|
+
symdb connect 192.168.1.20 # remembered in ~/.config/symbiolink
|
|
227
|
+
symdb caps # what this phone can and cannot do
|
|
228
|
+
symdb shell info
|
|
229
|
+
symdb shell battery
|
|
230
|
+
symdb shell ls 'C:\Data'
|
|
231
|
+
symdb push photo.jpg 'C:\Data\'
|
|
232
|
+
symdb pull 'C:\Data\file.txt' .
|
|
233
|
+
symdb screencap screen.jpg
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Over the USB cable (phone in PC Suite mode, relay started):
|
|
237
|
+
|
|
238
|
+
```sh
|
|
239
|
+
symdb connect --usb # auto-detects /dev/ttyACM1 (remembered)
|
|
240
|
+
symdb shell info # same commands once connected
|
|
241
|
+
symdb -s usb:/dev/ttyACM1 caps # or name the port explicitly
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Setup helpers: `symdb sis-path`, `symdb install-app [--to PATH]`,
|
|
245
|
+
`symdb setup-udev [--install] [-y]`, `symdb --version`.
|
|
246
|
+
|
|
247
|
+
Live mirror and keypad (PyQt5):
|
|
248
|
+
|
|
249
|
+
```sh
|
|
250
|
+
symcast 192.168.1.20 # or --discover; --scale 2 --quality 50
|
|
251
|
+
symcast --usb # the cable instead of Wi-Fi
|
|
252
|
+
symcast 192.168.1.20 --record session.avi # MJPEG AVI via ffmpeg
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Keys: arrows = d-pad (held), Enter/Space = select, F1 = left softkey, F2 or Esc =
|
|
256
|
+
right softkey, F3 = call (opens dialled numbers), F4 = end (clears the dialer,
|
|
257
|
+
closes apps; if the bridge itself is in front it opens Menu first, so the bridge
|
|
258
|
+
is not closed), F5 = menu, Backspace/Delete/C = clear, 0-9 * # direct,
|
|
259
|
+
Ctrl+T = send text, Ctrl+S = screenshot to ~/Pictures, Ctrl+R = reconnect,
|
|
260
|
+
H or ? = help overlay. The keypad on screen is clickable.
|
|
261
|
+
|
|
262
|
+
`-s host[:port]` selects a device explicitly, `-s usb` or `--usb` the cable;
|
|
263
|
+
`SYMDB_DEVICE` does the same from the environment. Ports: **47020/TCP** (server,
|
|
264
|
+
also the local end of the USB relay), **47021/UDP** (announcements).
|
|
265
|
+
|
|
266
|
+
### The USB rule
|
|
267
|
+
|
|
268
|
+
`symdb setup-udev --install` copies the bundled `70-symbiolink.rules` to
|
|
269
|
+
`/etc/udev/rules.d/` and reloads udev. The rule does two things. The phone's
|
|
270
|
+
second CDC-ACM port (the one `symbiolink_usb.exe` uses) declares a vendor protocol, so
|
|
271
|
+
Linux `cdc_acm` skips it; the rule adds the Nokia id so it appears as an extra
|
|
272
|
+
`/dev/ttyACMn`, normally `ttyACM1`. The logged-in user also gets access
|
|
273
|
+
(`uaccess`), so no `sudo` or `uucp` group is needed. The phone's own modem port
|
|
274
|
+
(`ttyACM0`) is held by the phone and reports `KErrAccessDenied`; it is not used.
|
|
275
|
+
|
|
276
|
+
### Try it without a phone (from a clone)
|
|
277
|
+
|
|
278
|
+
The fake phone implements the server side over a local directory, so the CLI and
|
|
279
|
+
the protocol can be exercised anywhere:
|
|
280
|
+
|
|
281
|
+
```sh
|
|
282
|
+
uv run python tests/fake_phone.py --root /tmp/phone --announce &
|
|
283
|
+
uv run symdb -s 127.0.0.1:47020 shell info
|
|
284
|
+
uv run symdb -s 127.0.0.1:47020 screencap /tmp/fake.jpg
|
|
285
|
+
uv run symcast --fake
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Building the phone package
|
|
289
|
+
|
|
290
|
+
The `SymbioLink.sis` bundled in the Python package is a build artifact of the
|
|
291
|
+
phone side. Rebuild it from a clone with:
|
|
292
|
+
|
|
293
|
+
```sh
|
|
294
|
+
sh scripts/build_native.sh # -> phone/native/out/_symbiolink.pyd, symbiolink_usb.exe
|
|
295
|
+
sh scripts/build_sis.sh # -> src/symbiolink/data/SymbioLink.sis
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
`build_native.sh` expects the toolchain next to this repository; point it
|
|
299
|
+
elsewhere with `SYMBIAN_SDK=/path/to/symbian-s60v3-toolchain`.
|
|
300
|
+
`build_sis.sh` looks for Python 2 and ensymble in the neighbouring RetroSend
|
|
301
|
+
checkout; override with `PY2=... ENSYMBLE=...`. The package carries
|
|
302
|
+
`_symbiolink.pyd` and `symbiolink_usb.exe`. Commit the rebuilt
|
|
303
|
+
`src/symbiolink/data/SymbioLink.sis` (it is excepted from the `*.sis` ignore
|
|
304
|
+
rule); `dist/` is only for `uv build` output.
|
|
305
|
+
|
|
306
|
+
## Tests
|
|
307
|
+
|
|
308
|
+
```sh
|
|
309
|
+
uv run pytest # framing, client, CLI, viewer (PC side)
|
|
310
|
+
python2 tests/test_phone_server.py # device modules on Python 2.7
|
|
311
|
+
sh scripts/check_py22.sh # rejects syntax newer than Python 2.2
|
|
312
|
+
sh scripts/build_native.sh # native module compiles (arm-none-symbianelf-gcc)
|
|
313
|
+
sh scripts/build_sis.sh # package builds
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
`tests/test_proto.py` and `tests/test_symcast.py` also run on their own with
|
|
317
|
+
`python3` (the viewer test needs PyQt5 and uses `QT_QPA_PLATFORM=offscreen`).
|
|
318
|
+
CI runs the pytest suite; the Python 2.7 phone test runs locally only, as
|
|
319
|
+
GitHub's setup-python no longer provides 2.7.
|
|
320
|
+
|
|
321
|
+
The phone-side checks above run offline. The hardware results in this README were
|
|
322
|
+
observed by hand on the phone, not by these tests.
|
|
323
|
+
|
|
324
|
+
## How it fits together
|
|
325
|
+
|
|
326
|
+
```
|
|
327
|
+
PC (Python 3) Phone (PyS60 1.4.5 + native helpers)
|
|
328
|
+
┌──────────────┐ TCP 47020 / SL/1 ┌────────────────────────────────┐
|
|
329
|
+
│ symdb │ ───────────────────► │ linkserver.py (app + sockets) │
|
|
330
|
+
│ symcast │ ◄─────────────────── │ handlers.py (commands) │
|
|
331
|
+
│ (PyQt5) │ UDP 47021 announce │ s60v3.py (platform) │
|
|
332
|
+
└──────────────┘ │ n79.py (hardware profile)│
|
|
333
|
+
▲ │ _symbiolink.pyd (WS/HAL, native) │
|
|
334
|
+
│ USB CDC-ACM (SL/1 bytes) └──────────────▲─────────────────┘
|
|
335
|
+
└────────────── cable ─────────── symbiolink_usb.exe ───┘ relays ACM::1 <-> 127.0.0.1:47020
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
- **Capability-driven.** Every command the phone cannot do comes back as a
|
|
339
|
+
refusal with a reason, never as a silent failure. `symdb caps` prints the
|
|
340
|
+
whole table.
|
|
341
|
+
- **Transport-independent protocol.** The same SL/1 byte stream runs over Wi-Fi
|
|
342
|
+
TCP and over the USB cable (through the phone-side `symbiolink_usb.exe` relay). Nothing
|
|
343
|
+
above the transport layer knows which one is in use.
|
|
344
|
+
- **Native where Python cannot reach.** PyS60 can screenshot and move files but
|
|
345
|
+
cannot inject keys, list apps or report capabilities. Those go into native
|
|
346
|
+
modules, behind the same protocol.
|
|
347
|
+
|
|
348
|
+
Detail: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md),
|
|
349
|
+
[docs/FEASIBILITY.md](docs/FEASIBILITY.md),
|
|
350
|
+
[protocol/slproto.md](protocol/slproto.md),
|
|
351
|
+
[docs/PROTOCOL.md](docs/PROTOCOL.md) (command meanings).
|
|
352
|
+
|
|
353
|
+
## Verified on hardware (0.3.5)
|
|
354
|
+
|
|
355
|
+
Nokia N79, firmware 10.045 (RM-348), 2026-11-29, server 0.3.5. Full evidence per
|
|
356
|
+
item is in [docs/CHECKLIST.md](docs/CHECKLIST.md).
|
|
357
|
+
|
|
358
|
+
- Connect, hello, caps, info and battery over Wi-Fi (TCP 47020) and over USB.
|
|
359
|
+
- Stream: q50 at 8.8 fps over USB and 7.4 fps over Wi-Fi (q30: 9.0 and 8.9),
|
|
360
|
+
frames of about 14-18 KB. The limit is the phone's JPEG encode, about 80 ms per
|
|
361
|
+
frame.
|
|
362
|
+
- Transfer: push about 132 KB/s over USB and 124 KB/s over Wi-Fi; pull about
|
|
363
|
+
257 KB/s and 222 KB/s. Request round trip median 54 ms over USB, 56 ms over
|
|
364
|
+
Wi-Fi.
|
|
365
|
+
- Keys seen on the screen: d-pad, select, both softkeys, call, end, menu, 0-9,
|
|
366
|
+
star, hash, clear, `input.text`. The keypad autolock blocks injected keys until
|
|
367
|
+
the phone is unlocked (LSK then `*`).
|
|
368
|
+
- Switching between USB and Wi-Fi works: a new client replaces a stale one.
|
|
369
|
+
|
|
370
|
+
## Roadmap
|
|
371
|
+
|
|
372
|
+
| Phase | Content | State |
|
|
373
|
+
|---|---|---|
|
|
374
|
+
| 1 | Protocol, `symdb`, device server, native helper, packaging | done; verified on hardware (Wi-Fi and USB) |
|
|
375
|
+
| 2 | Live screen mirroring, `symcast` viewer, frame rate/latency measurement | done; measured on hardware (about 8-9 fps) |
|
|
376
|
+
| 3 | Remote control: key injection (`SwEvent`), key maps, touch profiles | keys done; touch blocked |
|
|
377
|
+
| 4 | App list/launch/stop, processes, logs, SIS install | blocked on native helpers |
|
|
378
|
+
| 5 | Polished `symdb` + `symcast`, reconnection | partly: Ctrl+R reconnect; the rest planned |
|
|
379
|
+
| 6 | Other Symbian devices and OS generations | planned |
|
|
380
|
+
|
|
381
|
+
## Limitations (read before filing a bug)
|
|
382
|
+
|
|
383
|
+
- **PyS60 1.4.5 only.** One Python runtime per S60 3rd Edition generation; S60
|
|
384
|
+
5th Edition and Symbian^3 ship PyS60 2.x with a different socket API.
|
|
385
|
+
- **Frame rate is capped at about 10 fps** by the phone's JPEG encode.
|
|
386
|
+
- **One client at a time**, and the phone cannot tell who connected (PyS60 has
|
|
387
|
+
no `getpeername`), hence the UDP announcement direction.
|
|
388
|
+
- **Keypad autolock** blocks injected keys until the phone is unlocked.
|
|
389
|
+
- **No process or app list** yet; silent `symdb install` does not exist (`symdb install-app` only pushes the SIS). A SIS pushed
|
|
390
|
+
over the bridge still has to be installed from the phone's own UI, which is
|
|
391
|
+
not silent.
|
|
392
|
+
- **Key injection needs `SwEvent`**, a system capability: a stock phone refuses
|
|
393
|
+
a self-signed package that declares it. Use an Open4All phone or a developer
|
|
394
|
+
certificate.
|
|
395
|
+
- **No TLS, no authentication.** The server accepts any connection on the local
|
|
396
|
+
network or the cable. Use it on networks you trust, or keep Wi-Fi off when not
|
|
397
|
+
needed.
|
|
398
|
+
|
|
399
|
+
## Related projects
|
|
400
|
+
|
|
401
|
+
- [symbian-s60v3-toolchain](https://github.com/manojanasuri16/symbian-s60v3-toolchain) - the toolchain used to build this.
|
|
402
|
+
- [RetroSend](https://github.com/manojanasuri16/RetroSend),
|
|
403
|
+
[RetroTele](https://github.com/manojanasuri16/RetroTele) - sibling S60 apps whose
|
|
404
|
+
socket, packaging and native-helper patterns this project reuses.
|
|
405
|
+
- RetroCamKey - the key-injection pattern (`SimulateRawEvent`) this project follows.
|
|
406
|
+
- [localsend-py22](https://github.com/manojanasuri16/localsend-py22) - the
|
|
407
|
+
PyS60 network notes that shaped the server.
|
|
408
|
+
|
|
409
|
+
## Publishing
|
|
410
|
+
|
|
411
|
+
Releases go to PyPI and GitHub Releases from `.github/workflows/release.yml`
|
|
412
|
+
when a `v*` tag is pushed.
|
|
413
|
+
|
|
414
|
+
One-time setup on PyPI (trusted publisher, no API token): at
|
|
415
|
+
<https://pypi.org/manage/account/publishing/> add a pending publisher with
|
|
416
|
+
PyPI project `symbiolink`, owner `manojanasuri16`, repository `SymbioLink`,
|
|
417
|
+
workflow `release.yml`, environment `pypi`. Create the `pypi` environment in the
|
|
418
|
+
GitHub repository settings (Environments) as well.
|
|
419
|
+
|
|
420
|
+
Then, for each release:
|
|
421
|
+
|
|
422
|
+
1. Bump `__version__` in `src/symbiolink/__init__.py` (the package version is
|
|
423
|
+
read from it).
|
|
424
|
+
2. Rebuild the phone package if the phone side changed
|
|
425
|
+
(`sh scripts/build_sis.sh`) and commit it.
|
|
426
|
+
3. `git tag vX.Y.Z && git push origin vX.Y.Z`.
|
|
427
|
+
|
|
428
|
+
The workflow builds the sdist and wheel with `uv build`, creates the GitHub
|
|
429
|
+
Release with them plus `SymbioLink.sis`, and publishes to PyPI.
|
|
430
|
+
|
|
431
|
+
## Licence
|
|
432
|
+
|
|
433
|
+
MIT, see [LICENSE](LICENSE). Python for S60, the S60 SDK and the Symbian
|
|
434
|
+
toolchain keep their own licences; none of them are redistributed here.
|