Skip to content
[Sabas] reverse-engineered the product

[Sabas] reverse-engineered the product

github.com • November 20, 2026

Reverse-engineering a $10 JieLi AC707N / BR35 e-badge (E87 & DG01) — round 360×360 RGB565 display, AXS5106L capacitive touch, 2 ADKEY buttons, 4 MB NOR flash, BLE — and flashing 100 % custom firmware onto a sealed OEM badge over BLE : no USB, no opening the case, no loader.

⚠️ Security research / educational use only. Read DISCLAIMER.md before using anything here, and use it only on hardware you own . Disclosure posture is in SECURITY.md .

⚠️ Security research / educational use only. Read DISCLAIMER.md before using anything here, and use it only on hardware you own . Disclosure posture is in SECURITY.md .

Talk in youtube Compré un e-badge de 10 dólares y terminé liberando su SDK – Andrés Sabas

A cheap consumer "e-badge" / otaku name badge built on JieLi's AC707N (BR35 family) BT/BLE SoC. Confirm you have the right unit before flashing anything:

A different PID needs a different chipkey and isd_config.ini ; do not reuse 0x9847 on one.

The OEM badge exposes exactly one foothold: an app-only BLE OTA (the path the ZRun app uses). This turns that into full control, entirely over BLE:

The custom firmware is packaged fw-custom — your app.bin spliced into an OEM .ufw , which keeps the OEM uboot byte-identical. A single qix flash --oem hands it to the resident OEM uboot, which rewrites the CODE partition and boots the custom. No cable, no loader. A raw SDK make image carries the native uboot instead, which cannot do that rewrite — flash one and the badge bricks silently at apply.

The custom → OEM restore (back to the stock firmware) goes the other way: a byte-exact dump of your unit is repacked with tools/ufw-repack/dump2ufw.py into a vanilla RCSP .ufw and flashed with qix rcsp-flash . Take the dump before the first custom flash ( docs/dump-firmware.md ).

The badge's MAC is constant (it lives in the preserved key_mac ); only the advertised name changes — the custom firmware advertises as EC-BADGE . All tooling addresses the badge by MAC , never by name.

Validation status: OEM → custom and custom → custom have been run end-to-end on real hardware. The prebuilt image in firmware/ is the one that was flashed. The custom → OEM leg reuses the same plumbing in reverse and needs only a dump of your stock image; the toolchain is described in docs/ota-howto.md .

To flash (BLE, no cable):

The badge, charged to ≥ 30 % or on USB for the whole flash window.

Python 3.10+ and pip install -e tools/qix-ble .

A BLE adapter. The client is built on bleak , so the transport runs on Linux (BlueZ), macOS (CoreBluetooth) and Windows (WinRT) — every BlueZ/DBus helper inside it is gated behind sys.platform == "linux" and is a no-op elsewhere. Linux is what has been validated on hardware , and the recipes in ota-howto.md are the Linux ones; their rfkill / hciconfig / qix cleanup / QIX_CONNECT_VIA_DBUS=1 steps are BlueZ workarounds that macOS and Windows neither need nor have.

To build from source: Linux x86-64 only — the JieLi toolchain and post-build tools are Linux ELF binaries. Also ~3 GB free disk and ulimit -n ≥ 65536. Full list in docs/build-badge-firmware.md .

⚠️ A failed OTA can require USB-ISP recovery. Every one of these will make a flash fail, and some fail silently :

Battery ≥ 30 %, or USB connected for the whole window. A brown-out while the code region is being rewritten bricks the unit.

Turn the phone's Bluetooth fully off. The badge accepts one connection; closing the ZRun app is not enough.

Do not run qix dump --auth since the last power-cycle. It sets a TEST_MODE flag that makes the badge silently reject REQ_UPDATE . Power-cycle to clear it.

Never flash a raw SDK make image as the OTA payload — native uboot, silent brick.

The ~1 MB transfer takes several minutes. Do not interrupt it.

Take a dump of your own unit first. Recovery means writing a byte-exact dump of your badge back over USB-ISP, and the custom → OEM restore needs your stock image too — no OEM firmware is distributed here. How to dump and write it back in docs/dump-firmware.md — wired / UBOOT, the only non-BLE step (the DIY dongle for it, tools/pi-pico-jl-dongle , is still a prototype).

Flash the prebuilt firmware over BLE (OEM→custom and custom→custom) — read Before you flash first: pip install -e tools/qix-ble # installs the `qix` client qix scan # find your badge's MAC qix flash firmware/custom-fw-ac707n.ufw --oem On a Linux/BlueZ host the bare command above tends to hang; the validated recipe adds an adapter reset plus a deterministic DBus connect. Full reference: docs/ota-howto.md . (The legacy qix provision / deploy-fw STAGER chain is no longer used — see the doc.)

Flash the prebuilt firmware over BLE (OEM→custom and custom→custom) — read Before you flash first:

On a Linux/BlueZ host the bare command above tends to hang; the validated recipe adds an adapter reset plus a deterministic DBus connect. Full reference: docs/ota-howto.md . (The legacy qix provision / deploy-fw STAGER chain is no longer used — see the doc.)

Go back to OEM (custom→OEM) — dump → repack → rcsp-flash , all documented in docs/ota-howto.md and docs/dump-firmware.md : python3 jluboottool.py " read 0x0 0x400000 oem-dump.bin " # wired, tools/jl-uboot-tool/ python3 tools/ufw-repack/dump2ufw.py oem-dump.bin oem.ufw qix rcsp-flash oem.ufw You must dump before the first custom flash — a restored image is built from your stock dump, not redistributed here.

Go back to OEM (custom→OEM) — dump → repack → rcsp-flash , all documented in docs/ota-howto.md and docs/dump-firmware.md :

You must dump before the first custom flash — a restored image is built from your stock dump, not redistributed here.

Build the firmware from source — two commands: scripts/setup-badge-build.sh # once: toolchain + SDK + patch + post-build tools + chipkey scripts/build-badge-fw.sh --ota # each build: app.bin + a flashable BLE-OTA .ufw scripts/build-badge-fw.sh --board dg01 --ota # …for the DG01 wristband instead --board picks the target hardware: e87 (default, the DragonJAR badge — ST77916 panel, AXS5106L touch, 2 buttons) or dg01 (the wristband — badge2_360 panel, CST816D touch, 1 button), and packages the image for that unit's OTA protocol. The two are not interchangeable; see Two boards . The custom firmware lives as a patch ( patches/badge/badge- .patch ) on top of the vanilla JieLi SDK, which is the git submodule at tools/community-re/jieli-sdks/e_badge_707_sdk_200 (pinned at the vanilla main commit and clonable anonymously from JieLi's GitLab — never redistributed from here). Full guide, provenance of every downloaded piece, and a troubleshooting table: docs/build-badge-firmware.md . (The scripts/build-jieli-ac707n*.sh helpers + patches/m1/ set remain for the vanilla/M1 variants.)

Build the firmware from source — two commands:

--board picks the target hardware: e87 (default, the DragonJAR badge — ST77916 panel, AXS5106L touch, 2 buttons) or dg01 (the wristband — badge2_360 panel, CST816D touch, 1 button), and packages the image for that unit's OTA protocol. The two are not interchangeable; see Two boards . The custom firmware lives as a patch ( patches/badge/badge- .patch ) on top of the vanilla JieLi SDK, which is the git submodule at tools/community-re/jieli-sdks/e_badge_707_sdk_200 (pinned at the vanilla main commit and clonable anonymously from JieLi's GitLab — never redistributed from here). Full guide, provenance of every downloaded piece, and a troubleshooting table: docs/build-badge-firmware.md . (The scripts/build-jieli-ac707n*.sh helpers + patches/m1/ set remain for the vanilla/M1 variants.)

Update the lock-screen image (over BLE, no reflash): tools/make_lockimg.py + qix rawflash lockimg.bin --addr 0x300000 --verify --reboot . See docs/lock-image.md . ( rawflash talks to the 0xD0–0xD4 raw-flash service that the custom firmware serves on its Update screen — not the legacy STAGER loader.)

Update the lock-screen image (over BLE, no reflash): tools/make_lockimg.py + qix rawflash lockimg.bin --addr 0x300000 --verify --reboot . See docs/lock-image.md . ( rawflash talks to the 0xD0–0xD4 raw-flash service that the custom firmware serves on its Update screen — not the legacy STAGER loader.)

Repack / inject into a UFW : tools/ufw-repack/ (pure Python, no wine).

Repack / inject into a UFW : tools/ufw-repack/ (pure Python, no wine).

Custom firmware features

The DragonJAR badge runs this custom firmware to explore and experiment with Bluetooth — research tools plus an on-device UI driven entirely from the badge. Its features:

Bluetooth Mouse — the badge acts as a BLE-HID mouse (the touchscreen is the trackpad) to drive compatible hosts.

Bluetooth Scanner — scans nearby BLE devices; pick one to browse its GATT services and characteristics.

Interactive GUI — LVGL touch with direct access to the Bluetooth tools and the device settings.

Physical-button — move between options, select, and go back using the badge's buttons.

Lock screen with gesture — on wake from suspend it shows a lock screen, unlocked with a touch gesture (a swipe). The wallpaper is updatable over BLE — see docs/lock-image.md .

Suspend — the device suspends and wakes on any physical button.

Brightness — adjustable from the settings .

Update mode — an option to enter firmware-update mode (BLE OTA).

Open research firmware — part of a JieLi e-badge reverse-engineering project, with the tools and docs published here to explore how it works and build on it.

The firmware code added by the patch lives, in order of size:

(Of the patch's ~15.5 k added lines, ~10.7 k are two embedded image headers; the real code delta is ~4.8 k.) Edit inside the SDK worktree, rebuild, then regenerate the patch — recipe in docs/build-badge-firmware.md .

Tests — there is no CI yet, so run them before opening a PR :

They cover protocol/packing logic against a mocked transport — no test touches real BLE or real hardware , so a green suite is not evidence that a flash works.

Security note — device chipkey

⚠ tools/chipkey/ and the firmware/ images embed the on-device flashing key ( 0x9847 ) for AC707N-class units, because the repack / inject / flash tooling needs it. It is published here as a research artifact — see DISCLAIMER.md . No OEM firmware, application binaries, application/cloud crypto keys, or vendor datasheets are included in this repository.

The build and BLE-flash paths are self-contained — clone the repo and go. The JieLi crypto helpers ( jltech : cipher / CRC / chipkey codecs, reverse-engineered from the jl-misctools project) are vendored as pure Python in tools/ufw-repack/jltech/ , with no crcmod and no external checkout; tools/jl-flash-decrypt carries its own standalone copies.

One script still needs the external jl-misctools mirror (gitignored under tools/community-re/ , obtained separately): scripts/gen_chipkey_keyfile.py , which uses jltech.chipkeyfile — a module that is not vendored here. It tells you so when you run it.

The wired dump step (custom→OEM) uses tools/jl-uboot-tool , a git submodule tracked in this repo — clone with --recurse-submodules (or git submodule update --init ) and install its requirements.txt . No OEM firmware is fetched by any of this.

Upcoming at DragonJarCon — "Compré un e-badge otaku de 10 dólares y terminé hackeándolo" ("I bought a $10 otaku e-badge and ended up hacking it"; talk in Spanish).

The research started from DragonJAR SAS 's APK-auditing skill ( Android-Pentesting-Skill ).

Andrés Sabas ( @sabas1080 ) — Electronic Cats

Heikki Perea ( @HeikkiRadu ) — Electronic Cats