[Q] Help ADB shell while in SafeStrap - Verizon Samsung Galaxy S 4

Like a lot of people, I rooted, busyboxed and installed SafeStrap. Unfortunately, I can't boot anymore, the best I can do is get into SafeStrap or recovery. I know I can manually remove safestrap using adb shell.
When I try to run adb shell while in SafeStrap, I get this:
Code:
CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "/sbin/sh"; caused by library "libc.so" not found
If I'm in actual recovery, adb devices does not list the phone.
Someone please help me get into ADB shell so I can dump SafeStrap!

CapinWinky said:
Like a lot of people, I rooted, busyboxed and installed SafeStrap. Unfortunately, I can't boot anymore, the best I can do is get into SafeStrap or recovery. I know I can manually remove safestrap using adb shell.
When I try to run adb shell while in SafeStrap, I get this:
Code:
CANNOT LINK EXECUTABLE: could not load library "libc.so" needed by "/sbin/sh"; caused by library "libc.so" not found
If I'm in actual recovery, adb devices does not list the phone.
Someone please help me get into ADB shell so I can dump SafeStrap!
Click to expand...
Click to collapse
Try "adb shell /system/bin/sh"
Something's not right, as there's no "/sbin/sh" file on my *stock* SGS4.
However. Removing Safestrap will probably just brick your phone. What build, bootloader, etc?

I'm NC5. I rooted with towelroot. Everything was actually working fine for several days, then I let the battery die and now I can't get past SafeStrap. I tried your suggestion trying to launch ADB shell and it returned the same error.
When I run ADB devices while in safestrap, it returns as being in recovery. I can also get it into sideload mode in the stock recovery. It is not detected when rebooted into Download.
At this point, I would be happy to completely factory reset with ODIN if that's even possible. I'm not familiar with ODIN, so I'm trying to read up.

While in Safestrap (I'm using v3.72 on a Galaxy S4 NB1), go to Mount -> Select "System". After mounting the system partition, I was then able to adb shell into the device like normal.
NOTE: One difference in adb that I noticed was that I lost my adb shell root access in Safestrap mode (even tho the device was rooted beforehand). Might be something with SELinux.
HTH.

Related

How to flash_image Amon RA's recovery

i have had problems with Rom manager not flashing recovery correct leaving me with no recovery. so i had to manually flash recovery following these steps exact. I have personally bricked 2 ERIS phones lucky me.The first i thoought it was just something i did, lucky i had another to replace it...(the second BRICK eris).
So here is a solution to keep from having a BRICK
USE Amon RA's Recovery PERIOD.
credit to northmendo @droidforums
1. download flash_image Here Updated Link 3/17/10
2. Open the terminal and copy and paste the following commands.
adb shell [hit enter]
su [hit enter]
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system [hit enter]
3. In a new terminal window (don't close the original one).
adb push flash_image /system/bin [hit enter]
exit [hit enter]
4. Now in the original terminal window
chmod 755 /system/bin/flash_image [hit enter]
5. Now exit all termainl windows and reboot your phone.
6. Download
Amon_RA's recovery Here.
7. Mount your phones sd card and drop recovery-RA-eris-v1.6.2.img on to it and eject
your phone.
8. Open the Terminal and copy and paste the following commands with the phone connected
to your computer.
8. adb shell [hit enter]
9. su [hit enter]
10. flash_image recovery /sdcard/recovery-RA-eris-v1.6.2.img
11. To get into recovery turn off you phone and hold the Volume Up + Power until it boots into recovery.
That's it.
ROM Manager and Clockwork recovery does not work for the Eris.
ROM Manager and Clockwork recovery does not work for the Eris (as far as I know).
Edit: Oops, sorry for the double post.
I currently have the clockwork recovery installed on my eris, can I just download amon's recovery image and install it to switch to it? Or do I have to uninstall clockwork recovery and then install amon's?
trishuhh said:
I currently have the clockwork recovery installed on my eris, can I just download amon's recovery image and install it to switch to it? Or do I have to uninstall clockwork recovery and then install amon's?
Click to expand...
Click to collapse
try to flash it from rom manager,(under other recoveries) if Rom manager has worked for you with no problems. if it doesnt work follow instructions as listed in 1st post
I wouldn't use clockwork recovery, it messed up my installation to the point i couldn't flash any rom or restore any nand. When i would try to flash anything it would fail, It failed when i tried to use the root rom....After I tried flashing root rom i had a nice looking brick on my desk....(I even changed back to RA but Clockwork had messed up my phone so bad that RA didn't even work either....
YOU HAVE BEEN WARNED!!!!!
Yeah, use Amon's. It does every job you need, and is 100% stable and reliable.
t2noob said:
I wouldn't use clockwork recovery, it messed up my installation to the point i couldn't flash any rom or restore any nand. When i would try to flash anything it would fail, It failed when i tried to use the root rom....After I tried flashing root rom i had a nice looking brick on my desk....(I even changed back to RA but Clockwork had messed up my phone so bad that RA didn't even work either....
YOU HAVE BEEN WARNED!!!!!
Click to expand...
Click to collapse
yea you beat me too it, , i only used it because i had it for my DROID and thought maybe devs would try to add it to the list on rom manager.
ok, obviously a bit of an amateur here, how do you know which recovery image you have, i installed amon's, but i'm not sure if clockwork made it to my phone somehow, thinking about unrooting soon, that's why i ask, thanks.
jrhoades858 said:
ok, obviously a bit of an amateur here, how do you know which recovery image you have, i installed amon's, but i'm not sure if clockwork made it to my phone somehow, thinking about unrooting soon, that's why i ask, thanks.
Click to expand...
Click to collapse
reboot into recovery and read the bottom
Ok Please help a newbie out here im losing my mind. I downloaded flash, plugged phone into mac and set phone to debugging and mounted. Opened terminal from utilities on Mac. When I enter adb shell it says "command not found" if I try using ./ before adb as suggested on another forum for macs when i enter su it asks for password? Any how please help a brother out. Thanks
I flashed amons ras recovery from my phone it was easier for me I didn't use rom manger or terminal emulater
Sent from my FroyoEris using XDA App
Can someone help me get rid of clockwork recovery it showed up after I flashed a rom. How do you flash Amons recovery?
tkryan said:
Can someone help me get rid of clockwork recovery it showed up after I flashed a rom. How do you flash Amons recovery?
Click to expand...
Click to collapse
You do exactly what the first post says
Sent from my Eris
ufccowboyfan said:
Ok Please help a newbie out here im losing my mind. I downloaded flash, plugged phone into mac and set phone to debugging and mounted. Opened terminal from utilities on Mac. When I enter adb shell it says "command not found" if I try using ./ before adb as suggested on another forum for macs when i enter su it asks for password? Any how please help a brother out. Thanks
Click to expand...
Click to collapse
When you are doing this, are you in the correct directory? For example, my SDK is installed in /android , so first I would:
cd /android/tools
then
./adb shell
could someone help me with this. i really need to get the stock recovery image on my eris and im alittle noobie at this stuff. if any one could help id be sooooo happy
I'm not sure how to flash amons on a mac. I know for windows you put the recovery.img in the sdk tools folder, boot into fastboot and type
Fastboot flash recovery recovery.img
To get stock recovery (I assume you want your phone back to stock) then flash the official ruu. Will return your phone to 100% stock. You can find it on a sticky in the Eris general forums I believe.
Sent from my Eris using XDA App
I'm not sure on a mac, but on Windows you put the img in the tools folder of your sdk, boot into fastboot and type in adb:
Fastboot flash recovery recovery.img
To get stock recovery back, simply flash the official ruu found on a sticky in the Eris general forums I believe. Flashing the ruu will unroot your phone.
Sent from my Eris using XDA App
I installed Amon Ra as part of the root for leakers instructions some time ago. -- Is there a new version out? (Search was surprisingly not helpful) And what is the best way to update recovery?
Slugdoc said:
I installed Amon Ra as part of the root for leakers instructions some time ago. -- Is there a new version out? (Search was surprisingly not helpful) And what is the best way to update recovery?
Click to expand...
Click to collapse
There is no new version out; the first version (v1.6.2) is the only one that Amon_RA published.
IF there was a new version, you could flash it by using adb with the existing Amon_RA. You don't even need to push a version of "flash_image" to the phone, because it is already in /sbin in Amon_RA recovery. Just get the recovery image to your SD card, start an interactive shell (adb shell), and then
flash_image recovery /sdcard/<wherever-you-put-it>/recovery-RA-eris-v1.6.2.img
Yes, you can "flash a recovery partition by using the recovery" - because when you are interacting with it (the recovery boot), it lives entirely in a ramdisk.
The second easiest way is to have the engineering bootloader (1.49.2000 S-OFF) installed on your phone, and flash it with fastboot from the PC, as in
fastboot flash recovery recovery-RA-eris-v1.6.2.img
Note that neither of these two methods perform any integrity checks on the recovery image file that the normal "Flash .zip from sdcard" ROM installation method does. Therefore, it is imperative that someone using these methods is extremely diligent in cross-checking image MD5 signatures after it has been transferred to the SD card. Amon_RA also has the "md5sum" utility built into it's shell, BTW.
I mention this last point as a warning to newbs - they seem to routinely corrupt files when they transfer them to the SD card. (I suppose they are not using the "safely remove hardware" controls correctly, or they are getting truncated downloads).
bftb0

Help with Bricked Rezound

I unlocked the bootloader from HTCdev.com and followed the instructions from scott's roms for installing clean rom dev edition which booted fine. I noticed that the phone wouldn't turn on today and discovered these issues.
Also, I have CWM recovery installed (I read about all the issues after the fact having never had issues like this before with a myriad of phones/tablets i ASS-umed that it would be fine).
Currently the phone will not charge, the screen stays black, it shows up in adb in recovery mode (screen still black), cannot get into the bootloader, cannot run fastboot commands. I've tried to use adb push to get amon-ra on this to no avail.
This isn't mine, it's a friends and if anyone knows a method for me to get into the bootloader i'd be grateful. I know fastboot and adb well enough. Please PM me or answer on here. Thanks guys!
You aren't in terrible shape.
If you can use adb you are ok. Download amon ra and my zimage flasher here: http://forum.xda-developers.com/showthread.php?t=1419587
Extract zimage flasher and find the file dd inside.
Then do "adb push dd /tmp"
Then do "adb push amonra.img /tmp"
Then do "adb shell"
Then do "cd /tmp"
Then do "chmod 4755 dd"
Then do "./dd dd if=/tmp/amonra.img of=/dev/block/mmcblk0p23"
Then yank battery and USB and try to charge.

[Q] Complete wipe through ADB

OK, here's the deal. My i777 was running SlimROM, updated, and now my power button is inop. Flashed back to stock ICS, but I forgot to do one critical step - a complete wipe before installing. Now my phone gets stuck at the "Rethink Possible" screen, and I can't do anything else.
I've booted into 3e recovery and tried recovery --wipe_data through adb, but it still hangs. (as suggested here). I've got a jig, forced it into download mode, and tried flashing another ROM, but I still get stuck on the Rethink Possible screen.
Is there a way that I can basically nuke all the contents of the phone so I can use it again? I've read through most of the documentation for adb, but I don't see an option.
steelforce said:
OK, here's the deal. My i777 was running SlimROM, updated, and now my power button is inop. Flashed back to stock ICS, but I forgot to do one critical step - a complete wipe before installing. Now my phone gets stuck at the "Rethink Possible" screen, and I can't do anything else.
I've booted into 3e recovery and tried recovery --wipe_data through adb, but it still hangs. (as suggested here). I've got a jig, forced it into download mode, and tried flashing another ROM, but I still get stuck on the Rethink Possible screen.
Is there a way that I can basically nuke all the contents of the phone so I can use it again? I've read through most of the documentation for adb, but I don't see an option.
Click to expand...
Click to collapse
Id wait until a dev chimes in, but my understanding is that as you can still get into DL mode, ODIN would be your best bet. Id flash one of the all in one ODIN ICS packages that also contain boot loaders (LL6 would be most recent). As a last resort you can also flash the stock .pit file and repartition the whole phone, BUT BE SURE TO BACKUP YOUR EFS FOLDER if possible. I say this as I did not do this and now have a generic IMEI on my phone, hindering some aps from working.
ADB is able to reformat and flash ROM packages as far as i know, though it should be unnecessary as long as you can still use ODIN. The only reason i used ADB was to resurrect a S2 i bought of someone that flashed a ROM from a i9100.
steelforce said:
OK, here's the deal. My i777 was running SlimROM, updated, and now my power button is inop. Flashed back to stock ICS, but I forgot to do one critical step - a complete wipe before installing. Now my phone gets stuck at the "Rethink Possible" screen, and I can't do anything else.
I've booted into 3e recovery and tried recovery --wipe_data through adb, but it still hangs. (as suggested here). I've got a jig, forced it into download mode, and tried flashing another ROM, but I still get stuck on the Rethink Possible screen.
Is there a way that I can basically nuke all the contents of the phone so I can use it again? I've read through most of the documentation for adb, but I don't see an option.
Click to expand...
Click to collapse
You need root access to format the data partition. I don't use adb a lot, but I think you can boot into recovery, then "adb shell", then "format data." You might have to type "su." If that doesn't get you out of the Rethink Possible screen, the I would format data, format system, and format cache. Then turn the phone off, by pulling the battery if necessary, and enter download mode and flash the full stock distribution. As the previous poster suggested, UCLL6 would be a good choice. You can get it from the download repository. See the link in my signature.
creepyncrawly said:
You need root access to format the data partition. I don't use adb a lot, but I think you can boot into recovery, then "adb shell", then "format data." You might have to type "su." If that doesn't get you out of the Rethink Possible screen, the I would format data, format system, and format cache. Then turn the phone off, by pulling the battery if necessary, and enter download mode and flash the full stock distribution. As the previous poster suggested, UCLL6 would be a good choice. You can get it from the download repository. See the link in my signature.
Click to expand...
Click to collapse
Thanks. I forgot to grab the phone before I left for the office this morning, so I'll try it when I get home later tonight.
steelforce said:
Thanks. I forgot to grab the phone before I left for the office this morning, so I'll try it when I get home later tonight.
Click to expand...
Click to collapse
So, home with my phone. When I get into the shell, format isn't a valid command:
Code:
[email protected]:/ $ format
format
/system/bin/sh: format: not found
Trying to su ends up segfaulting, so I don't think it's a permissions issue. Other sources suggest using fastboot, but as I understand it, the i777 doesn't support it.
I'm looking at the mounts - is there documentation on which of the /dev/block/mmcblk0pX partitions map to the mount points? I'm familiar with Linux (at least enough to get me in trouble), but I'm lost on where to go next.
You have to have root access to do the format command. Requires the # prompt, like this:
Code:
adb shell
$ su
# format data
# exit
$ exit
Probably, cache is mounted but system and data are not mounted. It shouldn't make any difference though, if I remember right.
If you can't get the su command to give you the # prompt, then maybe adb is not connected to the daemon correctly?
Edit:
I have never used adb in recovery before, so for my own interest, I decided to do a little experimentation. First of all, to get a hash prompt in shell try
Code:
adb root
followed by
Code:
adb shell
From reading, it seems some people say both wipe and format commands should work in shell in recovery, but I couldn't get them to work. I would get "/sbin/sh: format: not found" error. So the work around is this:
Code:
adb shell
~ # mount /data
~ # rm -rf /data/*
~ # reboot
This will recursively force the removal of the contents of the data directory. I did not test this, but I did test "rm -rf /cache/*" and successfully removed the contents of the cache directory, so I know it should work.
If your system still doesn't boot, you could wipe cache and system as well as data and then reboot into download mode and flash the full stock tar
Code:
adb shell
~ # mount /data
~ # mount /system
~ # rm -rf /cache/*
~ # rm -rf /data/*
~ # rm -rf /system/*
~ # reboot download
creepyncrawly said:
Edit:
I have never used adb in recovery before, so for my own interest, I decided to do a little experimentation. First of all, to get a hash prompt in shell try
Code:
adb root
followed by
Code:
adb shell
Click to expand...
Click to collapse
Ugh - adb root fails with the following error:
Code:
D:\adt-bundle-windows-x86_64-20130219\sdk\platform-tools>adb root
adbd cannot run as root in production builds
Looks like it's because the build that I have flashed doesn't have root. Wicked catch-22, since I can't root the phone until I wipe the cache to actually boot.
steelforce said:
Ugh - adb root fails with the following error:
Code:
D:\adt-bundle-windows-x86_64-20130219\sdk\platform-tools>adb root
adbd cannot run as root in production builds
Looks like it's because the build that I have flashed doesn't have root. Wicked catch-22, since I can't root the phone until I wipe the cache to actually boot.
Click to expand...
Click to collapse
Well, yes, you need root. You could flash one of the stock plus root packages, probably Entropy512's original uckh7 plus root since it has busybox, with odin, see links in my sig. I didn't see anything in your original posts that indicate the flash would fail.
creepyncrawly said:
Well, yes, you need root. You could flash one of the stock plus root packages, probably Entropy512's original uckh7 plus root since it has busybox, with odin, see links in my sig. I didn't see anything in your original posts that indicate the flash would fail.
Click to expand...
Click to collapse
The flash doesn't fail, but it's never able to boot past the AT&T "Rethink Possible" splash screen. I've tried flashing a couple of different packages, but i'll try some more tonight.
steelforce said:
The flash doesn't fail, but it's never able to boot past the AT&T "Rethink Possible" splash screen. I've tried flashing a couple of different packages, but i'll try some more tonight.
Click to expand...
Click to collapse
Flash the rooted package and you will then have root. Whether the phone boots or not, the system will then contain the superuser.apk and the su binary. I suggested Entropy512's package because I'm not sure but I think you need busybox to use the unix commands in adb in recovery. My stock plus root packages don't have busybox, and if you can't boot, you can install it from the play store. Once you have root in the system, then adb root should succeed.
creepyncrawly said:
Flash the rooted package and you will then have root. Whether the phone boots or not, the system will then contain the superuser.apk and the su binary. I suggested Entropy512's package because I'm not sure but I think you need busybox to use the unix commands in adb in recovery. My stock plus root packages don't have busybox, and if you can't boot, you can install it from the play store. Once you have root in the system, then adb root should succeed.
Click to expand...
Click to collapse
I tried both of Entropy512's packages from here. Flashed them and tried to boot, both hung at the Rethink Possible screen. Rebooted into recovery, was able to connect to it via adb - but adb root failed on both.
I'm getting closer and closer to punting and picking up a Nexus 4 after this....
With lineage recovery I do a full wipe like:
Code:
mkfs.ext4 -qFF /dev/block/by-name/userdata
mkfs.ext4 -qFF /dev/block/by-name/cache
mkfs.ext4 -qFF /dev/block/by-name/system

[Q] boot loop, how to update data to /data/system ?

Hi all,
anyone can point in the right direction how to get this boot loop fixed? theoretically i would want to push back the correct 3 locksettings files into /data/system as i have bad locksettings.db uploaded in it.
background info:
- boots into main home launcher then immediately reboots
- samsung note 3 with MJ7 stock rom but with MJ1 bootloader
- rooted and android 4.3, can access download mode and stock recovery mode
- knox 0 and wishing to remain as is
If you have USB Debugging enabled and have accepted the authentication request, then you should be able to remove the lockscreen settings like this:
adb shell
su
rm /data/system/locksettings.db
rm /data/system/locksettings.db-wal
rm /data/system/locksettings.db-shm
reboot
Other than that, you might just have to do a factory reset as that will remove the old lockscreen settings as well.
es0tericcha0s said:
If you have USB Debugging enabled and have accepted the authentication request, then you should be able to remove the lockscreen settings like this:
adb shell
su
rm /data/system/locksettings.db
rm /data/system/locksettings.db-wal
rm /data/system/locksettings.db-shm
reboot
Other than that, you might just have to do a factory reset as that will remove the old lockscreen settings as well.
Click to expand...
Click to collapse
how do i get into adb? booting into download mode and stock recovery, i can't see any devices through the command "adb devices".
if i'm in stock recovery and choose the option "apply update from adb", only then can i see the device but i'm limited to adb sideload only without shell.
ebackbone said:
how do i get into adb? booting into download mode and stock recovery, i can't see any devices through the command "adb devices".
if i'm in stock recovery and choose the option "apply update from adb", only then can i see the device but i'm limited to adb sideload only without shell.
Click to expand...
Click to collapse
Have to be booted or custom recovery for adb to work.
es0tericcha0s said:
Have to be booted or custom recovery for adb to work.
Click to expand...
Click to collapse
initially that's what i thought.
i'm wondering is it possible to reflash through odin a small subset so that it replaces certain files into /data/system alone? theoretically that could work right? if so, i need some pointers on where to go to attempt that.
ebackbone said:
initially that's what i thought.
i'm wondering is it possible to reflash through odin a small subset so that it replaces certain files into /data/system alone? theoretically that could work right? if so, i need some pointers on where to go to attempt that.
Click to expand...
Click to collapse
No. For 2 reasons. One, Odin doesn't work like that. It can install all the separate partitions, but not individual files and settings. And two, official firmware files don't wipe data.

How to fix Android boot loop, ADB?

My android (jellybean) tablet was turned off in middle of update and now is in boot loop. It was rooted with USB debugging on.
I MUST recover files (PDFs, .doc, .wav .JPEG, etc ) without erasing them.
Questions:
1 Do I use Odin and TWRP together?
2 Will Odin flash Samsung stock firmware erase files on device?
3. Will TWRP .img file erase everything?
4. Are these instructions correct?
I recommend you install TWRP recovery. It's the most feature-rich of all the recoveries I have used, and I will be assuming that is the recovery you use for the rest of this.
1. Boot into TWRP. (how? TWRP is an .img file )
2. Push your ADB public key to your device to force authentication.
____On Windows, do: adb push %UserProfile%\.android\ad
bkey.pub /data/misc/adb/adb_keys
3. Reboot into Android. Try adb shell and see if you get a shell prompt. If so, great! Exit it and run adb logcat, and read the huge error log for problems. If you didn't get the shell, well, then I think you're screwed, unless someone has cooked up a recovery zip for enabling adb.
What happens after ADB logcat?
Thank you..

Categories

Resources