0

I am trying to get Bluetooth MAC address on my internal app, but still not working until now.

First I use libMobileGestalt private library but can not get the information.

I am using the following code but get null.

CFStringRef value = MGCopyAnswer( kMGDiskUsage );
NSLog(@"Value: %@", value);
value =    MGCopyAnswer( kMGBluetoothAddress );
NSLog(@"Value: %@", value);

Value: {
    AmountDataAvailable = 24597590016;
    AmountDataReserved = 209715200;
    TotalDataAvailable = 24807305216;
    TotalDataCapacity = 29322899456;
    TotalDiskCapacity = 31708938240;
    TotalSystemAvailable = 335544320;
    TotalSystemCapacity = 2386038784;
}
Value: (null)

Second I use liblockdown private library.

I am using the following code but "connection" is nil cause I cannot keep going.

LockdownConnectionRef connection = lockdown_connect();
NSString *mac = lockdown_copy_value(connection, nil, kLockdownBluetoothAddressKey);

Finally I use https://github.com/durul/udidinspector

But the bluetooth MAC address is not correct.

I want to ask if there is actually no way to get my device bluetooth MAC address?

Thanks :)

1 Answers1

1

Apple certainly seem to have removed any access to MAC addresses. You can get around it if you're in control of the peripheral and send the mac address over in the manufacturer specific information in the advertising data or by exposing it through a service once connected.

CMash
  • 1,987
  • 22
  • 35