I've suffered in using adb.exe
.
I wanted to use adb.exe
shell prompt same as bash, so I decided change the default bash binary (of course binary was cross compiled, and everything was perfect)
change bash binary is followed below order
adb remount
adb push bash /system/bin/
adb shell
cd /system/bin
chmod 777 bash
mv sh sh.bak
ln -s bash sh
first change was successful, but problem is occurred when second try.
I push new bash binary, but I missed change bash's permission 777, and disconnect adb shell
.
after
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb.exe shell
- exec '/system/bin/sh' failed: Permission denied (13) -
C:\Program Files (x86)\Android\android-sdk\platform-tools>
Is there any smart idea to fix this permission problem?
please help me...
If the device hasn't crashed completely (/system/bin/sh is a dependency for a lot of things - rebooting may not get very far!) and the system partition is still writable, you might be able to adb push a new copy of bash, where you have set the permission bits as desired on the host system before pushing it (you may have to use cygwin or even linux in order to have permission bits locally)
It sounds like the device is rooted, so you might be able to configure or customize a terminal emulator app to give you a session using the backup sh, run the backup sh again as root using some escalation tool, and then fix the problem.
If you have a modified recovery with adb, you could probably fix it from there by mounting the (normal) system partition manually.
Last resort would restoring from a vendor-signed vanilla image.
Hopefully you get un-stuck, but perhaps you've learned from this experience - changing the default shell is probably not a good idea. It would be better to load your custom shell under a different name and run it manually.
A general solution for doing such things:removing system app and all.
adb shell
mount -o rw,remount -t yaffs2 /dev/block/mtdblk4 /system
cd /system/app/
rm maps.apk
mount -o ro,remount -t yaffs2 /dev/block/mtdblk4 /system
sync
reboot
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With