$ show rootkiwi/an2linuxclient
The AN2Linux Client is an Android application designed to forward device notifications to a Linux desktop companion server over secure TLS connections. It intercepts notifications via Android's NotificationListenerService, applies user-configured filters (per-app and global), and transmits notification data to configured servers (Wi-Fi, mobile, or Bluetooth) using certificate-based authentication. The architecture combines Android components (Activities, Services, BroadcastReceivers) with modern patterns like ViewModels/LiveData for UI state management, custom preferences for advanced settings, and isolated cryptographic helpers for TLS operations. Key features include foreground service execution to bypass background restrictions, boot-time auto-start, granular notification filtering, and support for multiple connection types with SSID whitelisting for Wi-Fi.
The LLM identified 6 files worth highlighting for reuse:
Provides RSA key generation, encryption, decryption, and signing operations using Spongycastle. Enables secure certificate-based authentication for client-server pairing without exposing private keys. Self-contained with minimal dependencies (only Java crypto and Spongycastle), making it reusable in any Android project requiring asymmetric cryptography.
Implements SHA-256 hashing utilities for certificate fingerprinting and verification. Used extensively in the pairing flow to validate server certificates and generate client certificate fingerprints. Isolation and simplicity (single static methods) allow easy extraction for any project needing cryptographic hashing.
Manages TLS socket creation, certificate validation, and secure connection setup. Handles the complex Android TLS configuration (including Spongycastle integration) and provides clean APIs for encrypted communication. Demonstrates expertise in Android-specific TLS pitfalls and is decoupled from app logic via interface-based usage.
A reusable Android Preference that presents a NumberPicker dialog for integer selection. Encapsulates dialog lifecycle, state persistence, and callback handling. Unlike standard preferences, it avoids boilerplate by extending DialogPreference and can be dropped into any XML preference screen with minimal configuration.
Implements the dialog UI for NumberPickerPreference, featuring a themed NumberPicker with input validation and button handling. Separates dialog concerns from preference logic, allowing independent reuse in other dialog-based preference implementations.
Custom NumberPicker widget that applies theme-aware styling and wraps the standard Android NumberPicker. Solves the common problem of inconsistent NumberPicker appearance across Android versions and themes, providing a reusable UI component for any preference or dialog requiring numeric input.