0

I have been trying to pull out the sqlite database from my sony xperia android device (OS: JellyBean 4.1.2), I have looked into different stackoverflow threads in some cases I am getting error "run-as: Package 'com.myapp' is unknown", in some cases mydata.db file shows up in my computer directory but with zero kb size. Is there any proper way of pulling database out ? Is there any guide from google for this purpose ? Note I have already visited following thread : android adb, retrieve database using run-as

2
  • you cannot pull database if the device is not rooted in your device OS, my suggestion is to copy the database on to your sdcard (stackoverflow.com/questions/14957835/…) if its your code. Commented Jun 8, 2016 at 6:50
  • Check out my answer on the duplicate question. If should be simplest way to do what you want. Commented Jun 9, 2016 at 9:36

2 Answers 2

1

If I understood correctly, you can use adb pull <path-to-db-on-phone> <path-on-your-pc>. In case you get any permission error : do adb remount and then try the above command again.

Sign up to request clarification or add additional context in comments.

3 Comments

Did not worked, I tried this one getting "pull: building file list... 0 files pulled. 0 files skipped."
adb pull command gives permission denied error then adb remount gives operation not permitted, do you have any idea why this is happening ?
@HarshShah : There may be permission problem. See this : stackoverflow.com/questions/2078710/…
-1

I found a solution.

First run this command

adb backup -f ~/data.ab -noapk app.package.name[![enter image description here][1]][1]

Just click on "Back up my data" button. The screen will display the name of the package you're backing up, then close by itself upon successful completion.

The resulting ".ab" file contains application data in android backup format.

To quickly extract a simple non-encrypted backup run:

dd if=data.ab bs=1 skip=24 | openssl zlib -d | tar -xvf -

It is possible that not all openssl installations are compiled with zlib support. Here's an alternative one-liner that makes use of python to achieve the same result:

dd if=data.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar -xvf -

The result is the apps/app.package.name/ folder containing application data.

Note: This method doesn't work if application developer has explicitly disabled ability to backup his app by setting android:allowBackup="false" in the application manifest.

Check this link: http://blog.shvetsov.com/2013/02/access-android-app-data-without-root.html

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.