Metadata-Version: 2.4
Name: justapk
Version: 0.1.0
Summary: Multi-source APK downloader with automatic fallback
Project-URL: Homepage, https://github.com/TheQmaks/justapk
Project-URL: Repository, https://github.com/TheQmaks/justapk
Project-URL: Issues, https://github.com/TheQmaks/justapk/issues
Author: TheQmaks
License: MIT
License-File: LICENSE
Keywords: android,apk,apkmirror,apkpure,download,fdroid
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: System :: Software Distribution
Requires-Python: >=3.11
Requires-Dist: beautifulsoup4>=4.12
Requires-Dist: curl-cffi>=0.7
Requires-Dist: lxml>=5.0
Requires-Dist: requests>=2.28
Description-Content-Type: text/markdown

# justapk

Multi-source APK downloader with automatic fallback. Downloads Android APK files by package name from 6 sources, trying each until one succeeds.

## Install

```bash
pip install justapk
```

Requires Python 3.11+.

## Usage

### Download

```bash
# Auto-select best source
justapk download org.telegram.messenger

# From a specific source
justapk download org.telegram.messenger -s apkpure

# To a specific directory
justapk download org.telegram.messenger -o ./apks/

# Keep XAPK as-is (don't auto-convert to APK)
justapk download com.termux -s apkpure --no-convert
```

### Search

```bash
justapk search telegram
justapk search telegram -s fdroid
```

### Info

```bash
justapk info org.telegram.messenger
justapk info org.telegram.messenger -s apkpure
```

### Convert XAPK to APK

```bash
justapk convert app.xapk
justapk convert app.xapk -o output/
```

Merges split APKs (base + native libs + assets) into a single APK and signs with a debug key.

### List sources

```bash
justapk sources
```

All commands output JSON to stdout. Progress goes to stderr.

## Sources

Tried in this order during fallback:

| # | Source | Method | Notes |
|---|--------|--------|-------|
| 1 | APK20 | Web + REST API | No Cloudflare |
| 2 | F-Droid | JSON API | FOSS apps only |
| 3 | APKPure | Mobile REST API | Largest catalog |
| 4 | APKMirror | Web scraping | Cloudflare (curl_cffi) |
| 5 | Uptodown | Mobile REST API + web token | No Cloudflare |
| 6 | APKCombo | Web scraping | Cloudflare (curl_cffi) |

## Python API

```python
from justapk import APKDownloader

dl = APKDownloader()

# Download with auto-fallback
result = dl.download("org.telegram.messenger", output_dir="./apks/")
print(result.path, result.size, result.sha256)

# Search across all sources
apps = dl.search("telegram")
for app in apps:
    print(app.package, app.name, app.source)

# Get info from first available source
info = dl.info("org.telegram.messenger")
print(info.name, info.version)

# Use specific source
result = dl.download("org.telegram.messenger", source="apkpure")
```

## License

MIT
