Extension. COVID-19. Decode QR Green Pass. Certificate. Encode/Decode QR

Hello friends,

here an extension to decode the COVID-19 EU QR Certificate, also called QR Green Pass. It's a demo, have a Toast. I have published this extension on my website in Spanish and I adapt it to this Community.

0.- About EU QR Certificate. Green Pass.

In some European countries, those vaccinated against COVID-19 (also those who have been recovered and those who have undergone a test) are given a QR code called the EU QR Certificate or QR Green Pass.

To decode the QR, we obtain its text that comes in BASE45 compressed with zlib and after other decodes we convert it into JSON

QR code Image -> QR DECODER -> QR-decoded string -> BASE45 decoder -> zlib compressed string -> COSE string -> CBOR decoder -> JSON file

https://gae-piaz.medium.com/decode-the-eu-green-pass-qrcode-using-java-b5654e55b0fc

github. com/GaetanoPiazzolla/greenpass-decode/blob/master/src/main/java/com/tano/green/Main.java

13 Likes

1.- Blocks.

Extension com.KIO4_QRGreenPass.aix.
http://kio4.com/appinventor/299F_extension_QRGreenPass.htm

  • The main block is TextQRGPToJson, the result of a QR scan, through the BarcodeScanner component, is inserted and the Json of the QR is obtained.

  • QRGPToJson block is similar to the previous one, but in this case a QR image located in the Image component is inserted.

  • QRToText, we put a QR of any type, it does not have to be Green Pass, and we obtain its text.

  • TextToBarCode, we insert a text and an Image component, we obtain the Bar Code 128 of that text.

  • TextToQR, we insert a text and an Image component, we obtain the QR of that text.

  • ImageToFile, converts an image located in an Image component to a file. Set the full path where we want to get that file, for example /storage/emulated/0/.../my_file.png

4 Likes

3.- Decode Image QR Green Pass to JSON. BarcodeScanner component.

p299F_QRGreenPass.aia (432.8 KB)

With BarcodeScanner component we scan a QR Green Pass and we get:

4 Likes

4.- Decode JSON.

qrgreenpass8

Split at { , } and get a list.

Then I look for the piece that contains the data.

Example of JSON, from https://gir.st/blog/greenpass.html

{-260: {1: {'dob': '1998-02-26', date of birth
            'nam': {'fn': 'Musterfrau-Gößinger', family name
                    'fnt': 'MUSTERFRAU<GOESSINGER',
                    'gn': 'Gabriele', given name
                    'gnt': 'GABRIELE'},
            'v': [{'ci': 'URN:UVCI:01:AT:10807843F94AEE0EE5093FBC254BD813#B', certificate ID
                   'co': 'AT', country of vaccination
                   'dn': 1, doses received
                   'dt': '2021-02-18', date of vaccination
                   'is': 'Ministry of Health, Austria', cert issuer
                   'ma': 'ORG-100030215', vaccine manufacturer
                   'mp': 'EU/1/20/1528', vaccine product id
                   'sd': 2, total number of doses
                   'tg': '840539006', targeted disease (COVID-19)
                   'vp': '1119349007'}], vaccine or prophylaxis
            'ver': '1.2.1'}}, schema version
 1: 'AT', QR code issuer
 4: 1624458597, QR code expiry
 6: 1624285797} QR code generated
5 Likes

5.- Scan QR with Camera component.

p299F_QRGreenPass_Camara.aia (432.8 KB)

  • Instead of using the BarcodeScanner, we can use the Camera component.
    We TakePicture, place it in an Image1.Picture and by means of the QRGPToJson block we decode it to JSON.

5 Likes

6.- Other blocks.

  • With this extension you can also encode/decode QR.

6 Likes

when a scan is been confermed then you post to alert your website . Why did you do that ???? can you please remove it pls we will appriciate ia so much and ou will help up pls

1 Like

is it possible to do the exacly oposid thing ???? text to qr

1 Like

There is a TextToQR block

2 Likes

it is not working would you mind making me a symple aia file pls you will help me

1 Like

There is a sample aia project above....

1 Like

i cannot do that action i put the following json code to encode it doesnt

exple what i use on the text to qr block and it is not working {-260: {1: {'dob': '1998-02-26', date of birth
'nam': {'fn': 'Musterfrau-Gößinger', family name
'fnt': 'MUSTERFRAU<GOESSINGER',
'gn': 'Gabriele', given name
'gnt': 'GABRIELE'},
'v': [{'ci': 'URN:UVCI:01:AT:10807843F94AEE0EE5093FBC254BD813#B', certificate ID
'co': 'AT', country of vaccination
'dn': 1, doses received
'dt': '2021-02-18', date of vaccination
'is': 'Ministry of Health, Austria', cert issuer
'ma': 'ORG-100030215', vaccine manufacturer
'mp': 'EU/1/20/1528', vaccine product id
'sd': 2, total number of doses
'tg': '840539006', targeted disease (COVID-19)
'vp': '1119349007'}], vaccine or prophylaxis
'ver': '1.2.1'}}, schema version
1: 'AT', QR code issuer
4: 1624458597, QR code expiry
6: 1624285797}

1 Like

it is not working

1 Like

What is not working?

image

image

2 Likes

i can generate qr code but wen i scan it with covid scanner app it ses eerror it is not working

We get the message, please stop spamming the community....

3 Likes

this is an output, but not an input json code...
see a correct example taken from here https://dgc.a-sit.at/ehn/

{
    "ver": "1.2.1",
    "nam": {
        "fn": "Musterfrau-G\u00f6\u00dfinger",
        "gn": "Gabriele",
        "fnt": "MUSTERFRAU<GOESSINGER",
        "gnt": "GABRIELE"
    },
    "dob": "1998-02-26",
    "v": [
        {
            "tg": "840539006",
            "vp": "1119349007",
            "mp": "EU\/1\/20\/1528",
            "ma": "ORG-100030215",
            "dn": 1,
            "sd": 2,
            "dt": "2021-02-18",
            "co": "AT",
            "is": "Ministry of Health, Austria",
            "ci": "URN:UVCI:01:AT:10807843F94AEE0EE5093FBC254BD813#B"
        }
    ]
}

Taifun

1 Like

It's not working

1 Like