Make sure the app is always signed *before* getting the MD5 hash.

I have a Jenkins job which runs a number of tests using Appium. It excecutes a harness that runs the tests by starting/quitting an Appium session for each test and uses fastReset (reset) to clear app data between tests.

I ran into a bug with the new Appium (v0.17.6) where the second test in the batch always got a reinstall instead of reset. The strange thing was that it only happened when running the Jenkins job.

Turns out that it is because the job copies the apk from another job in the beginning. The original apk is of course unsigned. So what happens here is that we get different MD5 sums for the first test (where the app is unsigned) compared to the rest of the tests (where the app is signed).

This fix makes sure we always sign the app before checking for the MD5 hash.