Skip to content
/ gaen Public

A cli to interact with the GAEN (Google Apple Exposure Notification) system

License

Notifications You must be signed in to change notification settings

enrichman/gaen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gaen

gaen is a simple cli to interact with the Google-Apple Exposure Notification system.

If you want to know more about the system please refer to the official Google and Apple documentations:

Install

To install from source clone the project and run

go install ./...

Usage

To download a TEK export run gaen download with a supported app (immuni or swisscovid, at the moment):

gaen download immuni

This will download the export in a out/immuni/xxx folder.

Then you can decode the export running

gaen decode out/immuni/xxx/export.bin

and this will output the decoded JSON

{
    "ID": "+wK7aDl5cTC2wbZ4Ux6bvw==",
    "Date": "2020-10-02",
    "RPIs": [
        [
            {
                "ID": "GkUh9M/fYslxaxucp0ayWg==",
                "Interval": "2020-09-29T02:00:00+02:00"
            }
        ],
        ...
        [
            {
                "ID": "N99nmdxpfAvk0ByUGWI6EQ==",
                "Interval": "2020-09-29T02:40:00+02:00"
            }
        ]
    ],
    ...
}

query

gaen implements a --query flag that follows the JMESPath specification that you can use to filter the output.

For example if you want to get the first TEK with its first RPI you can run:

gaen decode out/immuni/167/export.bin --query '[0].{ ID:ID, Date:Date, RPIS:RPIs[0] }'
{
    "Date": "2020-09-29",
    "ID": "+wK7aDl5cTC2wbZ4Ux6bvw==",
    "RPIS": {
        "ID": "GkUh9M/fYslxaxucp0ayWg==",
        "Interval": "2020-09-29T02:00:00+02:00"
    }
}

or get the first 5 RPIs like this:

gaen decode out/immuni/167/export.bin --query '[0].{ ID:ID, Date:Date, RPIs:RPIs[:5].[{ ID:ID, Interval:Interval }] }'
{
    "Date": "2020-09-29",
    "ID": "+wK7aDl5cTC2wbZ4Ux6bvw==",
    "RPIs": [
        [
            {
                "ID": "GkUh9M/fYslxaxucp0ayWg==",
                "Interval": "2020-09-29T02:00:00+02:00"
            }
        ],
        [
            {
                "ID": "72eL1vRaRXuRfTFTnR6gDA==",
                "Interval": "2020-09-29T02:10:00+02:00"
            }
        ],
        [
            {
                "ID": "itB7DTxs6aCl3FWz5QxQVw==",
                "Interval": "2020-09-29T02:20:00+02:00"
            }
        ],
        [
            {
                "ID": "h77WS2cu5x7SHoUw6Tgdfg==",
                "Interval": "2020-09-29T02:30:00+02:00"
            }
        ],
        [
            {
                "ID": "N99nmdxpfAvk0ByUGWI6EQ==",
                "Interval": "2020-09-29T02:40:00+02:00"
            }
        ]
    ]
}

About

A cli to interact with the GAEN (Google Apple Exposure Notification) system

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published