Draft: parse_androidmanifests: order by max_vercode
This reverts 83ffeb85, which shortcutted the detection code to always prefer build.gradle. The workaround was done by ending the paths loop early and using the found versions directly. This makes the function hard to extend with other file formats, for example pubspec.yaml as gradle would take precedence.
Instead the new code strictly uses the highest version information based on the assumption that an app can change the build system build not lower the version code.
There is one related bug we need to fix. The old max_vercode computation
below the paths loop, i.e.:
and (max_vercode is None or vercode > max_vercode):
,
uses '>' to compare the version code but vercode and max_vercode are
strings, resulting in a bogus string compare. This has been fixed by
converting vercode to int and only converting it back to string before
returning the function result. This entailed fixing one unit test.