Installing Superuser on Android User Debug Build (no su binary found) - android

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

Related

How to give an app, running on my own AOSP -eng build, root permissions?

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?

How to root or GPIO access on custom android-based development board

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.

How to root Genymotion Android Emulator?

I have downloaded Genymotion Android Emulator for personal use. I searched over internet to root this device, forums says that via adb shell its already rooted -"agreed".
Sumits-MacBook-Pro:sdk eSumit$ adb -s 192.168.57.102:5555 shell
root#vbox86p:/ #
root#vbox86p:/ # whoami
root
Found Genymotion configure apk, it will help to root access, if checkbox get clicked - "always allow su access", I did that as well, and then it get stuck like here. (see below)
If I restart by myself, it shows that no root access ?
May I know what I am missing here ?
Here are the pictures sequence :
I have also followed various tutorials e.g. Youtube - how to root genymotion emulator Android 7.0 but no solution yet
Apparently, there is some problem with the su binary. You can re-install it by downloading SuperSU zip archive and dropping it onto the device window. Restart will be needed.
Please note that the current version (2.79) does not seem to work due to missing /etc/fstab file on Genymotion systems. It works fine with 2.46.
Source: https://www.youtube.com/watch?v=YC9Bz5xVHCU
Make sure you have already installed Genymotion ARM Translation.If already,
Drag UPDATE-SuperSU-v2.46.zip to Genymotion Emulator(not sure other versions of SuperSU zips), and drop on it.It will confirm to flash zip file to emulator, click OK .After waiting for a while, you will get successfully message.Then, restart your emulator and check it with any Root Check App.Here is Tools file if you haven't it.I tested it on Google Nexus 5,Android 6.0 Emulator.I hope this will help for you.
Maybe it uses Iso file mounting system like Bluestacks that's why I guess it can't be rooted and also if it says its rooted then you can use UltraISO to modify root files only if it uses ISO file system.

Failed running an app as root

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.

Running su on Android root

Hi so my application runs some commands using the su in android root.
It works fine in JellyBean on the Galaxy Nexus but when I try to run it on the LG Nexus 5 (kitkat), I get an error saying:
su: uid 10069 not allowed to su
I'm not really sure what I'm missing here. I have root access (it runs su fine on the Galaxy Nexus).
Basically the application reads in a command from a TextEdit, strips it, appends the necessary parameters etc. and then calls the script which is put on the phone. I use the ProcessBuilder to build the call for the script.
Any fixes or ideas as to where I should look would be appreciated. Thank you
The issue was SuperSu not being properly installed and granting permission to the application. Once I changed that there were no permissions issues.
If you have problem with rooting to super user.
You can use "run-as" command to access files of your application.
ex: run-as com.your.package
It will drop you to the shell#android:/data/data/com.your.package $
now you can use commands ls
Then it will display the list of file folders
cache
databases
lib
shared_prefs

Categories

Resources