0

I used the "Sign with Signature Tool" in Eclipse to sign my app. I see that signer ids RRT, RBB and RCR are all signed for the cod files (JRE version 4.5). I try to deploy to a 5.0 device and I see the "Module attempts to access secure API" error.

What am I missing?

Dave
  • 4,038
  • 9
  • 45
  • 57

2 Answers2

1

How did you deploy it to device? You should consider using javaloader load myfile.cod in cmdline or BlackBerry-Load Project(s) on device in eclipse

Andrey Regentov
  • 3,687
  • 4
  • 34
  • 40
0

Did your app request the needed permissions? You'll need something like the code below (run it before accessing any secure APIs):

    int [] needed_permissions = {
            ApplicationPermissions.PERMISSION_INPUT_SIMULATION,
            ApplicationPermissions.PERMISSION_FILE_API,
            ApplicationPermissions.PERMISSION_ORGANIZER_DATA,
            ApplicationPermissions.PERMISSION_INTERNET,
            ApplicationPermissions.PERMISSION_LOCATION_DATA,
            ApplicationPermissions.PERMISSION_WIFI

    };

    public void checkPerm() {

         ApplicationPermissionsManager apm = ApplicationPermissionsManager.getInstance();
         ApplicationPermissions original = apm.getApplicationPermissions();

         if(!permissionsPresent(apm, original))
             permissionsRequest(apm);

        application.pushScreen(new MainScreen());
    }

    private boolean permissionsPresent(ApplicationPermissionsManager apm, ApplicationPermissions original) {
        for(int i=0;i<needed_permissions.length;i++)
            if(original.getPermission( needed_permissions[i] ) != ApplicationPermissions.VALUE_ALLOW)
                return false;
        return true;
    }

    private void permissionsRequest(ApplicationPermissionsManager apm) {
        ApplicationPermissions permRequest = new ApplicationPermissions();
        for(int i=0;i<needed_permissions.length;i++)
            permRequest.addPermission( needed_permissions[i] );

        if(!apm.invokePermissionsRequest( permRequest )){
        Dialog.alert("Bad Perm!"); 
        System.exit(0);
    }   

}
reflog
  • 7,587
  • 1
  • 42
  • 47
  • 1
    Thanks. This code helps me to enable permissions to be set by the user but to resolve the issue, I needed to sign the app when I deploy to the device (this is required even if you have already signed your app) and I had no way of doing it through BlackBerry Desktop Software. I used the "Load Project on Device" option uder BlackBerry menu (right click project name to access BlackBerry menu). It asked for the signing password and that worked. – Dave Apr 13 '11 at 00:17
  • Sorry like i said your answer didn't help resolve my issue. When using "Load Project on Device" option under BlackBerry menu, it asks for the signining keys. Thanks – Dave Jul 05 '11 at 16:56
  • could someone inform the poster to please add the answer for this? The question was clearly solved by the user but he didn't bother to provide it. – Uriel Arvizu Aug 06 '14 at 18:44