Trying to get file access through adb & su - Vibrant Q&A, Help & Troubleshooting

I wanted to backup my K-9 email settings which are supposed to be at
/data/data/com.fsck.k9/
I tried doing adb pull /data/data/com.fsck.k9/ C:\whatever
That gets nothing
I tried going into adb shell and I can move around the folders just fine.
/data/data/com.fsck.k9 has subfolders, but I don't have access to them
(get permission denied)
I tried doing su, and that also got permission denied.
I found a thread from 2009 that talked about getting su.zip from magicandroidapps.com and I did that, put it into /data/local, changed permissions so it is executable, but when I execute it with ./su I get:
su: access granted, courtesy of [www]magicandroidapps.com
su: permission denied
and I still don't have permissions.
I've learned a lot about the android so far, but am at the end of my knowledge. Any suggestions on how to do this?

first time you su from adb the Superuser.apk on your phone is going to want permission... you must click always allow on your phone...
so if you are trying with the phone booted, before typing su make sure your screen is on and then click allow... if it doesnt ask for it, clear your su.apk
if you are trying this from recovery, you have to boot your phone on first and allow adb su permission
by the way, you dont get flamed if you read the rules to posting in this forum...

Related

Rock & a hard place with Superuser

Edit: Im stuck. I cannot root my phone because something is wrong with Superuser.apk, and I can't uninstall superuser because I can't get root. And if I try to install Superuser it just fails because it's already in there. So I have no idea what to do now, I need to return this phone to the Verizon store and I can't get the Superuser app off the phone. Any ideas?
http://ip208-100-42-21.static.xda-developers.com/showthread.php?p=6978379
should work. I did this to upgrade from market the version that came with the lag fix from the market.
I couldn't get that to work..
What happens when you adb shell into the device, and do 'su'. If you get a # prompt, you have root.
You don't need Superuser.apk to have root access. You can always run the rage.bin process to get a root shell. From there you should be able to at least rename Superuser.apk to something like Superuser.apk.old.
Yeah, I can type su and get the # prompt. Is this what runs the rage.bin:
adb shell
cd /data/local/tmp
chmod 0755 rage.bin
./rage.bin
?
Sorry, Im new to the ADB process. How would I go about renaming? I wanted to use something like root explorer to find the file and remove or rename it, but I can't get any root apps to work. Obviously because Superuser doesnt function I don't get permission prompt. Root explorer either crashes or says to restart to get the permission prompt.
GHII said:
Yeah, I can type su and get the # prompt. Is this what runs the rage.bin:
adb shell
cd /data/local/tmp
chmod 0755 rage.bin
./rage.bin
?
Sorry, Im new to the ADB process. How would I go about renaming? I wanted to use something like root explorer to find the file and remove or rename it, but I can't get any root apps to work. Obviously because Superuser doesnt function I don't get permission prompt. Root explorer either crashes or says to restart to get the permission prompt.
Click to expand...
Click to collapse
If you can do "su" and get the # prompt, forget about rage.bin. You have root access, it's just Superuser that's screwed up.
go to your # prompt and do the following
cd /system/app
mv Superuser.apk Superuser.apk.old
See if that gets you any further as far as being able to re-install
I appreciate your help more than you know, really, thanks. I tried that and I get 'failed on 'Superuser.apk' - No such file or directory. Can it be installed anywhere else, like in a temporary directory?
When I try adb install Superuser.apk it starts to then says:
pkg: /data/local/tmp/Superuser.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
So I tried what you just mentioned but using the above directory:
#
cd /data/local/tmp
mv Superuser.apk Superuser.apk.old
and it didn't give me any errors, just the #..but when I went and tried to install Superuser again I got the same error as above.
Ok, new update! I remember someone asking me to do ls in adb shell to get a list of what's in there..so, I did that with /system/app and I got a list...at the very bottom of the list was superuser.apk..this whole time i've been messing with Superuser.apk, a capital S. So, I used your mv method on the lower case version, seemed to work..but when I did adb install Superuser.apk I get Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
Didn't work but I feel Im getting closer
Wow, i just happen to look and the superuser app was no longer showing up in my apps..problem solved. Thanks again for everyone's help in this thread and others.

Method to install root for Honeycomb

Check this thread for updated and improved information, many thanks to j4mm3r
http://forum.xda-developers.com/showthread.php?t=953110
Credit goes to NuroSlam for coming up with a working method. This requires a functioning adb connection. Using this version of su is not as secure because it will not activate Superuser for your permission to grant root access. In fact, it can work without Superuser.apk installed at all. Hopefully we will soon have an updated su or maybe the next version of Honeycomb will be prerooted. First download the following files:
1. su http://www.magicandroidapps.com/su.zip
2. Superuser.apk http://bit.ly/su2361ef
3. busybox http://busybox.net/downloads/busybox-1.18.2.tar.bz2
Extract the above files using your favourite program
Using adb, install all three files to /data/local:
adb push su /data/local
adb push Superuser.apk /data/local
adb push busybox /data/local
Use adb remount to open the /system directory
adb remount
Use adb shell to move files
adb shell
cd /data/local
cat Superuser.apk > /system/app/Superuser.apk
cat su > /system/bin/su
cat busybox /system/xbin/busybox
Symlink su and set permissions:
ln -s /system/bin/su /system/xbin/su
chmod 06755 /system/bin/su
Typing su should now work
su
su: access granted, courtesy of www.magicdroidapps.com
Install busybox
exit from adb shell and using a terminal application (i.e Root Explorer or Better Terminal Emulator) on the nook,
su
busybox --install -s /system/xbin
That should do it, works with Root Explorer, Titanium Backup, LCD Density, Quick Boot and SetCPU.
Good Luck
really? That simple? Root was the only reason i haven't jumped on the Honeycomb train. This may change my mind.
I tried this on the 2gb sd image got root. But after I rebooted root was gone.
I noticed su is in /system/bin rather than /system/xbin on the Froyo image. Any reason?
Homer
anbradle said:
I tried this on the 2gb sd image got root. But after I rebooted root was gone.
Click to expand...
Click to collapse
Check your steps, especially permissions and the symlink. Works consistently on reboot for me.
Homer_S_xda said:
I noticed su is in /system/bin rather than /system/xbin on the Froyo image. Any reason?
Homer
Click to expand...
Click to collapse
I couldn't get it to work for me without installing in /system/bin and using a symlink to /system/xbin
chhaggerty said:
It wouldn't work for me without installing in /system/bin and using a symlink to /system/xbin
Click to expand...
Click to collapse
It should work anywhere in the default PATH as long as it's got the full permissions (7655) set. I've only got one in xbin wih no symlink and all has been well for the superuser app...
[email protected]:/system/bin # echo $PATH
echo $PATH
/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
[email protected]:/system/bin # ls -l su
ls -l su
su: No such file or directory
[email protected]:/system/bin # ls -l /system/xbin/su*
ls -l /system/xbin/su*
-rwSr-sr-t root root 76232 2011-02-04 09:08 su
-rwSr-sr-t root root 76232 2009-07-31 19:08 su-magic
-rwSr-sr-t root root 26264 2010-08-10 06:52 su-new
-rwSr-sr-t root root 68340 2011-01-31 11:22 su-org
chhaggerty said:
Credit goes to NuroSlam for coming up with a working method. This requires a functioning adb connection. First download the following files:
1. su http://www.magicandroidapps.com/su.zip
2. Superuser.apk http://bit.ly/su2361ef
3. busybox http://busybox.net/downloads/busybox-1.18.2.tar.bz2.
Good Luck[/B]
Click to expand...
Click to collapse
i might take credit for gaining root, but the rest is all you
Thanks! I couldn't really follow the part with installing busybox. Was I supose to make the busybox binary? Anyway, I just let titanium backup install busybox for me by clicking the "Problems?" button.
Just tried Root Explorer and it's working great. Nice being able to quickly edit the build.prop file. Upped the dalvik heap size to 64mb and messing with LCD density.
Thanks again!
Nathan
nswenson said:
Thanks! I couldn't really follow the part with installing busybox. Was I supose to make the busybox binary? Anyway, I just let titanium backup install busybox for me by clicking the "Problems?" button.
Just tried Root Explorer and it's working great. Nice being able to quickly edit the build.prop file. Upped the dalvik heap size to 64mb and messing with LCD density.
Thanks again!
Nathan
Click to expand...
Click to collapse
Running busybox from terminal will install all the busybox commands in /system/xbin which should make them available when using adb.
Just a suggestion...
Making a batch file with the command and packing everything in 1 zip makes it a lot easier for most people and reduces the chances of people forgetting a step.
You were right I tried again and now I am rooted after reboot. Thanks
jleecong said:
Just a suggestion...
Making a batch file with the command and packing everything in 1 zip makes it a lot easier for most people and reduces the chances of people forgetting a step.
Click to expand...
Click to collapse
Okay...
I am running HC (v2) off a 8gb sd card.
So do I just do these steps to gain root or do I need to partition the sd card first?
Thanks
Note to the OP, this method isnt exactly quite the same as using the "su" from the SuperUser app would be. This is just a modified "su" binary from the AOSP build which bypasses the check for uid AID_SHELL. Typically, the su shipped with Android only allows root access if invoked via "adb shell".
Now, although this modified binary is quite ok and will get you on the way working with all the Apps that require root access, but it will leave your system unsecure.
You see the guys who developed SuperUser have a hook inside the "su" binary which invokes the SuperUser activity which allows the user to allow/disallow/track other applications' root requests and usage.
So my advice is to be really careful and understand what you are doing if you decide to install this.
I'm gonna try and recompile ChainsDD's SuperUser and see if I can remove its dependency on mktemp.
EDIT: There is no need to push the SuperUser.apk, the modified su has no relation with it and it will work anyways.
j4mm3r said:
Note to the OP, this method isnt exactly quite the same as using the "su" from the SuperUser app would be. This is just a modified "su" binary from the AOSP build which bypasses the check for uid AID_SHELL. Typically, the su shipped with Android only allows root access if invoked via "adb shell".
Now, although this modified binary is quite ok and will get you on the way working with all the Apps that require root access, but it will leave your system unsecure.
You see the guys who developed SuperUser have a hook inside the "su" binary which invokes the SuperUser activity which allows the user to allow/disallow/track other applications' root requests and usage.
So my advice is to be really careful and understand what you are doing if you decide to install this.
I'm gonna try and recompile ChainsDD's SuperUser and see if I can remove its dependency on mktemp.
EDIT: There is no need to push the SuperUser.apk, the modified su has no relation with it and it will work anyways.
Click to expand...
Click to collapse
agreed, i was just going for root myslef
j4mm3r said:
I'm gonna try and recompile ChainsDD's SuperUser and see if I can remove its dependency on mktemp.
EDIT: There is no need to push the SuperUser.apk, the modified su has no relation with it and it will work anyways.
Click to expand...
Click to collapse
In
http://howto.ccroms.net/android_project/build/mod/root
I would have though that the purpose of the changes, specifically;
LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_STATIC_LIBRARIES := libc
Were what should resolve the _mktemp not found?
j4mm3r said:
Note to the OP, this method isnt exactly quite the same as using the "su" from the SuperUser app would be. This is just a modified "su" binary from the AOSP build which bypasses the check for uid AID_SHELL. Typically, the su shipped with Android only allows root access if invoked via "adb shell".
Now, although this modified binary is quite ok and will get you on the way working with all the Apps that require root access, but it will leave your system unsecure.
You see the guys who developed SuperUser have a hook inside the "su" binary which invokes the SuperUser activity which allows the user to allow/disallow/track other applications' root requests and usage.
So my advice is to be really careful and understand what you are doing if you decide to install this.
I'm gonna try and recompile ChainsDD's SuperUser and see if I can remove its dependency on mktemp.
EDIT: There is no need to push the SuperUser.apk, the modified su has no relation with it and it will work anyways.
Click to expand...
Click to collapse
Howard from MagicAndroidApps.com noted this on the original Honeycomb thread. I'll update the OP to make this clear. Thanks.
So once we acquire root, there is nothing to shield apps or commands from performing root without the users knowledge?
Edit: That does sound correct the way i typed it, hope you guys understand what i'm trying to convey
Mikey1022 said:
So once we acquire root, there is nothing to shield apps or commands from performing root without the users knowledge?
Edit: That does sound correct the way i typed it, hope you guys understand what i'm trying to convey
Click to expand...
Click to collapse
yes, at the stands, its just root access. granted i had my own reasons for this

[Q] Lost Permissions of SU in system/bin/su

Well guys i used a 1 click root to root my lg esteem from metropcs.
Worked perfect, than an update came and the phone become unrooted.
So i changed the permission of su in system/bin/su
It worked! my phone was un rooted again
Than this is my fault and the part iam stuck on -.-
I used root explorer and changed the permission of Su to match the other files.
I restarted and lost root! crap
Now whats even worse is, i cant use SU in adb shell any more
I just get the $ symbol everything i enter the su command under the adb shell and it wont give me root access to even changes the permissions back.
So now what i do, i cant use one click root anymore, and i cant get root with adb shell:
HELPPPPPPP
XD
I can see it is a real complicated situation and no doubt you messed up everthing. Maybe hard to find someone can help here. Give us the solution when you get it. Thanks.
I have heard of people using the lg recovery tool to recover bricked phones,
when it detects your phone isnt booting correctly it re flashes it.
But the problem is, my boots perfectly , so it just tells me my phone is up to date.
There has got to be a way to trick it some how....
Anyway off topic, how do i get my root back XD
Install root binary again.
Accidentally sent from my Google Nexus S using XDA Premium
You mean re install Su binary file to bin and xbin folders?
Or am i missing something?
ok i was able to change the permissions back on the system/bin/su file
Now things get werid,
I still cant run su command in adb shell as root
I checked the permissions of system/bin/su
i set chmod to 6755
Thats right isnt it?
The permissions DID CHANGES
so i dont get why root checker is telling me i dont have permission still......
I got it working i re installed binary 3.0.3 and i had root access again.
Than right after i set chmod to 6777 on /system/bin/su
i lost root again, what does this mean?

[Q] update to jb and root isnt working properly

before i made the update i did a backup of the root with voodoo ota rootkeeper.
now after the update rootkeeper the box "root permission granted" is unchecked and i dont know how to change it.
i tried to delete the "su backup" but it didnt work.it is written that the su backup is deleted but when i restart the rootkeeper it is still there.
i found a thread which could help me :http://forum.xda-developers.com/showthread.php?t=1911261
(For those with 'partial' root after JB update - regain root).
with adb the command su works.
but the problem is when i start adb shell there is no device listed anymore.i still can browse through the directory of my asus prime but i cannot push files because then there is no device error.
when i quit adb and restart adb to run "adb devices" the device is listed but after i start adb shell there isnt any device listed anymore.
cheers
lumpilumpe
Don't delete the SU backup - that is all you have with root at the moment.
It isn't clear which steps you can do.
Push files to device (in any state, /data/local/tmp for example?)
SU within ADB shell?
remount /system within ADB?
Seems like you can make it, if you work out the right things to do...
thx for the fast reply. yeah su within adb.
step 1:adb shell
step 2:su
step 3: yeaaaaahh... i found my mistake!!!
thx again for your answer , i solved it now.
for everyone who has the same problem.follow the steps from these link :http://forum.xda-developers.com/showthread.php?t=1911261
i made a mistake before .
last question:what can i do next time to prepare myself a better way?
cheers
lumpilumpe
Q
UOTE=tshoulihane;34224306]Don't delete the SU backup - that is all you have with root at the moment.
It isn't clear which steps you can do.
Push files to device (in any state, /data/local/tmp for example?)
SU within ADB shell?
remount /system within ADB?
Seems like you can make it, if you work out the right things to do...[/QUOTE]
lumpilumpe said:
before i made the update i did a backup of the root with voodoo ota rootkeeper.
now after the update rootkeeper the box "root permission granted" is unchecked and i dont know how to change it.
i tried to delete the "su backup" but it didnt work.it is written that the su backup is deleted but when i restart the rootkeeper it is still there.
i found a thread which could help me :http://forum.xda-developers.com/showthread.php?t=1911261
(For those with 'partial' root after JB update - regain root).
with adb the command su works.
but the problem is when i start adb shell there is no device listed anymore.i still can browse through the directory of my asus prime but i cannot push files because then there is no device error.
when i quit adb and restart adb to run "adb devices" the device is listed but after i start adb shell there isnt any device listed anymore.
cheers
lumpilumpe
Click to expand...
Click to collapse
I like SuperSU instead of SuperUser.
Check to see if you still are rooted by installing another app that requires root. (SuperSU will do).
What I did was simply have SuperSU forget OTA Rootkeeper, then close OTA Rootkeeper completely meaning ending it completely and then opening it again and having SuperSU ask if I want to grant it SU permissions again.
I don't remember if SuperUser lets you forget an app so it asks you again or not.

[Help]Damaged phone, manual root.

Here's my situation...I had 2 rezounds...One perfectly OK, rooted and Titanium backed up, but my kids poured milk into it...yaay. The 2nd rezound which was my wife's seems to have something physically wrong with it where I can't connect to it with fastboot (but adb works ok when the phone is fully booted), which means I can't dev unlock it, or apply most of the root methods out there...
So I decided to try some other things...
I downloaded the Cydia Impactor...
Drop Su didn't work
but,
start telnetd as root on port 22 did work!
so I then went in and remounted /system as RW
and copied su to /system/bin and the Superuser.apk to /bin/apps.
I then performed a echo ro.kernel.qemu=1 >/data/local.prop.
Now when I reboot, I get the root shell if I adb in to my phone...
But, on the screen only the status bar at the top comes up and if I try to swipe down, I get
"Unfortunately, System UI has stopped".
After this, I went into adb shell and noticed the su was gone from /system/bin...So this time I pushed it to /system/xbin, changed to root owner and chmod'd it to 06755..I removed the local.prop since I think that was causing the problem with the launch screen.
After rebooting, the Rezound had deleteed the su again, but the launcher comes up OK.
So I'm thinking, maybe I need to name the su something else...nope that won't work.
I guess for now I can be happy I can get temp root...
1. Run Cydia Impactor and select start telnetd as root on port 22.
2. copy su to /system/xbin and chmod 06755 /system/xbin/su
3. Run Titanium backup, and allow SU access.
works until phone reboot when su is removed by something.
Any ideas for next steps anyone?
Thanks,
Scott

Categories

Resources