简体   繁体   English

拆除SIM卡或SD卡时如何“锁定”设备?

[英]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. 我正在向我的代理商分发带有重要商业信息的Android手机。 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. 如果用户删除SIM卡,SD卡或尝试修改存储在设备存储器上的数据,系统需要锁定并尽可能向关注人员发送通知。

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 您可以使用DeviceAdmin Api执行某些操作

I think you could register a DeviceAdmin, and as soon as the phone boots up check the SIM and SDCARD. 我想你可以注册一个DeviceAdmin,一旦手机启动,请检查SIM卡和SD卡。 Then you could either continue to wipe data or set a new password for the device using resetPassword and call locknow . 然后,您可以使用resetPassword继续擦除数据或为设备设置新密码并调用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. 在一天结束时,您的数据永远不会对确定的软件黑客100%安全。 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. 1)在SD卡状态下注册接收器,如果未安装相应的动作,可以与sim相同,为SIM保存可从TelephonyManager类获取的sim号。

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. 2)如果用户关闭手机,然后拔出SD卡或SIM卡,重启应用程序可以检查SD卡是否存在或者SIM卡是否已更改。 in this case too you can take action accordingly, 在这种情况下你也可以采取相应的行动,

but if user replaces the sdcard in switch off mode you can not do anything. 但如果用户在关闭模式下替换SD卡,则无法执行任何操作。

I think it's possible to: 我认为有可能:

  1. Register BroadcastListener for the BOOT_COMPLETED broadcast 为BOOT_COMPLETED广播注册BroadcastListener
  2. So after boot completing you will have BroadcastReceiver started - where you can check presense of SIM or SD card - which is easy like: 因此,在启动完成后,您将启动BroadcastReceiver - 您可以在其中检查SIM或SD卡的存在 - 这很容易:

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

  1. If check fails you can either BRICK device (which is cruel) or wipe data through DevicePolicyManager.wipeData 如果检查失败,您可以使用BRICK设备(这是残忍的)或通过DevicePolicyManager.wipeData擦除数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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