$ show karasevm/PrivateDNSAndroid
PrivateDNSAndroid is a native Android application that provides a quick settings tile to toggle the system's Private DNS mode between off, automatic, and a user-defined hostname. It allows users to manage a list of DNS servers (add, edit, delete, reorder) stored in a Room database, and cycle through them via the tile or shortcuts. The app requires the WRITE_SECURE_SETTINGS permission, which can be granted via Shizuku or ADB. The architecture follows standard Android patterns: Activities, Services (TileService, ShortcutService), ViewModel, Repository, and Room DAO. The UI uses both traditional XML layouts and Jetpack Compose for dialogs. The codebase is well-structured, uses modern libraries (Kotlin Coroutines, Room, Compose, Material 3), and includes features like settings export/import and multi-language support. It is a focused, single-purpose utility app with clean separation of concerns.
The LLM identified 2 files worth highlighting for reuse:
This Room DAO implements a robust pattern for reordering items in a list using sortOrder columns. It provides moveUp and moveDown methods that atomically increment/decrement sort orders within a transaction, preventing gaps and conflicts. The pattern is reusable in any Android app that needs drag-and-drop reordering with Room, and demonstrates careful handling of concurrent modifications.
A Jetpack Compose dialog that explains how to grant the WRITE_SECURE_SETTINGS permission. It uses AnnotatedString with LinkAnnotation to embed clickable links within the text, providing a clean, accessible way to display instructions with external references. This pattern can be extracted and reused in any Android app that needs to show a permission explanation dialog with hyperlinks.