FORUMS
Remove All Ads from XDA

How to manually update su and SuperSu file through ADB root shell?

4 posts
Thanks Meter: 2
 
By towenyu, Junior Member on 2nd November 2015, 10:16 AM
Post Reply Email Thread
I have an un-rooted device, with Android 5.0 system, and the core is ARM Coretex A53.

I happen to found "adb root" works, that means I can play as root through ADB shell.

I successfully deleted a trash apk, renowned "kingroot", from my system.

Then, I try to manually update su and SuperSu file, through the bellowing commands:

# mount -o rw,remount /system
# cp /sdcard/mrw/su /system/xbin/su
# cp /sdcard/mrw/su /system/bin/su
# pm install /sdcard/mrw/superuser.apk
(I'm using a 2.46 SuperSu version, which should be OK for Android 5.0 system)

But it fails. The SuperSu told me " su binary not installed".

My questions:
1. Is this a feasible way to update Su and SuperSu, and get root access?
2. There's a bunch of architect, I tried both "arm" and "arm64", but none of the su binary can work. Which architect shall I choose, when I'm running on a ARM Coretex A53 core? ( I know it is a 64bit core)

Thanks a lot, and Best Regards,
towenyu
The Following User Says Thank You to towenyu For This Useful Post: [ View ] Gift towenyu Ad-Free
 
 
2nd November 2015, 08:48 PM |#2  
xfullmetal17's Avatar
Senior Member
Thanks Meter: 54
 
Donate to Me
More
Did you get this device secondhand? Also what device is it, since many have their own root method because of OEM crap.

That said, you only need su in one location, either /system/xbin/su or /system/bin/su (I typically see it in /system/xbin/su). I'm not sure what happens if it's in both, but it's just wasted space.

You can try these commands through adb root; since you already were able to get su onto your device, it may be just a matter of ownership and permissions:
Code:
# mount -o rw,remount /system
# chmod 755 /system/xbin/su
# chown root:root /system/xbin/su
# mount -o ro,remount /system
chown 755 sets the permissions to rwxr-xr-x (user gets read/write/execute, group/other gets read/execute). Execute is the important bit here, since otherwise the su binary can't do its job. After those commands, try SuperSU again and see if it works (you might need a reboot, because of how Android 5.0+ handles changes to /system) The last mount -o ro command just changes /system back to read-only, to prevent accidental changes to other parts.
3rd November 2015, 04:58 AM |#3  
OP Junior Member
Thanks Meter: 2
 
More
Successfully rooted!

Not that simple, but basically follow the update-binary script already inside supersu package.

Only need to made slight modification due to my system won't support "unzip"
3rd November 2015, 07:54 AM |#4  
xfullmetal17's Avatar
Senior Member
Thanks Meter: 54
 
Donate to Me
More
Now that you're successfully rooted, go install Busybox, that'll give you a lot of Linux commands Android doesn't have by default, including unzip.
The Following User Says Thank You to xfullmetal17 For This Useful Post: [ View ] Gift xfullmetal17 Ad-Free
3rd November 2015, 08:53 AM |#5  
OP Junior Member
Thanks Meter: 2
 
More
Quote:
Originally Posted by xfullmetal17

Now that you're successfully rooted, go install Busybox, that'll give you a lot of Linux commands Android doesn't have by default, including unzip.

Thanks for your advice! I will try it.
But don't there's already a Busybox in android system? I guess what I need to do is find somewhere a more powerful busybox binary -- or build it by my own, but that may be not so easy for me.
4th November 2015, 07:30 AM |#6  
xfullmetal17's Avatar
Senior Member
Thanks Meter: 54
 
Donate to Me
More
Android has some basic Linux commands support, but I don't think it has Busybox (if you have a custom ROM you may have some additional commands, but since you said unrooted I don't think it was installed.

This is one of the most popular installers for Busybox: https://play.google.com/store/apps/d...ricson.busybox
I've used it since I first rooted with Android 2.2 and haven't had any issues with it (save for lack of vim, since stock Android doesn't have the correct libraries for it)
The Following User Says Thank You to xfullmetal17 For This Useful Post: [ View ] Gift xfullmetal17 Ad-Free
7th June 2016, 11:34 AM |#7  
Member
Thanks Meter: 0
 
More
rooting my htc m9 running marshmallow
Hi, I'm totally blind, and twrp isn't an option for me since it doesn't have a built in screen reader. I would like to install supersu to system, would some one kindly help me in telling me what files to put where. I think the m9 is arm64, but besides su and supersu.apk, I think there's installrecovery.ssh and some other files that have to go in, so please help some one
Quote:
Originally Posted by xfullmetal17

Android has some basic Linux commands support, but I don't think it has Busybox (if you have a custom ROM you may have some additional commands, but since you said unrooted I don't think it was installed.

This is one of the most popular installers for Busybox: https://play.google.com/store/apps/d...ricson.busybox
I've used it since I first rooted with Android 2.2 and haven't had any issues with it (save for lack of vim, since stock Android doesn't have the correct libraries for it)

27th May 2017, 08:50 PM |#8  
Senior Member
Thanks Meter: 240
 
More
Hi guys ,

it is possible to run manualy via adb shell update-binary file from META-INF supersu folder for install it ? (means before unpacked folder supersu is copied to ex. /tmp)
I'm asking bcose no custom recovery and no root on my device yet.

Thx
30th August 2017, 02:49 PM |#9  
Senior Member
Flag Shenzhen
Thanks Meter: 215
 
More
Quote:
Originally Posted by nalas

Hi guys ,

it is possible to run manualy via adb shell update-binary file from META-INF supersu folder for install it ? (means before unpacked folder supersu is copied to ex. /tmp)
I'm asking bcose no custom recovery and no root on my device yet.

Thx

I have same saturation, no TWRP, no SU installed on my device: root@idol4s_cn:/ #, Android M,
What I have is a userdebug boot.img support "adb root", so my draft commands in my mind please run one by one, not batch.. WARNING, this may make your system bootloop,take your own risk!!!.)
fastboot flash boot boot_userdebug.img
fastboot reboot
adb wait-for-device
adb root
adb remount
adb disable-verity
adb shell setenforce 0
adb reboot

cd D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64
adb wait-for-device
adb root
adb remount
adb shell setenforce 0
adb push .\su /system/bin/su
adb push .\su /system/xbin/su
adb shell chmod 06755 /system/bin/su
adb shell chmod 06755 /system/xbin/su
adb shell /system/bin/su --install
adb shell /system/bin/su --daemon&
adb install ..\common\Superuser.apk
adb shell setenforce 0
adb disable-verity

if you found SuperSU not found root, try adb shell setenforce 0 again.
then you can get SuperSU found su file need to update, use normal way to do it.
then, it will be "Installation success !"
Enjoy it.
so reference log:
D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64>adb push su /system/bin/su
adb: error: failed to copy 'su' to '/system/bin/su': Read-only file system

D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64>adb root

D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64>adb push su /system/bin/su
adb: error: failed to copy 'su' to '/system/bin/su': Read-only file system

D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64>adb remount
remount succeeded

D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64>adb push su /system/bin/su
[100%] /system/bin/su

D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64>adb push su /system/xbin/su
adb: error: failed to copy 'su' to '/system/xbin/su': Read-only file system

D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64>adb shell
root@idol4s_cn:/ # su
root@idol4s_cn:/ # cd /system/bin
root@idol4s_cn:/system/bin # chmod 06755 su
chmod: chmod 'su' to 106755: Read-only file system
1|root@idol4s_cn:/system/bin # ls su
su
root@idol4s_cn:/system/bin # ls -al su
-rwxr-xr-x root shell 108496 2008-02-29 03:33 su
root@idol4s_cn:/system/bin # su --intall
root@idol4s_cn:/system/bin # su --daemon&
[1] 6146
root@idol4s_cn:/system/bin # getenforce
Enforcing
[1] + Done su --daemon
root@idol4s_cn:/system/bin # setenforce 0
root@idol4s_cn:/system/bin # getenforce
Permissive
root@idol4s_cn:/system/bin # exit
root@idol4s_cn:/system/bin # exit
root@idol4s_cn:/ # exit

/system/bin/su
exit
^C
The Following User Says Thank You to Azlun For This Useful Post: [ View ] Gift Azlun Ad-Free
31st August 2017, 09:47 AM |#10  
Senior Member
Thanks Meter: 240
 
More
Quote:
Originally Posted by Azlun

I have same saturation, no TWRP, no SU installed on my device: root@idol4s_cn:/ #, Android M,
What I have is a userdebug boot.img support "adb root", so my draft commands in my mind please run one by one, not batch.. WARNING, this may make your system bootloop,take your own risk!!!.)
fastboot flash boot boot_userdebug.img
fastboot reboot
adb wait-for-device
adb root
adb remount
adb disable-verity
adb shell setenforce 0
adb reboot

cd D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64
adb wait-for-device
adb root
adb remount
adb shell setenforce 0
adb push .\su /system/bin/su
adb push .\su /system/xbin/su
adb shell chmod 06755 /system/bin/su
adb shell chmod 06755 /system/xbin/su
adb shell /system/bin/su --install
adb shell /system/bin/su --daemon&
adb install ..\common\Superuser.apk
adb shell setenforce 0
adb disable-verity

if you found SuperSU not found root, try adb shell setenforce 0 again.
then you can get SuperSU found su file need to update, use normal way to do it.
then, it will be "Installation success !"
Enjoy it.
so reference log:
D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64>adb push su /system/bin/su
adb: error: failed to copy 'su' to '/system/bin/su': Read-only file system

D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64>adb root

D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64>adb push su /system/bin/su
adb: error: failed to copy 'su' to '/system/bin/su': Read-only file system

D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64>adb remount
remount succeeded

D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64>adb push su /system/bin/su
[100%] /system/bin/su

D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64>adb push su /system/xbin/su
adb: error: failed to copy 'su' to '/system/xbin/su': Read-only file system

D:\tools\Downloads\SR3-SuperSU-v2.82-SR3-20170813133244\arm64>adb shell
root@idol4s_cn:/ # su
root@idol4s_cn:/ # cd /system/bin
root@idol4s_cn:/system/bin # chmod 06755 su
chmod: chmod 'su' to 106755: Read-only file system
1|root@idol4s_cn:/system/bin # ls su
su
root@idol4s_cn:/system/bin # ls -al su
-rwxr-xr-x root shell 108496 2008-02-29 03:33 su
root@idol4s_cn:/system/bin # su --intall
root@idol4s_cn:/system/bin # su --daemon&
[1] 6146
root@idol4s_cn:/system/bin # getenforce
Enforcing
[1] + Done su --daemon
root@idol4s_cn:/system/bin # setenforce 0
root@idol4s_cn:/system/bin # getenforce
Permissive
root@idol4s_cn:/system/bin # exit
root@idol4s_cn:/system/bin # exit
root@idol4s_cn:/ # exit

/system/bin/su
exit
^C

Thank You - I will check and give feedback
8th November 2017, 07:03 AM |#11  
Junior Member
Thanks Meter: 0
 
More
Can I somehow just copy su and supersu files to phone (stock ROM) with full root shell to get root? Unfortunately bootloader is locked and only root shell is available.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes