Bluetooth-LE-Spam icon indicating copy to clipboard operation
Bluetooth-LE-Spam copied to clipboard

Add ability to change tx power bit on rooted devices

Open chronosirius opened this issue 1 year ago • 15 comments

I just wanted to know if this is possible as I have root access - if it is I'll look into it and maybe (?) make a PR.

chronosirius avatar Nov 07 '23 03:11 chronosirius

Feel free to look into it, until now I didn't find a way to do that even with root unless you have direct access to the hci device or BusyBox Installed. But this app should be a standalone application :)

simondankelmann avatar Nov 07 '23 04:11 simondankelmann

If one has root access to the shell, there is a way to get access to the hci device, right?

chronosirius avatar Nov 07 '23 23:11 chronosirius

Not necessarily, i have looked at it a few minutes on an older rooted phone but didnt find anything. I think to address a bigger number of devices a user would need root access and hcitool installed which comes with busybox in some cases i think ?! if thats the case i think it would be possible to send actual bytedata directly via command line allowing us to modifiy the payload completely free :)

simondankelmann avatar Nov 08 '23 07:11 simondankelmann

Could one clone the hcitool binary and package it with the app or, while keeping it a standalone app, tell users that one can do more with busybox if they choose to install it?

chronosirius avatar Nov 08 '23 23:11 chronosirius

Not necessarily, i have looked at it a few minutes on an older rooted phone but didnt find anything. I think to address a bigger number of devices a user would need root access and hcitool installed which comes with busybox in some cases i think ?! if thats the case i think it would be possible to send actual bytedata directly via command line allowing us to modifiy the payload completely free :)

Magisk and KernelSU comes with BusyBox installed. You also can it build it yourself and include it

DerGoogler avatar Nov 12 '23 15:11 DerGoogler

Interesting, I don't have hcitool or bluez installed on my magisk phone.

Update: I have BusyBox (I thought it was separate commands, my bad) but how do I use hcitool/bluez with it?

chronosirius avatar Nov 13 '23 06:11 chronosirius

@simondankelmann take a look at this thread: https://stackoverflow.com/a/35499446.

DerGoogler avatar Nov 17 '23 11:11 DerGoogler

Very Interesting ! But i think this way you can only set the actual txpower level. What we need to increase the range is setting the tx power in the payload to something like "low" but actually send with "high"

simondankelmann avatar Nov 17 '23 11:11 simondankelmann

I'm looking forward to this, too. I currently have 2 rooted devices (Magisk), a S7E and a S10e. Would love to see this implemented.

Fusseldieb avatar Jan 21 '24 01:01 Fusseldieb

Is this possible with Shizuku?

TailsFanLOL avatar Mar 08 '24 14:03 TailsFanLOL

I think the problem with this is that Android, since version 4.4 has been using BlueDroid as a Bluetooth stack. BlueDroid handles the tx bit by itself, so we cannot control it without replacing the Bluetooth stack completely. I was thinking perhaps we could bundle BlueZ with the app and then compile it on first run, but I'm not sure exactly how we would hook BlueZ in.

TLDR: If we want this we will have to use a different Bluetooth stack than the android native one. Root is unhelpful without that.

chronosirius avatar Mar 11 '24 17:03 chronosirius

I think the problem with this is that Android, since version 4.4 has been using BlueDroid as a Bluetooth stack. BlueDroid handles the tx bit by itself, so we cannot control it without replacing the Bluetooth stack completely. I was thinking perhaps we could bundle BlueZ with the app and then compile it on first run, but I'm not sure exactly how we would hook BlueZ in.

TLDR: If we want this we will have to use a different Bluetooth stack than the android native one. Root is unhelpful without that.

Just fork that part

DerGoogler avatar Mar 11 '24 17:03 DerGoogler

I presume it would not be possible to use e.g. BlueZ on newer versions of Android? Maybe through some kind of Magisk patch(that doesn't exist to my knowledge)?

Alluseri avatar Mar 18 '24 08:03 Alluseri

I presume it would not be possible to use e.g. BlueZ on newer versions of Android? Maybe through some kind of Magisk patch(that doesn't exist to my knowledge)?

I know the BlueZ maintainers had an android version up to version 5.0, but after that I have found nothing, not even magisk patches. One would have to completely modify AOSP to change the stack, and I have no idea how to even begin doing that.

chronosirius avatar May 13 '24 17:05 chronosirius

None of the original devs are up for doing this so if you want to do it yourself, go ahead.

ha2ked avatar May 15 '24 17:05 ha2ked