[Q] - exec '/system/bin/sh' failed: Permission denied (13) - - Android Q&A, Help & Troubleshooting

Does anyone know how to use linux to push an original sh file or even just the whole bin folder?
I am unable to use the shell command in adb because I really messed that up by replacing my bin folder with another phones bin folder (same phone make and model - Samsung Proclaim).
(whoops, as you can tell I don't understand much about the system files and therefore I shouldn't be messing with them but my phone was stuck in a bootloop and I got google happy and desparate)
But I've read a few things about possibly using linux to get in there and put the originals back. I have been using linux for a short while but I lack the skills necessary to do this.
Does anyone know if this is something that I can learn to do in a few days or is this something that only years of experience can accomplish?
I'm willing to search and read whatever is necessary I just need a push in the right direction.

Download Stock ROM
Open and decompress zip file (or whatever)
not just adb push the sh executable but all /system folder
remount /system
Code:
adb remount
Code:
adb push ./STOCK_DECOMP/system /system
if you get errors on copying app, just copy each internal folder one by one
at least i got internal shell on a Kindle doing this way (just copying an original sh didn't resolve my problem), but all environment was a little messy.
good luck.

Related

Changing where OTA updates get stored on LG Spectrum and possibly other phones

Ok, this will be a bit of a technical thread, so bear with me. This is so people have an understanding of how to find and look at the update files that get put on a phone. If you are reading thru this, I will assume that you have a basic understanding of ADB and possibly of shell commands like ls and cd
When you go into settings -> About Phone - Software update, your phone does many checks to the file system. One of them is at a file /data/fota/ipth-muc.prop . Most people do not know this directory exists as when you are in ADB you can not do a list command on the /data directory without root. This file is re-created each time you boot your phone. If we do the following command, we can dowload the file to our computer:
ADB pull /data/fota/ipth-muc.prop
If we open the file, it will look a lot like this.
firmware.version=VS920ZV3
max.pkg.size=157286400
This file can also contain additional data. The string we want to add in there is where to download and place update packages. This can be defined as such:
pkg.location=
If this line does not exist, it will default to /cache/fota . Being as we can not cd into /cache or pull/push files there, this is a bad spot to put it. How ever, we can make directories and read/write to them under /data/local . Using this info we can do the following.
ADB shell
mkdir /data/local/temp
exit
From there, we can edit the original ipth-muc.prop file we pulled to look like this:
firmware.version=VS920ZV3
max.pkg.size=157286400
pkg.location=/data/local/temp
If you edit the file, use a true file editor. Notepad will not save it correctly, but Wordpad had no issues. From there we do the following
ADB push ipth-muc.prop /data/fota
Now when we do the update, it will place the downloaded files into our temp directory (note, you must do this after the phone is fully booted, but before you have the phone look for an update). Once the files are done downloading, click remind me later. Then we can go into ADB and pull the files.
ADB pull /data/local/temp
You will get two files. One will be the update "ipth_package.bin" and the manifest files "ipth_package.bin.dd" . The manifest file also contains the link to the original file name as link to it on the host server. The ipth_package.bin file is a simple zip file that can be opened with almost any archiving program.
The zip is signed by LG using their personal key, so modifying it and pushing it back to the phone is not currently possible. We can however see the contents of an update and see what is being change. I hope to use this in the near future to either break the LG key or find a way to find a glitch in a patch being done.

[Q] Updater-script

Hi.
I'm using a Samsung SGH-i997 Infuse 4g. GB 2.3.6
I'm using root explorer to describe file system.
I hope someone with experience with updater_script can help.
I was interested in running a command from /system/xbin.
When you run root explorer, in the root, there is a /bin folder and a /system/bin folder. They contain same commands
Commands in it will have: mount, unmount, reboot etc
To run this in updater-script, you will need this:
run_program("sbin/mount", argument etc);
I wanted to run a command in /system/xbin
These command are: (ex:chmod, clear, grep, insmod etc)
I know these commands can be included in a script file, ex: mumbojumbo.sh
and can be extracted, given permission and run as a script.
What I was interested in was if it was possible to run these from updater-script without going through a *.sh script.
Example:
run_program("system/xbin/chmod", argument);
Obviously I have tried without succeeding using different combinations
Thank you
bump
10 chars
just run_program("sbin/chmod", blah) will do.
while in recovery...connect to the adb shell and look into sbin/

[Q] Please help- simple mistake... bricked phone

Hi all-
I have unknowingly renamed the framework-res.apk file to framework-res.bak, following the suggestion of a website (who had said to copy the file over, not rename it). I had no idea that would make the phone instantly useless, and render everything inoperative
I was rooted. All I need to do is copy the backup back over, but how?
I am able to get into CMM-based Recovery v5.0.2.7 and can mount the system directory and see it on my PC, but for some reason the framework directory is invisible. There is talk on the web about getting to a prompt and typing:
adb push framework-res.apk /system/framework/framework-res.apk
But how in the world do you get to a prompt? I don't see it on any menu, anywhere and the adb command is unrecognized on my OS.
Hoping I'm not ruined...... thanks for any advice.
Samsung Captivate Glide Android 2.3, Ubuntu
To get ADB, you first have to install the Android SDK.
http://developer.android.com/sdk/index.html
Then, you have to put ADB in the PATH variable.
http://www.redmondpie.com/how-to-set-up-android-adb-and-fastboot-on-windows-tutorial/
After that, you can just type adb in the command prompt and it should work.
Hi,
I downloaded the SDK tools and got the adb command, but when I mount the phone with recovery I still don't see any framework directory.
I got to DOS and navigated to the directory where my copied framework-res.apk file was, and ran:
c:\adb\adb push framework-res.apk L:\framework\framework-res.apk
it replied with:
1319 kb/s (7979827 bytes in 5.905s)
However, then I rebooted the phone and it won't get past the SAMSUNG screen at all, it just sits there forever.
- why can't I see the framework directory, even though I have mounted it through CWM based recovery?
- can I see it using the ADB tools?
- has just copying the copied file back over, destroyed the cell phone? I can't possibly see how.
Thanks for any help
OK I found out the problem.
you need to use forward slashes and put the whole pathname in:
C:\adb\adb push framework-res.apk /system/framework/framework-res.apk
Thats assuming you have the adb command in the c:\adb directory.
It seems the phone is working again.
WHEW! Man that file is dangerous. be warned.

[Q] [help]how to get system folder permission for hdx7

I just play andorid device a few days, but My hdx7 is a little bricked because i deleted some system app. Now I can log in fire os, have adb, usb connected and internal storge, even i can operate device setting app, but i can't open the other app because i don't have a desktop.
I compare system/app folder with the same folder in the amazon bin, found that the folder lack of scores of app, but the other system folder is the same. So I hope can adb push app folder to the system folder, but the pemission denied. I try to remount or mount, it can't work.
if adb root, then "adbd cannot run as root in production builds.
if adb push apk to the app folder, then “permission denied".
if adb remount, then ”remount failed: Operation not permitted".
and I have try adb shell like that:
# su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# chmod 777 /system
# exit
it didn't work.
my hdx7 have rooted.
My Questions are:
1. If I could push the app folder to the system folder and reset to factory, is my hdx saved?
2. How to get the system folder rw in the situation?
thx for any prompt, although i am a rookie but i will try my best, i wish the adept can help me and will be enormously grateful. Sorry for my poor english.
It sounds to me that you had lost root.
kschang said:
It sounds to me that you had lost root.
Click to expand...
Click to collapse
So i have tried root again like "http://forum.xda-developers.com/showthread.php?t=2544965" said
But it didn't work, please see the attach, But I don't know why.
Sorry for that i'm rookie to andorid and ask so many questions.
randolphling said:
So i have tried root again like "http://forum.xda-developers.com/showthread.php?t=2544965" said
But it didn't work, please see the attach, But I don't know why.
Sorry for that i'm rookie to andorid and ask so many questions.
Click to expand...
Click to collapse
Hmmm... It says you still have root (the prompt changed after "su")
I personally don't use ADB much. I have Root Explorer (grabbed it legally for free from Amazon ages ago) and Wifi Explorer Pro (same method) so I basically WiFi myself the files I need sideloaded then move them around on the device itself. But if you've lost launcher, you have deeper issues.
Have you tried ADB push any launcher? Or even a download store like 1Mobile or Aptoide?
ADB is basically a Linux shell debug into Android, so you need to learn some Unix shell commands. I'm sure you can find ADB guides with the basic commands, like "ls", "cp", and so on.
You need to check the directory and see if the system/app and other system directories are still there. This is one reason I only play with the copy of ROM I have (see Safestrap Recovery).

Strange behavior of the system folder

Hello everyone,
I’ve a problem with my system folder as I can’t write to it anymore.
Phone: HTC Desire with Android 4.1.1;
rom: https://forum.xda-developers.com/showthread.php?t=2183281
My story: I wanted to try a model specific soft and I made a change of model in the build.prop in the system folder. Everything was ok, but when I edited back the build.prop with ES file editor, it saved the file as a blank file. I then moved the blank file to the SD card with success and tried to copy the build.prop from a backup I’ve done; and I get permission denied…
So far I’ve tried:
- Re-mounting the system folder
- Clearing ES file explorer data to give a SU access again
- Trying the same thing with Terminal Emulator but I’m not familiar with android command line
So now I’ve a phone without build.prop in the system and I suppose it will not be happy about it the next reboot.
My question: How I lost the capacity to write to the system folder, from a theoretical point of view, and how I can clean this mess as a personal matter. As the phone is still up I hope that it’s still possible to solve the problem without having to re-install everything.
If someone is interested by this, I will welcome any help.
Kuroneko
Try
mount -o remount rw system
In terminal.....And then try to copy with terminal itself...Use CP command
Thank for the help but sadly it didn’t make the trick.
I use Terminal Emulator
After several trials with the command I think that I’ve found the correct syntax but at the end it didn’t worked.
Working in the root folder where I put a copy of build.prop:
su
mount –o remount,rw /system
cp build.prop /system/build.prop
>can’t create “/system/build.prop”: Out of memory
I also tried to create a text file in the system folder with Total Commander without success.
I fear that there is a serious **** up in the system, probably with the file handling. Under windows (and dos) I could find my way but I’m not familiar with Linux system, and even less with Android. Under normal circumstance I would reboot the system but without a build.prop in the system directory I fear that it will go even worse.
Any other suggestion?
Kuroneko
PS: I’ve nothing again command line but with a 3.7” touch panel it’s far from fun…
This is due to HTC's read/write protection that is built into the boot.img. You might see if there is a custom kernel for your device that has this flag disabled.
Thank for your answer,
But I’m not sure that I follow you.
If the problem was due to an r/w protection of the boot image, how I was able to modify my build.prop, and later erase it?
If you could explain this it would help greatly as it means that I could re-boot without worry.

Categories

Resources