11-30-2009 03:50 PM - edited 11-30-2009 03:52 PM
I created a test app for some OpenGL stuff and tried to install it on my BlackBerry to see if some of the problems I have been having were from the simulator or from something I coded. I got the standard message "Module <name> attempts to access a secure API."
I ran the app through the SigningTool that came with Eclipse Plugin 1.1 and it says that I need to have it signed with RIMAPPSA2. I remember reading that RIMAPPSA2 means a non-public class/interface is being accessed but all the classes/interfaces I use either I wrote or are public. The end result is obviously that I cannot run the app on a physical device.
Has anyone else experienced this or knows what might be causing it?
On a side question, is there any way to find what source code files are using signed classes?
12-01-2009 02:52 AM
Clear the Event Log and cold-reboot the device with your module installed. What you should see in the Event Log is this. I believe that during the boot phase there will be a couple of lines dedicated to the error in your module, listing the name of the offending class. If it's not there, try starting your app -- if I recall correctly, the OS will again log the name of the offending class and method in the Event Log.
12-01-2009 06:55 AM
Thanks, will try and respond with results.
12-04-2009 06:09 PM
Sorry I'm late, busy lately.
I cleared the log, pulled the battery, tried the app.
Here's the log.
It does mention my app (The one know as SetionTesting, I typed too fast and forgot the 'c') but it says verification/linking error.
When I ran it it throws the error before main is called so I can't do much.
12-08-2009 04:23 AM
Looks like your module SetionTesting is referencing net.rim.device.api.ui.FontMetrics but does not have the required signature to do so. Please check which signatures your module has. You can find the list in Options -> Applications -> (menu) -> Modules -> (select your module, and click on it) -- look for Signer IDs section.
12-08-2009 07:07 AM - edited 12-08-2009 07:17 AM
Thank you for helping though.
EDIT: Found where FontMetrics is mentioned. That is odd, would think that that would be on the actual device. Also I compiled Hello World and luckily it didn't require RIMAPPSA2.
12-08-2009 08:42 AM
What makes you think that FontMetrics does not require a signature? As to RIMAPPSA2 signature, you're probably invoking some undocumented API (e.g., an undocumented method). Try commenting out some code to find out what part of your code adds the requirement of RIPAPPSA2 signature. Once your code is free from this requirement, you can then sign the module, and the module will not be getting the "Cannot access secure API" exception any more.
12-08-2009 09:03 AM - edited 12-08-2009 09:09 AM
I just checked the documentation that came with BlackBerry plugin 1.1 for Eclipse and FontMetrics is labeled as unsigned. But I also checked the online documentation and FontMetrics isn't mentioned so I wonder if that is considered a undocumented feature? Let me try...
Tried commenting out just FontMetrics (and adding to another app) but it didn't make a difference. As stated in the original post, is there any tool/utility to find what source files contain a non-public classes/functions? The types that require signing are presented as warnings unless specified not to.
12-10-2009 05:57 PM
What BlackBerry Smartphone model and BlackBerry device software version are you testing on? You can find this under Options, About on the BlackBerry Smartphone. Can you post a new eventlog taken after removing FontMetrics?
12-10-2009 07:52 PM - edited 12-10-2009 07:55 PM
Look at the "My Device" label under my name.
Interesting, as stated previously FontMetrics don't cause the Eclipse plugin 1.1 to say that I need to use RIMAPPSA2 (if I create a generic app and add FontMetrics the signing issue doesn't pop up and if I remove FontMetrics from SetionTesting the signing issue doesn't go away).
Yet the application is put on an actual device, if it has FontMetrics I get the ControlledAccessException, if it doesn't have the FontMetrics it doesn't get the ControlledAccessException. So I was actually able to run the application but it doesn't draw anything so either I am doing something wrong or OpenGL doesn't work just yet on an actual device.
Either way I put the applications on the actual device, cleared the event log, and restarted the device with a battery pull. Then ran the app.
eventLog_w_FontMetrics -- With FontMetrics
eventLog_wo_FontMetrics -- Without FontMetrics