Akhil Soni
Akhil Soni

Reputation: 60

uninstall Application Password Protected

How to start an Activity or an IntentService before an application will be uninstalled by the user who has earlier installed the app on there device?

Upvotes: 1

Views: 1990

Answers (3)

Urasquirrel
Urasquirrel

Reputation: 1585

One way to achieve what you want would include the following steps:

  1. (temporarily) rooting the device
  2. converting the app in question into a system app (e.g. using Titanium Backup ★ root, but there are also other apps helping you with this step)
  3. unroot the device again As the app now resides in read-only space (/system), the user cannot delete it without either rooting the device or flashing a ROM -- which of course could be done, but it's a higher inhibition threshold at least.

There is no such thing as impossible with computers. There is only difficult and highly improbable to happen anytime soon. This is a fact not an opinion. Often someone says "impossible" and there is someone interrupting them saying "Just did it.".

Upvotes: 1

Ion Aalbers
Ion Aalbers

Reputation: 8030

You cannot prefend an user removing an application.

The DELETE intent will be send when the user requests to uninstall. The PackageManager will receive this intent and start uninstalling the application.

So, without any Android modifications, you cannot add an password.

Upvotes: 0

Satheesh Kumar R CyB
Satheesh Kumar R CyB

Reputation: 125

You have to use Intent filter called "android.intent.action.DELETE" in the AndroidManifest.xml Like below

<activity
    android:name=".Activity"
    android:label="@string/app_name" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <action android:name="android.intent.action.VIEW" />
        <action android:name="android.intent.action.DELETE" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:scheme="package"  />
    </intent-filter>
</activity>

This will call the activity.

Upvotes: 0

Related Questions