2

I have developed an application to work within the Samsung Knox environment. Due to the restrictions on the Knox environment, I need the app to respond differently depending on whether it's in a Knox container or outside of it. How can an app tell programmatically if it's been deployed inside the container?

Greg N
  • 95
  • 6

1 Answers1

3

I have a similar problem, though our application is NOT made to work within the Knox environment, but some users will place it in there anyway... So I am looking for a similar feature. I found the following which might help you. Sadly for us it doesn't work as it seems to only work when including the Knox Premium SDK: https://seap.samsung.com/faq/how-does-app-detect-if-container-was-created

In short there are two ways to check. Either call this in code:

KnoxContainerManager.getContainers()

Or add this to your Manifest and add a Broadcast listener:

    <receiver
        android:name=".receiver.KnoxContainerReceiver"
        android:exported="true" >
        <intent-filter>
            <action android:name="com.samsung.knox.container.creation.status" />
        </intent-filter>
    </receiver>

public class KnoxContainerReceiver extends BroadcastReceiver{
    @Override public void onReceive(Context context, Intent intent ){
    //do something
    }
}

If anyone finds a solution that works without the SDK I am very interested to hear it.

Kasium
  • 985
  • 10
  • 24
  • samsung link is dead – Nick Apr 12 '18 at 18:42
  • I would guess the equivalent live link is https://docs.samsungknox.com/dev/knox-sdk/faqs/container/how-does-an-app-detect-if-a-container-was-created-using-the-knox-sdk.htm – mirh Sep 23 '21 at 16:09