SFOS 5.2.0.22 for OnePlus 5T

:heart_decoration: Disclaimer (please read)

  • This whole project — the port, the fixes, the scripts and the documentation — was produced by an AI (DeepSeek). It was tested on one device only. If that matters to you, please review the code/config yourself before using it, or simply don’t use it.

  • It is not an official Jolla product and is not supported by Jolla.

  • Flashing custom firmware can brick your device and void your warranty. You are responsible for your own device.

  • The flashable image embeds a Sailfish OS root filesystem, which is Jolla’s proprietary software and is not covered by the MIT license of the packaging scripts.

Full instructions, checksums, build steps and a detailed bring-up log are in the repository:


What does NOT work

  • VoLTE — and therefore calls and SMS on LTE-only networks. The modem and its IMS daemons run, and the port provisions an ims APN, but ofono 1.29 has no IMS client and the Android 9 vendor has no IMS HAL for one to drive, so IMS cannot be brought up. Calls fail after ~30 s where there is no 2G/3G to fall back to (e.g. China Unicom LTE-only areas). Fixing this would require rebasing the port on an Android 11+ vendor.

  • 4K recording (capped at 1080p on purpose — the encoder only produces ~11.6 Mbps H.264 Baseline at 4K, which looks bad on moving scenes)

  • USB idVendor reports 0000 (cosmetic on Linux, may confuse Windows driver matching)

  • iproute2 is not installed in the rootfs (ip command missing)

  • Fingerprint, GPS(probably working)


What was changed / added compared to a plain HADK build

Device fixes:

  1. Video recording — the stock LineageOS libstagefright.so lacks the hybris fix for 64/32-bit buffer marshalling between the 64-bit camera process and the 32-bit OMX encoder (ACodec.cpp, VideoNativeMetadata_ptrSized). Without it every recorded frame is dropped and the camera deadlocks when stopping the recording. The installer writes patched libstagefright.so (and a libcameraservice.so with the shutter sound disabled) into /system/lib64.

  2. Camera preview and video playback — gst-droid rebuilt with the hybris shim: /usr/share/droidmedia/hybris.c is compiled into both the plugin and the base library, so the plugin has no bionic dependencies and dlopen()s the Android media stack at runtime. A plain -ldroidmedia link fails inside the camera process, and the camerabin then falls back to fake-auto-video-src (the colour-bar preview).

  3. USB developer mode — persistent mode instead of the default “ask on connect” one, which re-enumerated the gadget on screen lock and broke RNDIS/SSH.

  4. Networking — static /etc/resolv.conf (systemd-resolved’s stub does not work on this kernel) and an IPv4-preferring /etc/gai.conf.

  5. Browser — gfx.webrender.compositor=false; otherwise Gecko WebRender shows a black page on this libhybris stack.

Extra app:

  • CPU Mode — a small native Sailfish app for the Snapdragon 835’s asymmetric CPU (4 × A53 + 4 × A73): Powersave / Balanced / Performance profiles, a live 60-sample frequency chart, and boot-time persistence via cpu-mode.service. Source is in the repository under cpu-mode/.

Installation (short version)

  1. TWRP: Wipe → Format Data (LineageOS 16 encrypts /data with FBE, which Sailfish OS cannot read — do not skip this).

  2. Flash LineageOS 16.0 for dumpling, and do not boot it.

  3. Flash the Sailfish OS image from the Releases page.

  4. Reboot to system.

Tip: if the modem shows “searching” and finds no operator after flashing, boot LineageOS once (all the way into Android) and then flash the Sailfish OS image again. The Android first boot initialises the modem’s NV/EFS and QMI state properly; after that registration works.


Credits

Thanks to the Sailfish OS HADK, the mer-hybris projects (libhybris, droidmedia, gst-droid, hybris-boot), the original sailfishos-oneplus5 port(sailfishos-oneplus5), LineageOS, TWRP and the wider Sailfish community.

The packaging scripts and documentation are MIT-licensed. Third-party components keep their own licenses (droidmedia Apache-2.0, gst-droid and GStreamer LGPL-2.1+, libhybris LGPL-2.1). “Sailfish OS” is a trademark of Jolla Ltd.; “OnePlus” and “LineageOS” are trademarks of their respective owners.

Feedback, patches and corrections are welcome — especially from anyone who knows how to get IMS working on an Android 9 base.

2 Likes