Talk:Android File System

From Free Knowledge Base- The DUCK Project: information for everyone
Revision as of 17:28, 4 February 2014 by Admin (Talk | contribs)

Jump to: navigation, search

using a "media" intermediary directory

Some people are using a "media" intermediary directory between the standard public directory and the storage root. See below

  • /sdcard/media/alarms OR /sdcard/Alarms
  • /sdcard/media/notifications OR /sdcard/notifications
  • /sdcard/media/ringtones OR /sdcard/ringtones
  • /sdcard/media/ui OR /sdcard/ui

Warning: This may be incorrect.

adb

adb is part of Android SDK

Someone claims a workaround to view the filenames in the /data/app folder without having root exists using "adb".

 adb shell pm list packages

to get a list of packages installed

However, you need to root the Android device to install Android SDK.

what?

list contents of /data/app without root

To do this from the command line, use adb shell pm list packages to get the list of installed packages, pick the desired package, append -1.apk to it, and pull it from /data/app. Example: If the package name is org.mozilla.firefox, use adb pull /data/app/org.mozilla.firefox-1.apk.

need to root first

You need to root your phone first. Then install Android SDK. run adb or ddms->file explorer, look for your interested-in APK in /system/app

backup then view

You can use a file browser with an backup function, for example the ES File Explorer Long tap a item and select create backup

stock, non-rooted Android OS

If the application, whose data you wish to access, is debuggable, its read-protected folder can be accessed with the help of the run-as command. In essence, we pretend to be the application in question and copy file(s) stored inside the application's data folder into user readable folder.

adb shell
run-as app.package.name \
cp /data/data/package.name/databases/application.sqlite /sdcard/
exit
adb pull /sdcard/application.sqlite ~/

This only works if the application is debuggable. If the application was not debuggable, so the method above did not work either.

Starting with Android v4.0 (Ice Cream Sandwich) Google has provided a way to backup data and applications from Android devices without root via adb.

adb backup -f ~/data.ab -noapk app.package.name

This will prompt you to "unlock your device and confirm the backup operation". To keep things simple do not provide a password, otherwise you will have to jump through the hoops to decrypt it later. 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. It's a tar archive that has been run through deflate and optionally encrypted (in a somewhat peculiar way) by AES-256-CRC cypher. To quickly extract a simple non-encrypted backup...

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

If that doesn't work, try this alternative using Python

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.

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