Skip to content

Commit f3e0c7f

Browse files
committed
v6.2.0: Major release — encrypted DNS, content filtering, parental controls, threat intel, 7 new screens
v5.2: Expanded tracker DB (405 signatures), threat intel feeds (URLhaus, Spamhaus, ET), captive portal handling v6.0: NetworkTrackerDb (200+ domains), DNS-over-TLS, local DNS server, safe search, encrypted backups, DNS stamps, schedule presets, DNS benchmark v6.1: Per-app DNS rules, content filtering (12+ categories), proxy mode (no-VPN blocking), QR config sharing, parental controls (PIN lock), crash reporter, WebDAV sync, connection tracker, Vico charts, Glance widgets, Lottie animations v6.2: DNS-over-QUIC (RFC 9250), WireGuard DNS proxy, 7 new settings screens, TLS fingerprinting (JA3/JA4), release hardening audit (operator precedence fixes, OkHttp leak fixes, security patches), 52/52 roadmap items complete
1 parent ca7eda3 commit f3e0c7f

83 files changed

Lines changed: 14069 additions & 402 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 143 additions & 27 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# HostShield
22

3-
![Version](https://img.shields.io/badge/version-5.0.0-blue)
3+
![Version](https://img.shields.io/badge/version-6.2.0-blue)
44
![License](https://img.shields.io/badge/license-GPL--3.0-green)
55
![Platform](https://img.shields.io/badge/platform-Android%208+-3DDC84?logo=android&logoColor=white)
66
![Kotlin](https://img.shields.io/badge/Kotlin-2.0-7F52FF?logo=kotlin&logoColor=white)
@@ -74,6 +74,9 @@
7474
| Feature | Description |
7575
|---------|-------------|
7676
| **DNS-over-HTTPS (DoH)** | RFC 8484 POST+GET. Cloudflare, Google, Quad9, NextDNS, AdGuard, Mullvad, CleanBrowsing |
77+
| **DNS-over-TLS (DoT)** | RFC 7858, TLSv1.3, SNI + hostname verification. Cloudflare, Google, Quad9, AdGuard |
78+
| **DNS-over-QUIC (DoQ)** | RFC 9250, QUIC Initial framing. AdGuard, NextDNS, Mullvad. Falls back to DoT |
79+
| **DNS-over-WireGuard** | Noise_IKpsk2 handshake, AES-256-GCM transport encryption. DNS-only WireGuard tunnel |
7780
| **Certificate Pinning** | SHA-256 pin validation per provider, unpinned fallback as last resort |
7881
| **Smart Latency Failover** | EMA-based latency tracking per provider, auto-selects fastest, falls back through all on failure |
7982
| **DNS Trap** | Routes hardcoded DNS IPs (8.8.8.8, 1.1.1.1, etc.) through VPN tunnel to prevent bypass |
@@ -154,14 +157,25 @@
154157
|---------|-------------|
155158
| **AMOLED Dark Theme** | Material 3 dark UI optimized for OLED displays |
156159
| **6 Accent Colors** | Teal, Blue, Purple, Green, Pink, Peach |
157-
| **24+ Screens** | Home, Sources, Rules, Stats, Settings, Logs, Apps, AppPrivacy, AppLogs, Firewall, ConnectionLog, DnsTools, NetworkStats, OverlapAnalysis, DnsLeakTest, RuleTest, HostsEditor, HostsDiff, AppExclusions, Onboarding, BlocklistGallery, AutomationAudit |
160+
| **31+ Screens** | Home, Sources, Rules, Stats, Settings, Logs, Apps, AppPrivacy, AppLogs, Firewall, ConnectionLog, DnsTools, NetworkStats, OverlapAnalysis, DnsLeakTest, RuleTest, HostsEditor, HostsDiff, AppExclusions, Onboarding, BlocklistGallery, AutomationAudit, ContentFilter, ParentalControls, DnsBenchmark, WebDavSync, CrashReports, QrConfig, TlsFingerprints |
158161
| **Home Dashboard** | Shield status, live query rate, cache hit rate, latency sparkline, top queried apps, category toggles, search history chips |
159162
| **Widgets** | Toggle widget + stats widget (blocked count, queries, block rate) |
160163
| **Quick Settings Tile** | VPN toggle from Quick Settings panel |
161164
| **App Shortcuts** | Long-press launcher: Toggle, Refresh Lists, Open Logs |
162165
| **Deep Links** | `hostshield://logs`, `hostshield://stats`, etc. |
163166
| **Onboarding Wizard** | Private DNS conflict detection, VPN permission, battery optimization |
164167

168+
### Content Filtering & Parental Controls
169+
170+
| Feature | Description |
171+
|---------|-------------|
172+
| **15 Content Categories** | Gaming, Streaming, Social Media, News, Shopping, Dating, Gambling, Adult, VPN/Proxy, Malware, and more — toggleable per category |
173+
| **Parental Controls** | 3 age profiles (Child, Teen, Adult) with automatic category blocking per profile |
174+
| **PIN Lock** | SHA-256 hashed PIN protects parental control settings from bypass |
175+
| **Local DNS Server** | "Portable Pi-hole" mode on port 5353 — other LAN devices can use phone as DNS filter |
176+
| **DNS Proxy Mode** | No-VPN, no-root DNS blocking via local proxy (tri-mode: VPN / Root / Proxy) |
177+
| **Safe Search Enforcement** | DNS-level rewriting for Google, Bing, DuckDuckGo, YouTube |
178+
165179
### Import, Export & Backup
166180

167181
| Feature | Description |
@@ -247,7 +261,7 @@ All actions are rate-limited (5s cooldown per action per caller) and logged to t
247261
| Language | Kotlin 2.0 |
248262
| UI | Jetpack Compose + Material 3 |
249263
| DI | Hilt (Dagger) |
250-
| Database | Room (10 tables, 9 migrations) |
264+
| Database | Room (11 tables, 12 migrations) |
251265
| Preferences | DataStore |
252266
| Async | Coroutines + Flow, ViewModels + StateFlow |
253267
| Networking | OkHttp 4 (source downloads, DoH resolver) |
@@ -262,8 +276,8 @@ All actions are rate-limited (5s cooldown per action per caller) and logged to t
262276
```
263277
app/src/main/java/com/hostshield/
264278
├── data/
265-
│ ├── database/ # Room DB, DAOs, converters, migrations (v1-v9)
266-
│ ├── model/ # Entities (10 tables), enums
279+
│ ├── database/ # Room DB, DAOs, converters, migrations (v1-v12)
280+
│ ├── model/ # Entities (11 tables), enums
267281
│ ├── preferences/ # DataStore preferences (AppPreferences)
268282
│ ├── repository/ # HostShieldRepository
269283
│ └── source/ # SourceDownloader
@@ -273,32 +287,51 @@ app/src/main/java/com/hostshield/
273287
│ └── parser/
274288
│ └── HostsParser.kt # Hosts file parser with wildcard support
275289
├── service/
276-
│ ├── DnsVpnService.kt # VPN packet loop (~2000 lines)
290+
│ ├── DnsVpnService.kt # VPN packet loop (~2700 lines)
277291
│ ├── DnsCache.kt # LRU + serve-stale + prefetch + negative/failure cache
278292
│ ├── DnsPacketBuilder.kt # DNS wire format builder/parser
279293
│ ├── DohResolver.kt # DoH with smart latency failover
294+
│ ├── DotResolver.kt # DoT (RFC 7858, TLSv1.3, 4 providers)
295+
│ ├── DoqResolver.kt # DoQ (RFC 9250, QUIC Initial, 3 providers)
296+
│ ├── WireGuardProxy.kt # DNS-over-WireGuard (Noise_IKpsk2, AES-256-GCM)
280297
│ ├── CnameCloakDetector.kt # CNAME + SVCB/HTTPS cloak detection
281298
│ ├── CnameCloakUpdater.kt # Remote CNAME cloak DB fetcher (AdGuard + NextDNS)
282299
│ ├── DohBypassUpdater.kt # Remote DoH bypass list fetcher
283300
│ ├── RootDnsService.kt # Root-mode DNS proxy
284301
│ ├── RootDnsLogger.kt # Root-mode DNS logging with UID attribution
285302
│ ├── IptablesManager.kt # Per-app firewall rule management
286-
│ ├── DnsCache.kt # DNS response cache with RFC 8767/2308/9520
303+
│ ├── LocalDnsServer.kt # LAN DNS server on port 5353
304+
│ ├── DnsProxyService.kt # No-VPN proxy mode DNS blocking
305+
│ ├── ContentFilterManager.kt # 15 content filter categories
306+
│ ├── ParentalControlManager.kt # Age-profile parental controls + PIN
307+
│ ├── AppDnsRuleEngine.kt # Per-app domain DNS rules
308+
│ ├── ConnectionTracker.kt # Real-time per-app connection tracking
309+
│ ├── ThreatIntelManager.kt # Threat intel feeds + radix trie IP lookup
310+
│ ├── SafeSearchEnforcer.kt # DNS-level safe search rewriting
287311
│ ├── NetworkStatsTracker.kt
288312
│ ├── AutomationReceiver.kt # Broadcast intent API
289313
│ ├── ScreenStateReceiver.kt # Context-aware firewall state
290314
│ └── *Worker.kt # HostsUpdate, AutoBackup, LogCleanup, etc.
291315
├── ui/
292316
│ ├── navigation/ # Compose navigation graph
293-
│ ├── screens/ # 24+ screens (Home, Logs, Stats, Settings, Firewall, ...)
317+
│ ├── screens/ # 31+ screens (Home, Logs, Stats, Settings, Firewall, ...)
318+
│ ├── components/ # Vico charts, Lottie animations, animated log feed
319+
│ ├── widget/ # Glance widgets (toggle + stats)
294320
│ └── theme/ # Material 3 theme + accent colors
295321
└── util/
296322
├── OfflineGeoIp.kt # MaxMind GeoLite2 offline lookups
297323
├── GeoIpLookup.kt # ip-api.com online lookups (legacy)
298324
├── TrackerSignatureDb.kt # Exodus-style APK tracker scanner
325+
├── TlsFingerprinter.kt # JA3/JA4 TLS ClientHello fingerprinting
299326
├── AppPrivacyScorer.kt # Per-app A-F privacy grades
300327
├── ImportExportUtil.kt # Multi-format import/export
328+
├── EncryptedBackup.kt # AES-256-GCM encrypted backups
301329
├── BackupRestoreUtil.kt # Backup/restore to app storage
330+
├── WebDavSync.kt # WebDAV cloud sync
331+
├── QrConfigSharing.kt # QR code config sharing (GZIP+Base64)
332+
├── CrashReporter.kt # Custom crash reporting
333+
├── DnsBenchmark.kt # DNS resolver latency benchmark
334+
├── DnsStampParser.kt # sdns:// DNS stamp parser
302335
├── DiagnosticExporter.kt # One-tap diagnostic report
303336
├── PcapExporter.kt # PCAP packet capture export
304337
└── RootUtil.kt # Root detection + binary management
@@ -335,6 +368,9 @@ VPN mode: ~1-3% battery/day (all traffic routed through local TUN interface). Ro
335368

336369
| Version | Highlights |
337370
|---------|-----------|
371+
| **6.2.0** | DoQ resolver (RFC 9250), WireGuard DNS proxy, 7 new UI screens, ConnectionTracker + TlsFingerprinter wired in. **Release hardening audit**: fixed ~60 operator precedence bugs in DNS wire format parsing across 6 files, WireGuard encryption failure no longer leaks plaintext, OkHttp response leaks fixed in 8 files, shell command injection prevention in root mode, CoroutineScope lifecycle fix in LocalDnsServer, private IP range validation fix, Compose crash safety, ProGuard rules for all new classes. **52/52 roadmap items complete** |
372+
| **6.1.0** | Per-app DNS rules, content filtering (15 categories), proxy mode, QR config sharing, parental controls, crash reporter, WebDAV sync, connection tracker, Vico charts, Lottie animations, Glance widgets |
373+
| **6.0.0** | Threat intel integration, NetworkTrackerDb, Safe Search enforcement, DNS benchmark, local DNS server, DoT resolver, encrypted backups, DNS stamps, schedule presets |
338374
| **5.0.0** | Serve-stale DNS (RFC 8767), SERVFAIL caching (RFC 9520), cache prefetching, hash set fast path (~2x), filter decision LRU cache, CNAME cloak databases (AdGuard+NextDNS), SVCB/HTTPS record parsing, offline GeoIP (MaxMind GeoLite2), configurable TTL caps |
339375
| 4.6.0 | DNS latency sparkline, source summary stats, search history persistence |
340376
| 4.5.0 | Query type distribution chart, per-app DNS log drill-down, permanent block/allow in log detail |

app/app/build.gradle.kts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// HostShield v5.0.0
1+
// HostShield v6.2.0
22
plugins {
33
id("com.android.application")
44
id("org.jetbrains.kotlin.android")
@@ -15,8 +15,8 @@ android {
1515
applicationId = "com.hostshield"
1616
minSdk = 26
1717
targetSdk = 35
18-
versionCode = 49
19-
versionName = "5.0.0"
18+
versionCode = 55
19+
versionName = "6.2.0"
2020

2121
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2222

@@ -145,9 +145,25 @@ dependencies {
145145
// DataStore for preferences
146146
implementation("androidx.datastore:datastore-preferences:1.1.1")
147147

148+
// Custom Tabs (captive portal login)
149+
implementation("androidx.browser:browser:1.8.0")
150+
148151
// Splash screen
149152
implementation("androidx.core:core-splashscreen:1.0.1")
150153

154+
// v6.1: Vico chart library (Roadmap #26)
155+
implementation("com.patrykandpatrick.vico:compose-m3:2.0.1")
156+
157+
// v6.1: Lottie animations (Roadmap #27)
158+
implementation("com.airbnb.android:lottie-compose:6.6.2")
159+
160+
// v6.1: Jetpack Glance widgets (Roadmap #29)
161+
implementation("androidx.glance:glance-appwidget:1.1.1")
162+
implementation("androidx.glance:glance-material3:1.1.1")
163+
164+
// v6.2: QR code generation for config sharing (Roadmap #38)
165+
implementation("com.google.zxing:core:3.5.3")
166+
151167
// v5.0: MaxMind GeoIP2 for offline GeoIP lookups (replaces ip-api.com rate-limited API)
152168
// Bundled GeoLite2-Country.mmdb (~6MB) + GeoLite2-ASN.mmdb (~8MB)
153169
implementation("com.maxmind.geoip2:geoip2:4.2.1")

app/app/proguard-rules.pro

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
# ── Services ──────────────────────────────────────────────────
5858
-keep class com.hostshield.service.DnsVpnService { *; }
5959
-keep class com.hostshield.service.RootDnsService { *; }
60+
-keep class com.hostshield.service.DnsProxyService { *; }
6061
-keep class com.hostshield.service.HostShieldTileService { *; }
6162
-keep class com.hostshield.service.DnsPacketBuilder { *; }
6263
-keep class com.hostshield.service.DnsCache { *; }
@@ -66,20 +67,36 @@
6667
-keep class com.hostshield.service.CnameCloakDetector$CnameResult { *; }
6768
-keep class com.hostshield.service.DohBypassUpdater { *; }
6869
-keep class com.hostshield.service.DohResolver { *; }
70+
-keep class com.hostshield.service.LocalDnsServer { *; }
71+
-keep class com.hostshield.service.DotResolver { *; }
72+
-keep class com.hostshield.service.DotResolver$** { *; }
6973
-keep class com.hostshield.service.IptablesManager { *; }
7074
-keep class com.hostshield.service.IptablesBinaryManager { *; }
7175
-keep class com.hostshield.util.DiagnosticExporter { *; }
7276
-keep class com.hostshield.util.TrackerSignatureDb { *; }
7377
-keep class com.hostshield.util.GeoIpLookup { *; }
7478
-keep class com.hostshield.util.GeoIpLookup$** { *; }
7579
-keep class com.hostshield.util.TrackerSignatureDb$** { *; }
80+
-keep class com.hostshield.util.NetworkTrackerDb { *; }
81+
-keep class com.hostshield.util.NetworkTrackerDb$** { *; }
7682
-keep class com.hostshield.service.ContextState { *; }
7783

7884
# ── v5.0: New classes ──────────────────────────────────────
7985
-keep class com.hostshield.service.CnameCloakUpdater { *; }
8086
-keep class com.hostshield.service.DnsCache$CacheResult { *; }
87+
-keep class com.hostshield.service.DnsDiskCache { *; }
88+
-keep class com.hostshield.service.DnsDiskCache$** { *; }
8189
-keep class com.hostshield.util.OfflineGeoIp { *; }
8290
-keep class com.hostshield.util.OfflineGeoIp$** { *; }
91+
-keep class com.hostshield.util.DnsBenchmark { *; }
92+
-keep class com.hostshield.util.DnsBenchmark$** { *; }
93+
94+
# ── v5.2: Captive portal + Threat Intel ──────────────────
95+
-keep class com.hostshield.service.CaptivePortalHandler { *; }
96+
-keep class com.hostshield.service.ThreatIntelManager { *; }
97+
-keep class com.hostshield.service.ThreatIntelManager$** { *; }
98+
-keep class com.hostshield.service.ThreatIntelWorker { *; }
99+
-keep class com.hostshield.service.SafeSearchEnforcer { *; }
83100

84101
# ── v5.0: MaxMind GeoIP2 ──────────────────────────────────
85102
-dontwarn com.maxmind.**
@@ -112,3 +129,64 @@
112129
-keepattributes EnclosingMethod
113130
-keepattributes SourceFile,LineNumberTable
114131
-renamesourcefileattribute SourceFile
132+
133+
# ── v5.x: Encrypted Backup (Roadmap #36) ────────────────────
134+
-keep class com.hostshield.util.EncryptedBackup { *; }
135+
136+
# ── v1.7.0: Named Schedule Presets (Roadmap #35) ────────────
137+
-keep class com.hostshield.util.SchedulePresets { *; }
138+
-keep class com.hostshield.util.SchedulePresets$** { *; }
139+
-keep class com.hostshield.util.SchedulePreset { *; }
140+
141+
# ── v5.x: DNS Stamp Parser (Roadmap #42) ─────────────────────
142+
-keep class com.hostshield.util.DnsStampParser { *; }
143+
-keep class com.hostshield.util.DnsStampParser$** { *; }
144+
145+
# ── v5.x: QR Config Sharing (Roadmap #38) ────────────────────
146+
-keep class com.hostshield.util.QrConfigSharing { *; }
147+
-keep class com.hostshield.util.ShareableConfig { *; }
148+
-keep class com.hostshield.util.RuleEntry { *; }
149+
150+
# ── v6.1: Domain-per-app DNS rules (Roadmap #12) ─────────────
151+
-keep class com.hostshield.service.AppDnsRuleEngine { *; }
152+
-keep class com.hostshield.service.AppDnsRuleEngine$** { *; }
153+
-keep class com.hostshield.data.model.AppDnsRule { *; }
154+
155+
# ── v6.1: Content Filter Categories (Roadmap #40) ────────────
156+
-keep class com.hostshield.service.ContentFilterManager { *; }
157+
-keep class com.hostshield.service.ContentFilterManager$** { *; }
158+
-keep enum com.hostshield.service.ContentCategory { *; }
159+
160+
# ── v6.1: Parental Controls (Roadmap #48) ──────────────────
161+
-keep class com.hostshield.service.ParentalControlManager { *; }
162+
-keep class com.hostshield.service.ParentalControlManager$** { *; }
163+
164+
# ── v6.1: TLS Fingerprinting (Roadmap #47) ─────────────────
165+
-keep class com.hostshield.util.TlsFingerprinter { *; }
166+
-keep class com.hostshield.util.TlsFingerprinter$** { *; }
167+
168+
# ── v6.1: Crash Reporter (Roadmap #39) ─────────────────────
169+
-keep class com.hostshield.util.CrashReporter { *; }
170+
-keep class com.hostshield.util.CrashReporter$** { *; }
171+
172+
# ── v6.1: Connection Tracker (Roadmap #46) ─────────────────
173+
-keep class com.hostshield.service.ConnectionTracker { *; }
174+
-keep class com.hostshield.service.ConnectionTracker$** { *; }
175+
176+
# ── v6.1: WebDAV Cloud Sync (Roadmap #37) ──────────────────
177+
-keep class com.hostshield.util.WebDavSync { *; }
178+
-keep class com.hostshield.util.WebDavSync$** { *; }
179+
180+
# ── v6.2: DoQ + WireGuard (Roadmap #45, #51) ────────────────
181+
-keep class com.hostshield.service.DoqResolver { *; }
182+
-keep class com.hostshield.service.DoqResolver$** { *; }
183+
-keep class com.hostshield.service.WireGuardProxy { *; }
184+
-keep class com.hostshield.service.WireGuardProxy$** { *; }
185+
186+
# ── v6.2: NflogReader + RootDnsLogger ───────────────────────
187+
-keep class com.hostshield.service.NflogReader { *; }
188+
-keep class com.hostshield.service.NflogReader$** { *; }
189+
-keep class com.hostshield.service.RootDnsLogger { *; }
190+
-keep class com.hostshield.service.RootDnsLogger$** { *; }
191+
-keep class com.hostshield.service.BlockNotificationService { *; }
192+
-keep class com.hostshield.service.BlockingScheduleWorker { *; }

app/app/src/main/AndroidManifest.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@
7373
android:value="Root-mode DNS interception proxy for ad and tracker blocking" />
7474
</service>
7575

76+
<service
77+
android:name=".service.DnsProxyService"
78+
android:exported="false"
79+
android:foregroundServiceType="specialUse">
80+
<property
81+
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
82+
android:value="Local DNS proxy for ad and tracker blocking without VPN or root" />
83+
</service>
84+
7685
<receiver
7786
android:name=".service.BootReceiver"
7887
android:exported="true"

app/app/src/main/java/com/hostshield/HostShieldApp.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.app.Application
44
import androidx.hilt.work.HiltWorkerFactory
55
import androidx.work.Configuration
66
import com.hostshield.service.CnameCloakUpdater
7+
import com.hostshield.service.ThreatIntelWorker
78
import com.hostshield.util.OfflineGeoIp
89
import com.topjohnwu.superuser.Shell
910
import dagger.hilt.android.HiltAndroidApp
@@ -27,6 +28,10 @@ class HostShieldApp : Application(), Configuration.Provider {
2728
// v5.0: Non-blocking startup initialization
2829
appScope.launch { cnameCloakUpdater.loadCached() }
2930
appScope.launch { offlineGeoIp.initialize() }
31+
32+
// v6.0: Schedule daily threat intelligence feed updates
33+
try { ThreatIntelWorker.schedule(this) }
34+
catch (e: Exception) { android.util.Log.w("HostShieldApp", "WorkManager scheduling failed: ${e.message}") }
3035
}
3136

3237
override val workManagerConfiguration: Configuration

0 commit comments

Comments
 (0)