For couple of years I'm a big fan of OnePlus. Watching their moves from the first device I bought. I was a happy user of OnePlus One (that is not on the market anymore) and decided to stay with this brand and I've bought myself a OnePlus 3T. Everything was super cool until I came across some disturbing informations about privacy[1].

So that amount of data that OnePlus is collecting is to much for me so decided to remove it. People found a solution to remove the service using Android Debug Bridge (adb)
Did not worked with adb for a longer while so decided to do a quick post about.

Preparations

Phone

Adb requires some actions to be taken on the phone so first thing is to enable Developer Options.

In Settings -> About Phone -> Build Number and tap it 5-7 times to enable. When ready it will show you a new entry in the settings called Developer Options. Go there and enable USB Debugging Settings -> Developer Options -> USB Debugging. Having this ready we can connect the phone to linux.

Desktop(linux ubuntu)

So we need to have adb installed and some tools like MTP (media transfer protocol). We need those because of udev definitions that are in this packages.

─╼ apt-get install android-tools-adb libmtp-dev mtpfs

Connect phone with MTP

Now having udev rules in place together with adb we can move on.
First connect you phone via USB and look for it using lsubs command:

─╼ lsusb
...
Bus 001 Device 015: ID 05c6:676c Qualcomm, Inc. 
...

this line is showing and ID in my case "05c6:676c".
First value is the vendor-id, the second the product-id we need those to create a custom udev entry in the rules from MTP.
So in my case:

vendor id: 05c6
product id: 676c

Now go to this file and add a new line using id's from lsusb.
Its also time do disconnect phone from USB port.

/lib/udev/rules.d/69-libmtp.rules

...
#OnePlus 3T
ATTR{idVendor}=="05c6", ATTR{idProduct}=="676c", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1", TAG+="uaccess"
...

Last thing to do it to restart the udev service and connect back the phone.
If you did everything correctly you will see a pop-up on your OP3, select "File Transfers (MTP)", select that and now you can transfer files between your OP3 and linux!

Connect to phone with adb

At this point everything should be ready to remove unwanted service.
First we need to check if adb can see the device

─╼ # adb devices
List of devices attached 
aa57425d        unauthorized

Now on the phone you should see a dialog asking to add a trusted USB device. Accept and confirm - after that adb should see the phone like this:

─╼ # adb devices
List of devices attached 
aa57425d        device

Unwanted service removal with ADB

Ok, so we are done with preparations and can move to the removal.
lets go to ADB shell[2] find our package and uninstall it!

x1 ~ # adb shell
OnePlus3T:/ $ pm list packages
...
package.net.oneplus.odm
...
OnePlus3T:/ pm uninstall -k --user 0 net.oneplus.odm
Success
OnePlus3T:/ $

Thanks it! You can uninstall any other packages that you want or do whatever ADB is capable.


TROUBLESHOOTING

PROBLEM: When running adb you came across this screen

─╼ # adb devices
List of devices attached 
????????????    no permissions

SOLUTION: That means its something wrong with udev rules.

PROBELM: Trying to connect to phone via adb usb and having error like this:

─╼ # adb usb
error: device unauthorized. Please check the confirmation dialog on your device.

SOLUTION: On the phone having USB debug turned on you have to authorize new USB device. After that adb will be able to operate.


  1. https://www.chrisdcmoore.co.uk/post/oneplus-analytics/ ↩︎

  2. http://adbshell.com ↩︎