# Flix Vision v3.6.3r — Reverse Engineering Summary

Decompiled from `zyhpy9.apk` (36.5MB) using jadx v1.5.5. Package: `flix.com.vision`.

## Architecture Overview

Flix Vision uses a **completely different** approach from DebridStream/Nexstream. No Stremio addons, no Torrentio. Instead, it uses:

1. **Embed URLs** (FLIXVISION1-5) — WebView-playable embed pages
2. **Video Hoster Extractors** — Site-specific scrapers for direct .mp4/.m3u8
3. **Movie Link Scrapers** — Playlist-based direct links
4. **Debrid Services** — RealDebrid, AllDebrid, Premiumize for resolving hoster links

## Source 1: Embed URL Sources (FLIXVISION1-5)

| Label | URL Pattern |
|-------|------------|
| FLIXVISION | `http://185.112.144.240/ext/gotv.html?goto={tmdb_id}&s={season}&e={episode}` |
| FLIXVISION2 | `https://embed.smashystream.com/playere.php?tmdb={id}` / `...&season={s}&episode={e}` |
| FLIXVISION3 | `https://autoembed.co/tv/tmdb/{id}-{season}-{episode}` (configurable `autoembed_url` pref) |
| FLIXVISION4 | `https://vidsrc.me/embed/tv/{id}/{season}-{episode}` |
| FLIXVISION5 | `https://vidsrc.xyz/embed/movie/{id}` |

The base embed URL (`M` on `LinksActivity`) defaults to `https://autoembed.co` and is user-configurable via `SharedPreferences` key `autoembed_url`.

## Source 2: Video Hoster Extractors (Complex, Fragile)

These extract direct video URLs from streaming sites using JSoup + regex + crypto:

| Extractor | Base Domain | Method |
|-----------|-------------|--------|
| **GogoExtractor** | `streamcool.pro` | Encrypted AJAX (`encrypt-ajax.php`), AES decrypt with fixed key (`9262859232435825`) |
| **DoodExtractor** | `doodstream.com` | Scrapes `/pass_md5/` token from page, constructs direct URL + token |
| **VidsrcExtractor** | `vsembed.ru`, `9anime.eltik.net` | Multi-step: get episode ID → source ID → futoken → decrypt URL |
| **CloudnestraExtractor** | `cloudnestra.com` | Scrapes iframe src, parses HTML comment `serversList`, extracts `src:` with variable replacement |
| **FileMoonExtractor** | `azm.to` | Unpacks JavaScript `eval()` (packed via HI), parses `.setup()` JSON |
| **CloseloadExtractor** | `closeload.top` | ROT13 + base64 brute-force + byte unmix loop to find .mp4 URLs |
| **VixcloudExtractor** | `vixcloud.co` | JSoup parses `window.video` + `window.masterPlaylist`, language-aware HLS audio/subtitle patching |

**These are NOT worth porting.** They use ROT13, base64 brute-force, packed JS unpacking, and anti-bot HTTP headers (randomized User-Agent, sec-ch-ua, Sec-Fetch-*). They break constantly.

## Source 3: Movie Link Scrapers (Direct Links)

| Service | Base URL | Pattern |
|---------|----------|---------|
| **AllMovieLand** | `allmovieland.you` (hardcoded default, configurable) | `/play/{imdb_id}`, `/playlist/{file}.txt` |
| **SwiftStreamz** | `swiftstreamz.cc/SwiftStreamzv2.4/data.php` | From `Constant.a` |
| **ML Host** | `trinstor297undoint.com` (pref `pref_ml_host`) | `/play/{imdb_id}` |

These return playlist JSON with direct `.mp4`/`.m3u8` URLs. Low maintenance, reliable.

## Source 4: HDO Box Scraper

Proxied through their backend IP `http://185.112.144.240`:
- `/ajax/movie_sources/{id}`
- `/ajax/movie_embed/{id}`
- `/ajax/v4_movie_episodes/{id}`
- `/ajax/movie_token`
- `/ajax/movie_suggest_search`

## Source 5: 123MoviesGo Scraper

Endpoints relative to configurable base:
- `/ajax/sources/{id}`
- `/ajax/movie/episodes/{id}`
- `/ajax/v2/episode/servers/{id}`
- `/ajax/v2/season/episodes/{id}`
- `ajax/v2/tv/seasons/{id}`
- `/ajax/suggest_search`

## APIs and Keys

| API | Key | Usage |
|-----|-----|-------|
| TMDB | `2f3cb5763db1117fcba3948632f8aad9` | Metadata, images, search |
| Trakt | `39c944040d5f19862b77e7a66b6c419af653c1e3bf226cc691eb2abbb551730c` | Watchlists, history, sync |
| Backend | `http://185.112.144.240` | Custom IP-based backend for embeds + images |

## Debrid Integration

| Service | Base URL | Auth |
|---------|----------|------|
| Real-Debrid | `https://api.real-debrid.com` | OAuth token (Bearer) |
| AllDebrid | `https://api.alldebrid.com` | API key (`agent: flixvision`) |
| Premiumize | `https://www.premiumize.me` | API key |

Hosts array (220+ file hosters): 1fichier, mega, mediafire, rapidgator, uploaded, uptobox, mixdrop, streamtape, doodstream, voe.sx, etc.

## Content Discovery

Content comes from:
1. **TMDB** — `/3/trending`, `/3/popular`, `/3/top_rated`, `/3/discover`, `/3/search`
2. **Trakt** — `/calendars`, trending movies, sync/collection, sync/watchlist
3. **HDO Box** — via backend IP proxy
4. **123MoviesGo** — via configurable base URL
5. **RidoMovies** — via configurable base URL
6. **SC** (Super Cinema?) — Inertia-based HTML scraping
7. **Adult** content APIs

## UI Assets (55 unique images)

Services: netflix, prime, disney, hbomax, hulu, paramount, peacock, starz, appletvplus, discovery, amc, cbs, brit_box, bet_plus, showtime, syfy

Debrid: rd_logo.png (RealDebrid), all_debrid.png, premiumize_icon.jpg, direct_stream.png

Other: tmdb_logo.png, trakt.png, imdb.png, vlc_icon.png, chromecast.png, settings.png

## Theme

- Primary: `#37414e`
- Dark: `#222932`
- Accent: `#01a3f8` (teal blue)
- RD color: `#f9a43e` (orange)
