Link to home
Start Free TrialLog in
Avatar of pamela rizk
pamela rizkFlag for Lebanon

asked on

Extract database of android

dear all

I refer to the below link :https://medium.com/@k1d_bl4ck/how-to-extract-the-database-and-other-things-from-an-enterprise-android-app-2194a52b249b
in order to extract database of an android apk
mybackup.ab is generated sucessfully
but I need to know how to convert mybackup.ab to mybackup.db in order to open it in sqllite browser so I can see the content of the table there .
below is the error generated
C:\Program Files (x86)\Android\android-sdk\platform-tools>dd if=backup.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar -xvf -\n
'dd' is not recognized as an internal or external command,
operable program or batch file.

Open in new window



Please help
Avatar of noci
noci

dd is a diskblock data copy tool from Unix/Linux.  (where you can tell to copy/skip certain blocks).
In this case the blocksize (bs=1) is set to 1 byte and the first 24 (skip=24) bytes are skipped ...  all other stuff is then read.and set to stdout.

Use this procedure on a Unix/Linux system. Or try install cygwin to get the commands.
Avatar of pamela rizk

ASKER

my needs is to  convert file backup.ab to backup.db
so that I can open .db file generated from Sqllite browser
the dd program can be found in cygwin , or on any linux/unix distro.
You can use it in the next way if you like:

dd if=backup.ab of=backup.db bs=1 skip=24

And then use the backup.db file as input for the python script.
or try:
python -c "import zlib,sys;  sys.stdin.read(24); sys.stdout.write(zlib.decompress(sys.stdin.read()))" <backup.ab | tar -xvf -

Open in new window

Might work of not work depending on file openmode. it should work if binary openmode was used. Not sure about windows python implementation though.
after installing cygwin
 using below command:
$ dd if=C:\\Users\\Pamela.Rizk\\Desktop\\backup.ab bs=24 skip=1|openssl zlib -d > mybackup.tar;
generates below output :
994002+1 records in
994002+1 records out
23856062 bytes (24 MB, 23 MiB) copied, 26.7905 s, 890 kB/s
and using below command:
$ tar -xvf mybackup.tar
generates below output :
apps/com.aims.SocrateMobile_N/_manifest
apps/com.aims.SocrateMobile_N/f/SM_Database.db3-shm
apps/com.aims.SocrateMobile_N/f/SM_Database.db3-wal
apps/com.aims.SocrateMobile_N/f/SM_Database.db3

but where can I find apps folder?
ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes thank you , i could find the file where cygwin  is installed.
thank you for your help.
es thank you , i could find the file where cygwin  is installed.
thank you for your help.