- 摘要:
很多手机或者手机助手都会有拦截APP权限的功能,如果权限被拦截,就不能正常获取到需要的信息。不过系统对权限的控制其实并不完美,还是有方法可以绕过的。这里以蓝牙mac地址做为示例,分享一种绕过系统权限控制的方法。
- 常用的获取bluetooth mac代码如下:
String getBluetoothAddress(){
String blueMac="";
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBluetoothAdapter != null)
{
blueMac = mBluetoothAdapter.getAddress();
}
return blueMac;