downloadResources

suspend fun downloadResources(missingResources: List<ResourceCheckResult>, context: Context, resFolder: String, downloadUrl: String): List<ResourceCheckResult>

Downloads a list of missing resource files from the specified URL and verifies their integrity.

This function iterates through the list of missingResources, downloads each one from the downloadUrl, saves it to the cache directory, and then verifies its integrity.

Return

A list of ResourceCheckResult representing the resources that failed to be downloaded or that failed the integrity check.

Parameters

missingResources

A list of ResourceCheckResult representing the resources that need to be downloaded.

context

The application context, used to access the cache directory.

resFolder

The folder name inside the cache directory where the resources should be stored.

downloadUrl

The base URL from which the resources should be downloaded. The file will be requested using a path formed by downloadUrl + entry.expectedHash