Releases: ShubhamJ010/ScreenshotJanitor
Releases · ShubhamJ010/ScreenshotJanitor
Release v0.4.2-alpha
Fixed
- Cold-start screenshot detection race — Complete rewrite of
ScreenshotContentObserverto handle MediaStore cold-start indexing delay on fresh app process:- Extended URI-based retry window from 1.5s to ~10.3s with exponential backoff (200ms → 2s × 3) so MediaStore has time to populate
DISPLAY_NAMEandRELATIVE_PATHcolumns on first launch - Added
IS_PENDINGcolumn check — skips rows that MediaStore has not finished writing, returningfalsefor retry instead of giving up - Added blank column detection — returns
falsefor retry whendisplayNameorrelativePathare empty (the root cause: old code returnedtrueand marked the URI as processed before columns were populated) - Added
performInitialScan()— scans the last 30 seconds of MediaStore immediately after observer registration to catch screenshots taken during the app startup window - Added
scanLatestScreenshots()fallback — scans the last 60 seconds of MediaStore when URI-based retries are exhausted (handles edge cases whereonChangefires before MediaStore creates the row at all) - Null/parse-error
onChangeURI now falls back to scanning recent images instead of silently dropping the event handleNewScreenshotconverted from fire-and-forget coroutine tosuspendfunction so callers wait for DB insert + notification before marking the URI as processed- Dedup set capped at 200 entries with oldest-25% eviction to prevent unbounded memory growth
- Extended URI-based retry window from 1.5s to ~10.3s with exponential backoff (200ms → 2s × 3) so MediaStore has time to populate
Changed
ScreenshotDetector.startDetector()now callsperformInitialScan()on the observer right after registration
Release v0.4.1-alpha
Changed
- Extracted battery optimization opt-out from
PermissionWarningCardinto its own dedicated card with standalone "Battery Usage" button PermissionWarningCard— simplified to only handle storage, notification, and all-files-access permissions
Removed
- Auto-start permission request flow (removed
onRequestAutoStartcallback andAutoStartUtildependency from HomeScreen)
Fixed
ScreenshotContentObserver.onChangereturn value — returnstrueonly when a screenshot is actually detected,falseotherwise (prevented false-positive triggering of downstream handlers)
Release v0.4.0-alpha
Added
- URI-based screenshot detection in
ScreenshotContentObserver(query by content URI ID instead of scanning latest) - Deduplication with synchronized
processedUris/pendingUrissets to prevent duplicate processing - Retry logic with
queryByIdWithRetry(3 attempts with 500ms delay) to handle MediaStore index race clearProcessedUris()lifecycle hook called after cleanup work completesgoAsync()/pendingResult.finish()pattern inBootReceiverandNotificationActionReceiverfor proper BroadcastReceiver lifecyclecontentObserverreference onSsJanitorAppto enable cleanup worker to reset dedup statenotificationManagerlifecycle management inScreenshotDetectionService(dismiss on destroy)REQUEST_IGNORE_BATTERY_OPTIMIZATIONSpermission declaration for battery optimization opt-out- Battery optimization check with re-evaluation on lifecycle resume
AutoStartUtil— OEM-specific auto-start settings intents (Xiaomi, Huawei, OPPO, vivo, OnePlus, Samsung)EmptyStateViewsubtitle parameter for multi-line empty state messages
Changed
- Switched
SsJanitorAppdatabase/repository/settings fromlateinittoby lazyfor thread-safe initialization - Refactored
ScreenshotDetectionService.onCreate()to start foreground inonCreate(moved out of helper method) - Simplified
ScreenshotCleanupWorker— removed deadautoDelete = truebranch; always deletes archived screenshots - Shared single
CoroutineScope(Dispatchers.IO)inScreenshotContentObserverinstead of creating per-screenshot scopes BootReceiverexportedattribute set totruefor reliableBOOT_COMPLETEDdelivery on modern Android- Permission warning card now includes "No Kill" and "Auto Start" action buttons
- Empty state message split into separate lines with kept count subtitle
- Animated stats grid entrance and extracted auto-archive badge
- Tracked file size for screenshots with freed-up bytes display
Removed
- All
Log.d/Log.e/Log.wstatements across the codebase (production code cleanup) ScreenshotDetectorstale-run guard log messages
Fixed
ContentUris.parseId()crash path — wrapped in try/catch forNumberFormatExceptionqueryByIdWithRetry— fixed to 3 total attempts (was 4 due to fallthrough)BootReceiver— missinggoAsync()which could cause ANR on bootNotificationActionReceiver— missinggoAsync()which could cause ANR
Release v0.3.1-alpha
Service: Implement background screenshot detection
Release v0.3.0-alpha
AVD: Update scale to 2.15 and align lid pivot
Release v0.2.0-alpha
v0.2.0-alpha
Release v0.1.0-alpha
Add Gradle caching to speed up build