Skip to content

feat: multidex, v2 signing, AXML parser, webhooks, and 6 more improvements#11

Merged
ykus4 merged 2 commits into
mainfrom
dev
May 1, 2026
Merged

feat: multidex, v2 signing, AXML parser, webhooks, and 6 more improvements#11
ykus4 merged 2 commits into
mainfrom
dev

Conversation

@ykus4

@ykus4 ykus4 commented May 1, 2026

Copy link
Copy Markdown
Owner
  • Multidex supportclasses2.dex, classes3.dex, … are encrypted as a bundled ZIP (assets/encrypted_extra.dex) and loaded via DexClassLoader path list in StubApplication
  • Proper AXML patcher — replaced best-effort regex with a structural binary parser that reads the string pool and resource map to precisely locate the android:name attribute on <application>
  • APK Signature Scheme v2 — pure-Python signing block (PKCS1v15 + SHA-256) appended after v1 (JAR) signing; satisfies the Android 7+ installer requirement
  • File size limits & validation — configurable FUIN_MAX_UPLOAD_MB (default 500 MB) + ZIP magic header check on upload
  • Auto-cleanupFUIN_CLEANUP_DAYS (default 30 days) prunes old packed APKs, mapping files, and job records on server startup
  • Rich APK analysis — new fuin/apk_info.py pure-Python AXML parser; extracts minSdk, targetSdk, version name, permissions, component counts, and DEX file list; stored in the App DB record
  • Job history persistence — new JobRecord DB table; job status is written throughout execution so GET /jobs/{id} works across server restarts
  • ProGuard mapping managementPOST /apps/{id}/mapping/upload stores mapping.txt; GET /apps/{id}/mapping downloads it
  • Webhook callbackswebhook_url form field on POST /pack (or FUIN_WEBHOOK_URL env var) fires a POST {"event": "pack.done", ...} on completion
  • CI / Docker workflowsci.yml (ruff lint + pytest) and docker.yml (build & push to GHCR on main/tags); Dockerfile simplified: runtime stage no longer installs Android build-tools (pure-Python fallbacks cover zipalign and signing)
  • Web UI — SDK badges, dangerous-permission highlighting, component counts, per-app detail panel, mapping upload/download, webhook URL input

ykus4 added 2 commits May 1, 2026 22:20
…lity

- Add .github/workflows/ci.yml: ruff lint/format + pytest on push/PR
- Add .github/workflows/docker.yml: build and push to GHCR on main/tags
- Dockerfile stage 2: remove redundant build-tools install (pure-Python
  zipalign/apksigner fallbacks make them unnecessary at runtime)
- .gitignore: add .docker-deps/ to prevent accidental large-file commits
Multidex support:
- classes2.dex, classes3.dex, ... are encrypted together as assets/encrypted_extra.dex
- StubApplication.kt extracts and loads extra DEX via DexClassLoader path list

AndroidManifest.xml patcher:
- Replaced regex-based fallback with structural AXML binary parser
- Reads string pool, resource map, and XML element chunks to precisely locate
  the android:name attribute on <application> tag
- Falls back to byte-level UTF-16LE replacement for UTF-8 encoded pools

APK Signature Scheme v2:
- Pure-Python v2 signing block appended after v1 (JAR) signing
- Computes APK content digests over ZIP sections, RSA-PKCS1v15 signature
- Compatible with Android 7+ installer requirements

File size limits and validation:
- Configurable FUIN_MAX_UPLOAD_MB (default 500 MB)
- ZIP magic header validation before starting a job

Auto-cleanup:
- FUIN_CLEANUP_DAYS (default 30) — deletes old App records, packed APKs,
  mapping files, and job records on server startup

APK analysis info:
- New fuin/apk_info.py: pure-Python AXML parser for package, version,
  minSdk, targetSdk, permissions, component counts, DEX file list
- Analysis stored in App.analysis (JSON column) and returned in API responses

Job history DB persistence:
- New JobRecord table; job status written to DB throughout execution
- GET /jobs/{job_id} falls back to DB for completed jobs after restart

ProGuard mapping management:
- POST /apps/{app_id}/mapping/upload — stores mapping.txt on disk
- GET  /apps/{app_id}/mapping       — download stored mapping

Webhook callbacks:
- webhook_url form field on /pack, or FUIN_WEBHOOK_URL env var
- Fires POST JSON {"event": "pack.done", "result": {...}} on completion

Web UI updates:
- SDK badges (min/target API level)
- Permission list with dangerous permission highlighting
- Component counts (A/S/R/P)
- Per-app details panel with version, SDK, DEX info
- Mapping upload/download UI
- Webhook URL input field
@ykus4 ykus4 merged commit d55ef89 into main May 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant