02-06-2010 01:46 PM
Hi. I'm trying to protect a company necessary cod module on BlackBerry devices. It is essential for compliance issues. Unfortunately the company isn't running a BES server. I have tried having 1 app install another so I could set the CodeModuleGroup flags AND have tried having a module set the flags on its own group.
* I am signing the applicaiton
* I am installing on real devices
* I am installing OTA via downloading the COD
* I have tried installing OTA from the JAD
I have verified I am accessing the correct CodeModuleGroup.
THIS line throws the ControlledAccessException:
myCodeModuleGroup.setFlag(CodeModuleGroup.FLAG_HID
I have also tried setting FLAG_REQUIRED.
I know of some spyware that successfully does this but I have never had access to the source.
Thanks,
Rick
02-06-2010 03:21 PM - edited 02-06-2010 03:24 PM
What's the full stack trace?
I hope you're aware that without a proper IT Policy you still can't prevent the deletion/modification of this module by the user or spyware. The user can always delete the module via the module list screen. As to spyware, it has full access to the CodeModuleManager API where it doesn't really matter whether a code module group is marked as hidden or not...
02-07-2010 08:59 AM
Full stack trace? ONE line - calling setFlag causes the controlled access exception. The trace is that one line. It doesn't matter if this is happening during an install of a new code module group OR an application trying to modify its own CodeModuleGroup.
The devices are not being managed by a BES - no IT policies are in effect.
I'm looking for someone to weigh in on the actual use of HIDDEN AND REQUIRED. These flags exist and the method exists. The application is code signed PER the docs. Why is an exception being thrown on a NON BES BlackBerry (no IT policies), on my OWN application, that is code signed per the docs? My expectation is this is a bug in the OS or the documentation is incorrect in the usage.
Rick
02-07-2010 09:15 AM
Well, your "one line" invokes a method from BlackBerry API, which invokes another method and so forth. Somewhere deep inside there's an exception thrown. The stack trace might give you more idea why the exception is thrown.
02-07-2010 01:45 PM
Debug log from device:
ensureHidden::net.rim.device.api.system.Controlled
No stack trace
ex.printStackTrace() results in "No stack trace"....
Rick
02-07-2010 02:45 PM - edited 02-07-2010 02:48 PM
Wrap your code into try {} catch (Throwable ...) {}. The OS will automatically log the full stack trace into the Event Log when an exception propagates into a catch(Throwable) clause. Also, the Debugger will (by default) automatically break on such exception.
08-02-2010 02:18 AM
Hello,now I have the same question.I have not made that success. Have you made it?
If you can help me,please email xingzheng756@163.com. thx
Tinus.