Skip to content

Add download helper utilities with integrity verification, metadata tracking, and anti-blocking features#229

Open
jeffryhawchab wants to merge 6 commits intoEFForg:masterfrom
jeffryhawchab:feature/download-helpers
Open

Add download helper utilities with integrity verification, metadata tracking, and anti-blocking features#229
jeffryhawchab wants to merge 6 commits intoEFForg:masterfrom
jeffryhawchab:feature/download-helpers

Conversation

@jeffryhawchab
Copy link

Summary

Enhances apkeep with download helper utilities including metadata tracking, SHA256 integrity verification, and customizable anti-blocking measures for more reliable and secure APK downloads from all supported sources (APKPure, F-Droid, Google Play, Huawei AppGallery).

New Features

Download Helper Utilities (src/util/download_helper.rs)

  • DownloadMetadata struct: Track comprehensive download information (app ID, version, filename, SHA256, file size, URL, timestamp, source)
  • SHA256 checksum computation: Automatic integrity verification after download
  • Metadata persistence: Save/load download metadata as JSON files alongside APKs
  • Resume support: Detect and resume interrupted downloads
  • Anti-blocking headers: Customizable User-Agent and HTTP headers with browser-like defaults

New CLI Options

  • --user-agent <agent>: Custom User-Agent string (default: Chrome/Windows)
  • --headers <headers>: Custom HTTP headers (format: 'Header1:Value1,Header2:Value2')
  • --timeout <seconds>: Request timeout (default: 300)
  • --verify: Verify APK integrity using SHA256 checksum
  • --save-metadata: Save download metadata as JSON
  • --skip-existing: Skip existing files instead of resuming

Integration

  • Integrated helper functions into APKPure download source
  • Helper functions available for all download sources (APKPure, F-Droid, Google Play, Huawei AppGallery)
  • CLI options passed through to download sources via options map

Bug Fixes

  • F-Droid extraction: Improved error handling in ZIP extraction to prevent panics on corrupted archives

Documentation & Testing

  • Updated README with new features and usage examples
  • Updated USAGE file with new CLI options
  • Added comprehensive unit tests for all helper functions
  • Enhanced .gitignore to exclude build artifacts

Usage Examples

# Download with integrity verification
apkeep -a com.instagram.android --verify .

# Download with custom anti-blocking headers
apkeep -a com.instagram.android --user-agent "CustomBot/1.0" --headers "Accept:application/json" .

# Download with metadata tracking
apkeep -a com.instagram.android --save-metadata .

# Works with all sources
apkeep -a org.mozilla.fennec_fdroid -d f-droid --verify --save-metadata .

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