Android root access - android

I have a Google Nexus 7, and I've been developing on it. Only recently, however, have I become unable to access the /data/ directory using the file browser in eclipse. The device was never rooted, but now since I upgraded it, I believe that I have lost access to this. Is there any way to get eclipse to use the "run-as" command to access my app's data directory? How come I have suddenly lost access to this?
Is the only option left to root the device?
Thanks

Is there any way to get eclipse to use the "run-as" command to access my app's data directory?
There is nothing for you to run "as" that would help here, AFAIK.
How come I have suddenly lost access to this?
You should not have had access to it in the first place. If you did, that was a security flaw in the device, perhaps fixed by a firmware upgrade.
Is the only option left to root the device?
You could not browse the /data/ directory on production hardware. For example, you can browse /data/ on the emulator.

I am able to given root permission by installing apk.
http://gadgets.ndtv.com/mobiles/features/how-to-root-nokia-x-and-get-access-to-google-play-store-and-google-now-508391

Related

Install Apk Silently in Android programatically without ROOT

I want to install app silently in android without using user prompt and without ROOT.
I know this question has lots of answers but i can't find proper answer for same.
i.e is it possible if we make app as device admin or device owner or profile owner ?
Thanks for advance.
It's not possible, the only way for skip user prompt, is to be root and place the apk on the system folder instead of app folder
If the apk is in the system folder you can install it silently easely, but the system folder can only be access with ROOT

Getting Android app root folder

I'm facing an issue trying to get the app root folder, the problem comes in an emulator with Marshmallow. When I do context.getFilesDir() it returns a wrong path:
data/user/0/com.android.appname/files/
When it should be:
data/data/com.android.appname/files/
Somebody know why is this happening and how to solve it or another way to get the right path to the app root folder?
/data/user/0/com.android.appname/files/ is a perfectly valid path to be returned by getFilesDir(). That directory will be usable by your app.
adb is not your app. Its view of the filesystem will be different.
The exact location of where getFilesDir() maps to on the actual filesystem ā€” or where tools like adb will see it ā€” will vary based on several criteria, including OS version, which user account is running your app (remember: Android supports multiple users!), and possibly device manufacturer/custom ROM changes.

Default Android host files block Google Analytics?

I've been working to get Google Analytics v4 set up in my app, but I've been having a few problems.
I'm working with a Galaxy Nexus phone and Google Analytics is being blocked by host files created by AdAway.
The problem is that I'm don't think I ever installed AdAway and IF at some point maybe I did (or someone else did it on my device) the host files are still on my phone even after doing a factory reset.
Why would the host files stay on the device ever after resetting the phone?
This is frustrating because I don't see any reason the host files should still be on the on the device and I'm not able to easily collect data on the device about app usage.
Does anyone have any advice about why the host files from AdAway would still be on my device even after resetting it?
Just reinstall AdAway - if you believe it's the cause of the problem - and select Disable Ad Blocking. This should restore the original hosts file that came with your Android firmware.
If that still doesn't work, then you can manually edit the hosts file to give you access to Google Analytics. The hosts file is located at /etc/ directory. Use a file explorer to navigate to this directory and edit/save the hosts file with a text editor.
Note: You'll need root permission to edit the hosts file under /etc/ directory since this directory is reserved for system apps or access with root privileges.

Accessing Android Files and Database Directly on the device if rooted?

When developing for Android I prefer just working with a real device plugged in most of the time since the Android emulators are such total garbage. The one pain point is when I want to access files and sqlite databases though. I believe with the adb shell it is possible to pull the database across, but this isn't a very convenient process.
I'm wondering if there are any tools on the market that allow you to see the database in real time, even if it requires rooting a device I'm open to it.
I am afraid that there are no tools that will let you see the db real time. You will need to get the db from the device and the see it on your system. You will have to root the phone and get SuperUser permission to access app databases. The database will (after getting root) then be available in the /data/data/com.your.application/databases folder.
Hi You don't have any tools to see the database in real times. But its achievable in rooted device. If your device is rooted just install root explorer app in it. and then browse for your package name in data/data/ location. There you will find out all the internal memory files including database files. hope this helps you.

Using root to access and modify protected database on Android

Iā€™m trying to create an app that is able to access and modify a protected database within /data/data/. This process obviously requires root privileges and I am testing this on a rooted device. The general code to access the SQLite database is complete and works against a test database that is located elsewhere (on /sdcard/).
However when I want the application to access the database within /data/data/, it obviously fails as I am trying to access it as a normal user. I have read on the topic of using the su binary on Android for a bit now, and as far as I understand it usually used to execute shell commands only.
So my initial idea of making this work was to simply change the permissions of the file when the application starts, and change it back when it quits. So before actually bothering with implementing that in the application itself, I used my file explorer to change the permission to rw-rw-rw-. However my application was still not able to open the database.
My next idea was to use the sqlite3 program directly from the shell, but I found out, that my ROM does not come with it, so I would have to distribute it myself (Titanium Backup seems to do that).
However there is something that makes me wonder if there might not be a better way: I am using Root Explorer as my file explorer and it has a built-in way to browse any SQLite database. Given that it does not seem to ship with a custom sqlite3 binary, and that my phone does not have one itself, the access seems to happen using the normal Java tools. But how does the app get root rights then?
Is there a way to make an Android application run as root? Or did I forget setting something for the permissions earlier which prevented me from accessing it? Or does anyone know how Root Explorer does it?
You cannot raise the permissions of an already running process as far as I know. The simplest answer would be to copy it somewhere using the root shell / command line edit it, then copy it back as root again. And yes, I did read your question, just didn't explain the answer fully. Hopefully it's clear now. Not sure if root explorer does that or something else, but it would work.

Categories

Resources