yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] osd_daedalus:
Partially worked, because I have "bmon_wrapper_loaded" but every thing I do results in "cannot find wireless tools, exiting...".

It is same behaviour when I tried to run tools from terminal and not from "run bcmon terminal".

What I noticed is I don't have nvram_cfg.txt, but these files:

root@GT-N7000:/etc/wifi # ls |grep nvram
nvram_mfg.txt
nvram_mfg.txt_murata
nvram_net.txt
nvram_net.txt_murata

I tried all of combinations... maybe I miss something?

looks like PIE binary incompatibility... so it was told in this post:

http://xdaforums.com/showpost.php?p=57168235&postcount=465

... because I have thought until now that enabling/disabling wifi was just a matter of module loading/unloading? :eek:

OK, let's make it old-style... all in the kernel! :good:

I was thinking... how the original Android kernel behaves inmac80211 and ath9k compiling? https://android.googlesource.com/kernel/common/+/android-3.4
[Android Apps and Games] ruleh:
I didn't test the original(?) android kernel but I assume it would work just fine. Afterall some other android kernels just compile nicely without any complaints what so ever. And then there are those "kill what we don't need" kernels which just don't work by simply "make"ing them

Also nvram_net.txt should work instead nvram_cfg.txt

PIE: workaround
[Android Apps and Games] luvk1412:
Hey guyz

I wanna use RFA on my mobile but I am facing problems with bcmon

Details:

Mobile-Moto e (1st gen)

ROM - cm12.1 based

Processor - sd 200

Issue:

When I open bcmon i get

Firmware Model:not detected

Installed tools version:0

Installed fw version:0

When I click on setyings nothing happens and clicking on status exits the app

I googled about the issue but didn't found any solution

Hope anyone here can help me out

Thnx
[Android Apps and Games] ruleh:
Your wifi chip is probably not supported.

Please make sure you have a bcm4330/bcm4329 chip.

Other wifi chips DO NOT work.

You have to find out yourself if your chip is one of the supported or not.

Bcmon says its not.
[Android Apps and Games] luvk1412:
Hey thanks for such a quik reply really appreciate it.. Can you tell me how can I find my WiFi chipset no. Or model whatever it is I checked GSM arena but didn't found .. I have moto e 1st gen
[Android Apps and Games] ruleh:
The easiest way to check would be to run "lsmod" before and after you disable wifi.

The one module that changes (gets removed from the list) is your wifi driver. From there you can find your chipset.
[Android Apps and Games] luvk1412:
What you said actually got over my head ... Can you explain in detail
[Android Apps and Games] ruleh:
Open terminal

run

lsmod

note the output

then disable wifi from android

then run (again)

lsmod

note the output (again)

now compare this to the output to the one from the beginning.

the one module that is missing on the 2nd output, is your wifi driver.

Type the name in google to find out your chipset
[Android Apps and Games] luvk1412:
​

By disabling WiFi you mean turning of WiFi only na? .. Doing will report
[Android Apps and Games] ruleh:
disabling wifi ---> turn of wifi from android (e.g from settings)
[Android Apps and Games] luvk1412:
This is what I got in result googled that wlan and no. But found nothing

Results

u0_a110@condor:/ $ su

root@condor:/ # lsmod

wlan 3471505 0 - Live 0x00000000 (C)

root@condor:/ # lsmod

root@condor:/ #
[Android Apps and Games] ruleh:
well that turned out to be useless.

Well you could try to look through your kernel sources but that takes time.....

....but at least we know know that you don't have a bcm4330/bcm4329 because it would be called "bcmdhd" or bcm4329"
[Android Apps and Games] luvk1412:
Oh OK... My bad :'(

But thnx quick help dude ... Really apreciated

I must continue this on PC only.. I thought I could run it on mobile
[Android Apps and Games] ruleh:
We are trying to make this work on usb wifi chips.

If you have an OTG cable and a usb wifi dongle you might be able to use it in the future.
[Android Apps and Games] luvk1412:
My moto doesn't supports otg

Again my bad.. Looks like my moto is against this thing :p
[Android Apps and Games] ruleh:
you might have a bad version of terminal emulator. Install a new one and then reinstall bcmon. Also make sure root is enabled everywhere.
[Android Apps and Games] ruleh:
At last, Victory!

Soooooo.....

Here it is again: another update on my progress

And it seems positive

Progress:

--kernel boots

--kernel modules load (yeah I kept it at modules for now [can't be bothered to boot up into cm12 with its pie restriction])

--usb OTG cable arrived

--lsusb finally found the damn ralink dongle (had to connect it to my laptop cooler and then connect that to my phone)

--iwconfig shows the device

--airmon-ng (from chroot) sets it to monitor (and gives it the wierd name "wlan1mon") note: it is set to monitor in chroot and in android.

--aircrack tools work fine from chroot

--reaver works from chroot

iwconfig sees the device

airodump from chroot

Problems

--sometime the phone refuses to accept that there is infact a usb device (the wifi dongle) connected to it.

--reaver for android doesn't really work out of the box (probably because wlan1mon)

--who knows?

What now?

--aircrack tools (on android)

----get airmon-ng (got it)

----set to monitor (really complicated--it doesn't like me)

----do some monitoring (works!)

--test different configurations to get rfa working (meaning change wlan1mon to wlan0 and then do tons of other stuff {though I have no idea how to change the names lol})

----alternatively, an interface selection menu would be helpfull.

--document the changes to kernel

--make universal patches. (near to end goal)

I am thinking of a giant module that combines the complete mac80211 stack, the complete cfg80211 stack and a lot of drivers---this would require the removal of the cfg80211 from the kernel {which will break a lot}.

Lets hope my phone will detect the ralink device again (cause it did once before I plugged it out) without the use of a high powered laptop cooler --- it works -->turns out that at below 15% battery charge, otg just refuses to give out power to the poor little device (but it still gives power to the damn laptop cooler which is connected to 3 mice and a headset all of which get powered by the tiny usb port)
[Android Apps and Games] SOEDI:
First of all: GREAT WORK, ruleh!

Instead of complaining like "RfA/bcmon is not working on my <insert random device here>", you are actually trying to get things done:good:

Btw: RfA has already some kind of support for monitor-mode without bcmon. Just have a look at the second post of this thread. You can set any wifi interface, no need to create workarounds specially for RfA :p

If something in RfA seems to cause problems, contact me, so we can solve it.

Regards,

SOEDI
[Android Apps and Games] ruleh:
I'm so sorry.

It turned out I was using an old version of RfA (no idea why) and therefore I didn't see these settings.
[Android Apps and Games] ruleh:
Goal

RfA on external wifi dongle

Progress

RfA is working on a rt73usb device

Problems

--Only for the sgs2 right now (which is kinda useless since it already has bcmon)

--android often refuses to send power to wifi dongle

--monitor mode from android is hard. (chroot is prefered)

What now?

--no idea really. You tell me.

Some comment

Basically it works. And when it works, it works good.

I did have problems getting RfA to work with the external device because I had an outdated version (v1.20) but the current version (v1.30) makes it very easy to use the external device once the drivers are loaded and the device is connected.

And it works PERFECTLY.

However my ralink device is very old and used and probably already dead (it just doesn't know it yet) so chances are that it won't work long for me (it already overheats like hell during usage). My wifi dongle died. One of the pins of the usb part broke off.

Right now I am thinking of different paths to take for the future and it would be helpful if people could...uhmm..welll....help.

Here are my suggestions:

1--Make patch files which normalise the networking stacks and drivers so that it is easy to simply compile them and flash along with the kernel.

2--A huge module which includes a normalised networking stack and all the drivers. This one should be able to be loaded into the kernel without a lot of troubles because all the dependencies should be resolved inside the module itelf (making it quite big)

Note: This module needs to be compiled with the correct kernel version but the kernel does not need to be recompiled

3--take, edit, make kernel. Basically fix every kernel one by one. I would suggest starting with the more common cm kernels and then working the way down.

4--Make a guide that tells people how to do the modifications themselves so they can learn while at the same time getting the stuff working.

5--Ask kernel developers to keep their kernel as standard as possible without breaking stuff (hybrid kernels are the worst offenders here).

6--Abandon the project and be happy with bcmon ('cause why not. Afterall it works for me).

Please tell me which one of these you prefer or if you have your own ones please share.

That's it for now

Edit: Since my wifi device died:crying::crying:, I won't be able to post any more updates concerning the use of the dongle.
[Android Apps and Games] gusky651:
help!!!

Hey developer! You did an awesome job with the app But unfortunately i cant test it cause of this error about libpcap.so.1 missing. My device is mtk so no broadcom. Please help me
[Android Apps and Games] ruleh:
Even if your device doesn't support bcmon, still install the app.

It will extract all the needed files at /data/data/com.bcmon.bcmon/files/libs
[Android Apps and Games] gusky651:
Still doesnt work. Also, do i nees busybox? Cause i dont have it installed.

---------- Post added at 02:37 AM ---------- Previous post was at 02:34 AM ----------

I forgot to mention that i installed bcmon, it said firmware version model not detected and in /data/datacom.bcmon etc. The folder files is empty
[Android Apps and Games] osd_daedalus:
A minute of silence of the brave ralink device, it will be always remembered...

From my side:

sincerely nothing... after the big help from [MENTION=6324821]ruleh[/MENTION] to make ath9k_htc compilable (I insist, if it works you should make a fork&pull request to CM kernel source!), I realized I wronged kernel :eek:

Right now I'm checking up the correct one, and try to adapt edits on the kernel. If it works, I'll make patch as suggested.

Let's see... I have a powered usb-OTG cable, which should resolve the issue Android refusing to give power.

99% of times will mean your device is not compatible with bcmon. You can adventure with us in kernel recompiling and making an external wifi device doing the job.

Unless someone of us wants to adventure in reverse engineering firmwares to grant monitor mode to devices' internal Wifi...

The issue with bcmon is in mobile devices' firmwares, which won't support monitor mode, such as Atheros AR6000 ones featured in another phone of mine...
[Android Apps and Games] gusky651:
In second post you said the scripts can be used on any device

---------- Post added at 03:52 AM ---------- Previous post was at 03:06 AM ----------

So monitor mode starts but it gives me missing file error the one with pcap
[Android Apps and Games] ruleh:
The scripts can be used on any device if you can activate monitor mode somehow.

How can you tell monitor mode is working? (depending on to this the scripts need to be altered.)

However you can decompile the bcmon apk and extract to the folder I mentioned before.
[Android Apps and Games] SOEDI:
Congratulations!

How do you start monitor-mode and get it to work with RfA? Its running without chroot?

And how about injection support?

In my opinion the best way is a big fat kernel module with a guide how to compile it yourself for your kernel.

We could post any precompiled module here, so users of frequent devices wouldn't even need to compile it theirself. (Giving weapons to monkeys, right? :p )

I have a rt73usb at home and could do some testings.

Are you willing to buy a new one? If so, I guess we can donate one for you. Just tell us whats the prize of the one you wanna buy and we will find a solution. ;)
[Android Apps and Games] gusky651:
I extracted the files but idk if in the right directory, see the photo. Also, when i press start attack it says monitor mode activated.
[Android Apps and Games] SOEDI:
You created a custom activation script which echoes "rfasuccess" ?

Well, to keep it simple: bcmon is not compatible with your device und external wifi support is not quiet ready yet, so for now you can just relax and wait.
[Android Apps and Games] gusky651:
Bcmon is not compatible because my phone doesnt have a broadcomm chipset?
[Android Apps and Games] ruleh:
I used a script which enables monitor mode in chroot as the monitor activation script.

(something like "linuxdeploy shell "airmon-ng start wlan1"")

Injection works fine (deauth at least)

And yes I am willing to buy a new one once the revival attempt of using a soldering iron fails.

I will try to get everything into a fat module. This will give me a ton of conflicting definitions but it might work.

Once we have the module we just need to match kernel version strings and everyone should be bale to use it.

Edit: The power issue was related to the lose pin in the usb dongle. Somehow whenever I had a higher charge it seemed to be randomly working though it wasn't really the cause. (the cause was the pin somethings jumping back to the correct position after cooling down (which was when I was recharging)--it became VERY hot [comparison: the hottest you can get from tap water])

---------- Post added at 20:33 ---------- Previous post was at 19:38 ----------

Yes however the libraries (some of them) and the binaries (includibg the reaver binary) also work on non bcmon chips (such as thr rt73usb).

If you can get a decent reading from something like iwconfig showing that your device is in monitor mode, then you can use a similar script to post 2.
[Android Apps and Games] Flake7100:
Hello I'm have Note 2 N7100 Dn4 rom+Aholicort Mod v11

Any help to run this app on my device ?
[Android Apps and Games] gusky651:
How do i use iwconfig? In terminal or what?
[Android Apps and Games] ruleh:
yes. you type "iwconfig" in terminal.

If you don't have it, you need to install it, there are many guides online on how to do it.
[Android Apps and Games] ruleh:
UNDEAD

From the dead rises the once falled hero rt73

Basically the "surgery" worked and its up and running again. It also doesn't overheat anymore (well it does but only slightly)

Seems like someone needs to go through a lot of hell before getting a chance to rest for ever.

It also got a new haircut (the usb head got shorten by 1-2mm because I accidently sealed it off with solder)

Seems like the power issue wasn't realted to the pin but to the mood of the device (don't ask what that is 'cause I don't know)

Back to topic

Since I don't know how to use git, make diffs , create patch files, etc..., it will take some time for me to test the changes on different kernels.

Also I have exams soon so instead I will make a brief guide on what changes need to be done to get usb devices working for the time being.

After that I will be working on the big module that could be distributed without making many changes (only version strings).

EDIT: I attached a somewhat rushed guide, Good luck figuring it out.

EDIT2: can someone take a quick look over the brcmfmac and brcmsmac drivers?
[Android Apps and Games] drakonizer:
Has anyone had any success in using Reaver on Lollipop? I have an S2 and it worked fine in CM10.2, but now since I upgraded to LP, I've been trying to get it to work again. I know PIE is the issue and I have flashed numerous PIE workaround zips, but it has been of no help.
[Android Apps and Games] ruleh:
The pie issue still exists and sadly it is being accepted as a "feature".

If you want to disable it you need to recompile the rom or contact your rom developer.

Another workaround would be recompiling reaver as a pie binary.
[Android Apps and Games] drakonizer:
I see... I seem to have had success in enabling monitor mode on bcmon, so PIE seems to be the only issue. I wonder if [MENTION=4096618]SOEDI[/MENTION] would be kind enough to release a PIE version of his amazing app, to help the LP users
[Android Apps and Games] ruleh:
Another workaround for now

You need a chroot gnu/linux (and linuxdeploy) with reaver

copy the 3 scripts and set them in RfA

script1

#!/system/bin/sh
svc wifi disable
rmmod dhd
insmod /system/lib/modules/dhd.ko iface_name=wlan0 firmware_path=/data/data/com.bcmon.bcmon/files/bcm4330_sta.bcmon.bin nvram_path=/etc/wifi/nvram_net.txt
LD_LIBRARY_PATH=/data/data/com.bcmon.bcmon/files/libs
LD_PRELOAD=/data/data/com.bcmon.bcmon/files/libs/libfake_driver.so sh
cd /data/data/com.bcmon.bcmon/files/tools
./enable_bcmon
echo "rfasuccess"
exit

script2

#!/system/bin/sh
linuxdeploy shell
cd /usr/bin

and script 3

#!/system/bin/sh
rmmod dhd
svc wifi enable
echo "rfasuccess"
exit

This is assuming you have a s2 and linuxdeploy (because that's what I use and it works).

It seems like (my) chroot is completely unaffected by pie restrictions (or everything is compile pie compatible).

Enjoy :)

edit: scrap that it doesn't work for the internal wifi (you need to actually set it to monitor mode in chroot, not just pretend that it is in monitor using the libfake_driver.so library --which btw doesn't load in chroot).
[Android Apps and Games] osd_daedalus:
First patches - won't assure it works

Checking differencies of [MENTION=6324821]ruleh[/MENTION] edited kernel against stock CM12.1 kernel with git, I came up with a big patch file... over 40000 lines! Looks like many different kernels were merged...

Really cfg80211 / mac80211 / wlan drivers are SO messed up?

After some work, applying portions of this patch one file at time, I came up with something which can make a bootable kernel at least on [MENTION=799465]bauner[/MENTION] NightOwl CM12.1 for N7000, which I thank also for his help (that's why I mention him). This should make mac80211 compilable.

The kernel I built works, but device goes in soft bootloop, I believe when it tries to enable mobile data. Unfortunately, N7000 is my daily driver device and you know, is hard to develop while the entire family and work collegues try to call you "right when you are flashing"...

So, here's to you what I got it to came up in making a kernel with mac80211 compilable (DISCLAIMER: won't assure it works! Can be a base to work on it)

Get your kernel sources and set your environment for building. I suggest you this guide to start.

Do your defconfig (remember to set your ramdisk source file) and menuconfig. Select to compile the mac80211 stack as module: you will find it in Networking Support --> Wireless --> Generic IEEE 802.11 networking stack

Copy the patch "mac80211.diff" in the root of the kernel source, and apply it with:

git apply mac80211.diff

It is highly probable git will complain about things not to be patchable. In that case, use the --3way argument, like this:

git apply --3way mac80211.diff

If all goes well, patch will be cleanly applied. Otherwise you are going to manually select between "yours" and "theirs" code.

Eventually, with git checkout and git reset --hard (also git clean -f) you can restore everything as before.

Proceed to make modules and hope it works. Do the zImage and flash the kernel.

If while doing zImage, something about "piggy_lzma" complains about unknown CPU architecture, apply the piggy_lzma patch with git apply, like before.

Hope again your phone boots up and won't go in a soft reboot cycle. In any case,

hope

:)

If all goes well AND you are so lucky you can load mac80211.ko, you can proceed all over again adding also your wireless device drivers (ath9k and ath9k_htc are badly broken: if I can resolve my issues I can attempt to work on it)

Let us know how it goes and PLEASE, apply corrections as I'm sure these patches are going to edit more than needed...

Credits for these patches:

if they work, praise [MENTION=6324821]ruleh[/MENTION]

if they brick your phone like it will happen 95% of times, blame me for the mess! :D

At least you should still be able to go in download/fastboot mode, so ensure you have already a working kernel to flash.
[Android Apps and Games] drakonizer:
1.4GB is quite a large workaround. A very good idea though. I'll keep it in mind if I need RfA urgently on my phone. But for now, I think I'll either wait for the OP to update his app, or downgrade just to use Reaver.

Thank you for your help
[Android Apps and Games] ruleh:
I looked through the patch and it is missing the ath drivers (luckily because they take 60k lines for me) and some small stuff, other than that, really nice.

We are now another step closer to the end.

However, I just tried to do a diff myself and found out how painfull the sources that I send you are.

So sorry for that.

Anyways, could you look over these 2 diffs and maybe add (or remove) things?
[Android Apps and Games] osd_daedalus:
Yes, I stripped out ath things because I wanted a working mac80211 module first :)

So, I have looked at your diffs and both will apply correctly. I have only removed lsexport.h as my kernel sources already feature it.

The only issue is about the "big" one (with ath support), because the kernel compiles, but just at the end, during MODPOST, it whines about undefined things:

CC [M] net/mac80211/rc80211_minstrel.o
CC [M] net/mac80211/rc80211_minstrel_ht.o
LD [M] net/mac80211/mac80211.o
Building modules, stage 2.
MODPOST 15 modules
ERROR: "led_brightness_set" [net/mac80211/mac80211.ko] undefined!
ERROR: "led_trigger_unregister" [net/mac80211/mac80211.ko] undefined!
ERROR: "led_trigger_register" [net/mac80211/mac80211.ko] undefined!
ERROR: "led_trigger_event" [net/mac80211/mac80211.ko] undefined!
ERROR: "led_blink_set" [net/mac80211/mac80211.ko] undefined!
ERROR: "led_classdev_register" [drivers/net/wireless/ath/ath9k/ath9k_htc.ko] undefined!
ERROR: "led_classdev_unregister" [drivers/net/wireless/ath/ath9k/ath9k_htc.ko] undefined!
ERROR: "led_classdev_register" [drivers/net/wireless/ath/ath9k/ath9k.ko] undefined!
ERROR: "led_classdev_unregister" [drivers/net/wireless/ath/ath9k/ath9k.ko] undefined!
make[1]: *** [__modpost] Errore 1
make: *** [modules] Errore 2

Of course, this won't apply if I try to compile only mac80211.ko, so it must be something between mac80211 and ath9k/ath9k_htc interaction.
[Android Apps and Games] ruleh:
Yeah maybe the driver and mac80211 versions are different, either too old or too new. That's why android kernels are a bit annoying: they update one thing, and leave everything else old.

Though I always thought that ath9k wasn't really that dependent on mac80211; One would think that the driver should be able to do its own led management.

Other than that, I would try compiling the driver and mac80211 in kernel, it makes many things much easier since android doesn't really have udev for dynamic module loading and loading modules by hand is just painfull. It could also resolve the modpost problem since those 2 modules don't really exist as modules anymore.

Then again there is no need to use the big patch when the small one or your one compiles and loads correctly.

EDIT: the led problem can be fixed by ensuring that led.o is being compiled. You can set it in the config file if you need to (called led class support or so).
[Android Apps and Games] osd_daedalus:
Very well, later I'm going to try and let you know how it goes

UPDATE: well... it compiled!

Tomorrow I'm going to attempt flashing

UPDATE 2: Ack, it flashed, but device started bootlooping and getting SystemUI FC. Maybe should I wipe ART cache after flashing kernel?

This evening I'm going to try again.
[Android Apps and Games] ruleh:
If you have any settings that are set on boot (e.g cpu governer etc) disable them.

And if the art cache wipe doesn't get you far, try a complete wipe and reinstall the rom and then the kernel before booting into android.

Anyway, Good Luck.