ReactorcoremeltdownandClaude Opus 5 deb582727f Harden untrusted-file parsing, drop two audio-thread allocations, prune dead code (v0.24.0)
SECURITY

A crafted .sf2 hung the app. SoundFontLoader's RIFF walk trusted the chunk
sizes in the file: a negative size moved the cursor BACKWARDS, so the walk
re-read the same chunk header forever. runCatching cannot catch that — there is
no exception, just a thread that never returns. 76 bytes was enough. Every seek
in both the chunk and sub-chunk loops is now forced forward, negative sizes end
the walk, and the sample offset is resolved in Long so a hostile 32-bit start
index can no longer wrap Int and land the read somewhere arbitrary.

Neither ZIP import had a decompression budget. The zip-slip path check does not
see a bomb, because its entries are perfectly well-named — they are just
enormous. A restore streams to disk and filled the device; a project bundle
accumulates in memory and exhausted the heap. New ZipLimits budgets both, with
different limits because they fail differently: 512 MB for a restore, 64 MB for
a bundle, 20k entries either way. An over-budget archive is rejected like any
other bad file, leaving existing data untouched.

PlaybackService was exported with no permission, so any app on the device could
bind the MediaSessionService and take transport control. Now exported="false".
Verified on an emulator that this changes nothing that matters: the session is
still the system's media button session, the notification still posts, the
foreground service survives backgrounding, no SecurityException. The only loss
is discovery by external media browsers (Auto, Assistant, Wear), which this app
never supported.

String.format("%.2f") in three parameter readouts used the default locale, so a
comma-decimal locale rendered knob values inconsistently with the rest of the
monospace UI. Pinned to Locale.US.

PERFORMANCE

Two allocations removed from threads documented as allocation-free:
  - applyLfos() called target.substring(sep + 1) every block for each active
    LFO (~250/s each), in a function that already parses the slot index
    character-by-character to avoid exactly this. Now matched with
    regionMatches, which allocates nothing.
  - busNoteOn() built `(0 until N).map { … }.firstOrNull { … }` twice — a range
    iterator plus an ArrayList per incoming MIDI note. Replaced with an indexed
    freeBusVoice() scan, matching the style used elsewhere in the file.

DEAD CODE

Arrangement.isLaneMuted had no callers (everything reads laneMuted[] directly).
Four tab-title strings and a notification-channel name were left over from an
earlier design — the tabs are composed with literals and media3 names its own
channel. Added the missing android:roundIcon, which is why lint thought
ic_launcher_round was unused; the asset was always meant to be referenced.

Lint is clean of UnusedResources, DefaultLocale and ExportedService. Its
remaining ObsoleteSdkInt advice — merge mipmap-anydpi-v26 into mipmap-anydpi —
is wrong for this AGP version and was reverted: aapt then fails to resolve the
launcher icons at all.

NOT CHANGED, flagged for a decision: android:allowBackup is still true, so
projects, presets, themes and the settings/bindings DataStore go to Google's
cloud backup. That is a standard hardening finding, but it is also a data
portability feature, and the app now has its own backup/restore — a product
call rather than a defect.

New tests: SoundFontLoaderTest (hostile SF2 headers, with timeouts — the hang
reproduces as a TestTimedOutException without the fix) and ZipBombTest (both
import paths, plus a guard that an ordinary backup still restores).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-03 21:16:29 +01:00

Sizzletracker (Android)

A retro, grid-based music tracker for Android — monospace UI, pixel icons, demoscene-style pattern editing — playable equally with touch, keyboard, gamepad, and MIDI (USB or Bluetooth).

platform language ui license

📖 Full User Guide — a detailed, screenshot‑by‑screenshot walkthrough of every tab, instrument, effect and control.

Features at a glance

  • Tracker tab — 4-track pattern grid (note / velocity-hex / MIDI-channel per track), beat & bar coloring, tap-to-focus + drag-to-edit with haptics and scale-aware note entry; plus an 8-lane arrangement piano-roll (up to 256 bars) with A/B loop regions.
  • Mix tab — 4 channels, each with an instrument + 4 FX slots, MIDI channel, volume, mute/solo.
  • Toolbox tab — 16 slots for instruments (3-oscillator synth, sampler, SF2/XI) and effects (arp, transposer, LFO, tape delay, reverb, filters, 10-band EQ, bitcrusher). Every device has an auto-generated editor and text presets.
  • Setup tab — .sng project save/load, color themes (with import/export), gamepad bindings, and searchable/collapsible MIDI bindings.
  • Master recording — render the master bus (with FX tail) to a WAV file.
  • Background playback with a media notification (Play/Pause/Stop).
  • Two-thread design — Compose UI on the main thread, a sample-accurate sound engine on its own high-priority thread.

There is also a standalone tools/samplepack-builder.html — an offline page for assembling Sampler preset bundles (drop audio onto 16 note-labelled pads, then download an importable .zip).

Build & run

Open the project in Android Studio (2024.1+) and Run on an API 26+ device or emulator.

From the CLI, make is the entrypoint (the Gradle wrapper is committed, so a fresh clone needs no setup):

make help        # every target, plus the current version
make check       # unit tests + lint
make staging     # release-like build for on-device testing
make install     # adb install -r the staging APK

Versions live in versions.properties (make bump-minor / bump-patch), and make release produces the unsigned, F-Droid-named APK. Publishing to the private F-Droid repo is a separate, manual make publish.

Where to start reading

See docs/DEVELOPER_HANDOVER.md — a from-scratch tour written for a developer new to Android: architecture, the file map, the "one action / one song / two threads" model, how to add an instrument or input, and an honest implemented-vs-TODO list.

Fastest orientation in code: model/Project.kt → input/InputAction.kt → ui/AppViewModel.kt → audio/AudioEngine.kt.

Project format

Songs use a human-readable .sng text format (see io/ProjectIo.kt), aligned in spirit with the desktop Sizzletracker; a byte-exact compatibility shim is a listed TODO in the handover doc.

License

Sizzletracker is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v3.0 or later (GPL-3.0-or-later). See the LICENSE file for the full text; every source file carries an SPDX GPL-3.0-or-later header.

Copyright © 2026 Reactorcoremeltdown

S
Description
No description provided
Readme GPL-3.0
5.1 MiB
Languages
Kotlin 46%
C++ 29.1%
Swift 15.1%
Objective-C++ 6.3%
Objective-C 1.5%
Other 1.9%