How to detect when an App is force moved to SD-Card on rooted Android

时间秒杀一切 提交于 2020-01-06 05:47:37

问题


I have declared my App as internalonly, yet some rooted users move it to SD-Card.

How can I detect at run-time that this has happened? I do not trust the information that packagemanager is reporting as these are rooted phones and my app should not had been moved to SD-card anyways.

Thanks!


回答1:


Have the application open /proc/self/maps and look for an entry that is an apk file and look at its path.

Why exactly are you concerned about this? Hopefully it is because of a functional reason, such as problems if the SD card is unavailable. Doing it for security purposes is of limited point on a rooted device.

If you detect it and complain, please have the error screen state why it is a problem. Just claiming "it's not allowed" or giving bogus reasons will only prompt people to figure out how to out-fake your fake-out detection and in the meantime leave you poor ratings in the market.



来源:https://stackoverflow.com/questions/6101240/how-to-detect-when-an-app-is-force-moved-to-sd-card-on-rooted-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!