Knox Tizen SDK - calling API kills the app

Using Knox Tizen SDK v2.4 on Galaxy Watch SM-805U running Tizen 4.0.0.1.
Want to enable a few privacy permissions through Knox.
Following functions return zero/success and work as expected, but they cause the app to get killed every time they’re called (app gets ‘pause’ and ‘terminate’ events).

  • knox_mdm_remove_privacy_permissions_from_packages

  • knox_mdm_add_privacy_permission_state_for_package

This prevents me from using the API to enable permissions without prompting the user.

1 Like

Hi,
It would be the reason for privacy issues, may be you missed any permission/feature definition which is required for your application. Could you please check below link, may be it would be helpful to solve the issue-


If you have all the required permissions and still facing problem then change the api version and try it again.
please let me know the status.

Hi, thanks for your reply.
I already have the following privileges listed in tizen-manifest -

http://tizen.org/privilege/appmanager.launch
http://developer.samsung.com /tizen/privilege/mdm.security
http://developer.samsung.com /tizen/privilege/mdm.application

Currently I’m targeting api version 4.0. If I target 3.0, then the Knox packages are not available anymore in project properties.

Admin edit: ninja edit to keep 404s at bay

If everything is okay with your code then it may happen due to legal issues, is your device is Korean! check this link below, this functions will not work with korean devices-
https://docs.samsungknox.com/devref/knox-tizen-sdk/group__mdm__application.html#gafd20793af02b75b9349035a9bad49863

I have three different devices, 2 bought in the US and 1 in India.
All 3 are ‘Made/Manufactured in Vietnam’ :confused:
The weird thing is that the functions actually work. Only thing is they cause the app to get killed as well.

How are you sure that this API is the only reason to kill your app? Did you remove that part of code and check it? I am just curious about the fact that if the api is returning success so it’s working ok!

Hi, yes… if I comment the API code out, the app is not killed.
Also like I mentioned, if the API call returns error, the app isn’t killed.
Also when I mean app is killed, it does not seem to have crashed. It actually receives all the lifecycle events - 1st pause and then terminate.

Samsung Tech Support has informed me that it is expected behavior for the app to get killed when it’s privileges are added or removed.
It is recommended that a different agent app manage privileges for any given app.

It makes me feel like its a bug issue. If you have been connecting it frequently and looking into directory then there something must have happen.