Skip to content

nicglazkov/caltrans-sabre

Repository files navigation

CHP + Waze SABRE for Highway Radar

A drop-in replacement for wzsabre that brings CHP live incident alerts and Waze crowdsourced traffic data to Highway Radar via the SABRE plugin protocol.

Package ID: app.sabre.wzsabre — same as wzsabre, so Highway Radar discovers this plugin automatically without any reconfiguration.


What it does

Source Data Update cadence
CHP Live Feed Accidents, road closures, debris, officer on road, weather hazards — directly from the California Highway Patrol statewide XML feed Every HR map refresh
Waze Crowdsourced police, accidents, hazards, road closures Every HR map refresh

Both sources run in parallel and feed into the standard HR crowdsourced-alerts layer — the same map overlay that wzsabre used to power.


Requirements

  • Android 6.0+ (API 23)
  • Highway Radar installed
  • Sideloading enabled on your device

Installation

Option A — Download the APK (recommended for most users)

  1. Go to the Releases page and download the latest app-release.apk.
  2. On your Android device, open Settings → Security (or Install unknown apps) and allow installs from your browser or file manager.
  3. Open the downloaded APK and tap Install.
  4. Open the CHP + Waze SABRE app once — this wakes up the background service.
  5. Open Highway Radar → Settings → SABRE and select CHP + Waze SABRE.

After a phone reboot: Open the CHP + Waze SABRE app once before using Highway Radar, or simply tap the green start button in HR — the plugin will start automatically.

Option B — Build from source

See BUILDING.md.


Configuration

Open the CHP + Waze SABRE app to access settings. All changes take effect immediately on the next HR map refresh — no restart needed.

Alert Categories

Each CHP category has two controls:

  • Toggle (on/off) — disabled categories are never sent to HR.
  • "Shows as" picker — controls which Highway Radar icon is used for that category.
Category Default HR icon What it covers
Fatal & Injury Accidents Accident (Major) 1179, 1183, fatals, SIG alerts
Minor Accidents Accident (Minor) Non-injury collisions, hit-and-run
Officer on Road Police Visible Traffic control, construction escorts
Closures & Congestion Road Closure Road closures, traffic advisories
Debris & Road Hazards Road Debris Debris, vehicle fires, misc. hazards
Weather Hazards Natural Fog, wind, snow, ice, chain controls

Tip: If you find the police icon distracting, set Officer on Road → Shows as → Road Closure to get a neutral congestion icon instead.

Incident Age

Drops CHP alerts older than a configurable threshold using the incident's actual LogTime from the feed (not the time your phone fetched it). This prevents stale multi-hour incidents from cluttering the map.

Options: No limit / 30 min / 1 hr / 2 hr / 4 hr / 8 hr (default: 1 hour)


Migrating from wzsabre

If you already have wzsabre installed:

  1. Uninstall wzsabre (Settings → Apps → wzsabre → Uninstall).
  2. Install this APK — it uses the same package ID (app.sabre.wzsabre) so HR picks it up without any changes to HR's settings.
  3. Open the new app once to start the service.

The package ID being identical to wzsabre is intentional — HR's plugin discovery whitelists app.sabre.wzsabre, and we reuse it so no HR-side changes are needed.


Troubleshooting

"Crowd-Sourced Alert Problems" banner in HR

  • Open the CHP + Waze SABRE app and check that the service status shows "Plugin active".
  • Tap the green start button in HR — this sends a fresh handshake.
  • On Android 15: open this app first, then HR. The background service must be running before HR requests data.

CHP alerts visible but no Waze alerts

  • Waze requires a real internet connection. The plugin loads waze.com in a background WebView to establish a session — this can take 5–30 seconds on first use.
  • Check that the app has network permission (it should request none explicitly; all network access is in the background service).

No alerts at all

  • Confirm HR is using the correct plugin: HR → Settings → SABRE → should show "CHP + Waze SABRE".
  • Check that no alert categories are all turned off in the app settings.

How it works (brief)

Highway Radar  ──broadcast──▶  MainBroadcastReceiver
                                      │
                               startService()
                                      │
                               SabreService (foreground)
                                 ┌────┴────┐
                              CHP feed   Waze
                              (XML)     (WebView
                                        cookie +
                                        OkHttp)
                                 └────┬────┘
                               sendBroadcast(response)
                                      │
                               Highway Radar  ◀──────
  • CHP: fetches https://media.chp.ca.gov/sa_xml/sa.xml, filters by radius and incident age, applies your category settings.
  • Waze: loads waze.com in a hidden WebView to harvest session cookies, then makes a direct HTTP call to the Waze georss API with the correct bounding-box parameters. This mirrors the exact approach used by wzsabre 1.8.
  • SABRE protocol: a broadcast-intent IPC protocol defined by Highway Radar. Our plugin responds to FETCH_REQUEST broadcasts with a JSON payload containing SabreFetchResponseAlert objects.

Contributing

Pull requests welcome. Run the test suite before submitting:

./gradlew test

324 unit tests cover the SABRE response format, alert type mapping, CHP XML parsing, config filtering, and LogTime parsing. See BUILDING.md for full dev setup.


License

MIT

About

Android SABRE plugin for Highway Radar that provides real-time CHP incident alerts and Waze crowdsourced traffic alerts on the map.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors