1

StoreKit has a bug that can lead to incomplete downloads being marked as "Finished".

I have seen some apps that download large files after In-App Purchases do an integrity check on them. How is this done?

openfrog
  • 40,201
  • 65
  • 225
  • 373
  • 1
    Typically, one compares the lengths of the original file and the downloaded file, and then one uses a hash function to generate a finger print for the downloaded file, which one compares to the original file. The current standard is SHA512; the older MD5 is now considered insecure. See this SO question: http://stackoverflow.com/questions/9580761/how-to-get-sha-512-hashing-in-objective-c – Eric Jablow Apr 19 '13 at 19:33

1 Answers1

1

Something I do in my own app is to pass a JSON with a list of resources will be downloading. Beside passing the URL of the resource, I also pass the checksum of it. After the download for a given file I compared the checksum I have from the JSON with the checksum of the file itself. You can use something like this.

Community
  • 1
  • 1
Rui Peres
  • 25,741
  • 9
  • 87
  • 137