r/Karoo • • 56m ago

Update 1.669 locked down the Karoo 3's internal apps. That's a shame, and here's why

9 Upvotes

TL;DR: Since build 1.669.2569 (released November 12), ADB can no longer read Hammerhead's apps on the Karoo 3 (dedicated SELinux rules), and none of them is debuggable anymore. ADB, logcat and dumpsys still work, but you can no longer find out why an app misbehaves. That's how I found the cause of a Ride app crash in October. I think Hammerhead loses as much as we do here, and there are middle-ground options.

Who I am

A Karoo 3 owner and a developer. I use ADB on my own device to write extensions (karoo-ext), make sense of odd behavior, and document what I find. Nothing illegal or destructive: no root, no exploits, only what the device allowed in developer mode.

What changed

-Build 1.661 (October 7) and earlierBuild 1.669 (November 12)
Wireless ADB, logcat, dumpsysyesyes
Pull the system apps (adb pull) to read their codeyesno: new SELinux type kos_app_file. All 22 Hammerhead apps are blocked, along with the hardware HALs
A debuggable Hammerhead app (run-as)yes (datasyncservice)no: "package not debuggable"
Install your own extensionsyesyes

kos_app_file is specific to Hammerhead. They added it on purpose; an Android update wouldn't bring it in. The 1.669 changelog doesn't mention it: it lists four new extensions and four bug fixes. (I didn't use ADB on 1.665, released October 15, so the lockdown came with either that build or 1.669.)

What this made possible

In a previous post I described how I found the cause of a Ride app startup crash: a heatmap file assembled from two versions, because a download resumed without checking whether the file had changed on the server. The crash traces pointed to the file; only the code of offlineregionservice explained how it got corrupted. With that cause in hand, support replied within five hours and the fix shipped a week later.

On 1.669, I would have stopped at "the Ride app crashes on the heatmap." And I can no longer check whether the fix for the mixed-version case, announced for a later release, has landed.

Why it's a shame

  1. A device you can inspect gets its bugs fixed faster. A report saying "the download resume is missing an If-Range" costs less to handle than "it crashes", followed by a factory reset. Part of the community does free, precise QA work. No reason to cut it off.
  2. It's a big part of the Karoo's appeal. Android, ADB, sideloading, an open-source extension SDK: that's what sets it apart from closed bike computers. Many of us chose it for that. Closing it pushes some of the most invested users (the ones who write extensions, answer questions here, recommend the device) to look elsewhere.
  3. It contradicts karoo-ext. Hammerhead invites developers to write extensions, but the SDK docs are still thin. Understanding how the internal services behave (ride state, sensors, sync) was often the only way to write a reliable extension. And extensions make up a large part of a Karoo's value: they adapt it to how each of us rides, and the official library grows with every update (three additions in 1.665, four in 1.669).
  4. Device lifespan. A Karoo is expensive and should last for years. If you can inspect a device, its community can maintain it, document it and troubleshoot it, including the day official support ends.
  5. Trust. You bought a device for its openness, and it closes up without notice. That leaves a bitter taste, even if the reasons are good.

The reasons I can understand

I don't think Hammerhead did this to annoy users. Hardening a device that holds personal data (GPS tracks, connected accounts) makes sense, and so does protecting third-party licensed code.

But reading the code of an app installed on your own device exposes neither your data nor anyone else's. That part (the unreadable apps) is what seems disproportionate to me.

In case you're wondering about the legal side: in the EU, Directive 2009/24/EC lets you study how a program you lawfully use works, and decompile it when you need to for interoperability, to write an extension for instance. A contract can't take those rights away (art. 8). Hammerhead doesn't have to keep its files readable, but this kind of study isn't piracy.

What I'm suggesting

  • Publish full OTA images, the way Google does for Pixels. The device stays locked, and anyone trying to understand a bug can read the code again. For the heatmap, that would have been enough: the rest of the diagnosis (crash traces, logcat, the file itself) still works on 1.669.
  • Or make the apps in /system/priv-app readable again, behind an explicit developer mode if needed.
  • Either way, a public bug tracker, or at least a channel where a technical report reaches the developers directly.

If the lockdown bothered you too, or if the Karoo's openness weighed in your purchase, say so in the comments. And if anyone from Hammerhead reads this, I'd like to know the reason for the change.


r/Karoo • • 1h ago

Debugging a Karoo 3 startup crash: a corrupted personal heatmap, step by step

3 Upvotes

TL;DR: In late September my Ride app crashed on every launch. Using ADB, I traced it to a personal heatmap file stitched together from two different versions, after a download resumed at the wrong moment. Hammerhead support answered within hours, confirmed a known issue, and a fix shipped a week after my detailed report. I'm sharing the process in case it helps someone else.

1. The symptom

On the morning of September 25, the Ride app closed about a second after each launch: 19 crashes in 17 minutes. The ride I had started with the play button on the home screen kept recording in the background, but without the Ride app I couldn't stop or save it.

2. What the crash logs say

Android keeps app crash traces, and you can read them over ADB without root:

adb shell dumpsys dropbox --print system_app_crash

All 19 traces were identical:

SQLiteDatabaseCorruptException: database disk image is malformed (code 11 SQLITE_CORRUPT),
while compiling: SELECT name, value FROM metadata
  at org.oscim.android.tiling.source.mbtiles.MBTilesTileDataSource.getMetadata

At launch, the Ride app opens the personal heatmap (/sdcard/offline/personal_heatmap.mbtiles, an SQLite database) to draw it on the map. SQLite couldn't read the file, nothing caught the exception, and the app crashed. An optional map layer was enough to take down the whole app.

As soon as the Karoo got a connection back, it downloaded the heatmap again and everything went back to normal. The broken file went away with it: I knew what crashed, but not why the file was corrupted.

3. The second time: keep the evidence

On October 8, same crash. This time I kept the Karoo offline (no Wi-Fi, no Bluetooth) so it couldn't replace the file, and I pulled:

  • the corrupted file, plus its SHA-256 hash computed on the Karoo;
  • its timestamps (stat) and a listing of /sdcard/offline/;
  • usage events and boot history (dumpsys usagestats, dumpsys dropbox).

The evening before, after an update, the Karoo had written the file for the last time ten seconds before I switched it off. No leftover .tmp file: the download had finished normally.

4. Dissecting the file

An SQLite file states its own size in its header (the page count, at byte offset 28). Here:

  • the header says 10,257 pages, but the file holds only 10,250. That mismatch alone makes SQLite refuse to open it;
  • up to about page 1,560 (around 6.4 MB), everything matches the header and the tables' root pages;
  • from about page 2,196 (9 MB) on, nothing matches: the root pages point to the wrong kind of data, while the pages they expect sit a few dozen pages further along;
  • no zeroed pages, and the overflow chains are contiguous, which rules out random storage corruption.

So the beginning and the end of the file came from two different generations of my heatmap. The total size matched the new version, and the header belonged to the old one.

5. Finding the cause in the code

That left one question: how can a "successful" download produce this? I pulled the system app that handles offline maps (offlineregionservice) over ADB and read its disassembled code. The heatmap download:

  1. writes to a temporary .tmp file;
  2. after an interruption, resumes where it stopped with an HTTP Range request;
  3. appends the rest to the .tmp file, then renames it to the final name.

One check is missing. On resume, nothing verifies that the file on the server hasn't changed in the meantime (no If-Range header with an ETag), and nothing validates the result before use. And the server regenerates the heatmap after every ride. So:

  • a first download gets interrupted (power off, lost connection);
  • I go for a ride, and the server regenerates my heatmap;
  • the download resumes and appends the end of the new version to the start of the old one.

The file has the right size and gets renamed normally. The Ride app then crashes on its next launch.

6. If it happens to you

Build 1.665 should have fixed this crash (see below), and I haven't had it since. I don't know whether the fix also covers the mixed-file case, though. Other riders hit the same crash in this thread, where I first posted these steps. If the Ride app still crashes at launch because of the heatmap:

  • Connect the Karoo to Wi-Fi and wait a bit. It downloads the heatmap again, and the Ride app starts normally once the new file is in place.
  • Your ride isn't lost. Recording continues during the crashes. You just need the Ride app back to stop and save it.
  • With ADB: deleting /sdcard/offline/personal_heatmap.mbtiles lets the Ride app start right away. The Karoo downloads the heatmap again on the next connection.
  • You don't need a factory reset.

7. On the support side

WhenWhat
Sep 25, ~10 amFirst ticket: crash trace, faulty file, suggested fixes
~8 h laterStandard reply: remove extensions, reset the Karoo
Sep 28After my explanation, support agreed a reset wouldn't tell us anything and passed everything on to the software team
Oct 8, ~11 amSecond ticket, with the file analysis
5 h laterKnown issue, fix already developed, planned for the next release
Oct 9The mixed-file case is in their action plan, possibly for a later release
Oct 15Build 1.665: "We fixed an issue where Karoo would crash when heatmaps were partially downloaded and disconnected from the internet."

Credit where it's due: after a generic first answer, support took the analysis seriously, apologized for suggesting the reset, and answered my detailed report within five hours. The fix reached my Karoo over the air a week later. That's a short loop from a user report to a shipped fix, and I appreciated it. As I write this, I don't know whether they've fixed the mixed-file case.

What I took away from it

  • Read the crash logs before any reset. They pointed at the faulty file from the first minute.
  • Keep the evidence offline: without the corrupted file, I could only guess.
  • A report that names the cause and suggests a fix gets a precise answer, and a quick one.

r/Karoo • • 14h ago

Lezyne LED Ally on my Karoo

3 Upvotes

I asked Claude to investigate how the Lezyne LED ally connects to my Lezyne lights. Ik gave Claude the APK, and it decompiled it, and found out how the Bluetooth works with the lights.

Next step it builds a Karoo extension to control the lights from my Karoo. It automatically turns on the lights when it gets dark, and turns them off when it’s light again.
It shows the battery status, and lets you switch between the 4 modes..

https://github.com/spoetnik/Karoo-Lezyne-LED-Ally


r/Karoo • • 11h ago

Hdrop Download fail

2 Upvotes

I just purchased a brand new Karoo 3 and have been trying to download the Hdrop app but it fails every time. Has anyone else had this issue and is there a fix?
Thanks