Skip to content

security: systematic resolution of 50+ findings (batch 1)#23

Merged
blankdotdev merged 2 commits into
mainfrom
security-fixes-batch-1
Feb 6, 2026
Merged

security: systematic resolution of 50+ findings (batch 1)#23
blankdotdev merged 2 commits into
mainfrom
security-fixes-batch-1

Conversation

@blankdotdev
Copy link
Copy Markdown
Owner

This PR addresses over 50 security and linting findings systematically.

  • Added scripts/security_fixer.py for batch analysis.
  • Resolved generic exceptions and magic numbers in WebViewActivity, SettingsUtils, and UrlCleaner.
  • Improved view clearing in SettingsPrivacyActivity and SettingsFrontendsActivity.
  • Added unit tests for URL validation.

Copy link
Copy Markdown

@github-advanced-security github-advanced-security AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mobsfscan found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

setupPlatformToggle(R.id.toggleRuralDictionaryMode, R.id.rural_dictionaryDomainContainer, SettingsActivity.KEY_RURAL_DICTIONARY_CLEAN_ONLY, "urbandictionary.com", R.id.btnRuralDictionaryClean, R.id.btnRuralDictionaryRedirect)
setupPlatformToggle(R.id.toggleRimgoMode, R.id.rimgoDomainContainer, SettingsActivity.KEY_RIMGO_CLEAN_ONLY, "imgur.com", R.id.btnRimgoClean, R.id.btnRimgoRedirect)
setupPlatformToggle(R.id.toggleGoogleMapsMode, R.id.googlemapsDomainContainer, SettingsActivity.KEY_GOOGLE_MAPS_CLEAN_ONLY, "google.com", R.id.btnGoogleMapsClean, R.id.btnGoogleMapsRedirect)
setupPlatformToggle(R.id.toggleTwitterMode, R.id.twitterDomainContainer, SettingsActivity.KEY_TWITTER_CLEAN_ONLY, "x.com", R.id.btnTwitterClean, R.id.btnTwitterRedirect, SettingsActivity.KEY_ALTERNATIVE_DOMAIN, SettingsActivity.DEFAULT_ALTERNATIVE_DOMAIN)

Check failure

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Error

Line detected, which is longer than the defined maximum line length in the code style.
setupPlatformToggle(R.id.toggleRimgoMode, R.id.rimgoDomainContainer, SettingsActivity.KEY_RIMGO_CLEAN_ONLY, "imgur.com", R.id.btnRimgoClean, R.id.btnRimgoRedirect)
setupPlatformToggle(R.id.toggleGoogleMapsMode, R.id.googlemapsDomainContainer, SettingsActivity.KEY_GOOGLE_MAPS_CLEAN_ONLY, "google.com", R.id.btnGoogleMapsClean, R.id.btnGoogleMapsRedirect)
setupPlatformToggle(R.id.toggleTwitterMode, R.id.twitterDomainContainer, SettingsActivity.KEY_TWITTER_CLEAN_ONLY, "x.com", R.id.btnTwitterClean, R.id.btnTwitterRedirect, SettingsActivity.KEY_ALTERNATIVE_DOMAIN, SettingsActivity.DEFAULT_ALTERNATIVE_DOMAIN)
setupPlatformToggle(R.id.toggleRedditMode, R.id.redditDomainContainer, SettingsActivity.KEY_REDDIT_CLEAN_ONLY, "reddit.com", R.id.btnRedditClean, R.id.btnRedditRedirect, SettingsActivity.KEY_REDDIT_DOMAIN, SettingsActivity.DEFAULT_REDDIT_DOMAIN)

Check failure

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Error

Line detected, which is longer than the defined maximum line length in the code style.
setupPlatformToggle(R.id.toggleGoogleMapsMode, R.id.googlemapsDomainContainer, SettingsActivity.KEY_GOOGLE_MAPS_CLEAN_ONLY, "google.com", R.id.btnGoogleMapsClean, R.id.btnGoogleMapsRedirect)
setupPlatformToggle(R.id.toggleTwitterMode, R.id.twitterDomainContainer, SettingsActivity.KEY_TWITTER_CLEAN_ONLY, "x.com", R.id.btnTwitterClean, R.id.btnTwitterRedirect, SettingsActivity.KEY_ALTERNATIVE_DOMAIN, SettingsActivity.DEFAULT_ALTERNATIVE_DOMAIN)
setupPlatformToggle(R.id.toggleRedditMode, R.id.redditDomainContainer, SettingsActivity.KEY_REDDIT_CLEAN_ONLY, "reddit.com", R.id.btnRedditClean, R.id.btnRedditRedirect, SettingsActivity.KEY_REDDIT_DOMAIN, SettingsActivity.DEFAULT_REDDIT_DOMAIN)
setupPlatformToggle(R.id.toggleYouTubeMode, R.id.youtubeDomainContainer, SettingsActivity.KEY_YOUTUBE_CLEAN_ONLY, "youtube.com", R.id.btnYouTubeClean, R.id.btnYouTubeRedirect, SettingsActivity.KEY_YOUTUBE_DOMAIN, SettingsActivity.DEFAULT_YOUTUBE_DOMAIN)

Check failure

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Error

Line detected, which is longer than the defined maximum line length in the code style.
setupPlatformToggle(R.id.toggleTwitterMode, R.id.twitterDomainContainer, SettingsActivity.KEY_TWITTER_CLEAN_ONLY, "x.com", R.id.btnTwitterClean, R.id.btnTwitterRedirect, SettingsActivity.KEY_ALTERNATIVE_DOMAIN, SettingsActivity.DEFAULT_ALTERNATIVE_DOMAIN)
setupPlatformToggle(R.id.toggleRedditMode, R.id.redditDomainContainer, SettingsActivity.KEY_REDDIT_CLEAN_ONLY, "reddit.com", R.id.btnRedditClean, R.id.btnRedditRedirect, SettingsActivity.KEY_REDDIT_DOMAIN, SettingsActivity.DEFAULT_REDDIT_DOMAIN)
setupPlatformToggle(R.id.toggleYouTubeMode, R.id.youtubeDomainContainer, SettingsActivity.KEY_YOUTUBE_CLEAN_ONLY, "youtube.com", R.id.btnYouTubeClean, R.id.btnYouTubeRedirect, SettingsActivity.KEY_YOUTUBE_DOMAIN, SettingsActivity.DEFAULT_YOUTUBE_DOMAIN)
setupPlatformToggle(R.id.toggleImdbMode, R.id.imdbDomainContainer, SettingsActivity.KEY_IMDB_CLEAN_ONLY, "imdb.com", R.id.btnImdbClean, R.id.btnImdbRedirect, SettingsActivity.KEY_IMDB_DOMAIN, SettingsActivity.DEFAULT_IMDB_DOMAIN)

Check failure

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Error

Line detected, which is longer than the defined maximum line length in the code style.
setupPlatformToggle(R.id.toggleRedditMode, R.id.redditDomainContainer, SettingsActivity.KEY_REDDIT_CLEAN_ONLY, "reddit.com", R.id.btnRedditClean, R.id.btnRedditRedirect, SettingsActivity.KEY_REDDIT_DOMAIN, SettingsActivity.DEFAULT_REDDIT_DOMAIN)
setupPlatformToggle(R.id.toggleYouTubeMode, R.id.youtubeDomainContainer, SettingsActivity.KEY_YOUTUBE_CLEAN_ONLY, "youtube.com", R.id.btnYouTubeClean, R.id.btnYouTubeRedirect, SettingsActivity.KEY_YOUTUBE_DOMAIN, SettingsActivity.DEFAULT_YOUTUBE_DOMAIN)
setupPlatformToggle(R.id.toggleImdbMode, R.id.imdbDomainContainer, SettingsActivity.KEY_IMDB_CLEAN_ONLY, "imdb.com", R.id.btnImdbClean, R.id.btnImdbRedirect, SettingsActivity.KEY_IMDB_DOMAIN, SettingsActivity.DEFAULT_IMDB_DOMAIN)
setupPlatformToggle(R.id.toggleMediumMode, R.id.mediumDomainContainer, SettingsActivity.KEY_MEDIUM_CLEAN_ONLY, "medium.com", R.id.btnMediumClean, R.id.btnMediumRedirect, SettingsActivity.KEY_MEDIUM_DOMAIN, SettingsActivity.DEFAULT_MEDIUM_DOMAIN)

Check failure

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Error

Line detected, which is longer than the defined maximum line length in the code style.
}
}
} catch (e: Exception) {}
} catch (e: Exception) {

Check failure

Code scanning / detekt

The caught exception is too generic. Prefer catching specific exceptions to the case that is currently handled. Error

The caught exception is too generic. Prefer catching specific exceptions to the case that is currently handled.
instance.health == "Healthy" || uptime >= 98f -> R.color.status_green_pastel to "●"
instance.health == "Issues" || uptime >= 85f -> R.color.status_yellow_pastel to "●"
instance.health == "Down" || uptime < 85f && instance.uptime != null -> R.color.status_red_pastel to "●"
instance.health == HEALTH_HEALTHY || uptime >= UPTIME_THRESHOLD_HEALTHY -> R.color.status_green_pastel to HEALTH_EMOJI

Check failure

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Error

Line detected, which is longer than the defined maximum line length in the code style.
instance.health == "Issues" || uptime >= 85f -> R.color.status_yellow_pastel to "●"
instance.health == "Down" || uptime < 85f && instance.uptime != null -> R.color.status_red_pastel to "●"
instance.health == HEALTH_HEALTHY || uptime >= UPTIME_THRESHOLD_HEALTHY -> R.color.status_green_pastel to HEALTH_EMOJI
instance.health == HEALTH_ISSUES || uptime >= UPTIME_THRESHOLD_ISSUES -> R.color.status_yellow_pastel to HEALTH_EMOJI

Check failure

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Error

Line detected, which is longer than the defined maximum line length in the code style.
instance.health == "Down" || uptime < 85f && instance.uptime != null -> R.color.status_red_pastel to "●"
instance.health == HEALTH_HEALTHY || uptime >= UPTIME_THRESHOLD_HEALTHY -> R.color.status_green_pastel to HEALTH_EMOJI
instance.health == HEALTH_ISSUES || uptime >= UPTIME_THRESHOLD_ISSUES -> R.color.status_yellow_pastel to HEALTH_EMOJI
instance.health == HEALTH_DOWN || uptime < UPTIME_THRESHOLD_ISSUES && instance.uptime != null -> R.color.status_red_pastel to HEALTH_EMOJI

Check failure

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Error

Line detected, which is longer than the defined maximum line length in the code style.
}

} catch (e: Exception) {}
} catch (e: Exception) {

Check failure

Code scanning / detekt

The caught exception is too generic. Prefer catching specific exceptions to the case that is currently handled. Error

The caught exception is too generic. Prefer catching specific exceptions to the case that is currently handled.
@blankdotdev blankdotdev merged commit 72386f2 into main Feb 6, 2026
3 of 5 checks passed
@blankdotdev blankdotdev deleted the security-fixes-batch-1 branch February 6, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants