Commit 1bfa133
authored
test: full ViewModel coverage, flow cancellation fixes, no-SIM state, lint cleanup (#37)
Tests (313 -> 363, all 30 features covered)
- DashboardViewModel: hardware list, last-used persistence, recent-alert cap
- WiFi, BLE, GPS, cell tower, tracker, rogue AP, deauth and signal logger
ViewModels: start/stop, auto-stop timers, error surfacing, alert-center
forwarding, dedup and reset paths
- CellTowerAnalyzer: SIM-absent and empty states
- core/testing/MainDispatcherRule for viewModelScope tests
Production fixes the tests and lint surfaced
- CellTowerAnalyzer and UltrasonicAnalyzer caught the collector's
cancellation inside their flow builders and emitted into a cancelled
flow ("flow exception transparency violated"). State is now built inside
the try and emitted outside it; cancellation is rethrown.
- Cell Tower screen explains when no serving cell can appear: new
CellTowerState.simAbsent (from TelephonyManager.simState) drives a
"No SIM card detected" card instead of an unexplained empty area.
- DeviceInfo is built via DeviceInfo.fromBuild() (null-safe) and provided
by Hilt, so DashboardViewModel no longer reads android.os.Build in a
constructor default that is null on the JVM.
- Signal Logger no longer counts every device in the first scan as "new".
Lint 149 -> 20 warnings
- String.format now passes Locale.US (28 sites)
- Dropped empty super.onCleared() calls (24 ViewModels)
- CellInfo.UNAVAILABLE inlined as a local constant for minSdk 26
- KTX: SharedPreferences.edit {}, createBitmap, Bitmap.set, toColorInt,
mutableIntStateOf
- Modifier is the first optional parameter on three composables
- Removed unused strings, colours and the unused ic_splash / mipmap
ic_notification bitmaps; mipmap-anydpi-v26 merged into mipmap-anydpi
- Removed the obsolete SDK 26 check, the redundant activity label and the
hardcoded /sdcard path
Remaining warnings are dependency version nudges, the branding vector
size, resource shrinking and identical round/regular launcher bitmaps.
Verified on Vivo V2036 (Android 13): splash, launcher icon, cell tower
no-SIM card, ultrasonic start/stop with no flow violations or crashes.
Claude-Session: https://claude.ai/code/session_011kW3RTWkhP74LwWy1UFbwt1 parent cc8e075 commit 1bfa133
73 files changed
Lines changed: 1163 additions & 172 deletions
File tree
- app/src
- main
- java/com/abhishek/zerodroid
- core
- di
- ui
- features
- ble
- domain
- ui
- viewmodel
- bluetooth_classic
- ui
- viewmodel
- bluetooth_tracker
- ui
- viewmodel
- camera
- domain
- viewmodel
- celltower
- domain
- ui
- viewmodel
- dashboard
- deauth_detector/viewmodel
- emf_mapper/viewmodel
- gps_spoof_detector/viewmodel
- gps
- ui
- viewmodel
- network_scanner/viewmodel
- nfc/ui
- privacy_score/viewmodel
- proximity_radar/viewmodel
- rf_bug_sweeper
- domain
- ui
- viewmodel
- rogue_ap_detector/viewmodel
- sdr/viewmodel
- sensors/viewmodel
- signal_logger/viewmodel
- ultrasonic
- domain
- viewmodel
- usbcamera/viewmodel
- uwb
- ui
- viewmodel
- wardriving/ui
- wifi_direct/viewmodel
- wifiaware/viewmodel
- wifi/viewmodel
- res
- drawable-hdpi
- drawable-mdpi
- drawable-xhdpi
- drawable-xxhdpi
- drawable-xxxhdpi
- mipmap-anydpi
- mipmap-hdpi
- mipmap-mdpi
- mipmap-xhdpi
- mipmap-xxhdpi
- mipmap-xxxhdpi
- values
- test/java/com/abhishek/zerodroid
- core/testing
- features
- ble/viewmodel
- bluetooth_tracker/viewmodel
- celltower
- domain
- viewmodel
- dashboard
- deauth_detector/viewmodel
- gps/viewmodel
- rogue_ap_detector/viewmodel
- signal_logger/viewmodel
- wifi/viewmodel
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 61 | + | |
65 | 62 | | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
241 | | - | |
| 242 | + | |
242 | 243 | | |
243 | 244 | | |
244 | 245 | | |
| |||
340 | 341 | | |
341 | 342 | | |
342 | 343 | | |
343 | | - | |
| 344 | + | |
344 | 345 | | |
345 | 346 | | |
346 | 347 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | 196 | | |
198 | 197 | | |
199 | 198 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | 63 | | |
65 | 64 | | |
66 | | - | |
| 65 | + | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
0 commit comments