Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Commit

Permalink
Support for long versionCodes
Browse files Browse the repository at this point in the history
Luckily, ApkMeta.versionCode is already a `Long`, so I didn't need to add a hacky `versionCodeMajor` field like in android.
  • Loading branch information
paulo-raca committed Oct 30, 2019
1 parent ad7140c commit 68667bc
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ public void onStartTag(XmlNodeStartTag xmlNodeStartTag) {
case "manifest":
apkMetaBuilder.setPackageName(attributes.getString("package"));
apkMetaBuilder.setVersionName(attributes.getString("versionName"));
apkMetaBuilder.setVersionCode(attributes.getLong("versionCode"));
Long majorVersionCode = attributes.getLong("versionCodeMajor");
Long versionCode = attributes.getLong("versionCode");
if (majorVersionCode != null) {
if (versionCode == null) {
versionCode = 0L;
}
versionCode = (majorVersionCode << 32) | (versionCode & 0xFFFFFFFFL);
}
apkMetaBuilder.setVersionCode(versionCode);
String installLocation = attributes.getString("installLocation");
if (installLocation != null) {
apkMetaBuilder.setInstallLocation(installLocation);
Expand Down

0 comments on commit 68667bc

Please sign in to comment.