[OnePlus 7 & 7 Pro Cross Device Development] Re4son:
brain service.

I've added a patch to the kernel used in the 2020.2 image but it seems that this doesn't work with all twrp versions. I am currently debugging that.

If you would like to manually disable the service, just open a root session in nethunter terminal and type:

mount -o remount,rw /vendor
cat /vendor/etc/init/vendor.oneplus.hardware.brain@1.0-service.rc

You shouldn't see a "disabled" anywhere in the output. So let's add it to permanently disable the service:

cp /vendor/etc/init/vendor.oneplus.hardware.brain@1.0-service.rc /sdcard/Download
echo " disabled" >> /vendor/etc/init/vendor.oneplus.hardware.brain@1.0-service.rc

To re-enable the service, just copy the original file back.

Hope that helps and I'm working on getting the patch execute on all twrp versions.

---------- Post added at 01:42 PM ---------- Previous post was at 01:40 PM ----------

You successfully started the KeX server.

Next you have to press "Open KeX client" in the NetHunter app to open the client, type in the password you've setup and click "connect"

Hope that helps

---------- Post added at 01:57 PM ---------- Previous post was at 01:42 PM ----------

Sorry for the outdated documentation. We've been too busy making it all work over the last few months but we've set some time aside over the next couple of weeks to update the documentation.

HID attacks require /dev/hidg* interfaces as you rightly pointed out.

We used to patch 3.x kernels to permanently enable this interface. The advantage was, that you didn't have to enable it. The disadvantage was that you were stuck with the parameters hardcoded in the kernel patch and you couldn't disable it when it conflicted with other gadget modes.

Along came kernel 4.x, which a) added HID USB gadget mode and b) allowed us to switch between modes via a userspace interface. We expose the userspace interface via the USB Armory.

That means, that for 4.x kernels such as in the OnePlus 7, you have to enable HID gadget mode in the USB Armory before you can use Rucky or other ruberducky like applications. And if you would like to transfer files between your device and your host and you are getting errors, just disable HID gadget mode and you are all set.

Hope that helps

---------- Post added at 02:16 PM ---------- Previous post was at 01:57 PM ----------

Thanks, and sorry that the battery issue isn't resolved yet :o

The 2020.2 image contains a ramdisk patch that should have disabled the oneplus brain service, which is the culprit of all the battery woes.

Unfortunately the patch does not seem to be applying cleanly on all twrp versions. I'm currently debugging that.

If you would like to manually disable the service, just open a root session in nethunter terminal and type:

mount -o remount,rw /vendor
cat /vendor/etc/init/vendor.oneplus.hardware.brain@1.0-service.rc

You shouldn't see a "disabled" anywhere in the output. So let's add it to permanently disable the service:

cp /vendor/etc/init/vendor.oneplus.hardware.brain@1.0-service.rc /sdcard/Download
echo " disabled" >> /vendor/etc/init/vendor.oneplus.hardware.brain@1.0-service.rc

To re-enable the service, just copy the original file back.

I am currently debugging the patch and I'm also looking at a kernel patch to disable the service. The kernel patch would remove reliance on twrp to play nicely but it means that you can't re-enable the service from userspace and it might cause problems with OP updates. It just looks messy. The ramdisk patch uses the Android init system as it should be used to disable services but that's of no use if it doesn't apply properly :p

Let me work on that. but for now you can use the manual approach.

If you are unsure about disabling the service permanently, or if you would like to convince yourself that it indeed is the culprit, you can stop the service temporarily and watch the battery performance improve. Just open a root session in nethunter terminal and type:

resetprop ctl.stop oneplus_brain_service

Hope that helps.