About six months ago, I finally decided to put iOS 4.2.1 on my iPhone 3G (where I was 3.1.3 for a long time), and at first the rumors about unprecedented brakes seemed either an exaggeration or a
flaw in 4.0.
However, after a couple of months, everything began to slow down too indecently.
Googled, disabled Spotlight, did not help.
It was obvious that the main problems were related to the Location services, it was enough to turn it on, sometimes it was not possible to answer the call even a few minutes after the card was closed.
Applications did not start, although Springboard was alive.
By top or free it was not clear what the plug was.
Google offers to make Reset Location Warnings - it helped, but not for long, the very next day everything returned to its former state. We had to keep the Location Services turned off, and when navigation was very necessary - prepare for a long time to wait.
And then I remembered the story with consolidated.db. Once the information about all movements (as it was written in the news) is saved in sqlite, for sure the base quickly becomes large and starts to slow down.
I found two whole consolidated.db:
iPhone:~ root# find / -iname consolidated* | xargs ls -l
-rw-r--r-- 1 root wheel 19036160 Oct 22 2010 /System/Library/Frameworks/CoreLocation.framework/Support/consolidated.db
-rw-r--r-- 1 root wheel 12611584 Jul 23 22:21 /private/var/root/Library/Caches/locationd/consolidated.db
The first one, though more, has not been updated for a long time, and the second is similar to what we are looking for.
I open it on the computer in the SQLite Database Browser - in the WifiLocation and CellLocation tables in the amount of about 100 thousand records, the coordinates are similar to my location. I struggle with the desire to glue them into a track and put them on a map - now this is not the point :)
I do
delete from wifilocation;
delete from celllocation;
update wifilocationcounts set count=0;
update celllocationcounts set count=0;
(for this, I had to take console sqlite3, which I later installed on the iPhone itself. It cannot do Truncate table.)
I do just in case vacuum. The file was reduced to 4 MB, still a lot, but should already be noticeable.
I poured the file back, I turned on locationd - it seemed to zashevilis. It ends at 10-20 seconds instead of a few minutes (this is visible in the top, as well as the icon with the arrow in the Status Bar, in the upper right corner next to the battery).
I try to erase it completely - maybe this fuss with sqlite is not needed in practice. And locationd re-creates it (not immediately on startup, but after a while), and again everything works.
Thus, if the location is hampered in the iPhone, and you have a jailbreak, you can try to cure it with
iPhone: ~ root # rm /private/var/root/Library/Caches/locationd/consolidated.db
As for the second consolidated.db from / System / Library, it contains various coordinates of GSM and WiFi base stations, mainly in the western hemisphere. Also, all entries have timestamp = 0. Perhaps this base should speed up navigation at demonstrations in Cupertino :)
')
PS If you set sshd - do not forget immediately,
immediately change the passwords of the root and mobile
and throw in your public keyPPS You can set 000 rights to it and forget until the next flashing.
chmod 0 /private/var/root/Library/Caches/locationd/consolidated.dbNot tested, but
they say that this is not enough, and it is best to replace it with a folder
rm /private/var/root/Library/Caches/locationd/consolidated.db
mkdir /private/var/root/Library/Caches/locationd/consolidated.db