Retrieve serial number in zebra device

D David Orduña 1 week 5 days ago
27 0 0

Hi!

 

We are trying to retrieve the serial number of a Zebra device (TC52x) from a MAUI application.

 

We are stuck, after reading the documentation available and trying many different approaches.

 

There are several ways to achieve this, but for our needs we have to use the AccessMgr one, which lets us setup the profile from inside the app itself.

 

We have implemented a very simple app following the documentation and looking at the samples in your github, but unfortunately we couldn't make it work. We share the code of our simple app attached, to help you understand our problema. The app only have the required configuration in the AndroidManifest.xml, and the implementation of the code in the MainActivity, as you have in some samples.

 

In your repos, there are some sample which retrieves the serial number, but these seem to be configured with StageNow. Other samples are using the AccessMgr, but not for querying the content provider to get the serial number. We have made a mix of all these samples, working with the AccessMgr and querying the content provider, but it seems that there is something wrong, because when we call to the content provider, it returns an empty cursor.

 

Looking at the logcat, we can see some logs related to these issue:

- Access Manager Status = false

- Unauthorized user returning empty cursor

 

As you could see in our code, we generate the profile dynamically. To do this we have to extract the signing certificate from the app (done following some steps in your docs). This step is working wrong too, because we can see some other logs related with this, where give us info about the “CallerSignature”. The log more relevant about this could be this one (we have omitted out cert):
- <wap-provisioningdoc><characteristic-error type="AccessMgr" version="10.4" desc="missing"><parm name="ServiceAccessAction" value="6"/><parm name="ServiceIdentifier" value="content://oem_info/oem.zebra.secure/build_serial"/><parm name="CallerPackageName" value="com.companyname.uniqueidzebra"/><parm-error name="CallerSignature" value="[OMITTED]" desc="Caller is not allowed:Package Name and Signature not matching"/></characteristic-error></wap-provisioningdoc>
I have highlighted the error description.

 

We have tried to create the profile directly from the EMDK extension for Visual Studio, setting the package name manually and importing the crt file but does not work either. Furthermore, I have compared the “CallerSignature” generated from our code and the one that the visual studio extension put in the profile file and are not equal at all.

 

Could anybody help us, please?

 

Thanks in advance.

Regards.

 

P.S: I’ve seen that this way of retrieving the serial number is useful till Android 13. From then on, how should we do this? Because I have not seen information about this in your docs. In a near future, we will have to get the serial numbers from A13+ devices…

CONTACT
Can’t find what you’re looking for?