Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 15
Registered: ‎08-01-2008
My Device: Not Specified
Accepted Solution

Blackberry application which can not be uninstalled from device

Hi,

I am developing an application which should not be uninstalled manually from device or through desktop manager.

Want suggestions if this is possible and how? If not then, is there any alternative way to create an application that will not be visible in applications list on device or in desktop manager (kinda hidden application (not a library but an app) ) ?

Thanks,
Alpesh 

Highlighted
Retired
Posts: 172
Registered: ‎06-07-2010
My Device: BlackBerry 8520
My Carrier: Rogers

Re: Blackberry application which can not be uninstalled from device

[ Edited ]

Hello Alpesh,

 

How are you doing? I hope all is well.

 

In regards to preventing an application from being uninstalled by a user, you can do the following:

 

1) If you are a BES Admin, you can enable this via Software Configuration

 

2) You can also augment your .alx file to include the <required>true</required>

 

Let me know if you have any further questions, and I will more than happy to help to assist 

Raihan Masroor
BlackBerry Development Advisor
Contributor
Posts: 15
Registered: ‎08-01-2008
My Device: Not Specified

Re: Blackberry application which can not be uninstalled from device

Hello Raihan,

Thanks a lot !!!

so, it is possible to make an application which can never be uninstalled even from Desktop manager.

I will be working on the solution and will let you know how it goes and solve my query.

Thanks,
Alpesh
Contributor
Posts: 15
Registered: ‎08-01-2008
My Device: Not Specified

Re: Blackberry application which can not be uninstalled from device

Raihan,

It worked the way I wanted Smiley Happy

Many Thanks,
Alpesh
Contributor
Posts: 15
Registered: ‎08-01-2008
My Device: Not Specified

Re: Blackberry application which can not be uninstalled from device

Rihan,

Just curious to know few things here:

1. If everyone create apps which cannot be uninstalled or If someone create an app to spy user data, how would someone ensures the security?

2. In my app, after authenticating the user, I want to give an option to uninstall the app, is there any way I can uninstall my app from my code? Reason is I don't want any user to forcefully use my application.

Thanks,
Alpesh
Contributor
Posts: 15
Registered: ‎08-01-2008
My Device: Not Specified

Re: Blackberry application which can not be uninstalled from device

For my second query, CodeModuleManager is the solution Smiley Happy but I observed application is deleted but still appearing in options->applications and also visible in desktop manager. so, I will not be able to reinstall the app deleted using CodeModuleManager?

-Alpesh
Retired
Posts: 172
Registered: ‎06-07-2010
My Device: BlackBerry 8520
My Carrier: Rogers

Re: Blackberry application which can not be uninstalled from device

Hello Alpesh,

 

How are you doing? I hope all is well.

 

I'm glad you were able able to implement the features of your application.

 

In regards to the application being observed in the applications screen, can you send me a snippet of your CodeModuleManager implementation?

 

Looking forward to your reply.

Raihan Masroor
BlackBerry Development Advisor
Contributor
Posts: 15
Registered: ‎08-01-2008
My Device: Not Specified

Re: Blackberry application which can not be uninstalled from device

Raihan,

Below is the code I have used to uninstall my application.


ApplicationDescriptor ad = ApplicationDescriptor.currentApplicationDescriptor();
int moduleHandle = ad.getModuleHandle();
int rc = CodeModuleManager.deleteModuleEx(moduleHandle, true);
if ( rc == CodeModuleManager.CMM_OK_MODULE_MARKED_FOR_DELETION ) {
        CodeModuleManager.promptForResetIfRequired();
} else if ( rc == CodeModuleManager.CMM_OK ) {
	Dialog.alert("Deleted");
}

Even after the hard reboot, device simply statred without reconfiguring anything and application was showing in applications list and desktop manager. So, I was not able to re-install the application Smiley Sad

Then I tried uninstallation using javaloader and worked. On reboot, device was reconfiguring which did not happened when I did the hard reboot after uninstalling the application through my code.

 

Any specific step I need to follow?

 

Also Sorry that I am going too pessimistic but I am curious to know, Is there any way to prevent uninstall through javaloader as well?

 

Thanks a lot,

Alpesh

Retired
Posts: 172
Registered: ‎06-07-2010
My Device: BlackBerry 8520
My Carrier: Rogers

Re: Blackberry application which can not be uninstalled from device

Hello Alpesh,

 

CMM API should throw an exception. Could be a bug.

 

Are you able to reinstall the application onto your device?

 

Using Javaloader can you run the following command javaloader.exe -u dir and see if your application modules are available. I'm predict that the modules will still be installed?

 

In regards to preventing an uninstall using javaloader, you can't prevent an uninstall if the following command is being executed "javaloader.exe -u erase -f <.cod files>

 

Looking forward to your reply.

 

Sincerely,

Raihan Masroor
BlackBerry Development Advisor
Contributor
Posts: 15
Registered: ‎08-01-2008
My Device: Not Specified

Re: Blackberry application which can not be uninstalled from device

Thanks a ton, Raihan

 

There was a mistake in my code and now I can completely remove the app from my device and no app module is present after deletion and reboot. I can reinstall the app too Smiley Happy

 

I really appreciate all your help and time in solving my problem.

 

Quick query, If RIM does not require any screening for such system level app that user can't delete then how RIM ensures the security of the device? tomorrow someone can create virus or app that cannot be deleted to spy data how can one secure the device.. I am just worried.

 

Regards,

Alpesh