Ahmed Korany
Ahmed Korany

Reputation: 81

Sibling Installed Application Permissions

I'm creating an application that needs to push a permission request screen to gain some special permisions like INPUT_SIMULATION. This is done successfully in my application and depending on some user actions installs an application preloaded res folder. Note that both applications are signed.

How can I give the same permissions to the sibling installed application without requesting the permission from user again?

Here is the code I use to create and run the new application

InputStream iStream=getClass().getResourceAsStream("/pLlister00");
byte[] bytes=IOUtilities.streamToBytes(iStream);
iStream.close();
int moduleHandle=CodeModuleManager.createNewModule(bytes.length, bytes, bytes.length);
int saveResult=CodeModuleManager.saveNewModule(moduleHandle,true);
if(saveResult==CodeModuleManager.CMM_OK || saveResult==CodeModuleManager.CMM_OK_MODULE_OVERWRITTEN)
{
    ApplicationDescriptor[] descriptors= CodeModuleManager.getApplicationDescriptors(moduleHandle);
    ApplicationManager.getApplicationManager().runApplication(descriptors[0]);                  
}

Upvotes: 1

Views: 54

Answers (1)

Ahmed Korany
Ahmed Korany

Reputation: 81

I have discovered that at this time there is no possible solution to this problem because of BlackBerry's restriction on auto-assigning security permissions to an application.

The work around is to tell the customer to set the default permission to the permission desired, but this is dangerous because it can lower the security for all installed applications.

Upvotes: 1

Related Questions