2

On a Samsung Galaxy 4 with 4.2.2 our app has started getting the following error (N.B. (it works fine on a galaxy III running 4.0.1) :-

“An application has been forced to stop for an unauthorized attempt to access system in your device. This may have been caused.....compromise the kernel of your device”.

and an SEAndroid star notification with "The application is forced to stop for unauthorized behaviour of the software. This may .."

and our app dies :(

We have debugged this on the Samsung Galaxy 4 running 4.2.2 and the force close and error notification happens when we call a standard Android USB Host api - UsbManager openDevice() (see three lines of code below) , on a device we have been handed by the "android.hardware.usb.action.USB_DEVICE_ATTACHED" intent which our activity has an intent filter set for and thus has permission to use (see extract from Android docs regarding automatic permission in this case). ...

UsbDevice usbdevice  =  (UsbDevice) getIntent().getParcelableExtra(UsbManager.EXTRA_DEVICE);
UsbManager mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
mUsbManager.openDevice(usbdevice); //App is force closed by SELinux at this point

Is this a known problem with SELinux or the latest security policy updates from Samsung? Is there a work around or fix?

extract from Android docs:- Obtaining permission to communicate with a device Before communicating with the USB device, your applicaton must have permission from your users. Note: If your application uses an intent filter to discover USB devices as they're connected, it automatically receives permission if the user allows your application to handle the intent. If not, you must request permission explicitly in your application before connecting to the device.

goelectric
  • 320
  • 3
  • 10

0 Answers0