while i add this line to my code
Process process = Runtime.getRuntime().exec("su -c");
or
Process process = Runtime.getRuntime().exec("su");
trying to run the"su" command,
process.exitValue() returns 1 which means fail.
This happens to my one Android device while my the other rooted android device works perfectly with this command. (process.exitValue() returns 0)
Can anyone teach me how to trace the error or how to fix it?
I am confused with this error while my two devices almost in the same condition.
Thanks for your reply in advance.
Hi guys,
Thanks for discussing this issue with me. Your reply hints me a clue that I have removed my old su and place a new su. Luckily enough, the return value is now 0 and I guess it means correct. However, Does any of you might know what is the difference between .exec("su -c") and .exec("su")? Please let me know if you know the difference.
I suspect you lack Superuser on the problematic phone, do you?
Or at least something about Superuser could be wrong (versions, binaries...)
su calls Superuser which allows root access or not.
Many problems seems to occurs on latest versions of Superuser.
Try to remove it and install other version:
http://goo.im/superuser
Another note: if you're trying to gain root access or to execute commands as root, you should not only use exec("su"). Take a look at the RootTools a library by stericson himself ;)
http://code.google.com/p/roottools/
The command su (which means Super User) is only valid on rooted phones. That is why your rooted phone recognizes it and works as expected. So, either you root your other device(s) or drop this idea on non-rooted phones :)
Since this is the only result I got for searching for the phrase, thought I'd post an update for anyone else coming across this.
Was following the instructions for installing Cyanogenmod. My issue was resolved by disabling Mass Storage mode on the device (change it to one of the other options).
Related
I ran CTS PLAN and after it finished, I saw that my Android device asked me enter a PIN code to access the device. However, I didn't set a PIN to lock the device, and I don't know which PIN I'm supposed to provide.
This problem happened to me on 2 more Android devices when I ran CTS on them.
I tried some passwords but they have not solved this.
I'm looking for a solution to this problem, but can't find any other mention of this problem.
NOTE: I ran CTS with a script, but has it really change something?
I had same issue,I entered pin as 12345.It's worked for me try from your side and let me know
Anyone can please provide me a better solution for the errors I am
mentioning down.As i have already tried so many solutions from
every
possible website.
Refer the image and please help me with the solution
Check if you have an active Appium connection to the device.
When you have an active Appium connection to your device / emulator, it will lock the ui-automator resources. So you will not be able to take a snapshot at that time.
Can you make sure you run below commands from terminal before taking screenshots.
adb root
adb remount
This fixed the issue for me. Also make sure a test is not already running on the device.
I am trying to change the value stored in /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq which is currently set to "1512000". I am attempting to do this via adb shell.
I type su and then navigate to /sys/devices/system/cpu/cpu0/cpufreq. I then type
chmod 777 scaling_max_freq
I confirm that the chmod worked by typing
ls -l scaling_max_freq
and sure enough it is listed as -rwxrwxrwx. I then type
echo 124200 > scaling_max_freq
and then
cat scaling_max_freq
sadly this reports that the file is unchanged as "1512000". None of the lines executed responded with any kind of error.
Maybe the governor is immediately overwriting this? Maybe I need some extra type of permission? Maybe this is somehow fundamentally not allowed on an android device and I need to control the clock speeds via a different mechanism altogether? The problem must be soluable somehow as it it performed by SetCPU.
BTW, this was all on a rooted Sony xperia z, Android 4.4.2, build number 10.5.A.0.230
Someone suggested attempting to write to scaling_min_freq... I tried it and to my surprise it worked. I was even more surprised when, afterwards I set scaling_max_freq and that worked too. I found this amazing because this document suggests that if anything you should set them in the reverse order.
Anyway, it all seems to be working now.
First, I know this question doesn't exactly belong here, but I'll explain later why I'm asking here instead of on the specific android board.
I'm developing an app, and yesterday I had some problems with sqlite, so I went on to checking how my database looked like. Found out I didn't have the sqlite3 actually installed on my phone, so I followed this answer to install it. I got some problems with the pushing part so I tried to alter the permissions on /system to try and make it work. I basically ran "chmod 7777 /system" on an adb shell. After that I still couldn't push the sqlite to the phone, so I quit the shell and tried to open it again, but I got a no permission error. When I unlocked the phone, every possible app (including system ones) started crashing, one after the other. I freaked out and took the battery off. at that time I had the phone connected through usb to a Ubuntu pc, with no headphones connected. When I turned the phone on again everything seemed to work properly, and I managed to push the sqlite to the system folder without any problem. I thought the problem was over and moved on with debugging and developing.
When I was going home, I was listening to some music with headphones and a friend called me. I answered but couldn't hear anything. I then later discovered that since then I can't hear anything and no one can hear me too. Every other sound related function works fine, except calling. I'm not hearing even that calling beep.
So that's why I'm asking here, as it's actually a question related to developing and coding stuff. Please, if anyone knows what this might be, answer here, I have tried many things to get it working again, but none of them worked. I read it could be a headphone related issue, but that seems to occur only on some motorola phones or something. I have a Galaxy S advance, 3 or 4 months old. I have also tried to change the chmod setting again, to chmod 4755 /system, but it remains the same. I'm getting really desperate here, I don't think customer support can solve this.
As nobody ansered yet, and also I think this is a too specific error for many people to know, I'll report what I did and discovered:
I changed the permissions of all the files in the folders /system and /system/app, not recursively.
A friend later told me UNIX systems sometimes have problem with executing programs that have too many permissions
All the system applications had full 777 permissions.
So I rebooted the device many times, even made a factory reset on it, but nothing seemed to work. So I began changing the permissions again. I tried to change everything to the default permissions (I used a friend device of same model as reference), and when I changed the system/app folder permissions to 755 and rebooted, it worked again!
So for all of you who don't know exactly how chmod and permissions on UNIX works, think twice before start to mess up with it.
so I'm trying to get root access on my Android in order to use Barnacle. But I keep getting the same error, over and over:
$ adb shell
$ rootshell
rootshell: permission denied
What is the deal with this? I mean, seems logical that I need some permissions to access rootshell, but I can't seem to find any way around it.
Anybody knows how?
Is there any other way to get root access to your phone? (An easy way, hopefully)
EDIT 1:
I will clarify the question.
Unix and Linux systems let you retrieve / change lost passwords for root user. Considering this:
Is there an easy way to root an Android device using the terminal on my Mac OS X? My device is an Xperia X10 mini pro.
Or, does anybody know why I get that permission denied error using adb and rootshell in the first place? It's supposed to work, as stated here?
Thnx!
A.
I'm not sure how much of a question this is or not or whether it is appropriate for StackExchange, but I'm gonna answer it anyway. I don't have enough rep to do anything else about the anyway :D
When you are trying to root any android phone in general, you need to run a program that gives you root access. You can't just simply say "adb give-me-root-permissions-please". :) But yeah, Google is your friend in this case. Apparently your phone the Sony Xperia needs a very specific rooting process that is enumerated here: http://forum.xda-developers.com/showthread.php?t=711907
I would recommend asking this kind of question THERE on XDA because that site is dedicated to questions like this. This site is for programming questions and the like :)
TO BE ROOT AT SONY XPERIA
you can use
king root software
or
rootkitXperia L
how to get temproot by 'getroot'
usage
push 'getroot' in device, set permission, and execute 'getroot'
adb push getroot /data/local/tmp
adb shell
$ cd /data/local/tmp
$ chmod 0755 getroot
$ ./getroot
use CVE-2013-6282 vulnerability
kernel start address 0xc0008000
In some cases, modify KERNEL_START_ADDRESS or KERNEL_SIZE in 'getroot.c'