简体   繁体   中英

How to “lock down” the device, on removal of SIM card or SD card?

I am distributing android phones with vital business information to my agents. Incase user remove SIM card, SD card or try to modify the data stored on the device storage, system need to lock down and if possible send notification to the concern persons.

This would require changing the baseband software of the device. You CANNOT do this on a post-production phone.

Update

Potentionally you can do something with the DeviceAdmin Api

I think you could register a DeviceAdmin, and as soon as the phone boots up check the SIM and SDCARD. Then you could either continue to wipe data or set a new password for the device using resetPassword and call locknow . This way the phone is locked and the user will need password from you

Don't store critical information on the phone. Failing that, don't store critical information in plain-text. Use some kind of network-based authentication to control access at run-time.

At the end of the day, your data will never be 100% secure against a determined software hacker. Or a user with a camera. So work with trustworthy people.

You can simple do following things.

1) register receiver on SD card states, if it is unmounted take action accordingly, can do same with the sim , for SIM save the sim number which can be get from TelephonyManager class.

2) and if user switch off the phone and then pull sd card or sim, on reboot app can check if the sdcard is present or the Sim changed. in this case too you can take action accordingly,

but if user replaces the sdcard in switch off mode you can not do anything.

I think it's possible to:

  1. Register BroadcastListener for the BOOT_COMPLETED broadcast
  2. So after boot completing you will have BroadcastReceiver started - where you can check presense of SIM or SD card - which is easy like:

telephonyMgr = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
String simSerial = telephonyMgr.getSimSerialNumber();

  1. If check fails you can either BRICK device (which is cruel) or wipe data through DevicePolicyManager.wipeData

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