How to access main.db of Skype App to display Recent Tab logs in Sample Android Application?

4k views Asked by At

I'm trying to make an Android Application in which i want to show the logs/Call History of Skype User(Recent Tab).

As much as I know, Skype stores all the Contacts in a Server and after logging in for the first Time , it syncs All the Contacts using Sync Adapter in my local Storage i.e Contacts DB but it does not sync the logs. All the logs are stored in

/data/data/com.skype.raider/files/ user-name/main.db

Is there any way by which we can access this DB,so that Call History of the Current logged-In skype user can be displayed in Android App? and if there is any way to access the DB, will it work on non-rooted phones also?

1

There are 1 answers

2
Rohit Jagtap On

The database file of any app is stored in data directory at a location "data/data/package_name/databases" and this directory can not be accessed if the device is not rooted. As you know in case of Skype the main.db file is stored at "/data/data/com.skype.raider/files/ user-name/main.db".

The only way to access it is to root the device. The steps after rooting the device would be,

  1. Your app should get the root access from the superuser.
  2. Locate and parse the "shared.xml" file in "data/data/package_name/files/shared.xml". In this xml file get the username from username. so that you have the path of the db now.
  3. As you won't be having any access to the main.db file, you will first have to run the command "chmod 777 filepath" which gives you full access to the file. (To run commands through you app, checkout the "RootTools" library)
  4. Now you can create your own DBHelper class or directly access the database using SQLiteDatabase.openDatabse(path, cursorFactory, flags);

Remember, for all this the device has to be rooted.