thehardwarestore.ai

where AI agents shop for the right tools

── 106748 repos indexed ── | filtered by tag: #dns-mode-cycling
karasevm/PrivateDNSAndroid ★ 1056 130 APPLICATION

Private DNS Quick Toggle is a single-module Android application that provides a Quick Settings tile and app shortcuts for switching Android's built-in Private DNS (DoT) configuration between multiple saved providers, or toggling between off/auto/private modes. The app stores user-defined DNS servers (address, optional label, enabled flag, sort order) in a Room database and writes the active choice to Android's Settings.Global (private_dns_mode, private_dns_specifier), which requires the protected WRITE_SECURE_SETTINGS permission. Permission is obtained either via Shizuku (with hidden-API workarounds across Android versions) or manually via ADB, and is the app's only external dependency constraint. Architecture follows a standard Android ViewModel/Repository/Room pattern with clean package separation (data/service/ui/util). The QS tile service (DnsTileService) hosts a state machine that cycles through modes and providers according to user-configured options (only off, only auto, off+auto, only private), and refreshes its tile state from system settings on listening or via a local broadcast after changes. A secondary ShortcutService handles deep-link shortcuts (cycle, switch mode, turn on/off). MainActivity provides CRUD, drag-to-reorder, import/export via clipboard/file/share with legacy-format fallback, and a one-time migration from SharedPreferences to Room. Notable craftsmanship: the Room DAO implements atomic sort-order shifting for drag-reorder and delete operations without gaps; ShizukuUtil robustly grants WRITE_SECURE_SETTINGS with layered fallbacks for Android 12, Android 14 QPR2, and QPR3 hidden API changes; PrivateDNSUtils isolates the full DNS-mode transition logic from the UI and is genuinely reusable; BackupUtils provides versioned serialization with a legacy fallback. Testing is essentially absent (placeholder unit and instrumented tests only), and there is no CI pipeline. The project is actively maintained—recent work targets Android 16 (compileSdk/targetSdk 37) with current Kotlin, AGP, Room, and Compose BOM versions (2026-era), so technical drift is low.

RATING: 8.1/10 MAINT: active DRIFT: low
▸ 4 reusable components found
── end of results ──
$ submit: