How to root BPI-M64

Hi guys, I recently bought M64 and everything runs smoothly and nice, but I’ve got some problems to get root access. I’ve tried Kingroot, Kingoroot, One Click Root, tried to get through terminal but nothing. Can you help me get this option enabled? It’s very important to me :slight_smile:

you can reference:

or

Sorry to bring this thread up again… Is there any recommendation on how to root the M64’s Android 6.0.1 v3 image (HDMI version) released in May 2017 (and are you working on an updated version of Android, btw)? The bootloader is unlocked via the developer options already.

I’ve been reading through the two posts, I’ve been trying to use several automated rooting apps (for both Android and Windows) without success. After that I’ve been tinkering with ADB and found out that you’re root when connecting to the M64 via “adb shell” command.

Knowing that I pushed busybox, su and Superuser.apk to /data/local/tmp/ and chmodded the permissions according to this guide https://forum.xda-developers.com/showthread.php?t=2684210

I moved su and busybox to /system/bin/ and Superuser.apk to /system/app/Superuser/, so in theory all files are placed, permissions are set and SuperSU shows up in the app drawer. But when starting it, SuperSU still returns “No root” errors.

Atm I’m thinking about finding a generic TWRP image, but that wouldn’t help since i don’t see myself able to flash anything to the device’s partitions. Both commands reboot bootloader and reboot recovery fail anyway, they result in a boot loop, i guess.

Any advice would be greatly appreciated, guys.

hello, do you disable the selinux? you should firstly use setenforce 0 to disable selinux.

Hi Tim and thanks for the advice… I had forgotten about SELinux, but even after disabling it I’m still not getting SuperSU to work (other apps also report no root). I went through all the setps again, first of all removing the files I previously had pushed to the device and rebooting once. I also downloaded the latest SuperSU flashable zip and extracted the Superuser.apk and su, and also downloaded some “latest” version of busybox - 1.22.x but should do the trick - and began from scratch.

  1. Pushing files to /data/local/tmp/ via ADB
  2. Connecting to shell via ADB
  3. Disabling SELinux
  4. Mounting /system/ as rw
  5. Setting permissions for files in /data/local/tmp/ (6755 for su, 755 for busybox and 644 for Superuser.apk)
  6. Creating a new dir Superuser for Superuser.apk in /system/app/
  7. Moving Superuser.apk to /system/app/Superuser/
  8. Moving su and busybox to /system/bin/
  9. Rebooting

I’m still clueless… Even the one-click root apps don’t succeed with SELinux disabled and /system/ mounted as rw. Maybe using those one-clickers have broken the system already and I need to reflash it. Guess I gonna get it done tomorrow.

Well, after reflashing the image several times I am still unable to get this device or rather this ROM rooted. Last week, after another reflash, I’ve tried to work my way through the notes of the update-binary script from SuperSU flashable zip, trying to establish a SuperSU system installation - still no success. Last chance I see is to try and install SuperSU system-less using its boot image patcher. I need a little timeout before working my way through that section of the script.

Hey guys,

It’s been quite some time… I had given up rooting the M64 meanwhile and only recently came back to try again when I found a new Android image released - Thx to the devs :smiley:

So, after flashing the latest Android 6 image (the Android 8 image felt a bit unfinished for everyday work) I verified that adb shell would still give me admin rights on the M64. Now here’s the trick that worked for me:

All “commands” are supposed to be typed in either Windows’ cmd or PowerShell or Linux’s Terminal. NOTE: I’m not the best author of manuals ever, so it’s gonna be brief, assuming you know how work with ADB.

  1. Connect M64 to your Windows/Linux computer, verify via adb: “adb devices” that M64 is connected
  2. Download Magisk ( https://magiskmanager.com/ || https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445 ) and unpack. We gonna need magisk.apk from common dir
  3. Install magisk.apk to your M64 via adb: “adb install magisk.apk
  4. Connect to M64 terminal via “adb shell
  5. Type “cd /dev/block/by-name/
  6. Type “ls -l” and verify that /boot is linked to /dev/block/mmcblk0p6
  7. Type “dd if=/dev/block/mmcblk0p6 of=/sdcard/Download/boot.img” NOTE: For the next step you’ll need a file explorer installed on the M64, I’ve used FX File Explorer ( https://play.google.com/store/apps/details?id=nextapp.fx ) for this purpose, ES File Explorer which comes pre-installed will do the trick, too.
  8. Launch Magisk Manager on your M64, click Install and choose Patch boot image file, then use the file explorer to pick /sdcard/Download/boot.img - the outcome will be a file named /sdcard/Download/patched_boot.img
  9. Back to your Desktop, connect to the M64 via “adb shell” in case you disconnected meanwhile
  10. Type “dd if=/sdcard/Download/patched_boot.img of=/dev/block/mmcblk0p6
  11. Type “reboot”, and use Magisk Manager to verify that your M64 is rooted (Magisk Manager should write something like Installed version: v17.1 [which is the lastest stable version as of writing this reply])

Let me know if this worked for you, too. Best regards.

PS E:\Program Files (x86)\WugFresh Development\data> .\adb devices
List of devices attached
9400503685200c19024e    device

PS E:\Program Files (x86)\WugFresh Development\data> adb shell
adb server is out of date.  killing...
* daemon started successfully *

1|root@bpi-m64-hdmi:/system # cd /dev/block/by-name/
cd /dev/block/by-name/
root@bpi-m64-hdmi:/dev/block/by-name # ls
ls
UDISK
alog
boot
bootloader
cache
empty
env
frp
media_data
metadata
misc
private
recovery
system
verity_block

root@bpi-m64-hdmi:/dev/block/by-name # ls -l
ls -l
lrwxrwxrwx root     root              2018-09-25 16:38 UDISK -> /dev/block/mmcblk0p1
lrwxrwxrwx root     root              2018-09-25 16:38 alog -> /dev/block/mmcblk0p16
lrwxrwxrwx root     root              2018-09-25 16:38 boot -> /dev/block/mmcblk0p6
lrwxrwxrwx root     root              2018-09-25 16:38 bootloader -> /dev/block/mmcblk0p2
lrwxrwxrwx root     root              2018-09-25 16:38 cache -> /dev/block/mmcblk0p11
lrwxrwxrwx root     root              2018-09-25 16:38 empty -> /dev/block/mmcblk0p15
lrwxrwxrwx root     root              2018-09-25 16:38 env -> /dev/block/mmcblk0p5
lrwxrwxrwx root     root              2018-09-25 16:38 frp -> /dev/block/mmcblk0p14
lrwxrwxrwx root     root              2018-09-25 16:38 media_data -> /dev/block/mmcblk0p17
lrwxrwxrwx root     root              2018-09-25 16:38 metadata -> /dev/block/mmcblk0p12
lrwxrwxrwx root     root              2018-09-25 16:38 misc -> /dev/block/mmcblk0p9
lrwxrwxrwx root     root              2018-09-25 16:38 private -> /dev/block/mmcblk0p13
lrwxrwxrwx root     root              2018-09-25 16:38 recovery -> /dev/block/mmcblk0p10
lrwxrwxrwx root     root              2018-09-25 16:38 system -> /dev/block/mmcblk0p7
lrwxrwxrwx root     root              2018-09-25 16:38 verity_block -> /dev/block/mmcblk0p8

root@bpi-m64-hdmi:/dev/block/by-name # dd if=/dev/block/mmcblk0p6 of=/sdcard/Download/boot.img
dd if=/dev/block/mmcblk0p6 of=/sdcard/Download/boot.img                        <
32768+0 records in
32768+0 records out
16777216 bytes transferred in 1.823 secs (9203080 bytes/sec)

root@bpi-m64-hdmi:/dev/block/by-name # dd if=/sdcard/Download/patched_boot.img of=/dev/block/mmcblk0p6
dd if=/sdcard/Download/patched_boot.img of=/dev/block/mmcblk0p6                <
32624+0 records in
32624+0 records out
16703488 bytes transferred in 2.920 secs (5720372 bytes/sec)

root@bpi-m64-hdmi:/dev/block/by-name # reboot
reboot

PS E:\Program Files (x86)\WugFresh Development\data>
2 Likes

Worked for me! Great and usefull tutorial! Helped me after searching for a long time! For step 8. you need an Internet connection for the “Magisk Manager” App, otherwise you can’t click “Install”. I’m running on Android 6.0.1 from 06.05.2017 and Magisk Version 18.0, everything seems to be fine.

Thank you very much. Best regards.

Thanks to j_dee463, you helped me a lot for rooting my m64 ! :smiley:




For those who cant have “adb devices” working :

sudo apt-get install android-tools-adb android-tools-fastboot

adb kill-server

lsusb // Bus 001 Device 006: ID 1f3a:1007 Onda (unverified)

sudo vim /etc/udev/rules.d/51-android.rules

SUBSYSTEM=="usb", ATTR{idVendor}=="1f3a", ATTR{idProduct}=="1007", MODE="0666", GROUP="plugdev", SYMLINK+="android%n"

sudo chmod a+r /etc/udev/rules.d/51-android.rules

sudo mkdir ~/.android

sudo vim ~/.android/adb_usb.ini

0x1f3a

sudo service udev restart

// reconnect your usb cable

sudo adb devices
1 Like

What is supposed that does this apk to root the Android´s system boot.img? Anyone knows what I need to modify in the source code to get the system rooted manually? I´ll like to know what I am doing with this apk, or what is needed to do to get boot.img rooted, if it´s possible. Thanks in advance!!!

Hi, Anafry:

I’m using the TOUCHSCREEN LCD 7 "S070WV20-CT16 with Banana Pi M64 and the touch screen is not working on Android 6.0.1 Release 2018-10-24! I already tried compiling the kernel 6.0.1 android 3.10 with the (bpi-m64-lcd or bpi-m64-lcd7) option and the touch screen does not work! The second problem I noticed is that from HDMI connected in android 6.0.1 kernel 3.10 (bpi-m64-lcd or bpi-m64 -lcd7), The Banana Pi M64 does not booting! Could you help me?? Sorry my bad english! :slight_smile:

Especification, my touch screen: BPI_TouchScreenLCD7