A while ago, I set up Apps2SD on my ADP, and while I am not sure what, I must have done something wrong, because afterwards, Android refused to boot properly, claiming that the file system permissions of pretty much all installed packages didn’t match up:
Package x.y.z has mismatched uid: 10089 on disk, 10079 in settings
Here’s the Python script I used to apply the file system permissions that Android expected. It iterates over the packages defined in your devices /data/system/packages.xml. Use at your own risk.
"""Parse Android's /data/system/packages.xml file and spits out shell code to fix UIDs. This helps you fix "Package x.y.z has mismatched uid: 10089 on disk, 10079 in settings" errors. """ from xml.dom import minidom xmldoc = minidom.parse('packages.xml') packages = xmldoc.getElementsByTagName('package') ignored =  for package in packages: try: userId = package.attributes['userId'].value is_shared = False except KeyError: userId = package.attributes['sharedUserId'].value is_shared = True # do not touch permissions of shared apks (they userid always seems to be 1000) if not is_shared: print "busybox chown %s:%s %s" % (userId, userId, package.attributes['codePath'].value) for subdir in ('', 'databases', 'shared_prefs'): # note we don't touch lib/ print "busybox chown %s %s:%s /data/data/%s/%s" % ( '-R' if subdir else '', userId, userId, package.attributes['name'].value, subdir)