Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Password Protected Android App

I wana make a security app and in case of stolen or lost my app must not be uninstalled without taking password. yes It is possible to make such an app that can take password before getting uninstall.. My friend Aditya Nikhade has made this app :) .But he is not giving me this secrete recipe:( Install this app Findroid from google Play. In this app first you need to unlock your app then only u can uninstall it. So please help me how to crack this technique.. I searched and got some incomplete answer in that we can declare a receiver of type PACKAGED_REMOVED but i want to know how can I stop if my app is being uninstalled. I am little close to solution of it. I am working/studying on Device Administrator. Please paste code snippet if anyone have. Thanks a Ton in advanced....!!!

like image 541
Caution Continues Avatar asked Nov 04 '22 11:11

Caution Continues


1 Answers

Unfortunately the ACTION_PACKAGE_REMOVED intent will be sent out to all receivers except for your own.

I think the closest thing to what your looking for is the Device Administration feature introduced in 2.2.

Once the application is registered as a Device Administrator, it can't be uninstalled unless its unregistered. This will prevent the app from being uninstalled.

While the Device Admin API doesn't allow for password protection of this particular feature, you can password protect your application to prevent someone from tampering with the Device Admin features in the app.

So whenever user tries to change the device admin features you can prompt user for password.

Add these actions to your manifest to fire app when tried to tamper the device admin rights of your app

    <intent-filter>
        <action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
        <action android:name="android.app.action.DEVICE_ADMIN_DISABLED" />
    </intent-filter>

on this action you can use password protection then!!

like image 111
Neji Avatar answered Nov 12 '22 16:11

Neji