Retrieving the Serial Number from an installed app

expand collapsive

Hello,

We have Hexnode installed on the device. We also have our company app installed there as well.

We need a way to somehow retrieve the device Serial number programmatically ( From the app itself)

Android restricts this retrieval only to the admin owner app which is Hexnode so we cant make our app the owner.

As i understand you do not support DELEGATION_CERT_INSTALL.

The only way left(?) is to call the API

curl -H “Authorization: <your API key>” .hexnodemdm.com/api/v1/devices/%7BDEVICE_ID%7D/” target=”_blank” rel=”noreferrer noopener”>https://<portal>.hexnodemdm.com/api/v1/devices/{DEVICE_ID}/

Only that the app does not know its Device id.

Another way is getting it by the IMEI key. But for that, we need #USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER

permission. Does Hexnode support this ?

Bottom line, how can the app get the device’s Serial number?

Thanks

<h1> </h1>

All Replies

  • Hello @lior-m, welcome to Hexnode Community!

    A viable way for the app to fetch the device’s serial number is to modify the app in such a way that managed app configurations can be set up from the UEM. This can be achieved using Hexnode’s App Configurations policy.
    The policy can be used to push the device’s serial number, device ID or IMEI number to an app if it supports managed configurations. The wildcards %serialnumber%, %deviceid% and %imei% can pass the corresponding values to the app.

    Here’s an example of passing such unique values to an app:

    Pass unique values to apps using App configurations policy

    Hope this helps. Do get back to us in case of any further queries.

    Regards,
    Chloe Edison
    Hexnode UEM