Home assistant PLUS supermarkt points

Tja… there is another project. I want the supermarkt points to be captured and tracked by home assistant.
The supermarkt is called PLUS, it is a Dutch supermarkt that sells bonus points (plus zegels) that you can later use to pay for products.

The technical difficulties:
– There is no website that has the information of points collected other than the app
– I have no experience with HACS

Never done it, so I must be able to do it.

Decompile the android app

I used a random google hit to download a version of the app as xapk (uhh yet another extension)

Okay, so an easy to extract file, that results in the following directory (I guess com.mobgen.plus is the important one)

Tja… next, I’ve used some quick copilot chat for analysis

So using jadx-gui I can see some PLUS supermarkt things

Search for PLUS

So I’ve found: ecop-os-app.plus.nl
And the cordova app files in android-app\PLUS+supermarkt_10.100.39_apkcombo.com\com.mobgen.plus\assets\www\index.html

After 15 minutes of searching

The cordova app uses something called OutSystems generated app, hence some ECOP_ files.
The file scripts\ECP_Savings_MCW.controller.js has details regarding the points

The endpoint was consturcted by copilot to

// Server action for getting max redeemable cards
maxRedeemCards_Get$ServerAction = function(e) {
    var a = this.controller;
    return a.callServerAction(
        "MaxRedeemCards_Get",  // Action name
        "screenservices/ECP_Savings_MCW/ActionMaxRedeemCards_Get", // Endpoint path
        "aE9gpUq5dpMJgAXnrG3vlg", // Action identifier
        {},  // Parameters
        a.callContext(e)
    )
}

I can recall the plus.nl website also points to these locations

Construct some postman magic

Yups, that is my test email, one of thousands

Change postman request to get the ‘volle kaarten’

Hmmmm, that is quite tricky, as every endpoint also has a apiVersion and moduleVersion

Probably these strings have to match on the server side.
I have the one from the ‘Volle kaarten’ api endpoint, but it didn’t work

Create a cordova app and import the files to see the network calls

The first app is working

Copy the decompiled files and run the cordova app, but it fails….