androidapkuser-tracking

Track android apk download source(not from Google play)


i wan't to track my app download source,apk will be available through several campaigns. Issue is app download link is direct url, It is not on Google Play Store so i can't receive INSTALL_REFERER broadcast.

I can track clicks easily by logging each click on my server, but how to track user installed and run app (and download source)

Approch 1:

Problem in above approach is i am not able to narrow down what all info i should capture in javascript to identify the user, keeping in mind different android browsers available and android device fragmentation.


Solution

  • got this one working, with the help of aapt.

    Basic approach is to insert a file in assets in apk on the fly.

    requires:

    then:

    As soon as user clicks on the download link hosted on your web-site, record an entry in a db, with some field describing the state as downloaded/downloading.

    generate your text property file to be inserted inside assets folder in apk. use aapt to add it to apk.

    aapt remove app.apk "assets/tracker.txt"

    aapt add app.apk "assets/tracker.txt"

    directory structure where source apk will be hosted like this : ROOT-> (assets ->(app_tracker.txt)) + app.apk

    after this signing

    jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -storepass STORE_PASSWORD -keystore KEYSOTRE_PATH alias_name

    NOTE: you should not modify the source app.apk and tracker.txt, what you should is to copy it to some relative path and then do modification over it.

    hope it helps, it helped me though :)