Chapter 3. Package manager

This section is not meant for hackers. It is for the understanding and help for keep the android device clean.

The package manager installs a package and can also remove it.

Unfortunately it is naive to think that after removing the package everything is cleaned and the device is as before the installation. Maybe after installing and immediate removing this is the case, but when an application gets started it can create data on the android device that is unknown to the package manager and therefore remains on the device after the un-install.

Luckily root restriction prevent that those data can not be spread into the system.

Unfortunately, but with good reason looking into package management on the device is restricted to root access. There seem to be a /data/system/packages.xml file that has registered all apps. Luckily the restrictions are not just an obstacle to the user but also to the applications, so applications can not just dump files where they want.

Therefore applications that need to store some data create usually a directory under /mnt/sdcard having the name of the app and then putting the data there. If the app is no more installed such directories (if identified) can be deleted manually. Good apps might let you choose or show where the data is stored, so it can be put in a directory where you make backup. Bad apps might just write it somewhere where the permission allows it and use arbitrary file and directory names.

When programming an Android device there is the PackageManager class that can be used to retrieve more from the device.

Linurs Hosttech startpage