Samsung.Developer Qualys
Feb 12, 2019
2:26 pm

Getting SecurityException: Admin doesn't own container 12, while calling any Knox API for AFW device.

Hello 

 

We have tried to enroll Samsung J7Pro(OSV8.1.0 and Knox v3.2) device with Android for work (Profile Owner).

we have followed tutorial (https://seap.samsung.com/html-docs/android/Content/tutorial-upgrade-work...)

steps we have followed.

1 created managed profile.

2 once managed profile created, we have activated KLM Standard license. 

3 after activating license, we have tried to install application sliently (ApplicationPolicy#installApplication(String apkFilePath, boolean installOnSDCard))

 but we are getting below exception.

 

SecurityException: Admin doesn't own container 12 ContextInfo.uid 1210204

    java.lang.SecurityException: Admin doesn't own container 12 ContextInfo.uid 1210204

    

    Admin doesn't own container 12 ContextInfo.uid 1210204

    android.os.Parcel.readException(Parcel.java:2021)

    android.os.Parcel.readException(Parcel.java:1967)

    com.samsung.android.knox.application.IApplicationPolicy$Stub$Proxy.installApplication(IApplicationPolicy.java:3443)

    com.samsung.android.knox.application.ApplicationPolicy.installOrUpdateApplicationInternal(ApplicationPolicy.java:699)

    com.samsung.android.knox.application.ApplicationPolicy.installApplication(ApplicationPolicy.java:659)

    com.qualys.android.samsung.helper.InstallApplicationHelper.installApplication(InstallApplicationHelper.java:22)

    com.qualys.android.samsung.handler.EDMVersionHandler4_0_1.handleMessge(EDMVersionHandler4_0_1.java:78)

    com.qualys.android.samsung.service.ProfileInstaller.onHandleWork(ProfileInstaller.java:119)

    android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:391)

    android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:382)

    android.os.AsyncTask$2.call(AsyncTask.java:333)

    java.util.concurrent.FutureTask.run(FutureTask.java:266)

    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)

    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)

    java.lang.Thread.run(Thread.java:764)

 

 

also we want to know what is minimum supported knox version and android os version for enrolling samsung device in AFW.

can you please look into the issue?

 

Thanks

Similar topics

No similar topics found.
Mikayla N.Samsung SEAP Moderator
Feb 12, 2019
10:16 pm

Hi,

The issue you are experiencing is due to missing permissions from your Android manifest file. Unfortunately, these permissions are missing from our tutorial. We are in the process of updating our tutorial and those changes should be made shortly. Please add the following lines to your manifest file. 

<uses-permission android:name="com.samsung.android.knox.permission.KNOX_APP_MGMT" />
<uses-permission android:name="com.samsung.android.knox.permission.KNOX_CONTAINER" />

As well, you will be unable to use any Knox APIs from within an Android for Work Profile until your workspace has been upgraded to a Knox Container, which is the process this tutorial is guiding you through. You will need to activate a Premium license to upgrade your profile to a container. Please make these changes and confirm with me if this solves your issues.

Best,

Mikayla

Samsung.Developer Qualys
Feb 19, 2019
9:46 am

Hi Team,

Thanks for the quick reply.

What I understood from the conversation that we need Knox Premium license to use AFW(Android For Work) on Samsung devices.

For that, I requested a trial for Knox Premium License from our partner portal and I got a license key from your team. I tried to activate our Samsung application with that trail License key but I am getting an error (Error code unknown 208, status fail) while activating the KLM key. Below is the code snippet we are using for activation.

KnoxEnterpriseLicenseManager mgr = KnoxEnterpriseLicenseManager.getInstance(getApplicationContext());
mgr.activateLicense(KLM_KEY);

 

Please find the error logs:

02-19 11:18:43.692 31151-31151/? E/ENTM:KLMBeanCreator: getKLMActivatoinBean() has Exception.
02-19 11:18:43.692 31151-31151/? W/System.err: java.lang.Exception: Server return fail : 3171
02-19 11:18:43.693 31151-31151/? W/System.err:     at com.samsung.klmsagent.bean.a.e.t(:51)
        at com.samsung.klmsagent.f.b.ko(:175)
        at com.samsung.klmsagent.f.a.ki(:267)
        at com.samsung.klmsagent.f.a.onPostExecute(:217)
        at android.os.AsyncTask.finish(AsyncTask.java:695)
        at android.os.AsyncTask.-wrap1(Unknown Source:0)
        at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
02-19 11:18:43.694 31151-31151/? W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:7000)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
02-19 11:18:43.730 2991-18266/? W/EnterpriseLicenseService: processKnoxLicenseResponse()
    processKnoxLicenseResponse().RO : null
02-19 11:18:43.760 31214-31214/? E/Zygote: isWhitelistProcess - Process is Whitelisted
02-19 11:18:43.766 31214-31214/? W/SELinux: SELinux selinux_android_compute_policy_index : Policy Index[2],  Con:u:r:zygote:s0 RAM:SEPF_SM-J730GM_8.1.0_0007, [-1 -1 -1 -1 0 1]
02-19 11:18:43.767 31111-31111/com.qualys.android.samsung E/Q Samsung Service: main | LicenceStatusReceiver | Error Statusfail
02-19 11:18:43.770 31111-31111/com.qualys.android.samsung E/Q Samsung Service: main | LicenceStatusReceiver | Error MessageKLM: Error code unknown 208, status fail
02-19 11:18:43.772 31111-31111/com.qualys.android.samsung W/ResourceType: No known package when getting value for resource number 0xffffffff
02-19 11:18:43.800 31111-31111/com.qualys.android.samsung E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.qualys.android.samsung, PID: 31111
    java.lang.RuntimeException: Error receiving broadcast Intent { act=com.samsung.android.knox.intent.action.KNOX_LICENSE_STATUS flg=0x10 pkg=com.qualys.android.samsung (has extras) } in com.qualys.android.samsung.receiver.LicenceStatusReceiver@637d1b3
        at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_54380(LoadedApk.java:1365)
        at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.$m$7(Unknown Source:4)
        at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.run(Unknown Source:39)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:7000)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
     Caused by: android.content.res.Resources$NotFoundException: String resource ID #0xffffffff
        at android.content.res.Resources.getText(Resources.java:354)
        at android.content.res.Resources.getString(Resources.java:448)
        at android.content.Context.getString(Context.java:556)
        at com.qualys.android.samsung.receiver.LicenceStatusReceiver.onReceive(LicenceStatusReceiver.java:128)
        at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$-android_app_LoadedApk$ReceiverDispatcher$Args_54380(LoadedApk.java:1355)
        at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.$m$7(Unknown Source:4) 
        at android.app.-$Lambda$aS31cHIhRx41653CMnd4gZqshIQ.run(Unknown Source:39) 
        at android.os.Handler.handleCallback(Handler.java:790) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:7000) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408) 

 

Can you please look into it and tell me if I am missing something.

And also can you please provide some steps to get the Knox Premium License. I have read on your portal that we have to purchase the Premium License from Resellers.


 
Mikayla N.Samsung SEAP Moderator
Feb 25, 2019
10:55 pm

Hi,

The error you are receiving is a binding error, which means that your package hasn't been bound to your license key. Have you registered your license with your account and associated your package? You can do this through your license key summary page. Associating your package can be done here. To purchase a premium key, please look at our list of resellers, to find a reseller in your country. 

Best regards,

Mikayla