androidzxingsamsung-knox

Knox Enrollment Service Preventing Camera Access


I am making a simple QR Scanning App and using Google's open Source Zebra Crossing library to do so. I have made one before and am trying the exact same method I used last time but a certain Knox Enrollment Service is getting in the way.

In the app I have a button that calls the a scan function that looks like this.

public void scan(View v) {
    Intent intent = new Intent("com.google.zxing.client.android.SCAN");
    startActivityForResult(intent, 0);
}

The function fires correctly and exits correctly. In the past version of the app I made, the camera would have opened and looked for a QR code to scan. Instead of that know I get an error message titled

Knox Enrollment Service: Sorry, the Android camera encountered a problem. You may need to restart the device.

Restarting the device does nothing.

Has anything changed in Android or is this specifically a native Samsung thing?

Ultimately though, is there a way to get around Knox Enrollment Service or another way I could scan QR codes without going through Knox?


Solution

  • I just encountered this as well and luckily was able to come up with a solution for it through trial and error.

    1. Go to your phone's search bar (swipe down on the home screen) and type in "Knox Enrollment Service"
    2. Scroll down to "Permissions"
    3. Click "Camera" then select "Allow"
    4. Exit out of the app you're trying to use and relaunch the app - it should work now

    I'm not sure why it's not enabled by default, but that seems to be the cause of the problem. Tested on a Galaxy A51 running Android Version 10, Knox API Level 30.