Skip to content

Address PR #76 review feedback: test assertions, unused vars, shared SHA-256 utility, label fix#79

Merged
muhammad7865 merged 2 commits intoPermission_Analyzerfrom
copilot/sub-pr-76-again
Mar 14, 2026
Merged

Address PR #76 review feedback: test assertions, unused vars, shared SHA-256 utility, label fix#79
muhammad7865 merged 2 commits intoPermission_Analyzerfrom
copilot/sub-pr-76-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 14, 2026

Applies all review comments from the Permission Analyzer PR (#76) — covering test quality, misleading labels, unused destructured variables, duplicated hashing logic, and inaccurate migration docs.

Changes

Shared SHA-256 utility

  • Extracted HashUtils.sha256Hex(String) into core/security/HashUtils.kt
  • Removed duplicate private sha256() from both MalwareRepositoryImpl and PermissionRepositoryImpl
// Before: identical private helpers in two repos
private fun sha256(input: String): String { ... }

// After: single canonical utility
HashUtils.sha256Hex(app.packageName)

PermissionRepositoryImpl

  • Destructured unused riskScore with _ — only riskLevel and reasons are used downstream
  • Fixed misleading log label: score=$malwareScoremalwareScore=$malwareScore

PermissionRiskScorerTest

  • assertTrue(score == 95)assertEquals(95, score) so failures show expected/actual values
  • Renamed test "overrides mathematically to 100""yields score of 99" to match the actual assertion
  • Destructured unused riskLevel with _ in the critical permissions test

AppCategoryClassifier

  • Removed leading space from ANTIVIRUS label: " Security""Security"

Documentation

  • MIGRATION_10_11 KDoc now explicitly states the migration drops and recreates permission_analysis_cache, clearing all cached rows
  • permission_analyzer_commit_summary.md corrected to reflect the destructive migration (previously claimed "without wiping existing data")

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI mentioned this pull request Mar 14, 2026
@muhammad7865 muhammad7865 marked this pull request as ready for review March 14, 2026 13:00
…sha256

Co-authored-by: muhammad7865 <137446210+muhammad7865@users.noreply.github.com>
Copilot AI requested a review from muhammad7865 as a code owner March 14, 2026 13:04
Copy link
Contributor Author

Copilot AI commented Mar 14, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.11.1-bin/bpt9gzteqjrbo1mjrsomdt32c/gradle-8.11.1/lib/gradle-daemon-main-8.11.1.jar (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Refactor permission analyzer with new scoring algorithm Address PR #76 review feedback: test assertions, unused vars, shared SHA-256 utility, label fix Mar 14, 2026
@muhammad7865 muhammad7865 merged commit fa3196d into Permission_Analyzer Mar 14, 2026
@muhammad7865 muhammad7865 deleted the copilot/sub-pr-76-again branch March 14, 2026 13:39
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