Mounting an USB wireless adapter to a Nexus 4 Brief problem

In short I am trying to mount an external USB wireless adapter to my Nexus 4 so that I can put the wireless adapter into monitor mode to use a tool called reaver.

System

I have a Google Nexus 4, running CyanogenMod 11 (11-20140308-SNAPSHOT-M4-mako), (Android 4.4.2) I have also flashed kali nethunter 1.21.

The problem

I can't get the wireless card into monitor mode using airmon-ng. After some searching I discovered that the wireless chip-set does not support monitor mode. So the only way I was going to obtain monitor mode was to use an external wireless adapter.

What I have tried so far

When I plugged the a USB wireless adapter into the Nexus 4, it was not getting picked up. I used the ifconfig command to try to detect it but then realised that the problem must lie with the Nexus 4 not providing the 5V needed to power the adapter. So I bought an otg y cable:



After using this I could see that any device plugged in was receiving power, but it still wasn't working. So I tried mounting a flash drive to see how that would work. It turned out that there was a software limitation preventing me from mounting a flash drive as the OS was missing the OTG components.

After doing some more searching I came across this. I then flashed it in recovery mode, and after rebooting I was able to mount flash-drives. I then plugged the external wireless adapter into the Nexus 4 hoping that it would detect it but still no luck. I also tried an alternative wireless adapter but still nothing.

Wireless adapter

I am using a "wireless 11n usb adapter". I am not certain but I believe it may be a driver problem. If so, I have no idea on how I would go about installing a driver on android. My wireless chip set is RTL8188EE.

The question

How do I mount an external USB wireless adapter to a Nexus 4?
There is a very good chance that you may not have a driver problem.

There is a very important detail everyone seemed to miss about using network connections via USB: they must be plugged in before the phone is powered on! The phone must also have Wifi and Data turned off, and potentially Airplane Mode! All before the device is turned on. Some devices can get away with not needing a reboot sesh, but this is the general rule explained with BobjGear and their Android ethernet adapters.

Secondly, another very important detail, is that sometimes, you need to manually configure the adapter and its ip address through ADB or Terminal Emulator. The commands follow this format, as described in this article:

ifconfig [eth0|eth1|eth2|etc] [IP] netmask [NETMASK]
route add default gw [GATEWAY] dev eth0


ifconfig is not a typo. You will have to figure out which network "slot" your dongle is attached on via netcfg. It will list all network components in use or idle, usually wlan0 is built-in wifi, rmnet listings are mobile data, and p2p0 is VPN. Your dongle will probably fall under eth0 or 1, or wlan1 or 2.

Finally, if all else fails, you may need to find an adapter that either a) has matching (or close to matching--starts with RTL8) chipsets, or b) a (Android/linux-confirmed) truly universal wifi dongle.

If that cannot be done, this XDA post explains how to modify a Nexus CM11 kernel (your lucky day) via modprobe to enable additonal drivers. You may want to contact him for help, as his flashable kernel is specific to a custom CM11 ROM posted on XDA, just to match the checksums.

Good luck!