简体   繁体   中英

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....!!!

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!!

I think it should run a background service. Else non running app will not have any chance of finding what's happening to it self. I'm not sure how to catch the "PACKAGE_REMOVED" event, but it should be from other element which is running as a system service. So system forcing that service to stop may be possible to catch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM