2

Recently I am working on a Mobile Device Management application in that i implemented a case to delete an application from device remotely but the problem is user have to click on uninstall button to proceed .But as i think if we are managing the device and it should not be and it is sure that user will not click on uninstall button.

So is there any way so that so we can delete an application without user prompt or we can something like automatically click on uninstall button when the activity called.

Intent uninstallIntent = new Intent(Intent.ACTION_DELETE);
            uninstallIntent.setData(Uri.parse("package:" + packageName));
            uninstallIntent.setAction(Intent.ACTION_VIEW); 
            uninstallIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
            context.startActivity(uninstallIntent);

I am using this code calling uninstall activity.

Piyush Agarwal
  • 25,608
  • 8
  • 98
  • 111
  • I think that is not possible, to avoid malicious software from deleting apps without user noticing – Max Rasguido Sep 05 '12 at 10:23
  • @MaxRasguido expected answer. – Piyush Agarwal Sep 05 '12 at 10:57
  • made it a little more specific in my answer by the way – Max Rasguido Sep 05 '12 at 11:54
  • @MaxRasguido I was researching for the same and got an info that in samsung devices it is possible by using samsung sdk.If it is how can we do that.Where can I find the sdk and code. – Piyush Agarwal Nov 04 '12 at 10:50
  • @MaxRasguido but the vendors like Mass360 is providing the feature of selective wipe without any user prompt.If it is not possible at all how they can do ??? – Piyush Agarwal Nov 30 '12 at 10:08
  • I really have no idea...as I told you I haven't been able to achieve your objective, and I think it shouldn't be possible to do – Max Rasguido Nov 30 '12 at 13:20
  • @MaxRasguido just check this link once http://www.maas360.com/products/mobile-device-management/android/ and is there any possiblity to perform "pm uninstall packageneame" command programatically because it is deleting application silently and also check this sample https://github.com/paulononaka/Android-InstallInBackgroundSample thanks a lot. – Piyush Agarwal Dec 04 '12 at 13:35
  • @pyus13, it really *is* possible with the Samsung SDK, since version 1 (they're on version 3, now). Those of us who have the SDK won't be able to share it due to extremely restrictive NDAs -- this makes sense, as the reach is quite extensive. However, even you had the SDK, you couldn't use it, as any app utilizing it must be sent to Samsung HQ to be signed prior to distribution. – 323go Mar 15 '13 at 22:44

1 Answers1

2

Well for all I know it's not possible to install uninstall packages without a user permission prompt, for a more technical answer reffer to this sources: Third Party Uninstalling - this states that the only way to install uninstall packages is asking the Android OS to do it for you, Intent or Package Manager install - this states that there is a special method to install/uninstall packages, but it can only be used by system apps.

So the only apparent way to install and uninstall packages would be an intent, and this intent will always show a prompt for installing uninstalling packages.

Community
  • 1
  • 1
Max Rasguido
  • 457
  • 6
  • 27
  • I already went through all these links but not got any solution. As i think android should provide this feature in DeviceAdmin. – Piyush Agarwal Sep 05 '12 at 12:05
  • It would be useful, but it would be very risky, if you could uninstall apps without a permission prompt you'd be able to uninstall apps the user doesn't want to uninstall, and that would be a pretty big security breach – Max Rasguido Sep 05 '12 at 12:14
  • That's why i am saying that this should be in DeviceAdmin so that by activating that user will give a permission to application to uninstall application without their confirmation. – Piyush Agarwal Sep 05 '12 at 13:02