Bluetooth mac изменить android

Root How do I permanently change my Bluetooth MAC Address?

I have a need to change my BlueTooth MAC address. I’ve done a little google searching, but I am not really sure if those methods would work for me. I saw some advice for people on CM7 with regards to a few lines of code, but I am not sure that the change is persistent after a reboot.

I’d mainly need this for Sense based ROMs, but I plan to run Jellybean off CM10.1 at some point as well. Each of my ROMs will require a different Bluetooth MAC address in order for everything to play nicely together.

Do I need some text in my init.d folder? Is there an app I can run that will do it?

Brian706

I like turtles!

Also I’m gonna move this into the root section, I think you’ll get more help there!

Palmetto Fellow

Android Expert

Also I’m gonna novel this into the root section, I think you’ll get more help there!

Thanks for the link and the migration to this forum. I debated where to put it myself, then figured I’d go general with it.

As for that procedure, I have to read through it a couple of times as a few parts don’t apply to me like the six axis controller and motionjoy. If I ignore those two parts of the procedure, it looks like a command that gets entereted through ADB.

Would I just pull the BT file, change it, and then slap it back in there? It seems like this is the procedure:

1. cd c:/asdk/platform-tools
2. adb pull /esf/bluetooth/bt_addr
3. Change the MAC address
4. adb push bt_addr /esf/bluetooth/

Do I need to create the platform tools directory, and do I need to do anything such that the file is dumped there automatically?
Does this ONLY affect the specific ROM that I am on, or does this change the BT MAC address at a higher level which would then affect all ROMs?

My goal is to have a different BT MAC address for each ROM that I run. I don’t need to change my BT MAC address to the same value for all ROMs. It must be different between ROMs or this will not help me.

Brian706

I like turtles!

I figured some wouldn’t apply to you but it looks like you could can follow the steps you posted. The only thing is your number one. That just happens to be the directory for his. I’m pretty sure you installed sdk mini per the complete newbie’s guide. If you followed those instructions your directory is likely: c:\sdk-tools

Don’t create a new directory. Yours is just wherever your adb and fastboot are located. And when you pull the file it will automatically go into the directory you are running the command from and that’s where you would find it on the pc.

Читайте также:  Драйвер broadcom usb bluetooth device драйвер

As for the other questions,they are really out of my scope of knowledge. Let’s see if anyone else jumps in, otherwise you may just have to do a little trial and error.

Also I forgot to mention that the guide was made for the s2. That blutooth file possibly doesn’t exist and probably isn’t in the same location. It may have a different name if it does exist. That guide I just skimmed and thought maybe there was useful information. It likely has to be tweaked though. I’ll look and see if i can find a file like that on my phone

Источник

Randomize Mac Address Bluetooth LE Broadcast

As far as I know some android phones today can act as BLE beacon (this feature is usually disabled in most devices ) . When an android device is acting as a beacon and is discoverable , is it’s MAC address randomised ? Can we in any way not show the actual MAC id when the device is discoverable ?

2 Answers 2

Most newer Android devices with 5.0+ have support for Bluetooth LE peripheral mode, meaning they can transmit as beacons. The feature is present in Android 5.0+, but some manufacturers have chosen to disable support on certain models, especially older models. You can see a list of devices known to support and not support this feature here: http://altbeacon.github.io/android-beacon-library/beacon-transmitter-devices.html

When the feature is enabled, the MAC address is not randomized during transmission, and the transmission includes the device’s actual bluetooth MAC address, allowing receiving devices to read this MAC address.

EDIT: Subsequent testing has proven to me that the above statement is incorrect. The MAC address is randomized each time the transmitter is restarted. You can see a proof of this here.

There is no mechanism in Android to change this.

When scanning on Android, the actual MAC address from the transmission is returned. To prove this, I started an iOS beacon transmitter using the Locate app on an iPod Touch 5th Generation with iOS 8.3, and simultaneously scanned for the device on both a Linux device as well as a Nexus 5X with Android 6.0:

Android Locate Beacon App on Nexus 5X with Android 6.0: MAC address: 60:35:48:79:D8:08

Linux Bluez sudo hcitool lescan : MAC address: 60:35:4B:79:D8:0B

As you can see, both devices read the same MAC address, proving that it is not spoofed on scan in either Android or Linux.

  • The Bluetooth MAC address reported by the iPod Touch with iOS 8.3 in Settings -> General -> Bluetooth reports 2C:FF:EE:xx:xx:xx (last three octets blanked out) differs from the address transmitted. This suggests that iOS randomizes the MAC address when transmitting.
  • The Bluetooth MAC address detected by Linux and Android does not change when you stop and restart advertising on the iOS device, suggesting iOS retains the same randomized address across restarts. After rebooting the iOS device and restarting transmission, both Linux and Android detected a different MAC address: 46:59:C9:CB:0C:D5. This suggests that the randomized transmitted MAC is changes across restarts on iOS.
Читайте также:  Bluetooth гарнитура jabra 3030

Источник

Можно ли изменить mac-адрес bluetooth мобильного устройства?

Можно ли изменить mac-адрес bluetooth мобильного устройства ?? Я спрашиваю об этом, потому что одна часть моей системы зависит от этой безопасности. Если это возможно, то насколько сложно это сделать и как это сделать.

Я знаю, что в Linux вы можете легко изменить это, но это касается ПК.

3 ответы

Производители устройств не разрешают изменять MAC-адрес, MAC-адрес контролируется и назначается IEEE, поскольку он должен быть уникальным.

Если вы производитель устройства, вы можете получить кучу адресов и постоянно менять их на одном устройстве. (так что теоретически это возможно). Изменение MAC возможно с помощью драйверов более низкого уровня, и обычно эта возможность не предоставляется приложениям.

«Я спрашиваю об этом, потому что одна часть моей системы зависит от этой безопасности». Если вы основываете MAC-адрес голубого зуба как соображение безопасности, вы поступаете неправильно.

Это ТОЧНО то же самое, что банки полагаются только на имя «back.com» для проверки того, что пользователь подключается к правильному веб-сайту. Вот почему https и SSL были изобретены не только для шифрования, но и для проверки того, что пользователи являются теми, кем они себя называют.

IE вам нужно будет реализовать какую-то цепочку доверия, чтобы это было безопасно, а не какой-то случайный MAC-адрес, который технически доступен для публичного просмотра (с диапазоном в пределах), а также может быть подделан, как было доказано приложением / драйверами ПК.

Я никогда не слышал о каких-либо инструментах в Windows, которые могут это сделать, только Linux. Я предлагаю вам получить Live CD с Linux и выполнить это пошаговое руководство:

Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками java-me mobile bluetooth or задайте свой вопрос.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

scofieldhsu/AndroidGetBluetoothMacAddress

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

  • Android has added read MAC address protection, LOCAL_MAC_ADDRESS, since Android M 6.0. So if you call Wifi/Bluetooth API to get their MAC addresses, you will get the default MAC address, DEFAULT_MAC_ADDRESS = «02:00:00:00:00:00».
  • Wifi API to get Wifi MAC address https://developer.android.com/reference/android/net/wifi/WifiInfo.html#getMacAddress() String getMacAddress ()
  • Bluetooth API to get Bluetooth MAC address https://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#getAddress() String getAddress () Returns the hardware address of the local Bluetooth adapter.
  • framework/base/api/system-current.txt field public static final java.lang.String LOCAL_MAC_ADDRESS = «android.permission.LOCAL_MAC_ADDRESS»;
  • Solution: https://stackoverflow.com/questions/33377982/get-bluetooth-local-mac-address-in-marshmallow
  • To get Wifi MAC address, you can use the Java NetworkInterface API https://docs.oracle.com/javase/7/docs/api/java/net/NetworkInterface.html byte[] getHardwareAddress() Returns the hardware address (usually MAC) of the interface if it has one and if it can be accessed given the current privileges.
  • To get Bluetooth MAC address, you can use a reflection library, net.vidageek (I have not tried it, so not sure if it works) http://projetos.vidageek.net/mirror/mirror/https://github.com/vidageek/mirror/
  • I have another method to get Bluetooth MAC address, by using reflection, Android AIDL (IBluetooth.aidl, IBluetoothManager.aidl, IBluetoothManagerCallback.aidl) to access Android Bluetooth service and then get the MAC address.
Читайте также:  Улучшить качество блютуз наушников

https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html static Class forName(String className) Returns the Class object associated with the class or interface with the given string name.

Method getDeclaredMethod(String name, Class. parameterTypes) Returns a Method object that reflects the specified declared method of the class or interface represented by this Class object.

Class classServiceManager = Class.forName(«android.os.ServiceManager»); Method methodGetService = classServiceManager.getDeclaredMethod(«getService», String.class); methodGetService.setAccessible(true); Get the Android “ServiceManager” and then get its member function “getService()”

Object object = new Object(); final IBinder iBinderBTManager = (IBinder) methodGetService.invoke(object, «bluetooth_manager»); Use the Android ServiceManager’s getService() with reflection method to get the Android Bluetooth manager “bluetooth_manger”

IBluetoothManager iBTManager = IBluetoothManager.Stub.asInterface(iBinderBTManager);

IBluetoothManagerCallback iBTManagerCallback = new IBluetoothManagerCallback()

IBluetooth iBT = iBTManager.registerAdapter(iBTManagerCallback); iBT.getAddress()

Use registerAdapter() to get IBluetooth instance, then invoke getAddress() of IBluetooth to get the Bluetooth MAC address.

Источник

Using edittext to change mac address android bluetooth app

I have a question about using edittext function in android. I have the following code in the main activity of my app:

 private static String address = "00:00:00:00:00:00"; //Then I have the on create below this 

In that line, the MAC address has to be manually edited and recompiled every time. How could I use an edittext in another activity and get the value the user inputs and have that replace the mac address. To clarify the second activity, it has an edittext area for user input, then it has a button for the user to confirm the information. What I want the activity to do is when the user clicks the button, it sends the MAC address to the main activity [above]. Also, I have various buttons in the main activity set up to send various Bluetooth signals. For example, the button fwd.id sends the signal ‘Front’ via Bluetooth:

 public void onClick(View v) < sendData("Front"); 

I was wondering that if on the same page [the second activity for configuration], I could create another edittext to alter the signal [in this case 'front'] being sent. For example, if the user wants to send the signal, 8 instead of 'front' they would input it into the edit text, click the same button as above for the mac address confirmation and the signal would change to whatever they input. If someone could please help me out, that'd be great. Thank you in advance. If you need any more info, let me know.

Источник

Оцените статью
Adblock
detector