Search code examples
androidacra

How does ACRA fetch app's installation id?


ACRA user manual mentions installation id (search for term INSTALLATION_ID) as unique identifier of each app's installation

The monsters you can see in the first field of each report line represents the INSTALLATION_ID. It can be considered as an equivalent of you users. Each installation of your app is given a generated unique identifier, which is kept through the updates of your app. These monsters are generated with a different variation for each installation ID, allowing you to visually locate reports from the same user in a list.

I tried to find more about apps' installation IDs, but there are none information about it except one page where Google guys mentions something like installation id, but in very short words.

So how does ACRA fetch this unique ID? Is the term INSTALLATION_ID its own term and does not have a base in Android, maybe?


Solution

  • I found a solution and I hope someone else will have use of it.

    If you are reporting custom ACRA messages via ACRA.getErrorReporter().handleSilentException(new Throwable(message)); then you will see in cloud tools like Acralyzer that there is a field installation id which is basically a unique id for each user. This way you can monitor a specific user and solve bugs he has.

    Download Acra sources from Github and navigate to a class org/acra/util/Installation.java. This is the class which generates a unique installation id.

    If you navigate to the line 67, you will see that installation id is nothing else but random UUID number(Note: If you uninstall and install the app, this Id will be regenerated).

     final String id = UUID.randomUUID().toString();
    

    So the actual ID is retrieved via a static variable sID and it's saved into a file in app's private file directory as ACRA-INSTALLATION.

    So how can you get your user's installation id and compare it with Acralyzer reports? Simply create a logic of reading this ACRA-INSTALLATION file and copy its content to external memory. After that a user can email that file to you or you can even pass it automatically to your own cloud script.

    If anyone needs more info, don't hesitate to ask.