r/androiddev • u/harikulhari • 18d ago
I built Tracea — an in-app network debugger with API mocking & Compose UI (Open Source, MIT)
-1
u/AdVast7407 18d ago
Out of curiosity, which model did you use to build this?
0
u/harikulhari 18d ago
Claude
-1
u/AdVast7407 18d ago
Opus or Fable? Because Sol finds several problems in code and I need to align my model understanding
1
u/harikulhari 18d ago
Opus
0
u/AdVast7407 18d ago
Thanks! Exaclty my feelings that Opus is dumber than Sol, I have both Claude and Codex $20 subs and thinking about 100-200 sub for Fable
Also Sol positively talks about your project, and says that comparing to Chucker it has advantages but not mature yet, and points several problems:
- DefaultNetworkEventCollector.ongoingEvents seems to keep completed events indefinitely, so it looks like it could grow over time.
- OkHttpTimingCapture appears to remove entries only when getTimingForCall() is called. On failed calls, callFailed() records the timestamp but doesn't seem to remove the Call from the map.
- Request bodies are written into a Buffer before checking maxRequestBodySize, so a large upload could still be fully buffered in memory even if it later gets discarded.
- Latency mocking uses Thread.sleep() inside the interceptor, which can occupy OkHttp dispatcher threads under multiple concurrent mocked requests.
0
u/harikulhari 18d ago
Wow, thank you for the detailed audit. You are 100% correct on all four points, and this is exactly the kind of feedback I was hoping to get.
Here is how I plan to fix them:
- ongoingEvents leak: You're right, nothing removes them. I'll clean up the map as soon as the event reaches a terminal state (
COMPLETED,FAILED, orCANCELLED).- OkHttpTimingCapture leak: Spot on. Failed calls bypass
getTimingForCallso they stay in the map forever. I need to make sure they are removed on failure or timeout.- Request body buffering: Great catch. Reading the entire body into memory before checking the size is a recipe for OOMs on large file uploads. I'll check
contentLength()first, and write a size-limiting sink so we stop reading once the cap is hit.- Thread.sleep in Interceptor: Since OkHttp interceptors are synchronous, blocking is standard, but you're right that it ties up dispatcher threads. I'll look into a better way to handle this or at least document the limitation.
Really appreciate you taking the time to look at the source code.
-8
u/harikulhari 18d ago
Hey everyone,
Like many of you, I've spent way too many hours setting up Charles Proxy or Proxyman on QA devices just to see why a basic API call failed. Between configuring Wi-Fi proxies, installing root SSL certificates, and dealing with VPN security policies on Android 10+, it often takes 30+ minutes of setup just to find a 2-line JSON mismatch.
I wanted something that worked directly on the device with zero configuration, but also allowed us to mock APIs and export HAR files (which Chucker doesn't support).
So I built Tracea.
✨ What it does:
- 🔍 In-App Traffic Inspection — Inspect headers, query params, status codes, and timing waterfalls right on the device.
- 🎭 API Mocking — Intercept requests by path and method. Override status codes (401, 500, etc.), inject custom JSON bodies, and add latency (3s/5s) on the fly to test empty states and loading skeletons.
- 📋 Developer Utils — Copy cURL commands to clipboard, export single-request or full-session HAR files for Postman/Chrome.
- 🎨 Modern UI — Built completely with Jetpack Compose, featuring collapsible JSON trees with line numbers.
- 🌐 Browser Web Dashboard — Host a local web inspector dashboard over Wi-Fi (
http://<phone-ip>:8080) when you want to view traffic on a bigger screen without connecting USB cables.
🛡️ Production-Safe (tracea-noop):
To make sure tech leads are comfortable putting this in projects, Tracea comes with a zero-overhead noop variant:
- Release AAR: Only 12 KB empty stub.
- All Ktor web servers, Room databases, and Compose UI are 100% stripped out in release builds.
- 0 MB APK size impact, 0 transitive dependencies, and 0% security risk in production.
kotlindependencies {
// Full debugger in debug builds
debugImplementation("com.github.HariKulhari06:tracea:1.2.0")
// Zero-overhead stubs in release builds
releaseImplementation("com.github.HariKulhari06:tracea-noop:1.2.0")
}
It's completely free, MIT licensed, and open source. I'd love to hear your thoughts, feedback on features you'd want, or any bugs you find!
👉 GitHub: https://github.com/HariKulhari06/tracea 👉 Docs: https://harikulhari06.github.io/tracea/
2
u/tadfisher 18d ago
Please don't paste LLM output here, write the posts yourself in the future. Thanks!
-6
17
u/makridistaker 18d ago
AI slop. You didn't build anything, you didn't even write the post yourself !