This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rooting Android
#1
Hi, 

Did anyone manage to get root in Android
I can actually get root through a serial console but I can't get it in apps. 
Set the setuid bit on su but still no success.

Code:
user@rk3288:/storage/emulated/0/ssh $ su
su: not allowed
1|user@rk3288:/storage/emulated/0/ssh $ ls -al /system/xbin/su                                                                
-rwsr-sr-x root     root        75352 2017-04-23 15:08 su
Reply
#2
(04-24-2017, 07:00 PM)alucao Wrote: Hi, 

Did anyone manage to get root in Android
I can actually get root through a serial console but I can't get it in apps. 
Set the setuid bit on su but still no success.

Code:
user@rk3288:/storage/emulated/0/ssh $ su
su: not allowed
1|user@rk3288:/storage/emulated/0/ssh $ ls -al /system/xbin/su                                                                
-rwsr-sr-x root     root        75352 2017-04-23 15:08 su

That's confused me.

Have you enabled the developer mode, does that give you root ? (Settings - About Android - Build Number (click 5-6 times) ?
Reply
#3
(04-24-2017, 09:31 PM)boudicca Wrote: Have you enabled the developer mode, does that give you root ? (Settings - About Android - Build Number (click 5-6 times) ?
  
I have enabled developer mode but doesn't seem to have given me root. Can't get root from SuperSu.
Reply
#4
okay will shove the my android image back on tonight...just to check.
Reply
#5
Managed to do it by looking at SuperSu scripts and executing them manually. Maybe there is an easier way?
Reply
#6
I am able to get root from another computer via LAN:
PHP Code:
adb connect 192.168.Bla.Bla
adb root
adb remount
adb shell
root
@rk3288 

But even if I install Supersu at the /system/app/  directory, I can see and run the app inside Android environment, but it tells me it is not rooted. How did you get supersu to work?
Reply
#7
You have to execute the supersu installation shell script from that root shell.

Unzip the apk and look at the installation shell script. See what it does. It needs some executable files in the same folder that the script is located. Those files are also included in the apk, they just need to be renamed (only the arm7 binaries are needed). Look at the installation script to see the file names needed.
Remount /system as writable (mount -o remount,rw /system) and then execute the installation shell script (busybox1.11 sh <supersu_installation_script>.sh).

Check the output of the script for major errors (some error messages are normal since the script is pretty redundant).

After running the installation script and rebooting, daemonsu should be started by the init scripts and supersu app should now work as expected.

Again, there must be an easier way of doing this.

Hope it helps.

After reading supersu documentation maybe it is as easy as just running something similar to the following commands:

Code:
unzip /path/to/supersu.zip META-INF/com/google/android/* -d /tmp
sh /tmp/META-INF/com/google/android/update-binary dummy 1 /path/to/supersu.zip
Reply
#8
In order to root Android you need to follow steps described at http://selvaline.blogspot.com.tr/2015/09/how-to-install-supersu-on-android-via.html#!/2015/09/how-to-install-supersu-on-android-via.html


Quote:You need to download the zip file from the official site and inspect it. This is a flashable from recovery zip file. Extract it into a folder, then navigate to META-INF/com/google/android and open the update-binary script file. From this file you can see where each single binary have to go in your Android's file system.


Below you can find full script I used to root my device;

Code:
adb shell "mount -o remount,rw /system"

adb push common/Superuser.apk /system/app/SuperSU/SuperSU.apk  
adb shell chmod 0644 /system/app/SuperSU/SuperSU.apk  
adb shell chcon u:object_r:system_file:s0 /system/app/SuperSU/SuperSU.apk

adb push common/install-recovery.sh /system/etc/install-recovery.sh  
adb shell chmod 0755 /system/etc/install-recovery.sh
adb shell chcon u:object_r:toolbox_exec:s0 /system/etc/install-recovery.sh

adb push armv7/su /system/bin/.ext/.su
adb shell chmod 0755 /system/bin/.ext/.su
adb shell chcon u:object_r:system_file:s0 /system/bin/.ext/.su

adb push armv7/su /system/bin/.ext/.su
adb shell chmod 0755 /system/bin/.ext/.su
adb shell chcon u:object_r:system_file:s0 /system/bin/.ext/.su

adb push armv7/su /system/xbin/daemonsu
adb shell chmod 0755 /system/xbin/daemonsu
adb shell chcon u:object_r:system_file:s0 /system/xbin/daemonsu

adb push armv7/su /system/xbin/sugote
adb shell chmod 0755 /system/xbin/sugote
adb shell chcon u:object_r:zygote_exec:s0 /system/xbin/sugote

adb push armv7/supolicy /system/xbin/supolicy
adb shell chmod 0755 /system/xbin/supolicy
adb shell chcon u:object_r:system_file:s0 /system/xbin/supolicy

adb push armv7/libsupol.so /system/lib(64)/libsupol.so
adb shell chmod 0755 /system/lib\(64\)/libsupol.so
adb shell chcon u:object_r:system_file:s0 /system/lib\(64\)/libsupol.so

adb shell touch /system/etc/.installed_su_daemon
adb shell chmod 0644 /system/etc/.installed_su_daemon
adb shell chcon u:object_r:system_file:s0 /system/etc/.installed_su_daemon

adb shell cp /system/bin/sh /system/xbin/sugote-mksh
adb shell chmod 0755 /system/xbin/sugote-mksh
adb shell chcon u:object_r:system_file:s0 /system/xbin/sugote-mksh

adb shell cp /system/bin/app_process32 /system/bin/app_process32_original
adb shell chmod 0755 /system/bin/app_process32_original
adb shell chcon u:object_r:zygote_exec:s0 /system/bin/app_process32_original

adb shell mv /system/bin/app_process /system/bin/app_process_original
adb shell chmod 0755 /system/bin/app_process_original
adb shell chcon u:object_r:zygote_exec:s0 /system/bin/app_process_original

adb shell mv /system/bin/app_process32 /system/bin/app_process_init
adb shell chmod 0755 /system/bin/app_process_init
adb shell chcon u:object_r:system_file:s0 /system/bin/app_process_init

adb shell ln -s /system/xbin/daemonsu /system/bin/app_process
adb shell ln -s /system/xbin/daemonsu /system/bin/app_process32

adb shell ln -s /system/etc/install-recovery.sh /system/bin/install-recovery.sh
Reply
#9
Code:
adb shell "mount -o remount,rw /system"

adb push common/Superuser.apk /system/app/SuperSU/SuperSU.apk  
adb shell chmod 0644 /system/app/SuperSU/SuperSU.apk  
adb shell chcon u:object_r:system_file:s0 /system/app/SuperSU/SuperSU.apk

adb push common/install-recovery.sh /system/etc/install-recovery.sh  
adb shell chmod 0755 /system/etc/install-recovery.sh
adb shell chcon u:object_r:toolbox_exec:s0 /system/etc/install-recovery.sh

adb shell push armv7/su /system/xbin/su
adb shell chmod 0755 /system/xbin/su
adb shell chcon u:object_r:system_file:s0 /system/xbin/su

adb push armv7/su /system/bin/.ext/.su
adb shell chmod 0755 /system/bin/.ext/.su
adb shell chcon u:object_r:system_file:s0 /system/bin/.ext/.su

adb push armv7/su /system/xbin/daemonsu
adb shell chmod 0755 /system/xbin/daemonsu
adb shell chcon u:object_r:system_file:s0 /system/xbin/daemonsu

adb push armv7/su /system/xbin/sugote
adb shell chmod 0755 /system/xbin/sugote
adb shell chcon u:object_r:zygote_exec:s0 /system/xbin/sugote

adb push armv7/supolicy /system/xbin/supolicy
adb shell chmod 0755 /system/xbin/supolicy
adb shell chcon u:object_r:system_file:s0 /system/xbin/supolicy

adb push armv7/libsupol.so /system/lib(64)/libsupol.so
adb shell chmod 0755 /system/lib\(64\)/libsupol.so
adb shell chcon u:object_r:system_file:s0 /system/lib\(64\)/libsupol.so

adb shell touch /system/etc/.installed_su_daemon
adb shell chmod 0644 /system/etc/.installed_su_daemon
adb shell chcon u:object_r:system_file:s0 /system/etc/.installed_su_daemon

adb shell cp /system/bin/sh /system/xbin/sugote-mksh
adb shell chmod 0755 /system/xbin/sugote-mksh
adb shell chcon u:object_r:system_file:s0 /system/xbin/sugote-mksh

adb shell cp /system/bin/app_process32 /system/bin/app_process32_original
adb shell chmod 0755 /system/bin/app_process32_original
adb shell chcon u:object_r:zygote_exec:s0 /system/bin/app_process32_original

adb shell mv /system/bin/app_process /system/bin/app_process_original
adb shell chmod 0755 /system/bin/app_process_original
adb shell chcon u:object_r:zygote_exec:s0 /system/bin/app_process_original

adb shell mv /system/bin/app_process32 /system/bin/app_process_init
adb shell chmod 0755 /system/bin/app_process_init
adb shell chcon u:object_r:system_file:s0 /system/bin/app_process_init

adb shell ln -s /system/xbin/daemonsu /system/bin/app_process
adb shell ln -s /system/xbin/daemonsu /system/bin/app_process32

adb shell ln -s /system/etc/install-recovery.sh /system/bin/install-recovery.sh

Great work on the script Fatih, this worked for me, but it took me a bit of extra stuff at the start and end of the process to work properly. I'll fill in the gaps for others who may be scratching their heads with the same problems I encountered.

First of all you need to obtain a later su.zip than the one you get pointed to by simply clicking through the links. If you go to: http://www.supersu.com/download

...then be careful NOT to obtain the latest, but instead go for "Recovery V2.79 Flashable.zip     MD5:f4ecbf5814215bf569ff3324fc1c91f5"

...because there is an issue with the latest (see here: https://forum.xda-developers.com/showpost.php?p=72428986&postcount=1645)

V2.79 is the one I used, and worked fine. 

I'm using Windows, so I copied your script into a file I called "rootandroid.bat" and placed it in my adb tools folder. I extracted the contents of the su.zip directly into this folder too (not into a subfolder, a lot of unzip programs do this by default to keep things organised, but I wanted to make sure the script could find adb and all the su files without any extra work, so everything needed to be at the same folder level).

Before running the .bat script, I opened a cmd prompt in my adb tools directory and executed the following commands:

adb connect 192.168.1.etc (make sure you use the IP where your own tinkerboard is connected)

adb root 

adb connect 192.168.1.etc (have to do this again)

adb remount

then simply: rootandroid.bat

Pushing the apk takes a few seconds, the rest of the commands in the script execute quite quickly.

The last thing required is to open the SuperSU app and allow it to run the 'update binary' then reboot. EDIT: Just fixed a missing line, so this step might not be necessary now, but open the app and it will tell you.

That's it!

If someone follows the same method, and discovers I missed a step or gave unclear instructions, please reply to help others.
Reply
#10
(07-08-2017, 08:26 AM)bedalus Wrote: If someone follows the same method, and discovers I missed a step or gave unclear instructions, please reply to help others.

Worked for me. Thanks, guys.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)