Hey all,
I'm hoping I'm in the right area to post this question. If I am not, if you could direct me to where I should post it I would appreciate it.
Anyway, here is my question: How does one go about changing the shell that su uses? I am using Android Terminal Emulator and while I have changed the default shell command line to ash, I am unable to figure out how to change the shell used when going into superuser mode. The default terminal is missing my most used feature (command recall) and I'd like to get it back.
If you could help me out, I would greatly appreciate it.
No one? Really?
gumbyx84 said:
No one? Really?
Click to expand...
Click to collapse
Well, if you were to use "/system/xbin/su -c /system/xbin/bash" in Cyanogenmod then it would give you bash shell as root. So, if you change the path to bash to ash on your ROM then you can have ash shell as root.
Related
does anyone know how to add new commands to shell ? or it is possible to install bash or something similiar inside, once we have root now ?
this shell inside is really "cuted" and almost all "ordinary(standart)" command I am missing
e.g: more vi and so on
maybe it works in different way , if yes just correct me
Any try to help is appreciated , but please stay on topic. because I can see it is one of the biggest problem here ..
Have you downloaded the newest version of busybox in the marked? This gives you a lot more commands then the first version posted with the initial root, one if them is vi.
thermoska said:
does anyone know how to add new commands to shell ? or it is possible to install bash or something similiar inside, once we have root now ?
this shell inside is really "cuted" and almost all "ordinary(standart)" command I am missing
e.g: more vi and so on
maybe it works in different way , if yes just correct me
Any try to help is appreciated , but please stay on topic. because I can see it is one of the biggest problem here ..
Click to expand...
Click to collapse
I did this:
Download bash binary from here: http://forum.xda-developers.com/showthread.php?t=537827
You can either replace the default "sh" with this (warning: the "sh" binary is the one that gives you root privileges in the first place, so you might loose them, I'm about to experiment with this and would post more details soon) or keep them both.
Download ASE from here: http://code.google.com/p/android-scripting/
This gives you an easy bridge to Android java using a scripting language of your preference.
When you use adb you will have VI and such available. I don't know much about the varios unix/linux shells available but I know that ADB is offering a lot of ****
Diabolico said:
When you use adb you will have VI and such available. I don't know much about the varios unix/linux shells available but I know that ADB is offering a lot of ****
Click to expand...
Click to collapse
no.. that's what busybox is for
Hi all!
This question may seem a little dumb.. But I'm trying to understand what configuration file (if it's that kind of thing used) gives the "shell" uid on my phone but a root uid on the emulator when I type "adb shell" command.
If someone could point out the process used, that would be great.
Thanks!
Nobody can give me a hint on my question?
Nerver mind, found the answer with the ps command..
All depends on the uid running adbd. On the emulator the uid is root and ion my phone it's shell.
I also believe in build.prop or default.prop or something. That ro.secure controls whether adb is root.
Thanks, I'll try to dig that.
in the ramdisk of your boot image you have a file called default.prop
if the setting in that file have:
persist.service.adb.enable=1
you get a root shell, if it has
persist.service.adb.enable=0
You do not get a root shell, basicly that is what you change when you root a phone or tablet, and then normally also add su and busybox to /system/xbin, and add the Superuser apk.
Per
If you type su on the prompt, you get root, nothing tricky.
yareally said:
If you type su on the prompt, you get root, nothing tricky.
Click to expand...
Click to collapse
Nothing tricky indeed, but you need a rooted phone to do this..
foxl3y said:
Nothing tricky indeed, but you need a rooted phone to do this..
Click to expand...
Click to collapse
True. I was just under the notion they had root.
I have your ICS root ready, how about we call it TPSparkyRoot. I based my research on code written by Dan Rosenberg (similar to what jchase did with NachoRoot in the fact that chown/chmod follows symlinks even when set during startup), here is a link to that research http://vulnfactory.org/blog/2011/08/25/rooting-the-droid-3/
**UPDATE**
Android's source has been patched so that future OEMs can not leave this hole open by accident.
https://android-review.googlesource.com/#/c/36035/
**UPDATE**
This method has been shown to work on the HTC One X see forum
http://forum.xda-developers.com/showthread.php?t=1644167
Theoretically this should work on Honeycomb versions of the Prime as well, since the Honeycomb update is where I found the flaw that is being exploited. I have confirmed this works on my Prime.
**UPDATE**
This exploit does not currently work for the latest ICS update released (v9.4.2.11 on 1/18/2012). You can use OTA Rootkeeper to backup your root prior to updating using OTA, which I have confirmed to work on my device, (this may not work if you push the update manually).
https://market.android.com/details?id=org.projectvoodoo.otarootkeeper
For the devs out there, it does not to honor the ro.kernel.qemu=1 setting within the local.prop because it is already set to blank by that point by the build.prop
You must have your Prime set up to use adb and your adb location contained in your path variable (windows) or unzip the files from my zip into that directory before running.
**UPDATED**
If you are have issues getting adb working, make sure asus sync is not running, if it is then kill it.
adb shell mv /data/local/tmp /data/local/tmp.bak
adb shell ln -s /data /data/local/tmp
adb reboot
adb shell rm /data/local.prop > nul
adb shell "echo \"ro.kernel.qemu=1\" > /data/local.prop"
adb reboot
adb shell id
//IF ID IS 0/root THEN CONTINUE, ELSE START OVER>
adb remount
adb push su /system/xbin/su
adb shell chown 0.0 /system/xbin/su
adb shell chmod 06755 /system/xbin/su
//UNDO EVERYTHING EXCEPT su
adb shell rm /data/local.prop
adb shell rm /data/local/tmp
adb shell mv /data/local/tmp.bak /data/local/tmp
adb reboot
**UPDATE** As jchase stated "If your device "bootloops" don't stress, just follow through with the commands as it "loops" ro.kernel.qemu can do funky stuff." I did notice this in my rooting but just assumed it was normal as this is my first use of adb.
**UPDATE2**
If you get a permissions error on the call
adb shell "echo \"ro.kernel.qemu=1\" > /data/local.prop"
then you may try
adb shell rm /data/local.prop
And then try the echo command again. This may be due to having rooted prior without cleaning up properly. Thanks to Franky_402 for this piece of info.
I have updated the batch file to include this step, it should still be fine for those who are not having the issue as well.
I have attached a zip file containing the su and a bat file for a more automated process (just pauses when during reboots, don’t hit go until it’s done rebooting). Or, you can run the commands manually and get the su file from the origin http://downloads.androidsu.com/superuser/su-bin-3.0.3.2-efghi-signed.zip
Finally, install Superuser to make it all work https://market.android.com/details?id=com.noshufou.android.su
**UPDATE** UNROOT
There are multiple was to unroot now that you have root access already (all you need to do is remove the su file; so you could potential skip all the steps before the remount and just add the local.prop manually using a file manager and then reboot).
The one most similar way to how you rooted would be to follow all of the steps above, but replace these 3 lines
adb push su /system/xbin/su
adb shell chown 0.0 /system/xbin/su
adb shell chmod 06755 /system/xbin/su
with this line
adb shell rm /system/xbin/su
This will remove the actual root, but it would leave behind any apps that you have given root access to or any files that those apps changed themselves (i.e. RootKeeper backs up the su file and the backup would need to be removed). If you had anything like this you would need to clean up that first before unrooting because it is a dead giveaway that it was rooted.
Viperboy should be releasing his tool shortly that utilizes this method, if you would like a one click process that installs apps along with it (superuser, busybox). I’m guessing it installed them to the root apps directory so these also would need to be removed when unrooting as well (i.e. if you root using his new tool you should unroot using it as well).
**UPDATED** Remove PayPal link in favor of link over there <-
Yes, as it says, I went from the same base exploit that was shown by Dan and was the base for jchase as well.
The commands more than likely are but the exploit must be different or Jcases rot would still be working... Thanks OP!!!
EDIT: He didn't "ask" for donations just gave a link since he doesn't have the donate button <<over there
Not mine at all, props to this guy! Send him some bones.
Yes, thanks, I did not realize that there was a donate button as I am still learning this forum.
This root is confirmed!
If your device "bootloops" don't stress, just follow through with the commands as it "loops" ro.kernel.qemu can do funky stuff.
Good ****.
sparkym3 said:
Yes, thanks, I did not realize that there was a donate button as I am still learning this forum.
Click to expand...
Click to collapse
Yeah it's in the User Control Panel on the top of the forum
"Reported" your thread to a mod, so he can move it to the dev section
And welcome to XDA Don't let the trolls take your love for android
jcase said:
This root is confirmed!
If your device "bootloops" don't stress, just follow through with the commands as it "loops" ro.kernel.qemu can do funky stuff.
Good ****.
Click to expand...
Click to collapse
OP, maybe put that in the OP, so users don't panic
Moved to development.
Holly smoke, it works....
jcase said:
Not mine at all, props to this guy! Send him some bones.
Click to expand...
Click to collapse
As the main man says. Give credit when due. It's not his. and give the guy props and if you wish to donate donate.
This is why this android community is crap. because everyone trolls. If it was jcases he'd release it. not someone else. and im sure as hell he wouldnt be saying these things 'like give the guy some bones'
rhcp0112345 said:
As the main man says. Give credit when due. It's not his. and give the guy props and if you wish to donate donate.
This is why this android community is crap. because everyone trolls. If it was jcases he'd release it. not someone else. and im sure as hell he wouldnt be saying these things 'like give the guy some bones'
Click to expand...
Click to collapse
Biggem isnt really a troll, he's obv just got out of the wrong side of the bed ... i'm sure he'll take that back.
Danny-B- said:
Biggem isnt really a troll, he's obv just got out of the wrong side of the bed ... i'm sure he'll take that back.
Click to expand...
Click to collapse
Also nothing wrong with asking for donations.
YOU ROCK. donations to you and jcase after payday
You would all post this WHILE I'm at work, have my prime with me, but not my charger! lol. I'll DEFINITELY check it out when I get home.
disturb3d1 said:
You would all post this WHILE I'm at work, have my prime with me, but not my charger! lol. I'll DEFINITELY check it out when I get home.
Click to expand...
Click to collapse
Dude mine should be here in 9 hrs
I might do an unboxing vid using my photon
Wait a minute, chainfire is paying attention to the thread, that only means good things. Please tell me your gonna dev some for this device
Sent from my SGH-T959 using XDA App
not going good for me I'm on ubuntu with working adb. copied su to home directory and running all commands from there. when i get to, adb shell "echo \"ro.kernel.qemu=1\" > /data/local.prop", i get, /system/bin/sh: cannot create /data/local.prop: Permission denied. So i never get the right id to continue. Anyways please help. thankx
Any chance in the future this can be converted to an apk to install on Prime or a One-click method, per se?
I'm freshly unlocked and perm rooted; I've already used Titanium Backup, Root Explorer, etc.... my Su is working.
I looked at the CleanTool thread in the Dev forum to see how to remove bloat, and executed the same commands from adb shell .... here's a small pasted section :
$ pm disable com.gameloft.android.Verizon.GloftLGolf2.lgolf2
pm disable com.gameloft.android.Verizon.GloftLGolf2.lgolf2
[1] Killed pm disable com.gameloft.android.Verizon.Glof
2.lgolf2
$ pm disable com.blockbuster.app.htc
pm disable com.blockbuster.app.htc
[1] Killed pm disable com.blockbuster.app.htc
Following a reboot, these bloat apps are still here and functioning. Anyone know what I'm doing wrong, or a more effective way to selectively remove what I consider bloat?
$ means you are not in SU
you need to type SU in ADB
The $ will change to #
Then try again (making sure if your phone asks you to allow ADB SU privs, you check allow; if that happens)
jdmba said:
$ means you are not in SU
you need to type SU in ADB
The $ will change to #
Then try again (making sure if your phone asks you to allow ADB SU privs, you check allow; if that happens)
Click to expand...
Click to collapse
This works, of course. This seems like such a duhhhhhh question, now that I know the answer.
Thanks so much
DIncLover said:
This works, of course. This seems like such a duhhhhhh question, now that I know the answer.
Thanks so much
Click to expand...
Click to collapse
Glad you were able to be helped.
Sorry for resurrecting this thread, but I was really surprised why "pm disable-user" does not work as user but also seems to require root-permissions? Makes no sense to me...
Hey all,
I'm hoping I'm in the right area to post this question. If I am not, if you could direct me to where I should post it I would appreciate it.
Anyway, here is my question: How does one go about changing the shell that su uses? I am using Android Terminal Emulator and while I have changed the default shell command line to ash, I am unable to figure out how to change the shell used when going into superuser mode. The default terminal is missing my most used feature (command recall) and I'd like to get it back.
If you could help me out, I would greatly appreciate it.
Know I'll catch some heat for this but would really like an answer so bumping the thread