0

I erased a file called .sh from the system/bin directory on my android jellbean device now it doesn't work properly. I can connect via USB and adb but cannot access the shell. How can I replace the missing time and gain access to shell

2
  • 1
    Reflash system partition, or if you have access to that standalone sh file then use a custom recovery to copy it under /system/bin. Next time, make custom recovery based backups if you decide to modify anything outside of /data partition.
    – Firelord
    Nov 7, 2021 at 4:15
  • Hi, it seems you accidentally created a duplicate account. Please refer to the help center to merge your accounts and regain ownership of the question and reply to the comments on your post. For this moment, I'll edit the post and add this information. Thanks for your understanding.
    – Andrew T.
    Nov 8, 2021 at 8:58

1 Answer 1

0

If you erased just the sh binary then you still be able to run others binaries, here a script I made that may fix it (you need the sh bin file and terminal emulator):

/system/bin/su
/system/bin/mount -o rw,remount /system
/system/bin/cp /sdcard/sh  /system/bin
/system/bin/chmod 755 /system/bin/sh
/system/bin/mount -o ro,remount /system
/system/bin/sh

Put your sh file on sdcard, and write this script with filename ending .sh, after open a file explorer click on the script and select terminal emulator to run the script.

5
  • I dont have any apps on the device everything was deleted can only use terminal emulator from a host device
    – user362909
    Nov 7, 2021 at 17:25
  • If you can't boot the device, then the only solution is flash the stock system partition, if your device supports fastboot try flash from it. Nov 8, 2021 at 10:38
  • I can boot device but cant use terminal emulator on it because I don't know how to get access to it from a host device
    – user362869
    Nov 9, 2021 at 3:13
  • Try install Termux (play.google.com/store/apps/details?id=com.termux) and run the script (you may also need to run this command before: termux-setup-storage ). Nov 9, 2021 at 10:34
  • I appreciate your answers however I don't think you fully understand all I can do with the device is boot it upand put in the password. I can't install apps. I'm tryind to figure out how to use another device or a computer to gain access via adb but every time I connect to it and type in adb shell it says shell not found because I deleted the sh file
    – user362869
    Nov 9, 2021 at 21:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .