Skip to content

Installation Setup

Emirhan Uçan edited this page Aug 2, 2026 · 6 revisions

Installation & Setup

Detailed guide for building and installing HydraDragonAV Mobile from source.

Prerequisites

Android SDK & Build Tools

Tool Version Notes
Android Studio Hedgehog+ Recommended for SDK/NDK management
SDK Platform API 26+ Android 8.0 Oreo or newer
NDK 25+ Required for Rust cross-compilation
Build Tools 34+ Gradle build system

Rust Toolchain

Install Rust via rustup, then add Android targets:

rustup target add aarch64-linux-android
rustup target add armv7-linux-androideabi
rustup target add x86_64-linux-android
rustup target add i686-linux-android

Install cargo-ndk:

cargo install cargo-ndk

Environment Variables

Set the following environment variables (or let build-android.ps1 auto-detect via %LOCALAPPDATA%\Android\Sdk):

set ANDROID_NDK_HOME=%LOCALAPPDATA%\Android\Sdk\ndk\26.1.10909125
set ANDROID_HOME=%LOCALAPPDATA%\Android\Sdk
set ANDROID_SDK_ROOT=%LOCALAPPDATA%\Android\Sdk

Building

Step 1: Build the Native Engine

cd hydradragonandroid
build-android.cmd

The build script:

  1. Verifies NDK installation
  2. Adds Rust Android targets (if missing)
  3. Installs cargo-ndk (if missing)
  4. Builds libhydradragonandroid.so for all 4 ABIs
  5. Copies output to app/src/main/jniLibs/

For individual ABI builds:

build-android.cmd -Abi arm64-v8a

Step 2: Build the APK

./gradlew assembleDebug

For a release build:

./gradlew assembleRelease

The signed APK will be at app/build/outputs/apk/.

Step 3: Install on Device

adb install -r app/build/outputs/apk/debug/app-debug.apk

Data Pipeline (Offline)

Detection assets must be generated offline from public sources before the app can operate with full detection coverage:

# NSRL whitelist (SQLite)
python gen_whitelist_packages.py

# NSRL whitelist (binary-fuse XOR filter)
python gen_whitelist_apk.py

# Malicious IP lists
python gen_ip_lists.py

# URL/domain XOR filters
python build_url_xfilter.py

# ClamAV Android filtering
python clam_juice.py --directory database_non_filtered --output database_filtered --profile cross-platform

See Data-Pipeline for full details.

Troubleshooting Build Issues

Issue Solution
cargo-ndk not found Run cargo install cargo-ndk
NDK path not detected Set ANDROID_NDK_HOME explicitly
Rust Android target missing Run rustup target add <target>
Gradle build fails on long paths Enable Windows long paths (git config --global core.longpaths true)
Missing libhydradragonandroid.so Ensure Rust engine built before Gradle build
SDK not found Set ANDROID_HOME to SDK path

See Also

Clone this wiki locally