I'm trying to access the root privileges of my android phone (OS 6.0.1 Samsung) without rooting the phone. It can be an app/service anything as long as I can get root access without having to root the phone.
I found out that there are some code/command you can do using 'su' but it requires a rooted phone. Can you use 'su' command in an unrooted android phones to access root privileges? If so, how? Or is there a way you can use root access without rooting the phone- by any means? Command lines? Third-party tools?
Thanks in advance.
I'm trying to access the root privileges of my android phone (OS 6.0.1 Samsung) without rooting the phone.
By definition, that is not possible. That is akin to demanding that something be purple without being purple.
Can you use 'su' command in an unrooted android phones to access root privileges?
No. For starters, it will not exist.
Or is there a way you can use root access without rooting the phone- by any means? Command lines? Third-party tools?
No.
SU is basically a binary that plays an important role in Android rooting and it is normally placed in the /system partition. It will be used when other apps need superuser permission, so if you don't have it there is no way to do this.
Check this link for further information https://www.kingoapp.com/troubleshoot/su-warning-window-on-kingo-superuser.htm
It is not possible to get root acces without su binary files in xbin or bin folder...and sudo was previously used in lower android version long ago this command can give you root acces without root but now not exist in any newer version...
Try to google your problem i am sure if u have samsung phone there must a procedure for root... happy rooting goodluck
Related
I'm building Android from source (for a custom ARM-based device).
I have an app, which I want to have root permissions.
In particular, I want my app to be able to run an arbitrary shell command as root.
I've read lots of articles about how to root phones and use other apps, such as SuperSU, to run apps as root.
I have a root shell on the device over adb.
How can I make my app run as root, without installing other apps and performing complicated work-arounds which I believe I do not need?
I have created this file on my device:
file:///data/user/0/io.ionic.starter/files/mypdf.pdf
But I can’t figure out how to find that file manually using my android device. Any ideas?
Note: I am using an emulator, Nexus 5X.
What do you mean by "manually"?
You can not access this file from another application on your Android device, such as a file manager or a PDF viewer.
This is because you created it inside your applications files directory, which is guarded by file system permissions and is only accessible to your application.
There are two exceptions to this rule:
If your device is rooted, you can use Root explorer to find the file.
If you created the file with "world readable" permission, another application can read it if it has the exact path (including full file name).
Note this may not work on newer versions of Android.
If you wish to access the file from you PC to examine it, you can use adb pull command. Since you are using an emulator, ADB should be running as root.
If it is not, use adb root command to switch ADB to run as root, then you will have no problem accessing any directory on the phone.
Keep in mind, this will not work on a real phone with stock ROM, as ADB can not run with root privileges on production systems.
I have this development board Open-Q 820
It is running an Android 7.0 based on some sources from CodeAurora (that seem based on AOSP sources). Seems it uses proprietary bootloader that can not be changed. I need to access GPIO (/system/class/gpio) from my android app to control an external device. Problem is I can not do this from android app - seems only root can access this files.
I can call "adb root" command from PC and then call from "adb shell" something like
echo 0 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio0/direction
echo 1 > /sys/class/gpio/gpio0/value
and it is working. But I need to do the same from my android app. I know how to access terminal and su from android app. I just dont know how to root custom device. I tried to install SuperSU.apk app and its corresponding su native app manually. It starts and says it need to update su binaries. After installing binaries and reboot the system then it becomes broken - infinite android logo. If I not install binaries update then SuperSU can grant permissions to my app but actully app still can not use su (I dont know why - I use this library inside my app: https://github.com/Chrisplus/RootManager). And after reboot SuperSU not working longer.
So may be you know some SuperSU alternatives (Knigroot not working too) or steps how to correctly install some superuser management app. Or may be I can use su directly (I tried but my app has not rights to access /system/xbin/su). Or may be I can make /sys/class/gpio accessible by android apps somehow (I tried chmod 777 on it - not works). May be some SElinux rights, but I have no experience with this.
Thank you
Magisk helped me. Since it is have option to patch custom boot image. I used this option and now root access works.
I'm currently doing lab work on an upcoming device and I've hit a wall on this particular one.
I can't say the model number, but it's running Android 5.1 and the build is LMY47D
It's a user debug build - so I have the SU binary and busybox installed, and I am perfectly capable of running any and all su commands.
I have the SU binary located in "system/bin/" and it's linked to "/system/xbin/." It has root access and the correct privileges (I think). Also you can see that busybox is installed.
Where I am having the problem is installing superuser and a few other apps.
I installed the apps to the "system/app/" folder with the privileges 755 along with appdel.apk and appdel2.apk (The ones that I need to give root access too)
Here is a snapshot of the "/System/app" folder.
As you can see, everything is there with root privileges, but when I try to access the application, nothing is working.
How do I give these applications Root Access?
As a side note, I can't flash or reload this ROM. Kingo root and IRoot just about bricked the phone. The superuser that I am trying to install is 2.46, which is the same superuser that the guys at Nexus Root are using on their LMY47D devices.
This is one of the guides that I have been following (among others): http://pocketnow.com/2012/10/10/root-without-unlocking
Thank you guys
I made a filemanager that I want go be able to navegate/modify some system folders (say, /data/). I copied my apk to /system/app, gave 644 permission to the apk file, and rebooted. Yet, my app is still run without root privileges (deny simple access to /data). I'm using Cyanogenmod 11.
Any clue?
Thanks!
L.
To clarify, the app being in the /system/app folder does not run it as root. Android is linux based, so having root access means that your app is able to run shell commands as the root user.
Generally speaking an app being in the /system/app folder makes all declared permissions available to it, (for example, declaring WRITE_SECURE_SETTINGS only does anything for system apps), and then the code that was only available to system apps is now available to yours as well.
For reliability, you should use shell commands where possible for anything that's normally unavailable. Do not use java.io.File to access files that are normally restricted.
I would recommend using RootTools as it makes running shell commands as root much easier. The first 3 pages on this linux command cheat sheet will probably cover everything you need.