[Q] superuser (AKA su) on EMULATOR - Android Software Development

Hi All,
I'm developing an application that uses su (needs root access) and I'm trying to use Android Emulator but su isn't really working on it.
For example:
# su id
# id
uid=0(root) gid=0(root)
I need to use root's shell for moving files and emulator doesn't work as should
Many Thanks In Advance,
Perdita2000.

The # means you have root.

I think you didn't understand the question?¿?¿?¿

There seems to be some good information here
http://stackoverflow.com/questions/5095234/how-to-root-getroot-access-on-android-emulator
From something awesome

Related

root hero

are there any roms that have root login as soon as you adb shell?? I have one for the eris so I know there out there,when you adb shell I need the # sign without having to use the su command
any help would be great

[Q] Do I have "real" root?

So I have a Samsung Vibrant with the following specs :
Firmware : 2.1-update 1
Baseband : T959UVJI6
Kernel version : 2.6.29
Build : ECLAIR.UVJI6
I used the Samsung Vibrant 1 click root application, have since verified I do have SuperUser installed as well as BusyBox, with quite a few different root based applications such as ClockWorkMod Recovery, One-Click Lag Fix, Set CPU, Titanium Backup, etc., and I have verified that ADB does work from a command prompt, however when I try to access su through ADB by doing the following commands, this happens :
C:/>adb shell
$ su
su
Permission denied
$
I have also tried to use Android Commander from my PC as a kind of root explorer and the program does detect my device and starts, but shows "Root Access : NO". From all threads I have investigated, this would almost seem as though I don't have "true" root access. Can anyone assist me and let me know what I am doing wrong?
bretjrodgers said:
So I have a Samsung Vibrant with the following specs :
Firmware : 2.1-update 1
Baseband : T959UVJI6
Kernel version : 2.6.29
Build : ECLAIR.UVJI6
I used the Samsung Vibrant 1 click root application, have since verified I do have SuperUser installed as well as BusyBox, with quite a few different root based applications such as ClockWorkMod Recovery, One-Click Lag Fix, Set CPU, Titanium Backup, etc., and I have verified that ADB does work from a command prompt, however when I try to access su through ADB by doing the following commands, this happens :
C:/>adb shell
$ su
su
Permission denied
$
I have also tried to use Android Commander from my PC as a kind of root explorer and the program does detect my device and starts, but shows "Root Access : NO". From all threads I have investigated, this would almost seem as though I don't have "true" root access. Can anyone assist me and let me know what I am doing wrong?
Click to expand...
Click to collapse
When you do "Adb shell" > "su" you have to allow it on your phone. A little popup will appear.
If you can su in a terminal on the phone itself then you can be certain you have root.
Are you sure there is not a prompt on the phone when you are attempting su from ADB? It might be asking for su permissions but timing out and showing denied.
bretjrodgers said:
So I have a Samsung Vibrant with the following specs :
Firmware : 2.1-update 1
Baseband : T959UVJI6
Kernel version : 2.6.29
Build : ECLAIR.UVJI6
I used the Samsung Vibrant 1 click root application, have since verified I do have SuperUser installed as well as BusyBox, with quite a few different root based applications such as ClockWorkMod Recovery, One-Click Lag Fix, Set CPU, Titanium Backup, etc., and I have verified that ADB does work from a command prompt, however when I try to access su through ADB by doing the following commands, this happens :
C:/>adb shell
$ su
su
Permission denied
$
I have also tried to use Android Commander from my PC as a kind of root explorer and the program does detect my device and starts, but shows "Root Access : NO". From all threads I have investigated, this would almost seem as though I don't have "true" root access. Can anyone assist me and let me know what I am doing wrong?
Click to expand...
Click to collapse
So after installing SU Terminal & Root Explorer from Android Market, when I did the following :
C:/>adb shell
$ su
su
#
I have verified that SuperUser permissions through ADB are obviously working. However when I do the following command...
C:/>adb root
adbd cannot run as root in production builds
...is displayed. It seems as though, yes, I do have SuperUser access, I don't have root access through ADB and Android Commander still does not recognize root. Is this because I am running the stock ROM, and if so, is there a general thread with all available/recommended Vibrant ROMs to install?
bretjrodgers said:
So after installing SU Terminal & Root Explorer from Android C:/>adb root
adbd cannot run as root in production builds
...is displayed. It seems as though, yes, I do have SuperUser access, I don't have root access through ADB and Android Commander still does not recognize root. Is this because I am running the stock ROM, and if so, is there a general thread with all available/recommended Vibrant ROMs to install?
Click to expand...
Click to collapse
Just to clarify, you realize adb root has nothing to do with your phone?
adb root restarts the adb daemon on the computer you are on as root (something I usually don't recommend).
When you start Android Commander make sure it has permissions on your phone when it makes the request.
d01100100 said:
Just to clarify, you realize adb root has nothing to do with your phone?
adb root restarts the adb daemon on the computer you are on as root (something I usually don't recommend).
When you start Android Commander make sure it has permissions on your phone when it makes the request.
Click to expand...
Click to collapse
Ok so I now understand the purpose of the adb root command after some additional research. I guess the issue is that when I run Android Commander, even though it does detect my device on the PC, it does not ask for/request SU permissions on my device
The FAQ thread for Android Commander:
http://forum.xda-developers.com/showthread.php?t=628138
** If you using Win7/Vista run Program as Administrator or disable UAC, otherwise this function will fail!
Click to expand...
Click to collapse
Guess I never needed for something like this since I'm comfortable with the command line.
d01100100 said:
The FAQ thread for Android Commander:
http://forum.xda-developers.com/showthread.php?t=628138
Guess I never needed for something like this since I'm comfortable with the command line.
Click to expand...
Click to collapse
I am running the program with both UAC disabled, and running as administrator and still the program does not recognize as root. I am only worried not just about Android Commander, but the possibility for functionality of other programs that require root as well.
Type adb shell
You'll see '$' as your prompt, type 'su'
$ su
You'll see '#' as your prompt, type 'id'
# id
uid=0(root) gid=0(root)
That means you have root.
Further proof you can remount /system from ro to rw.
You have root, Android Commander isn't the standard to judge whether your root is working correctly. Just a cursory glance at the app thread, it requires quite a bit of finesse to get working and it's touchy about which rom you're using. If yours doesn't work and you've actually followed the directions, send the developer your logs in the proper thread.
Why not just download the app Terminal Emulator and just type "su".... you'll either get the # or Permission Denied.
Based off everything you said, yes, you have root... ^ easiest way to test though. No need to deal with adb.

[Q] Busybox Blues [Request for Info][SOLVED]

Im not new to Linux, but I am new to busybox.
I noticed I can access some basic info type commands like: ls, cd, cat, etc... but I cant access commands like grep, tail, traceroute, and a bunch of others. As user or superuser I have the same result.
If I type "busybox" I can see a fairly comprehensive list of applets that were compiled into busybox, I'm just at a loss how to access them all.
Is there a script or list that maintains a list of accessible commands I can edit?
Do I have to link to each individual command I want to invoke?
Do I need to cd to /bin/busybox to use commands? or can it be added to users path?
I'm using Terminal Emulator, is there a better program I should be using for accessing the command line?
Can someone with more busybox experience please enlighten me?
busybox cat
as example... or "busybox top"
you can also chose to install in a location.
busybox --install /system/xbin
if path includes /system/xbin, you dont need busybox in front of commands anymore
its not recommended to install into /system/bin
"busybox thank-you" I knew there had to be a simple answer.

How to root the RAZR M?

Hey guys,
I have been trying to figure out how to root the RAZR M but I can't find any good instructions. I'm on the latest update. Thanks in advance!
Sent from my XT907 using xda app-developers app
http://www.droidrzr.com/index.php?/topic/5151-Root-For-Droid-Razr-M-(JellyBean-and-ICS)
Sent from my SCH-I535 using Tapatalk 2
I followed the instructions here:
http://forum.xda-developers.com/showthread.php?t=1940630
but needed to replace the SU & Superuser.apk from the rootzipfile link at http://aosp.us/?p=294 before running it.
justaq said:
I followed the instructions here:
http://forum.xda-developers.com/showthread.php?t=1940630
but needed to replace the SU & Superuser.apk from the rootzipfile link at http://aosp.us/?p=294 before running it.
Click to expand...
Click to collapse
Will it work on Verizon RAZR M with JB Update.
I rooted, after being updated to JB, using the method posted DroidRzr.
just a test:laugh:
rooted, if not for stupid apps
Or, I think so anyway. I ran the exploit on my xt907 and can su from an adb shell, but superuser never asks me for perms when I try using root apps (which all fail, btw). Also replacing/updating the su binary from superuser doesn't work; it fails trying to get root access. So off to a root shell I go...
# cd /system/xbin
# cp su su2
# rm su
# touch su;ed su
: i
#!/system/bin/sh
export SHELL=/system/bin/sh
echo [email protected] >> /storage/sdcard0/su_args
script -qa /storage/sdcard0/su_script -c "/system/xbin/su2 [email protected]"
.
w
q
y
# #damn custom thing doesn't like wq
# chmod 755 su
Not the best logging, perhaps, but it does work. Well, almost. After checking the version of su a couple times, superuser opens a root shell and runs:
/system/bin/busybox touch /data/sutest && /system/bin/busybox echo YEAH
This is where it fails. Not only is there no YEAH, but no errors are printed, either. Some googling later, I found logcat--the results of that are here, and don't change if I replace su with su2. Google isn't being too much help concerning that crash. Anyone know what's up/how to fix? I find it really weird that I can get root from an adb shell, but not from apps.
Thanks.

root for 306SH

So I'll update randomly...
boot.img and recovery.img -> https://drive.google.com/file/d/0B5QYBzdG6RuyZy1TSHc2VDVhY2M/view?usp=sharing
temp root:
Code:
adb push root /data/local/tmp
adb push wpoff /data/local/tmp
adb push fbunlock /data/local/tmp
adb push recovery.img /data/local/tmp
adb push boot.img /data/local/tmp
adb shell
$ [COLOR="Red"]chmod 755 /data/local/tmp/root[/COLOR]
$ [COLOR="Red"]chmod 755 /data/local/tmp/wpoff[/COLOR]
$ [COLOR="Red"]chmod 755 /data/local/tmp/fbunlock[/COLOR]
$ /data/local/tmp/root
...
#
defeat WP:
Code:
# /data/local/tmp/wpoff --unprotect-all
check WP status(optional):
Code:
# /data/local/tmp/wpoff --dump
If you see it's all zeroes there it means good, or if there are many 5555 it means NG.
unlock bootloader:
Code:
# /data/local/tmp/fbunlock
install TWRP and patched boot:
Code:
# dd if=/data/local/tmp/recovery.img of=/dev/block/platform/msm_sdcc.1/by-name/recovery
# dd if=/data/local/tmp/boot.img of=/dev/block/platform/msm_sdcc.1/by-name/boot
install SuperSU:
Code:
FLASH SUPERSU LIKE OLD DAYS
Why patch boot?
Cos MIYABI stops ptrace, some apps depends on it won't work properly.
Chinese here:
禁止转载到国内论坛,禁止用于商业用途。日版不会有的。
Note:
a. Remember to rename recovery.00X.zip to recovery.zip.00X before unzipping!
b. If you don't flash boot.img before install SuperSU, you will end up in boot loop. To restore, delete /system/xbin/daemonsu.
Attachments will be uploaded soon.
Hi tewilove, many thanks for publishing this. Amazing work! And a big time saver
tewilove tnx allot !!
hey some one know how can i put su inside in system and then to use SuperSU ?
thank you a lot
thanks but i can not use root app and super su can not install bin su
thank you for your help
tewilove said:
Tested with a 306SH with SW version S4081.
How to:
https://youtu.be/UJs7ruckGgc
This is v1, since the shell code has to be improved yet(WIP).
It only obtains temp root with kernel context. The left things are changing to init context, disable mmc_protect_part, disable miyabi LSM.
There might be v2, which solves all above, if I have time.
And it also works with many other devices.
For example, 305SH, MI4C, SH-01G.
If it keeps crashing, it should be my hard coded offsets.
PS: Please don't reshare this thread.
PS: Chinese: 请不要转载到贴吧,论坛,谢谢。
Click to expand...
Click to collapse
thank you for your help 谢谢某因幡分享
Please I'd like to know how you did that.could you be more clear, a step by step maybe?
Sent from my D6616 using XDA Free mobile app
salmanaman said:
Please I'd like to know how you did that.could you be more clear, a step by step maybe?
Sent from my D6616 using XDA Free mobile app
Click to expand...
Click to collapse
you can watch the video that tewilove make for us .. but we need to wait when some one unlock protect bcs after you restart phone root will disappear..
tewilove said:
Tested with a 306SH with SW version S4081.
Click to expand...
Click to collapse
How can I know that I got the temporary root? Is this step in the input ID?
all step working on my 305sh like youtube video but supersu not working and root checker say me no rooted
soudara said:
all step working on my 305sh like youtube video but supersu not working and root checker say me no rooted
Click to expand...
Click to collapse
yes we know about this .. i try to remount system ( with this command : busybox mount -o remount,rw /system) to get permission but my device is restart when i try .. maybe its from this write protection that @tewilove tell us .. if he can tell us how we can install su in system if its possible for now .. ?
ok so for the moment is useless ?
soudara said:
all step working on my 305sh like youtube video but supersu not working and root checker say me no rooted
Click to expand...
Click to collapse
me too?maybe just kernel root??
---------- Post added at 12:48 PM ---------- Previous post was at 12:31 PM ----------
loonbg said:
yes we know about this .. i try to remount system ( with this command : busybox mount -o remount,rw /system) to get permission but my device is restart when i try .. maybe its from this write protection that tewilove tell us .. if he can tell us how we can install su in system if its possible for now .. ?
Click to expand...
Click to collapse
yea?rootxplore and xposed said no root?
I don't think that folks are understanding what "temp" root means. This solution allows you to achieve root for the current shell session. This does not install the additional binaries to allow other applications to use root access.
With that being said, I am wondering if we can use this temporary elevated access to correct the vulnerability outlined in CVE-2015-1474 affecting /system/lib/libui.so that Sharp has neglected to address in previous OTA updates. The only "corrected" libui.so that I have been able to locate was compiled for v5.0.1 so I am afraid that file would not be compatible with this earlier version of Android on the 306SH. I am not really savvy with in depth programming to be able to fully investigate this and develop a viable solution... anyone who would be able to point me in the right direction would receive many thanks. :banghead:
My apologies if this should have been posted in a separate thread.
awesom! it worked in my 306sh with root permission acquired in shell.
can you use root app and install super su ?
Write protection is keeping us from remounting /system as rw. This prevents us from doing anything that would have any type of impact on the current situation. I want to experiment with attempting to mount partitions with the device powered off... but my device is encrypted so I am unable to access the shell with device off until I perform a factory reset. I am planning on doing that tonight so hopefully I will be able to report back with more information soon.
Sent from my 306SH
soudara said:
can you use root app and install super su ?
Click to expand...
Click to collapse
No. We are working on it though.
On another note, I can't get this temp root to work.
Video of what happens is linked. (too large to attach)
https://mega.co.nz/#!blNTjbhS!p2ljioY_43xlWkpu3EWpj8LvfMVP5eushZT23KLPASk
TechInMD said:
Write protection is keeping us from remounting /system as rw.
Click to expand...
Click to collapse
So I assume, from the quoted text, you have tried mounting /system as rw while in the temp root shell session?
Yes. I tried using the mount command both directly from the root shell prompt plus I tried using busybox to mount also. There seem to be slight variations between them. Also, not sure if it is relevant but I attempted it both through adb and in terminal on the device. I can get to the root prompt but not further.
Sent from my 306SH

Categories

Resources