开发者

EventInjector on BlackBerry to close the camera - security threat?

开发者 https://www.devze.com 2023-01-04 14:10 出处:网络
we are using the native BlackBerry camera in our app, using the Invoke class to start the camera.We listen for an image being written to the filesystem, and when the user is finished with the camera,

we are using the native BlackBerry camera in our app, using the Invoke class to start the camera. We listen for an image being written to the filesystem, and when the user is finished with the camera, we call

Application.getApplication().requestForeground();

inside fileJournalChanged() to get back to our app.

This caused a problem with the camera lingering on the image taking on some devices, some of the time. If you want gory details you can see my post on the BB forums from a while back.

http://supportforums.blackberry.com/t5/Java-Development/restore-invoked-camera-after-deleting-an-image-from-the/m-p/511332

Suffice to say, I am still trying to fix this. Using EventInjector to inject an ESC key press works,开发者_开发知识库 however in this question

Getting Event Injector Permission

it is described as a security threat. However this is widely suggested as the way to close the camera and work around other issues. Has anyone had problems using this method to close the camera or to do anything else? Is there a better "best practices" method for closing the camera, as there apparently is in Android (I don't actually know, a senior developer here mentioned it)?

By "problems" I guess I really mean business rules types of problems... app getting blacklisted by an organization, slammed in the app store, etc?

Thanks in advance, this has been troubling me for a while.


I think the biggest problem you'll face is that using event injection requires special application permissions - ApplicationPermissions.PERMISSION_INPUT_SIMULATION to be exact. Since granting an application this permission basically allows it to simulate input events into ANY application at any time, it is considered quite dangerous because a badly-written or intentionally malicious application could do a lot of damage. Therefore many end-users and business do not allow applications that require this permission.

0

精彩评论

暂无评论...
验证码 换一张
取 消