How to fix Android Market when installed a .apk via adb

This post is a draft from back in 2010 and assuming that you are the owner of a rooted Android device that just installed a bunch of applications (.apk) via the adb tool. This might be the case if you have a lot of packages (.apk) on your pc, and just install them via usb like:

find . -iname “*.apk” -exec adb install ‘{}’ \;

Remember that you will have to download the Android SDK for the adb tool and start the adb server as root before using it (sudo adb start-server).

Now the problem: the Android Market doesnt see your installed apps, so it wont look for updates and you cant easily remove/handle them. But there is an easy fix.

The Android Market keeps a list (more specific: a database, sqlite3) in

/data/data/com.android.vending/databases/assets.db

Weird thing, after looking with SQLite Browser into the database, all applications installed via adb where present. The only problem was the “install_time” value of the apps, beeing 0.

So you could either adb pull the assets.db to your PC, edit the values (e.g. UNIX timestamp of now), and push it back or use a script on the phone to do the job for you.

For the script, you will need root access, a busybox version with sqlite3 (just execute “sqlite3” on a phone shell and see if it recognizes the command)

# sqlite3 /data/data/com.android.vending/databases/assets.db
sqlite> UPDATE ASSETS SET install_time = CURRENT_TIMESTAMP WHERE install_time = 0;
sqlite> .exit
# exit

Leave a Reply

You must be logged in to post a comment.