Most mobile comic and PDF reader templates cut corners: sluggish WebView wrappers, zero archive validation, hardcoded Firebase configs, and missing store-compliance flows (Age Gate, consent timestamps, in-app account deletion).
I built PanelVerse to solve that — a dual-native Android (Kotlin / Material 3) and iOS (SwiftUI / iOS 16+) comic, manga, and PDF reader designed for indie publishers and self-hosted Komga / Kavita / Calibre libraries.
Here are the four engineering decisions that mattered most:
1. Validating Untrusted CBZ & PDF Files On-Device
Accepting local .cbz and .pdf files up to 250 MB means treating every archive as hostile input:
- ZIP-slip protection: Reject any archive entry containing path traversal (
../), absolute paths, or backslashes before extraction. - Image-bounds validation: Decode bounds first (
inJustDecodeBounds = true), verify actual MIME type (image/jpeg,image/png,image/webp), and cap total pixels at 128 MP to prevent OOM bitmap bombs. - Native PDF rendering: Verify
%PDF-magic bytes and page-count bounds via Android SDKPdfRendererbefore saving to app-private storage.
2. XXE-Safe, HTTPS-Only OPDS 1.2 Browser
Instead of relying on fragile web scrapers, PanelVerse includes a native OPDS 1.2 Atom browser so users can connect their own self-hosted Komga, Kavita, or Calibre servers:
- Disables DTDs and external entities (
disallow-doctype-decl,external-general-entities,external-parameter-entities) to block XXE. - Rejects non-HTTPS URLs, embedded credentials, and SSL downgrades (
followSslRedirects(false)), with a strict 2 MB XML response cap. - Downloads
.cbzand.pdfacquisitions straight through the same validated offline import pipeline.
3. Store Compliance & OWASP MASVS Hardening
Google Play and Apple App Store reviews fail apps quickly when privacy or security is an afterthought:
- Firebase security: Least-privilege
database.rules.jsonverified by an automated emulator test suite + Firebase App Check (Play Integrity). - Runtime anti-tampering: Blocks
FLAG_DEBUGGABLEand attached debuggers in release builds, plus optional XOR-masked SHA-256 release signing certificate pinning configured viagradle.properties. - Automated compliance gate: A 12-check CI script verifies zero remote fonts, zero third-party ad/tracker SDKs, active Age Gate + server-timestamped Policy Consent, and one-tap Delete Account (wiping Firebase Auth + all RTDB user nodes).
4. Testing With 20 Parallel AI User Personas
Manually testing RTL layouts, long-text German/Swedish/Finnish compound words, and 1.4x accessibility font scales across 10+ devices takes days.
So I built and bundled mobile-agent-testers right inside tools/mobile-agent-testers/:
- Uses Maestro CLI (unified Android + iOS automation) + pluggable Google Gemini / Claude vision backends.
- Spins up 20 unique
(device × locale × persona)agents in parallel via a GitHub Actions matrix strategy (e.g., Anna, 68, 1.4x font on iPhone SE in Swedish and Fatima, 42, RTL Arabic on Pixel 8). - Annotates screenshots with severity bounding boxes (
BLOCKER/MAJOR/MINOR), deduplicates identical bugs across devices, and outputsreport.md,report.json, and a single-file interactivedashboard.html.
cd tools/mobile-agent-testers && ./setup.sh mobile-agent-testers plan -c panelverse.yaml -n 20 mobile-agent-testers run -c panelverse.yaml -n 4 \ --devices iphone-se,pixel-8 --locales sv-SE,ar-SA \ --backend gemini --driver maestro Check Out the Full Source Code
If you're building an indie comic publisher app, self-hosted OPDS reader, or white-label PDF/manga reader and want to skip months of native boilerplate and security work, the complete Android + iOS source code (plus the 20-agent AI QA suite and 10-minute BUYER_SETUP.md) is live here:
Happy to answer any questions about Android PdfRenderer, OPDS 1.2 parsing, Firebase App Check, or running Maestro + vision agents on GitHub Actions!
