Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Getting "this app does not have access to call OEM service" #2

Open
ricksieben9 opened this issue Nov 27, 2020 · 6 comments
Open

Getting "this app does not have access to call OEM service" #2

ricksieben9 opened this issue Nov 27, 2020 · 6 comments

Comments

@ricksieben9
Copy link

Hello,

I happened upon your article whilst looking for a way to get serial number on Android 10. I am using EMDK Profile Manager (not StageNow) as such:

image

Yet I am still getting:

"Error: This app does not have access to call OEM service. Please assign access to content://oem_info/oem.zebra.secure/build_serial through MX. See ReadMe for more information"

I am also using Xamarin if that matters.
Would you have any idea what is still missing?

Thanks.

@darryncampbell
Copy link
Owner

Hi, my colleague James did this in one of his sample apps, it is probably easier for me to give you his article and sample app: https://developer.zebra.com/blog/granting-permission-access-serial-imei-numbers-mobile-computers-running-a10 / https://github.com/ZebraDevs/OEMIdentifiers-Java-Sample. Please let me know if that helps.

@ricksieben9
Copy link
Author

Hi, thank you for your response.

From what I can tell, your colleague shows how to retrieve the package and signature, and then apply them on startup. In my case however, these are static. As such, the permissions are present in the profile from the start. All other permissions (such as SoundManager, UIManager, etc.) apply correctly, so I have no reason to assume the problem exists with applying the profile.

@darryncampbell
Copy link
Owner

Hi, I see the confusion.... I hadn't tried to run that app myself until just now but that dialog that looks like a runtime permission request is just a custom dialog which gates the call to the EMDK profile Manager. The custom dialog is completely optional but there is another sample created by another colleague of mine which I believe more closely matches what you are looking to achieve: https://github.com/ZebraDevs/DeviceIdentifiersWrapper-Sample

@ricksieben9
Copy link
Author

Hi,
I am not using / can't use your colleague's wrapper, but I have translated it (party) to C#. Yet the cursor remains empty. But from what I can tell, since my caller signature and package name are both static and known to me before runtime, I shouldn't even need to get them during runtime and then apply them in a profile.
Could you explain why it isn't enough to build them into the profile.xml like it is with all the other managers?

@darryncampbell
Copy link
Owner

Not all managers require you to provide a package signature, it is actually a very small minority where the additional overhead is required as we do not want to relax the Android security model without some other control. Providing the signature at runtime, as my colleague does, can make things easier but some customer deployments will prevent applications from invoking the MX access manager from within the app so the approach would not work in those scenarios.

I am unsure why your cursor will be empty, the most likely cause is that you are providing the wrong signature in my experience & most commonly using the debug key instead of the release key or vice-versa. If the https://github.com/ZebraDevs/DeviceIdentifiersWrapper-Sample works without modification it points towards this possibility.

@darryncampbell
Copy link
Owner

ltrudu referenced this issue in ltrudu/DeviceIdentifiersWrapper Jul 9, 2021
Updated build graddle configurations for publishing releases
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants