Skip to content

About

Rust rewrite of DSU-Sideloader — install GSIs via DSU on Android

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

DSU Sideloader (Rust)

Fork of VegaBobo/DSU-Sideloader with the main architecture rewritten in Rust.

What is this?

Install and manage Android GSIs via DSU (Dynamic System Updates) — bootable GSIs without modifying your system partition.

Original app (Kotlin/Compose) is in app/ for reference. The Rust core lives in dsu-core/.

Architecture

dsu-core/              ← Rust workspace crate
├── src/
│   ├── lib.rs         ← Library root (4 modules)
│   ├── image.rs       ← Pure Rust decompression (gz/xz/zip — no C .so)
│   ├── privileged.rs  ← Root / ADB / Shell privilege escalation
│   ├── dsu.rs         ← DSU install/status/remove/reboot logic
│   ├── logcat.rs      ← Installation progress tracking via logcat
│   ├── cli.rs         ← CLI arg parsing and command dispatch
│   └── bin/dsu.rs     ← Binary entrypoint
app/                   ← Original Kotlin/Compose code (reference)

Key design decisions

  • No C libraries. All decompression uses pure Rust crates:
    • flate2 with rust_backend for gzip
    • lzma-rs for xz
    • zip (pure Rust) for DSU zip packages
  • Privilege auto-detect. Detects Root → ADB → Shell in priority order
  • Thread-safe progress reporting. Installation runs in background thread, reports via mpsc channel
  • CLI-first. Designed for Termux use; JNI bindings optional for Android app shell

CLI Usage

# Build
cd dsu-core && cargo build --release
# Binary at: dsu-core/target/release/dsu

# Check status
dsu status

# Install a GSI
dsu install ~/Downloads/lineage-21.0-20240101-arm64_bvN.img.xz

# Install with custom userdata size
dsu install --userdata-mb 8192 ~/Downloads/system.img.gz

# Update (preserve userdata)
dsu install --preserve ~/Downloads/new-system.img.xz

# Remove DSU
dsu remove

# Boot into DSU
dsu boot

# Revert to original system
dsu revert

# Enable/disable sticky mode
dsu enable
dsu disable

# Check max userdata size
dsu userdata-size

# Force specific privilege mode
dsu --mode root status
dsu --mode adb install image.xz

Building for Android

# On Termux:
pkg install rust
cd dsu-core
cargo build --release

# Cross-compile for other targets:
# armv7-linux-androideabi
# aarch64-linux-android
# x86_64-linux-android
# i686-linux-android
cargo build --target aarch64-linux-android --release

Status

  • Image decompression (gz, xz, zip — pure Rust)
  • Privilege escalation (Root, ADB, Shell)
  • DSU install / status / remove / reboot
  • CLI tool with progress tracking
  • JNI bridge for Android app shell
  • Shizuku mode support
  • Hidden API bypass
  • F-Droid release

License

GPL-3.0 (same as original)

About

Rust rewrite of DSU-Sideloader — install GSIs via DSU on Android

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages