-
Notifications
You must be signed in to change notification settings - Fork 1
Developer Guide
Emirhan Uçan edited this page Jul 7, 2026
·
13 revisions
Deep-dive into the HydraDragonAV Mobile codebase for contributors.
HydraDragonAV-Mobile/
├── app/ # Android application module
│ ├── src/main/java/ # Java/Kotlin source
│ │ ├── com/hydradragon/av/ # Main app package
│ │ │ ├── engine/ # ScanEngine + NativeScanner
│ │ │ ├── services/ # GuardService, DnsVpnService, etc.
│ │ │ ├── accessibility/ # DynamicAnalysisService
│ │ │ ├── screen/ # ScreenCaptureService
│ │ │ ├── network/ # NetworkSecurityScanner/Monitor
│ │ │ ├── models/ # ML model interfaces
│ │ │ └── ui/ # Settings and UI
│ └── src/main/jniLibs/ # Compiled native .so files
├── hydradragonandroid/ # Native Rust engine
│ ├── src/ # Rust source
│ │ ├── jni_bridge.rs # JNI interface
│ │ ├── scanner.rs # Main scan orchestrator
│ │ ├── yara.rs # YARA-X integration
│ │ ├── clamav.rs # ClamAV integration
│ │ ├── tlsh.rs # TLSH fuzzy hashing
│ │ ├── ml.rs # ML anomaly detection
│ │ ├── url_scanner.rs # URL extraction + XOR filter check
│ │ └── emulation.rs # Unicorn CPU sandbox
│ └── Cargo.toml # Dependencies
├── hydradragonclamav/ # ClamAV bindings crate
├── hydradragonml/ # ML model crate
├── hydradragonextractor/ # Archive extraction crate
├── hydradragonxorfilter/ # XOR filter crate
├── yara-x/ # YARA-X rules directory
├── database/ # ClamAV signature databases
├── database_non_filtered/ # Unfiltered ClamAV databases
├── whitelist/ # NSRL whitelist data
├── allxfilter/ # URL XOR filters
├── allips/ # Malicious IP lists
└── *.py # Data pipeline scripts
The native Rust engine (libhydradragonandroid.so) communicates with Java via JNI.
| Crate | Purpose |
|---|---|
hydradragonandroid |
Main engine — JNI bridge, scan orchestration |
hydradragonclamav |
ClamAV libclamav Rust bindings |
hydradragonml |
MinHash/LSH + Isolation Forest + AIEngine |
hydradragonextractor |
Archive extraction (zip/gz/tar/xz/lzma/7z/rar) |
hydradragonxorfilter |
Binary-fuse XOR filter implementation |
cd hydradragonandroid
build-android.cmdOr with specific ABI:
build-android.cmd -Abi arm64-v8a- Add the rule to
yara-x/*.yar - Validate:
yara-x check yara-x/your_rule.yar - Rebuild the native engine and APK
After making changes to the yara-x fork (e.g. adding module functions), update the Cargo.lock in both dependent crates:
cd hydradragonclamav
cargo update
cd ../dev-tools/hydradragon_yara_x_compile
cargo updateThis pins the lock files to the latest commit without triggering a full rebuild. Use cargo update -p yara-x to update only the yara-x packages if preferred.
The Android app is a standard Gradle project targeting API 29+.
| Service | Type | Purpose |
|---|---|---|
GuardService |
Foreground Service | 24/7 monitoring and scan orchestration |
DynamicAnalysisService |
Accessibility Service | On-screen text scanning, clickjacking prevention |
ScreenCaptureService |
MediaProjection | Periodic screen OCR |
DnsVpnService |
VpnService | DNS filtering (Web Shield) |
-
cargo clippy -- -D warningsmust pass - Use
rustfmtfor formatting - JNI functions must follow the
Java_com_hydradragon_av_*naming convention - All unsafe blocks must have safety comments
- Follow Android AOSP style guidelines
- Use dependency injection where practical
- Services must handle lifecycle properly (particularly
VpnServiceandAccessibilityService)
./gradlew testcd hydradragonandroid && cargo test- Build debug APK and install on a physical device or emulator (Android 10+)
- Verify all permission flows
- Test scan with known EICAR/malware test files
- Test accessibility and VPN service toggles
- Architecture — System design
- Contributing — Contribution guidelines
- Quick-Start-Guide — Build instructions