How to Install su binary from twrp using Ubuntu 16.04? - P8lite Q&A, Help & Troubleshooting

I managed to install twrp in Huawei P8 Lite and to have shell access via adb when on recovery by theese commands:
Code:
adb reboot recovery
# After booted sucessfully
adb shell
I also managed to obain a su binary. Now how I can move it to my device's xbin? As fas I have seen the recovery itself has it's own /system/xbin and I cannot figure out how to access the system's one (the one that uses during the normal boot).
Can you help me?

If you want root you can use Magisk

Related

[Guide] How to recover your semi-brick

YES YOU NEED TO READ THIS WHOLE POST, PROB MORE THEN ONCE TO MAKE SURE YOU GOT IT. YES I KNOW HOW LONG IT IS, I TYPED IT!
the reason i call it a semi-brick is because a true brick can bot be recovered with out opening the case.
first go here and read this for info: http://forum.xda-developers.com/showthread.php?t=838484
now since your here im going to assume that its too late.
*things you will need.
copy of cwm recovery. get it here (the manual install link): http://forum.xda-developers.com/showpost.php?p=9145724&postcount=28
adb installed and working.
a known good rom, or nandroid backup. here is one: http://forum.xda-developers.com/showthread.php?t=836042 (use odex one)
a wpthis.ko for YOUR specfic kernel (run (adb shell cat /proc/version) that will tell you what kernel you have)
*first thing we need to know is, are you s-off or s-on now?
if your s-off just boot into clockwork mod recovery, wipe the phone and flash a known good rom and be done with it. if you dont have cwm recovery installed. boot into fastboot (vol down+power) you must have the sdk/adb installed and working, and type fastboot flash recovery LocationOfRecovery.img (where LocationOfRecovery.img= where you have the recovery, ie c:\android\recovery.img). once thats installed follow instructions above.
*if you are s-on:
will the phone boot into android? if so your not bad off.
if you want to unroot to return the phone, follow the unroot thread here: http://forum.xda-developers.com/showthread.php?t=835971
if you dont want to unroot then you have a couple of different options. if you have cwm recovery still installed, just follow instructions above and flash a known good rom. ive been told that boot.img (kernel) wont flash if you are s-on. the way to fix this (temporarily) is boot into recovery, but before you flash run these commands:
(put wpthis.ko in sdk folder)
adb remount
adb push wpthis.ko /data/local/wpthis.ko (specific for your kernel)
adb shell
# insmod /data/local/wpthis.ko (should get same function not implemented error as when u rooted first time)
then proceed to flash the rom. once booted into android skip down to, "now to get back to s-off"
*if you have stock or eng-recovery installed.
will the phone attempt to boot android at all? where is it stuck at?
a good min after it starts to try to boot, type these commands:
adb remount
adb shell
if you can get in shell then theres still hope. back out shell for a second and start here:
put the cwm recovery.img and wpthis.ko in your sdk folder
adb remount
adb push wpthis.ko /data/local/wpthis.ko (specific for your kernel)
adb push recovery.img /data/local/recovery.img
adb shell
# insmod /data/local/wpthis.ko (should get same function not implemented error as when u rooted first time)
# dd if=/data/local/recovery.img of=/dev/block/mmcblk0p21 (now wait a min or 2 to give it time to finish)
#sync (give it another min or to just to be safe)
#reboot recovery
at this point you should be in cwm recovery. follow instructions above for flashing with s-on.
*if you cannot get into shell while booting, but have eng-recovery installed, there might be some options.(however this is all theory)
boot into recovery-
if you are on linux using adb, you can try taking sh from /system/bin folder of any custom rom, chmod 0755 it, then push it to /system/bin and adb shell might work.
windows-
boot into recovery.
a system.img compatible with your installed kernel pushed may work. put the system.img into the sdk folder.
adb push system.img /data/block/mmcblk0p25
then reboot and see where you are. if that dont work, grab the modified miscnew.img here: http://www.4shared.com/file/pUPfrGi-/mmcblk0p17.html
rename it misc.img put it in sdk folder and
adb push misc.img /dev/block/mmcblk0p17
then reboot into bootloader with PC10IMG.zip on root of sdcard and it should run though. if it does your fully stock and get to start all over again.
*if you cannot get into shell, and you have stock recovery, im sorry your pretty screwed. as of right now the only thing thats gonna bring it back is a full img/update signed from htc thats equal to or higher then the version currently on the phone. (well and jtag of course)
*well now you've done one of the steps above. your booted into android, you have perm root, and cwm recovery installed, just still s-on. dont worry your almost there!
first take that wpthis.ko for you kernel and push it, and the eng hboot.
adb push wpthis.ko /data/local/
adb push hboot-eng.img /data/local
then from adb shell, or terminal root prompt:
# insmod /data/local/wpthis.ko (again you should get the function not implemented error)
NOW REMEMBER THIS NEXT STEP COULD MEAN DEATH FOR YOU G2 IF TYPED WRONG, AND AFTER ALL THIS HARD WORK!
# dd if=/data/local/hboot-eng.img of=/dev/block/mmcblk0p18
wait a few mins to be sure its done.
# sync
wait a few more just cause.
reboot, you should now be s-off, cwm recovery installed, and free to do whatever you want. just dont go screwing it up again
* as new methods are discovered, or ones here are proven wrong, i will update as necessary. as of the writing post, 2 devices that i know of have been saved!
good luck!
wpthis.ko for bacon bits.03 kernel: http://www.4shared.com/file/OAcd1bix/wpthis-263221-cyanogenmod.html

[Q] update not possible

hi there,
i believe i bricked my hero.
After android >2.1 booted only in safe mode i was playing around with other roms and Recoveries.
Only RUU_2.73.405.5 (Android 1.5) worked but after i updated OTA to 2.1 there is no way to flash back to 1.5 with RUU: it says Bootloader version error.
so in safe mode i coudn't install any app for Root or get SU for flashing a custom recovery over adb.
have anyone any idea what i could do, please?
u have to make a Goldcard....
Do You still have amon ra or clockwork?
Edit: nvm, i see that You cant flash them.
Sent from my Hero using XDA
thanks for your reply,
my sdcard is a goldcard, but now i've tried another one.
no success.
is there any way to get root with adb?
(i can't mount /system for...
adb shell mount /system
adb push su /system/bin/
adb shell chmod 4755 /system/bin/su
adb push Superuser.apk /system/app/
adb shell reboot)
overall the main problem with every rom is the safe mode

LG G2 (Verizon) - Recovery (CWM), no download, bootloop stuck **FIXED**

I will preface this with stating that this is not my phone. A friend had rooted his LG G2 and installed CWM. After he accepted the OTA, the phone was essentially rendered useless. After this process, the phone will be reverted back to 100% STOCK. It took a while to compile all of this information, and I give all credit to respective owners, but this process I pieced together from multiple threads and was able to make this work.
Symptoms-
Not booting (Hanging at LG screen)
Able to access CWM recovery
Unable to Mount USB
Unable to access Download Mode
#####1#####
Uninstall all previous LG Drivers installed (Add/Remove Programs)
#####2#####
Install PDAnet to get the drivers required installed.
#####3#####
Once PDAnet is installed, ADB should recognize the device when it is in 'Recovery' mode.
(ADB Devices should give the result of: ###DEVICEID### Recovery)
#####4#####
Download aboot.img from: http://downloads.codefi.re/autoprime/LG/LG_G2/D802/Stock_Firmware/10b_EUR_16G_partitions
(The file will need to be renamed to aboot.img)
#####5#####
Download: http://www.androidfilehost.com/?fid=23252070760973106
#####6#####
Extract the files we need:
g2_security
loki_patch
loki_flash
recovery.img
#####7#####
Get into a command prompt and run the following:
adb push g2_security /sdcard/
adb root
adb push loki_patch /data/local/tmp
adb push loki_flash /data/local/tmp
adb push recovery.img /data/local/tmp
adb shell "dd if=/dev/block/platform/msm_sdcc.1/by-name/aboot of=/data/local/tmp/aboot.img"
adb shell "chmod 644 /data/local/tmp/aboot.img"
adb shell "chmod 755 /data/local/tmp/loki_patch"
adb shell "chmod 755 /data/local/tmp/loki_flash"
adb shell "/data/local/tmp/loki_patch recovery /data/local/tmp/aboot.img /data/local/tmp/recovery.img /data/local/tmp/recovery.lok"
adb shell "/data/local/tmp/loki_flash recovery /data/local/tmp/recovery.lok"
adb shell "rm /sdcard/g2_security"
adb shell "dd if=/dev/block/platform/msm_sdcc.1/by-name/fota of=/sdcard/fota-backup.img"
adb shell "dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/fota"
adb shell sync
adb reboot recovery
Once the above is done, the phone should boot into TWRP. I shut the phone off at this point and held "Volume Up" + "Power" and Download mode now worked!
#####8#####
Uninstalled PDAnet and then followed the instructions on the following page (including installing the drivers)
#####9#####--At this point the following thread finished reverting the phone to stock.
http://forum.xda-developers.com/showthread.php?t=2448960
My only suggestion is that you RUN THE MD5 HASH to ensure the large file downloads correctly. After this was done, the phone was successfully reverted back to stock.
If you found this help, please donate and buy me a beer!
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBZ8G6ZPUEN4C
Hi, your last step, a Verizon link for restoring back to stock.. I have international D802.. can I use some other rom(omni rom) instead of your last step...
Guys, this exactly worked for me.. i used D802... however, i used all verizon files only to flash and finally went to download mode and flashed stock ROM... awesome help guys.. i was about to change the PCB by spending half of mobile cost..... i am definitely getting you a case next week...
still nothing
Still stuck in fast boot mode cannot do anything in cwm
---------- Post added at 09:39 PM ---------- Previous post was at 09:35 PM ----------
Still stuck in fast boot mode cannot do anything in cwm. Please can someone help me ??????
:good:
Me too on D802 and it worked. followed exactly as instructed.
thanks bro!
Thanks so much for the guide, one problem for me.... Im on a mac... I have pdanet, and android sdk set up but i cant get the commands to work. any idea on what to use for the commands?
P.S It does find the phone just fine with ./adb devices
dtuma1980 said:
I will preface this with stating that this is not my phone. A friend had rooted his LG G2 and installed CWM. After he accepted the OTA, the phone was essentially rendered useless. After this process, the phone will be reverted back to 100% STOCK. It took a while to compile all of this information, and I give all credit to respective owners, but this process I pieced together from multiple threads and was able to make this work.
Symptoms-
Not booting (Hanging at LG screen)
Able to access CWM recovery
Unable to Mount USB
Unable to access Download Mode
#####1#####
Uninstall all previous LG Drivers installed (Add/Remove Programs)
#####2#####
Install PDAnet to get the drivers required installed.
#####3#####
Once PDAnet is installed, ADB should recognize the device when it is in 'Recovery' mode.
(ADB Devices should give the result of: ###DEVICEID### Recovery)
#####4#####
Download aboot.img from: http://downloads.codefi.re/autoprime/LG/LG_G2/D802/Stock_Firmware/10b_EUR_16G_partitions
(The file will need to be renamed to aboot.img)
#####5#####
Download: http://www.androidfilehost.com/?fid=23252070760973106
#####6#####
Extract the files we need:
g2_security
loki_patch
loki_flash
recovery.img
#####7#####
Get into a command prompt and run the following:
adb push g2_security /sdcard/
adb root
adb push loki_patch /data/local/tmp
adb push loki_flash /data/local/tmp
adb push recovery.img /data/local/tmp
adb shell "dd if=/dev/block/platform/msm_sdcc.1/by-name/aboot of=/data/local/tmp/aboot.img"
adb shell "chmod 644 /data/local/tmp/aboot.img"
adb shell "chmod 755 /data/local/tmp/loki_patch"
adb shell "chmod 755 /data/local/tmp/loki_flash"
adb shell "/data/local/tmp/loki_patch recovery /data/local/tmp/aboot.img /data/local/tmp/recovery.img /data/local/tmp/recovery.lok"
adb shell "/data/local/tmp/loki_flash recovery /data/local/tmp/recovery.lok"
adb shell "rm /sdcard/g2_security"
adb shell "dd if=/dev/block/platform/msm_sdcc.1/by-name/fota of=/sdcard/fota-backup.img"
adb shell "dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/fota"
adb shell sync
adb reboot recovery
Once the above is done, the phone should boot into TWRP. I shut the phone off at this point and held "Volume Up" + "Power" and Download mode now worked!
#####8#####
Uninstalled PDAnet and then followed the instructions on the following page (including installing the drivers)
#####9#####--At this point the following thread finished reverting the phone to stock.
http://forum.xda-developers.com/showthread.php?t=2448960
My only suggestion is that you RUN THE MD5 HASH to ensure the large file downloads correctly. After this was done, the phone was successfully reverted back to stock.
If you found this help, please donate and buy me a beer!
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBZ8G6ZPUEN4C
Click to expand...
Click to collapse
My ADB keeps saying that my phone is unauthorized ;( I can only access .zip. Anyone else have this issue? Have tried multiple drivers, Sideload is the only thing that works.
Joppykid said:
My ADB keeps saying that my phone is unauthorized ;( I can only access .zip. Anyone else have this issue? Have tried multiple drivers, Sideload is the only thing that works.
Click to expand...
Click to collapse
Are you connected via PDAnet?
dtuma1980 said:
Are you connected via PDAnet?
Click to expand...
Click to collapse
I can't because I cannot turn on USB Debugging, I am stuck in the Recovery. Details of my situation are in this thread I posted. http://forum.xda-developers.com/showthread.php?t=2726985
Joppykid said:
I can't because I cannot turn on USB Debugging, I am stuck in the Recovery. Details of my situation are in this thread I posted. http://forum.xda-developers.com/showthread.php?t=2726985
Click to expand...
Click to collapse
Oh boy i got the same issue before. I just go to a local technician to have it fixed.
Joppykid said:
I can't because I cannot turn on USB Debugging, I am stuck in the Recovery. Details of my situation are in this thread I posted. http://forum.xda-developers.com/showthread.php?t=2726985
Click to expand...
Click to collapse
Same issue here. In the command prompt, anything I do returns the unauthorized device error.
EDIT- I'm going to try and sideload a custom ROM, and then flash the stock ROM after setting USB debugging to see if that helps at all. I'll let you know
Joppykid said:
I can't because I cannot turn on USB Debugging, I am stuck in the Recovery. Details of my situation are in this thread I posted. http://forum.xda-developers.com/showthread.php?t=2726985
Click to expand...
Click to collapse
Please refer to the initial post. This will only work if you can access the recovery. If you cannot access recovery, this method isn't going to work. Sorry!
dtuma1980 said:
Please refer to the initial post. This will only work if you can access the recovery. If you cannot access recovery, this method isn't going to work. Sorry!
Click to expand...
Click to collapse
Did you not see what I wrote? Recovery was the only thing I could access. This method didn't work because the RSA Token wasn't authenticated on my computer any longer. My phone was bricked. I now have a new one. Lesson learned. Make sure you have USB debugging on with an RSA token on your computer at all times.
Did you end up wiping the internal SD with the process? I am in a similar situation except I don't have a friend like you to help me out haha.
Joppykid said:
My ADB keeps saying that my phone is unauthorized ;( I can only access .zip. Anyone else have this issue? Have tried multiple drivers, Sideload is the only thing that works.
Click to expand...
Click to collapse
I factory wiped/reset my phone is CWM which got my phone to be recognized as in recovery.
I can't get past the adb shell commands to work. it keeps saying 'dd: can't open '/data/local/tmp/aboot.img' : Not a directory
I tried with the double quotations and without to see if the command would work thinking I was messing up the syntax.
perfect just saved my a$$. ota took for the 24a update. found this and i am back where i was.awesomes

Root, TWRP 2.8.7.0 Recovery & Flasher, insecure boot.img blu studio 5.0C d536

This is for blu studio 5.0 C d536u
This is a guide to quickly root, flash twrp recovery and insecure boot.img.
First you need to have your fastboot/ adb working.
Download
https://www.androidfilehost.com/?fid=24052804347766981
Code:
adb reboot bootloader
fastboot flash boot boot.img
fastboot reboot
adb remount
adb push UPDATE-SuperSU-v2.46.zip /sdcard
adb push root /system/xbin
adb shell
chmod 755 /system/xbin/*
flash_twrp
reboot recovery
In recovery naigate to UPDATE-SuperSU-v2.46.zip and install.
Credits
@Chainfire
super user package update-supersu-vxxx.zip
https://download.chainfire.eu/696/SuperSU/UPDATE-SuperSU-v2.46.zip
Will this work on the d535u? Currently have CWM with SuperSu Free v2.49.
bobl61 said:
Will this work on the d535u? Currently have CWM with SuperSu Free v2.49.
Click to expand...
Click to collapse
I have no ideal.
Sent from my BLU STUDIO 5.0 C using Tapatalk
New update is available for this phone, same twrp recovery and root method works on update.
v14 is the latest version for this phone.
Sent from my BLU STUDIO 5.0 C using Tapatalk
OH MY GOT!
vampirefo said:
This is for blu studio 5.0 C d536u
This is a guide to quickly root, flash twrp recovery and insecure boot.img.
First you need to have your fastboot/ adb working.
Download
https://www.androidfilehost.com/?fid=24052804347766981
Code:
adb reboot bootloader
fastboot flash boot boot.img
fastboot reboot
adb remount
adb push UPDATE-SuperSU-v2.46.zip /sdcard
adb push root /system/xbin
adb shell
chmod 755 /system/xbin/*
flash_twrp
reboot recovery
In recovery naigate to UPDATE-SuperSU-v2.46.zip and install.
Credits
@Chainfire
super user package update-supersu-vxxx.zip
https://download.chainfire.eu/696/SuperSU/UPDATE-SuperSU-v2.46.zip
Click to expand...
Click to collapse
I have been ALL DAY..... like literally ALL DAY [ok I totally took a long as break] ---But I've been toiling to install it with out KingRoot,. (as I did once before with my HTC Desire 510) However I couldn't remember how exactly, even in theory. But just now, I kid you not, I have finished rooting but with KingRoot......the FIRST thing that hits me in the face tho. ???? this page... WTF?!?!!?
You guy are incredible at what you do... but whats most incredible is your love for community and helping your neighbor. May YOUR God grant you the desires of your heart with out ever losing or compromising Understanding and Wisdom.
Thanks again, your one of my hero's
Thanks man, you are the best.

Root OnePlus 2 with TWRP or OTA stock ?

Hi,
I've got a new OnePlus 2 phone.
Do i really have to flash TWRP in order to root my phone using SU tool ? or i can stay with the OnePlus 2 original stock ?
What are the advantages of TWRP?
Best,
Jonathan
rose10 said:
Hi,
I've got a new OnePlus 2 phone.
Do i really have to flash TWRP in order to root my phone using SU tool ? or i can stay with the OnePlus 2 original stock ?
What are the advantages of TWRP?
Best,
Jonathan
Click to expand...
Click to collapse
You can either FLASH TWRP recovery or BOOT into it: the difference is that when you boot into TWRP, it's temporary, which means when you've done your stuff and you reboot into the system, stock recovery will be present. To do so, boot into bootloader:
Code:
adb reboot-bootloader
and instead of:
Code:
fastboot flash recovery recovery.img
which FLASH the recovery, do:
Code:
fastboot boot recovery.img
which lets BOOT into TWRP.
Then you'll be able to flash SuperSu.V.Xx.zip beforehand pushed into your device.
Benefit of TWRP?
Full backup / restore, change file format, flash zip files, etc, etc.
For the OTA, you can still flash them, but you'll have to flash the stock ROM then the incremental zip if you FLASH TWRP or the full OTA update zip file from here.
Hi again,
After rooting my device....i can't copy a sound file to my /system/media/audio/ui..... How can i change the library permission ?
rose10 said:
Hi again,
After rooting my device....i can't copy a sound file to my /system/media/audio/ui..... How can i change the library permission ?
Click to expand...
Click to collapse
Which method? ADB shell? With an app?
If you use ADB shell / Terminal Emulator, you need to mount it into Read-Write mode.
To do so:
(
If you use ADB
Code:
adb shell
)
Code:
su
Code:
mount -o remount,rw /system
Then you can move your file.
Or if you use an app (ES File Explorer for example), you need to enable Root Mode: swipe from left, scroll down and activate "Root Explorer" case.
A thanks is always appreciated.

Categories

Resources