android / nowinandroid

A fully functional Android app built entirely with Kotlin and Jetpack Compose
Apache License 2.0
15.93k stars 2.81k forks source link

Set Gradle verification to check the dependency have been compromised #1410

Open Jaehwa-Noh opened 2 months ago

Jaehwa-Noh commented 2 months ago

What I have done and why

Set Gradle verification. From this documentation

Working with external dependencies and plugins published on third-party repositories puts your build at risk. In particular, you need to be aware of what binaries are brought in transitively and if they are legit. To mitigate the security risks and avoid integrating compromised dependencies in your project, Gradle supports dependency verification.

Gradle can check dependencies' checksum in build time, and verify that dependencies have been compromised. I set Gradle option for just warning when checksum throw error. If you want to make new verification-metadata.xml, run this gradle --write-verification-metadata sha256 check

How I'm testing it

Choose at least one: