Centrify Identity Service with Android devicesQuestion:
A custom Android app has been deployed out to devices via the InHouse app method in Cloud Manager.
After some time, a new version of this custom app was released and the new apk uploaded to the Cloud Manager for re-deployment.
For devices that do not have the old version installed, the updated app is downloaded and installed with no issues.
However for devices that do have the previous version installed, the app is not updated.
Manually uninstalling the old version allows the new version to be re-downloaded and installed.
The version number on the custom app is confirmed to be set higher than the previous version.
Why does this happen and can the app be configured to be updated automatically?Answer:
According to the Android Developers documentation
, Android apps contain two different properties for version numbers:
- This is used to display the version number as a human-readable string and can be presented in any format that is meaningful to the app developer and app users, e.g. v1.2.1, 20151125, etc.
- This is used internally by the Android platform (and Google Play Store) and is stored as a whole integer value. There are no minor or major version differentiations, as this value is only used to tell if the app is different from the previous published version, e.g. 1, 2, 3, etc.
If the versionCode
property is not incremented in the updated apk, then the Android platform will not recognise the app as an updated version, even if the versionName
property is changed.
This is not configured by Centrify; this property is compiled into the apk file by the app developer.
To verify these properties independently, an apk analysis tool such as Apktool
could be used:
- Install Apktool using the steps in the website above
- Run the following command on both the older and updated apk files of the target Android app:
- apktool d target.apk
(Replace "target.apk" with the actual filenames of the apk files)
- The commands will unpack the apk files with some diagnostic outputs, one of these output files will have a .yml extension
- Open this .yml file with a text editor to view the apk properties in plain text format.
- The versionCode properties can be compared between the old and new apk .yml outputs.
- apkFileName: old.apk
- versionCode: '0'
- versionName: 1.1.1
- apkFileName: new.apk
- versionCode: '0'
- versionName: 2.0.1
(All external links provided as a courtesy)