# Competitive APK Analysis — 2026-05-20

Three APKs decompiled with jadx 1.5.1 to identify features, patterns, and anti-patterns for NexStream implementation planning.

## Apps Analyzed

| App | Version | Package | Architecture | Content Source |
|-----|---------|---------|-------------|---------------|
| Cinema HD | 3.0.6 | com.yoku.cinemahd.v3 | Hardcoded scrapers (140+) + Jsoup | Website HTML scraping |
| Debrid Stream | 3.2.3 | com.debridstream.tv | Stremio addon protocol + Compose | Community addons |
| Flix Vision | 3.6.2 | flix.com.vision | Server-driven config + extractors | Backend JSON config |

## Key Architectural Insight: Flix Vision's Server-Driven Model

Flix Vision does NOT hardcode 140 scrapers like Cinema HD. It fetches a JSON config from a server that tells the app:
- What provider URLs to use
- Feature toggles
- Content filter data
- APK update info
- IPTV playlists

Only ~11 extractor classes on-device. The server can add new providers without app updates.

**This is the hybrid model to emulate**: Stremio addons for primary content + a lightweight remote config backend for feature toggles, provider overrides, and content filtering JSON.

## Features NexStream Should Add (ranked by impact)

### P0 — Already Implemented
- Content filter for kids profiles (`ContentFilter.kt`, genre-based)
- Edge-to-edge immersive mode (`enableEdgeToEdge()`)

### P1 — High Impact, Moderate Effort
- OpenSubtitles auto-download (Flix Vision v2.8.0)
- In-player episode picker (Flix Vision v2.9.0)
- Audio track selection UI (Flix Vision v3.6.0)
- Auto-play next episode countdown card (Flix Vision v3.6.0)
- Subtitle smart positioning / gravity markers (Flix Vision v3.6.0)

### P2 — Medium Impact
- Server-driven remote config (Flix Vision pattern — GitHub Releases JSON)
- Quality sorting on source list (Flix Vision v2.4.0)
- Netflix-style screen saver (Flix Vision v3.3.0)
- Debrid cloud/torrent browser (Flix Vision v2.6.0)

### P3 — Lower Priority
- M3U playlist import (Flix Vision v1.0.8)
- People search by actor/director (Flix Vision v1.0.8)
- JSON backup/restore (Flix Vision v3.6.0 — already partially implemented)
- Player rating animation (Flix Vision v3.0.0)

## Anti-Patterns Identified

### Cinema HD — DO NOT COPY
- 140+ hardcoded scraper classes in a static array — unmaintainable
- Plain SharedPreferences for API tokens — insecure
- `usesCleartextTraffic="true"` — security vulnerability
- `hardwareAccelerated="false"` — kills video performance
- 6+ ad SDKs — bloat

### Flix Vision — patterns to AVOID despite good architecture
- Hardcoded backend server IP (`http://185.112.144.240`) — traceable, HTTPS
- AsyncTask in production code — use coroutines
- Singleton Application anti-pattern (`public static App F`)
- String concatenation for API keys — leaks in memory dumps
- `Thread.sleep(1000L)` in production — blocks worker thread

## Decompilation Workflow
```bash
# Download
curl -sL <apk-url> -o app.apk

# MediaFire requires extracting direct link from HTML:
grep -o 'https://download[^"]*' page.html | head -1

# Decompile
/tmp/jadx-1.5.1/bin/jadx --show-bad-code -d output-dir app.apk

# Quick manifest check
unzip -p app.apk AndroidManifest.xml | strings | grep -E "versionCode|versionName|package="
```

Full deliverables at `~/apk-analysis/` — 6 markdown documents totaling ~1,400 lines.
