# Command & Conquer: Rivals API

*Disclaimer: You should thoroughly read EA’s* [*Command & Conquer: Rivals EULA*](https://www.ea.com/games/command-and-conquer/command-and-conquer-rivals) *before engaging in any of the subsequent forensic activity. This is purely for educational purposes. And you likely shouldn’t go poking at EA’s production services with your own account*

### Summary

I was cleaning up some old files and came across a data dump I took from Rivals. Surprisingly, I also had a draft article to walk through the reverse-engineering process I used to document their API 😅 This post is an attempt to finish what was started and reduce my draft backlog!

It’s worth noting that the captures are from May 2020 (Pixel 3, Android 10, game version 1.8), and the .apk I revisited is version 1.14.0. Endpoints have almost certainly drifted since then, so treat this as a snapshot of what I found, not a living map

The short version: in 2020 I peeked at the .apk, got nowhere useful, and spent my time on mitmproxy captures instead. In 2026 started playing again and went back to the binary, recovered the game server’s protobuf schemas from it, and suddenly those old captures made a lot more sense

That’s the spine of this post and a similar theme if you’ve read these:

- [Debugging Mobile Apps with mitmproxy](https://medium.com/sean3z/debugging-mobile-apps-with-mitmproxy-4596e56b3da2)
- [My C&C Projects throughout the years](https://medium.com/sean3z/my-c-c-projects-throughout-the-years-23f429ef3d56)

### Why?

I thoroughly enjoy Rivals, a free mobile game published by EA, however I would really prefer better statistics than what’s available in-game

For example, understanding how my deck performs against certain players or where I can improve. That itch is what started the 2020 dump, and it’s what finally got me to finish this

### 2020: a dead-end .apk and a useful wire dump

![](https://cdn.hashnode.com/uploads/posts/6aefcf97a529a56101dcc7c8/8d68a7fc-b989-4b36-84aa-003c2b32dfe1.png align="center")

Back then I opened the .apk (`com.ea.gp.candcwarzones`) in Android Studio and learned a few things that felt interesting at the time

- Rivals uses Celdum-Bold and DaytonaPro fonts
- EA uses custom `.sb` / `.sba` / `.sb3d` files for assets (animations, models, etc.). There've been a few attempts to crack those, but I wasn't able to find anything readily accessible
- The game pulled in Firebase, and I guessed it might be for real-time in-match data transfer (although I never confirmed that)

Honestly, the .apk was a bit of a dead end for what I actually wanted. The Java side looked like a shell of SDKs, and the interesting stuff was all on the wire. So I pointed my phone at a mitmproxy instance on my local network (same setup as my mitmproxy post) and just played the game while watching traffic roll by

I’ve always wondered why that worked so easily on Android 10, since apps stopped trusting user-installed certificates back in Android 7. Years later the answer turned out to be sitting in the binary:

`com.ea.ironmonkey.HTTPRequest`, the Java class the native engine uses for HTTP, installs a trust manager that accepts any certificate (it only checks the expiry date) along with an allow-all hostname verifier. Its user agent is `"osiris " + http.agent`, which is exactly the `osiris Dalvik/2.1.0 ...` header from my captures. That's the code path the game server calls were going through, and that's why mitmproxy just worked

So, let’s move on to what the wire actually showed

### Rivals API

Yes, Rivals has an internal (undocumented) API. Saying it’s inconsistent is an understatement (seemingly due to also leveraging EA’s game-agnostic endpoints as well). Some services speak plain JSON, and the game server itself speaks protobuf

### Domains

Here’s every host I saw the client talk to in 2020, with what I know about each one now

- `accounts.ea.com` — OAuth, token refresh and token info
- `gateway.ea.com` — Identity, personas and persona links
- `friends.gs.ea.com` — Friends list and friend invitations
- `groups.gameservices.ea.com` — Alliances (EA calls them groups)
- `prod.scorpion-ea.com` — The Rivals game server itself (protobuf)
- `prod.us-east-1.battle-service.scorpion-ea.com` — Battle service, US region
- `prod.eu-central-1.battle-service.scorpion-ea.com` — Battle service, EU region
- `rtm.tnt-ea.com` — Real-time messaging (chat and presence)
- `pin-em.data.ea.com` — In-game inbox / engagement messages
- `pin-river.data.ea.com` — Telemetry (EA's PIN event pipeline, `/pinEvents`)
- `pn.tnt-ea.com` — Push notification registration (EA's PushTNG)
- `ping1.tnt-ea.com` — A bare `HEAD /`, the SDK's "am I online?" check
- `product.sn.eamobile.com` — The real-money store catalog

A few interesting tidbits from the DNS side. `groups.gameservices.ea.com` CNAMEs through `groupt.tnt-ea.com` to an Elastic Beanstalk environment in us-east-1, and `rtm.tnt-ea.com` lands on an AWS load balancer. So, it's AWS all the way down

Internally the game seems to be codenamed Scorpion (hence `scorpion-ea.com`), and EA's social stack is Antelope. The persona namespace for Rivals is `antelope-scorpion-candcwarzones`, which ties both names together

You won’t find most of those hostnames hardcoded, and that’s on purpose. On launch, Nimble calls EA’s “Synergy Director” (`https://syn-dir.sn.eamobile.com/director/api/android/getDirectionByPackage`) with the package name and some device info. The director replies with a map of service keys to URLs. Here's how the keys line up with the hosts above

- `nexus.connect`, `nexus.proxy`, `nexus.portal`: the identity stack (accounts and gateway)
- `antelope.friends.url`, `antelope.groups.url`, `antelope.rtm.host`: friends, groups and real-time messaging
- `river.pin` and `pin.aruba.url`: telemetry (`/pinEvents`) and the inbox (`/action`)
- `ens.url`: push notifications. Nimble's PushTNG module registers the phone's Firebase token at `{ens.url}/games/{game}/devices`, which is how `pn.tnt-ea.com` shows up
- `synergy.product`: `/product/api/core/getAvailableItems`, `getMTXGameCategories` and `getDownloadItemUrl`, so that's the catalog of real-money purchases behind `product.sn.eamobile.com`

`ping1.tnt-ea.com` is hardcoded as `MAIN_NETWORK_REACHABILITY_CHECK_URL` in Nimble, so it's a connectivity check rather than a latency check. The Scorpion codename is everywhere too: the main activity is `ScorpionActivity`, and the C++ classes are `ScorpionWorld`, `ScorpionNetworkManager` and `ScorpionGroupManager`

I’ve broken up the rest of the API into the following services

- Authentication
- Persona
- Friends
- Alliance
- Game server (protobuf)
- Inbox

### Authentication

Rivals uses EA’s standard OAuth flow on [accounts.ea.com](http://accounts.ea.com). The client holds onto a refresh token and trades it for a fresh access token, which only lives for about an hour

```plaintext
POST https://accounts.ea.com/connect/token?client_id=candcwarzone-2016-android-client&client_secret=<client_secret>&grant_type=refresh_token&refresh_token=<refresh_token>&release_type=prod
Accept: */*
X-Include-RT-Time: true
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
```

Yup, everything rides in the query string, client secret included (with an empty body). Not exactly what you’d expect from an OAuth token endpoint, but here we are

```javascript
{
    "access_token": "<access_token>",
    "expires_in": 3599,
    "id_token": "<id_token>",
    "refresh_token": "<refresh_token>",
    "refresh_token_expires_in": 86399,
    "token_type": "Bearer"
}
```

So, roughly an hour for the access token and a day for the refresh token. Each refresh hands back a new refresh token, so the client keeps rolling it forward

The Java half of Nimble actually has the exact same string as a form-body template (`grant_type=refresh_token&refresh_token=%s&client_id=%s&client_secret=%s&redirect_uri=nucleus:rest`), so it was clearly designed as a body. The copy that actually runs in Rivals is the C++ port inside `libapp.so`, and that's the one sending it in the query string. The other fun bit is that neither the client ID nor the secret is in the .apk. Both come back from the Synergy Director response (`clientId` / `clientSecret`), so EA can rotate them without shipping an update

Now, you can ask EA what a token actually represents with `tokeninfo`

```plaintext
GET https://accounts.ea.com/connect/tokeninfo?access_token=<access_token>
Accept: */*
X-Check-Underage: true
X-Include-Authenticators: true
X-Include-StopProcess: true
```

```javascript
{
    "authenticators": [
        { "authenticator_pid_id": <pid_id>, "authenticator_type": "AUTHENTICATOR_ANONYMOUS" },
        { "authenticator_pid_id": <pid_id>, "authenticator_type": "NUCLEUS" },
        { "authenticator_pid_id": <pid_id>, "authenticator_type": "AUTHENTICATOR_GOOGLE" }
    ],
    "client_id": "candcwarzone-2016-android-client",
    "expires_in": 3599,
    "is_underage": false,
    "persona_id": <persona_id>,
    "pid_id": "<pid_id>",
    "pid_type": "AUTHENTICATOR_ANONYMOUS",
    "scope": "offline basic.antelope.links.bulk openid signin antelope-rtm-readwrite search.identity social_recommendation_user basic.antelope basic.identity basic.persona basic.persona.write antelope-inbox-readwrite",
    "stopProcess": "OFF",
    "user_id": "<user_id>"
}
```

This one’s actually pretty telling. My single Rivals persona is backed by three authenticators: an anonymous device login, my EA (Nucleus) account and Google. The scopes also hint at the rest of the map, with `antelope-rtm-readwrite` for real-time messaging and `antelope-inbox-readwrite` for the inbox

The anonymous login is the `mobile_game_UPID` flow in Nimble's `AuthenticatorAnonymous` (`/connect/auth?mobile_login_type=mobile_game_UPID&...`). Facebook and Google get their own authenticators, and they all end in the same `redirect_uri=nucleus:rest` code exchange. All four `X-` headers above are string constants in `libapp.so`

The access token then shows up in two different ways depending on the service. `gateway.ea.com` wants a normal `Authorization: Bearer <access_token>`, while friends and groups want it in an `X-AuthToken` header alongside `X-Application-Key: candcwarzones-2016-android`. Consistent, right?

### Persona

A persona is your in-game identity. You can fetch your own from the identity gateway

```plaintext
GET https://gateway.ea.com/proxy/identity/pids/me/personas/<persona_id>
Authorization: Bearer <access_token>
X-Expand-Results: true
X-Persona-Property-Category: SERVICE_BAN_ALL
```

```javascript
{
    "persona": {
        "dateCreated": "2018-06-24T13:12Z",
        "displayName": "sean3z#<suffix>",
        "isVisible": true,
        "lastAuthenticated": "2020-05-12T23:13Z",
        "name": "sean3z#<suffix>",
        "namespaceName": "antelope-scorpion-candcwarzones",
        "nickName": "sean3z",
        "personaId": <persona_id>,
        "pidId": <pid_id>,
        "showPersona": "EVERYONE",
        "status": "ACTIVE",
        "statusReasonCode": ""
    }
}
```

That `SERVICE_BAN_ALL` property category is a fun one to see in a routine profile call (thankfully my status still says `ACTIVE`). And yes, it's a hardcoded string in the client, so every launch asks about bans

You can also see how each authenticator links to the persona within the Rivals namespace

```plaintext
GET https://gateway.ea.com/proxy/identity/links?personaNamespace=antelope-scorpion-candcwarzones
Authorization: Bearer <access_token>
```

That returns a `pidGamePersonaMappings` list with one `ACTIVE` mapping per authenticator, all pointing at the same `personaId`

The most useful persona call, though, is the batch lookup. The game uses it to turn a list of persona IDs (say, your alliance roster) into display names

```plaintext
GET https://gateway.ea.com/proxy/identity/personas?personaUri=%2Fpersonas%2F<persona_id_1>&personaUri=%2Fpersonas%2F<persona_id_2>&...
Authorization: Bearer <access_token>
Content-Type: text/plain;charset=UTF-8
```

It’s worth noting the client only ever sent about 20 `personaUri` values per request, then split the rest into another request. I'd assume that's a server-side cap. The response is a `personas.persona` array in the same shape as above

### Friends

Friends live on [friends.gs.ea.com](http://friends.gs.ea.com), with separate calls for inbound and outbound invitations

```plaintext
GET https://friends.gs.ea.com/friends/2/personas/<persona_id>/invitations/inbound?start=0&count=100&names=true
GET https://friends.gs.ea.com/friends/2/personas/<persona_id>/invitations/outbound?start=0&count=100
X-Api-Version: 2
X-Application-Key: candcwarzones-2016-android
X-AuthToken: <access_token>
```

Both come back as `entries` plus `pagingInfo` (`offset`, `size`, `totalSize`). Mine were empty at the time

The friends list itself is where it gets interesting

```plaintext
GET https://friends.gs.ea.com/friends/2/personas/<persona_id>/platforms/ea/friends
```

```javascript
{
    "EA-GLOBAL": {
        "friends": []
    },
    "EA-INGAME": {
        "friends": [{
            "displayName": "<friend>#<suffix>",
            "nickName": "<friend>",
            "personaId": <persona_id>,
            "userId": <user_id>
        }]
    }
}
```

So, friends are split into two buckets. `EA-GLOBAL` would be friends from your wider EA (Origin) account, and `EA-INGAME` are the ones you added inside Rivals. All of mine were in-game (a few in-game friends, names left out here), which honestly tracks for a mobile game. Both bucket names (`EA-GLOBAL`, `EA-INGAME`) are constants in `libapp.so`, so the client knows about both even though I only ever had in-game friends

### Alliance

Alliances are EA “groups” of type `ScorpionCI`. You can look up which alliance you're in like so

```plaintext
GET https://groups.gameservices.ea.com/group/instance?pagesize=1&pagestart=0&typeId=ScorpionCI&userId=<persona_id>
X-Acting-UserId: <persona_id>
X-Acting-UserType: NUCLEUS_PERSONA
X-Api-Version: 2
X-Application-Key: candcwarzones-2016-android
X-AuthToken: <access_token>
```

```javascript
[{
    "_id": "<alliance_guid>",
    "name": "𝕋𝕀𝔹𝔼ℝ𝕀𝔸ℕ 𝕊𝕌ℕ",
    "r": "Founder"
}]
```

That’s my alliance (yes, the fancy Unicode name came through intact), and `r` is my role. I founded Tiberian Sun back during the Alpha release, so Founder it is. `ScorpionCI` isn't hardcoded in the client at all. The game server hands it over in `InitializeResponse.groupType` (more on `init` below), so EA could point Rivals at a different group type without an update

There’s also a call for join requests waiting on approval, which was an empty array for me

```plaintext
GET https://groups.gameservices.ea.com/group/instance/pendingApproval?pagestart=0&pagesize=20&userId=<persona_id>
```

And the full details, roster included

```plaintext
GET https://groups.gameservices.ea.com/group/instance/<alliance_guid>/members?pagestart=0&pagesize=30&groupConfig=true
```

```javascript
{
    "_id": "<alliance_guid>",
    "attributes": {
        "description": "Welcome back Commander_ <discord link> Masters 2 or higher required to join",
        "env2": "prod",
        "groupcode": "<group_code>",
        "iconid": "3",
        "lastactive": "1589323671",
        "locationid": "2",
        "minplayerlevel": 60,
        "type2": "1"
    },
    "creator": <persona_id>,
    "dateCreated": 1532180693849,
    "groupTypeId": "ScorpionCI",
    "lastAccessDate": 1589241600000,
    "maxSize": 30,
    "memberList": [
        { "groupTypeId": "ScorpionCI", "groupguid": "<alliance_guid>", "id": <persona_id>, "r": "Founder", "since": 1532180693849, "ts": 1532180693849 },
        { "groupTypeId": "ScorpionCI", "groupguid": "<alliance_guid>", "id": <persona_id>, "r": "Leader", "since": 1535656810345, "ts": 1535656810345 },
        { "groupTypeId": "ScorpionCI", "groupguid": "<alliance_guid>", "id": <persona_id>, "r": "Member", "since": 1585082055943, "ts": 1585082055943 }
    ],
    "name": "𝕋𝕀𝔹𝔼ℝ𝕀𝔸ℕ 𝕊𝕌ℕ",
    "override": {
        "joinConfig": {
            "canInviteToJoin": true,
            "canUserRequestMembership": false,
            "isFreeJoin": true,
            "isPwdProtected": false
        }
    },
    "shortName": "Tiberian Sun",
    "size": 28
}
```

A few things jump out. Roles are `Founder`, `Leader` and `Member` (all three are string constants in the client), `maxSize` is 30, and every timestamp is in epoch milliseconds (except `lastactive`, which is seconds, because of course it is). Most attributes also show up twice with a `2` suffix (`description2`, `iconid2`, `minplayerlevel2`). I originally guessed that was a migration that never got cleaned up. Half right: `description2` and friends appear right next to the originals in `libapp.so`, so the client still reads and writes both sets. Whatever the migration was, it never finished

The game server also has its own idea of an alliance. Its protos call them guilds (`PlayerGuildData` with `guildId`, `guildName`, `iconId`, `locationId`, `currentMemberCount`, `maxMemberCount`), which is why the game server and EA's social platform use different names for the same thing

Notice the member list only gives you persona IDs, though. That’s where the batch persona lookup from earlier comes in, and it’s exactly how the client turns a roster into names

### Game server (protobuf)

Now for the main event. Everything gameplay-related goes to [prod.scorpion-ea.com](http://prod.scorpion-ea.com), and nearly every request looks something like this

```plaintext
POST https://prod.scorpion-ea.com/<method>
charset: UTF-8
CONFIG-HASH: <config_hash>
Accept: application/x-protobuf
Content-Type: application/x-protobuf
SESSION-ID: <session_id>
COOKIE: AWSALB=<awsalb_cookie>
EADP-PERSONA-ID: <persona_id>
MINOR-VERSION: 8
X-Scorpion-Request-Latency: <previous_method> <epoch_ms> <latency_ms>
User-Agent: osiris Dalvik/2.1.0 (Linux; U; Android 10; Pixel 3 Build/QQ2A.200405.005)
```

`Accept: application/x-protobuf` means the bodies are Protocol Buffers, a compact binary format. Without the .proto schema files, the field names and types are a mystery, so all you get is field numbers, lengths and whatever strings happen to be readable. That's the honest limit of what I could decode back in 2020

`X-Scorpion-Request-Latency` is a neat one too. It looks like the client reports the previous call's name, timestamp and round-trip time (e.g. `purchaseCard ... 675`) on the next request, so roughly 600–850 ms per call back then. That's nothing to brag about, but it's not terrible for a mobile game either. `AWSALB` is just the AWS load balancer's sticky-session cookie

### 2026: opening the .apk properly

This is where revisiting the binary paid off. The fonts from 2020 check out (`Celdum-Bold.otf` plus Bold, Regular and Semibold `DaytonaPro`), and so do the asset formats. There are 808 `.sb`, 369 `.sba` and 114 `.sb3d` files in `assets/published`, plus 243 `.sbfx` files

The Firebase guess was wrong though. The app pulls in Firebase Analytics, Crashlytics and Cloud Messaging (push), but not the Realtime Database SDK. There’s a `firebase_database_url` in the resources, but it points at a project called `test-scorpion-12716110`, which looks like a leftover from the default Firebase config. Matches are played over a WebSocket, which we'll get to

The bigger reason I called the .apk a dead end in 2020 is that the Java code is mostly a shell. It’s EA’s Nimble SDK, Facebook, AWS and friends. The actual game is a 64 MB native library, `lib/arm64-v8a/libapp.so`, built on EA's in-house IronMonkey engine. And that's where things got interesting, because the game server's protobuf schemas are compiled right into it

Protobuf schemas normally stay on the developer’s machine, but C++ protobuf (the full runtime, not “lite”) compiles each `.proto` file into the binary as a serialized `FileDescriptorProto`. That's how reflection and debug printing work. `libapp.so` has 108 of them sitting in plain sight, from `protocol/service.proto` to `data/player_data.proto`

Recovering them is mostly bookkeeping. Find bytes that look like `0x0A <len> "something.proto"` (field 1 of a `FileDescriptorProto` is its file name), walk the protobuf fields from there until something stops parsing, then print the descriptor back out as `.proto` text. I did it with a ~150-line Perl script, but tools like pbtk do the same thing

The best part is `protocol/service.proto`, which declares the whole game server

```c
service ScorpionService {
  rpc init(InitializeRequest) returns (InitializeResponse);
  rpc getPlayerState(GetPlayerStateRequest) returns (GetPlayerStateResponse);
  rpc findMatch(FindMatchRequest) returns (FindMatchResponse);
  rpc purchaseCard(PurchaseCardRequest) returns (DynamicPurchaseResponse);
  rpc donateCards(DonateCardsRequest) returns (DonateCardsResponse);
  rpc startConvoy(EmptyMessage) returns (StartConvoyResponse);
  // ...72 RPCs in total
}
```

Every method carries two custom options, `option_http_verb` (always `"POST"`) and `option_modified_resources` (`"player"` and/or `"client"`, so the client knows which cached state to refresh afterwards). And each RPC name is literally the URL path, `POST /findMatch` and so on

The headers check out too. `CONFIG-HASH`, `SESSION-ID`, `EADP-PERSONA-ID`, `MINOR-VERSION` and `X-Scorpion-Request-Latency` are all string constants in the client. `SESSION-ID` and `CONFIG-HASH` come straight from the `init` response (`sessionId` and `gameConfigHash`), and `MINOR-VERSION: 8` is the 8 in version 1.8. There's also an `X-Scorpion-RequestId` header that never showed up in my captures

With the schemas in hand, I went back to the 2020 dump and re-read every method I’d captured. Here’s that list, now with their real message types

- `POST /init` — Session bootstrap (`InitializeRequest` → `InitializeResponse`)
- `GET /mapIp` — Returns your region as plain text (e.g. `US`), not protobuf
- `POST /findMatch` — Enter matchmaking (`FindMatchRequest` → `FindMatchResponse`)
- `POST /startClones` / `POST /collectClones` — Cloning chamber (`StartClonesRequest` / `CollectClonesRequest` → `*Response`)
- `POST /purchaseCard` — Buy unit cards (`PurchaseCardRequest` → `DynamicPurchaseResponse`)
- `POST /donateCards` — Donate cards to an alliance member (`DonateCardsRequest` → `DonateCardsResponse`)
- `POST /getGuildTrophies` — Alliance trophy counts (`GetGuildTrophiesRequest` → `GetGuildTrophiesResponse`)
- `POST /startConvoy` / `POST /fuelRushConvoy` — Convoy start and speed-up (`EmptyMessage` → `StartConvoyResponse` / `FuelRushConvoyResponse`)

**init.** This is the first call, and the payload carries the access token along with client details. The readable bits include the client ID (`candcwarzone-2016-android-client`), a game version string (1.8.x), an SDK version (1.42.0.x), `nimble` (EA's mobile SDK), the locale `en_US` and a device ID

`InitializeRequest` has the version split out (`majorVersion`, `minorVersion`, `patchVersion`, `hotfixVersion`), the access token as `eadpSessionToken`, your `personaId`, and a `PinHeaders` message. That's where all those readable strings live. `PinHeaders` is EA's telemetry header block, with the client ID (`tid`), game version (`v`), SDK version and type (`sdkv`, `sdkt` = nimble), locale (`loc`) and a `didm` map of device IDs (`androidid`, `gaid`, `eadeviceid` and friends)

The response is the real prize. It has your entire `PlayerData`, the `sessionId` and `gameConfigHash` you'll send on every later call, a `gameConfigURL` to download the game balance data, the `groupType` (`ScorpionCI`), and a `ServerApplicationProperties` block with the battle-service hosts, the replay storage location and `dlcBaseUrl`

**mapIp.** The simplest call of the bunch. `GET /mapIp` with no body returns `US`, and the client uses it to pick a region. `https://prod.scorpion-ea.com/mapIp` is hardcoded in `AppSettings.cpp`. It's not part of `ScorpionService`, which explains why it's the one GET in the bunch

**findMatch.** This is the one I was most excited about back in 2020, because your deck is right there in the request. Pulling out just the readable strings

```plaintext
Cmdr_Gdi_Solomon
Unit_Gdi_Riflemen
Unit_Gdi_RocketTroopers
Unit_Gdi_JumpTroopers
Unit_Gdi_Pitbull
Unit_Gdi_Talon
Unit_Gdi_Orca
prod.us-east-1.battle-service.scorpion-ea.com
prod.eu-central-1.battle-service.scorpion-ea.com
```

That’s a commander plus six units (my GDI deck at the time), along with the battle-service hosts the client is willing to play on. Unit IDs follow a `Unit_<Faction>_<Name>` pattern and commanders follow `Cmdr_<Faction>_<Name>`, which is exactly what you'd need for deck-level stats

The response is kind enough to tell you what it is in the headers

```plaintext
X-Protobuf-Schema: protocol/matchmaking.proto
X-Protobuf-Message: ws.app.proto.FindMatchResponse
```

Thankfully, that at least gives us the message name, even without the schema. The readable parts of `FindMatchResponse` are a match ID, a fresh load balancer cookie, the battle-service base URL, a couple of GUIDs, a WebSocket URL (`wss://prod.us-east-1.battle-service.scorpion-ea.com/ws`), the region (`us-east-1`) and a queue name shaped like `matchmakingqueue-us-east-1-#<id>-1.8-RegularGame`. So, matchmaking happens over REST, and the actual match is played over a WebSocket to the battle service

And now we have the schema. `protocol/matchmaking.proto` is one of the recovered files, and it matches the header exactly

```c
message FindMatchRequest {
  int32 numberOfUsers = 1;
  int32 retryCount = 4;
  Deck selectedDeck = 5;
  Enums.MatchType matchType = 6;
  string debugMapChoice = 7;
  repeated string battle_service_hosts = 8;
  string eventId = 9;
  string debugBucketNameSuffix = 10;
}

message FindMatchResponse {
  Status status = 1;                 // Success, AlreadyInGame
  string matchToken = 2;             // the "match ID"
  string lbCookie = 3;               // replayed as AWSALB= on the WebSocket
  string battle_service_dns_name = 4;
  string instance_guid = 5;          // GUID #1
  string player_match_token = 6;     // GUID #2
  string client_connection_url = 7;  // wss://.../ws
  string aws_region = 8;
  string bucket_name = 9;            // the queue name
  int32 min_trophies = 10;
  int32 max_trophies = 11;
}
```

A deck is `Deck { commanderNameId = 1; buildingNameIds = 2; unitIds = 3; }`. The `RegularGame` in the queue name lines up with `Enums.MatchType`, which has `Regular`, `EVENT`, `FRIENDLY` and `CUSTOM`. Also notice `debugMapChoice` and `debugBucketNameSuffix`, which are leftovers from internal testing

**Cloning chamber.** `startClones` takes a chamber name and a unit, which in my case was `free_cloning_chamber` and `Unit_Gdi_Riflemen`. The response echoes those back with a GUID for the job and a timer type of `StandardTimed`. `collectClones` just sends that job GUID back when it's done

Spot on against the schema. `StartClonesRequest` is `{ cloningChamberId, unitId }` and `CollectClonesRequest` is `{ activeChamberId }`. The GUID is the key into `CloningLab.activeChambers`, a map of in-progress chambers (`unitId`, `numBattlesRequired`, `numBattlesCompleted`, `quantityToReceive`, `startTimeMs`, `endTimeMs`). There isn't a timer-type field anywhere though, so `StandardTimed` is most likely the chamber's `cloningChamberConfigId`. In other words, the free chamber runs the "standard timed" config

**purchaseCard.** This was 160 credits for 10 units, and the request body is tiny. It’s basically just the unit ID

```plaintext
Unit_Gdi_Hammerhead
```

The response, on the other hand, is huge. Back in 2020 I thought the server was dumping a big slice of player state after every action. Readable strings in there include

```plaintext
Unit_Gdi_Hammerhead
free_cloning_chamber / Unit_Gdi_Riflemen / StandardTimed
daily_battle_bonus
Ent_CommanderSkin_Cmdr_Gdi_Jackson_Wildfront
Ent_UnitSkin_Unit_Nod_Widowmaker_ArcticWhiteSkin
Ent_UnitSkin_Unit_Nod_FlameTroopers_ArcticWhiteSkin
Unit_Nod_Venom, Unit_Gdi_Disruptor, Cmdr_Nod_Seth, Unit_Gdi_MSV, Unit_Nod_ChemicalWarrior
promoLevelT05, promoOneTime, promoLevelT10, promoLapsedSpenderDay28, promoCmdrSkinJacksonWildfront
Unit_Gdi_MammothTank, Unit_Nod_FlameTank, Unit_Gdi_Titan
```

So, in one response you get the cloning chamber state, the daily battle bonus, owned skins (`Ent_` entitlements), what looks like the store's card rotation and a list of active promos. `promoLapsedSpenderDay28` is a pretty candid name for a promo, and I'll let you draw your own conclusions there

Close, but it’s not a general player-state dump. `PurchaseCardRequest` is `{ itemDefinitionId, regularStorefrontIndex }`, so it's the unit ID plus which store slot you tapped. The response is a `DynamicPurchaseResponse`, which has three parts

- `OpenRewardResponse`: everything the purchase touched. That's your updated wallet, unit progressions (hence all the unit IDs), the cloning lab, player boosts (`daily_battle_bonus` fits there) and entitlements (the `Ent_` skins)
- `updatedDynamicStorefront`: the store's card rotation (`cardPackIds`) and per-offer purchase counts keyed by offer ID, which is where the `promo*` names come from
- `updatedWallet`

The game just sends back every collection the purchase could have changed. As for the currency, the `Wallet` message has `premium`, `credits`, `fuel`, `tickets`, `dataChips`, `eventCurrency`, `supplies` and `battlePoints`, and card purchases come out of `credits`

**donateCards.** Donation requests are identified by a string shaped like this

```plaintext
donationRequest_prod-{<alliance_guid>}-<request_id>
```

The request sends one of those IDs plus a small number (the card count, I believe). Back then I thought the response included the same player-state blob as above, plus every open donation request in the alliance

The card count guess is right, since the field is literally `numberOfCardsToAttemptDonation`. The response is smaller than I thought though. `DonateCardsResponse` has your reward, `cardsSuccessfullyDonated`, the request's updated count, your updated unit progressions, `playerLevel`, `currentExperience` and `DailyData`. Those donation request IDs come from `DailyData.donationRequestIdToExpiringAmountDonated`, which is every request *you've* donated to today (it powers the daily donation cap), not every open request in the alliance

**getGuildTrophies.** The request contains the alliance GUID and a few small numbers, and the response repeats that GUID with what look like trophy counts. So, under the hood, alliances are “guilds” to the game server and “groups” to EA’s social platform

Confirmed by the schema. `GetGuildTrophiesRequest` is `{ repeated LeaderboardType types; repeated string guildIds; }`, and the small numbers are leaderboard types (`TrophiesAll` = 1, `TrophiesGdi` = 2, `TrophiesNod` = 3, `GuildTrophiesAll` = 4, and so on). The response maps each type to a `guildId → trophies` map

**Convoys.** `startConvoy` and `fuelRushConvoy` both send an empty body (`Content-Length: 0`) and get back a short opaque message. There's no readable string in either, so in 2020 I could only tell you they exist

Both take `EmptyMessage`, and an empty protobuf message encodes to zero bytes, hence the `Content-Length: 0`. The responses are numbers only, which is why I couldn't read them. `StartConvoyResponse` is the updated `PlayerConvoyPool` plus your wallet, and `FuelRushConvoyResponse` adds the `completionRewards`. "Fuel rush" means spending fuel (`Wallet.fuel`) to finish a convoy immediately. There's also a `completeConvoy` for letting one finish on its own, with an `alwaysSetMeToTrue` field that I just have to point out

### The other 60-odd methods I never captured

Bounties (`completeBounty`, `claimBountyChest`, `reRollBounty`, `refreshAllBounties`), progression (`upgradeItem`, `openCompletedFreeChest`, `claimExperienceLevelUpReward`, `purchaseExperienceLevel`, `battleTheaterLevelUpReward`, `completeSeason`), the store (`purchaseStaticStoreReward`, `purchasePromotionalOffer`, `purchaseUnitCrate`, `purchaseDynamicCrate`, `purchasePlayerBoost`, `claimReceipt`, `openVault`), alliances (`createGuild`, `refreshGuild`, `getDonationCountsForRequests`, `requestDonation`, `checkMailbox`, `processPlayerMailbox`), friendly and custom battles (`hostFriendlyBattle`, `joinFriendlyBattle2`, `createCustomGame`, `joinCustomGame`), events and races (`startEventRun`, `claimEventReward`, `retireEventRun`, `collectRaceReward`, `completeRace`, `checkRaceState`, `checkRaceLeaderboard`), social (`leaderboards`, `getPlayerTrophies`, `getPlayerProfile`, `getFeedData`, `updateLike`, `getFriendsTopWeeklyStats`, `getTvLogByLeague`), replays (`shareReplay`, `saveReplay`, `unsaveReplay`), and a handful of housekeeping calls like `desyncLogSave`, `perfReportLogSave`, `updateClientData`, `collectDailyReward` and `deleteAppleAccount`

### Inbox

The in-game inbox comes from EA’s engagement service

```plaintext
POST https://pin-em.data.ea.com/em/v4/action
Content-Type: application/json
um_version: v4
x-ea-env: production
```

The request body is JSON, with your age, country, language and platform, a `didm` block of device IDs (`<device_ids>`), a `pidm` block of account IDs and a list of trigger IDs (`inbox_all_msgs` in this case). The response is a list of messages, each with a title, body, image URLs, a link and a start and end date

Mine were all marketing messages, like “Establishing Twitter Control” pointing at @CnCRivals and the original “Welcome to Command & Conquer: Rivals!” letter. Each message also ships with tracking URLs for impressions, clicks, conversions and errors, so this is very much a marketing pipe rather than a mailbox

Internally this is “Aruba”, EA’s engagement manager. The director key is `pin.aruba.url`, the path constant is `/action`, and `init` even forwards `arubaClientAttributes` to the game server. `didm` and `pidm` are the same `DeviceIdMap` and `PlayerIdMap` that show up in the PIN telemetry protos, so the inbox and telemetry share one identity format. That's also a pretty clear sign the inbox is built on the telemetry stack

### The battle service (the part I missed)

I never captured a single byte from the battle service in 2020, and I always assumed I’d just messed up the capture. The .apk explains it

Two things. The WebSocket isn’t opened through Java at all. It’s EA’s DirtySDK (`ProtoWebSocket` on top of `ProtoSSL`), which opens its own native sockets and ignores the phone's Wi-Fi proxy setting, so that traffic most likely never went near mitmproxy. Even if it had, ProtoSSL does its own certificate checks against a built-in CA list, topped up by the four certificates in `assets/published/certs` (Amazon and Starfield roots), so a mitmproxy CA wouldn't have passed

The protocol is in `protocol/match_session.proto`. The client opens `client_connection_url` (sending `lbCookie` back as `AWSALB=`) and sends a `ConnectToSession` with the match tokens. From then on, every message is a `ClientTransportMessage` or `ServerTransportMessage`. The server can upgrade you to UDP (`Connected.udpConnectionHostname`/`udpConnectionPort`). The game itself is deterministic lockstep. Clients only send commands (`SquadMoveCommand`, `PurchaseUnitCommand`, `UseUnitAbilityCommand`, `SurrenderCommand` and so on), the server relays them with a `NetTick`, and both clients periodically send a `GameHash` so the server can catch desyncs (`DesyncDetected`)

And yes, `DebugSpawnCommand`, `DebugKillCommand` and `DebugDepositTiberiumCommand` are in the shipping protocol. No, I didn't try them

### Building the tracker

So, back to what I was really after: deck-level stats. With `findMatch` you can see exactly which commander and units go into every match, and I assumed the results were only available over the battle-service WebSocket. The protos say otherwise, and it makes this a whole lot easier

```javascript
// data/player_data.proto
message PlayerData {
  ...
  BattleLog battleLog = 22;
  ...
}

message BattleLog {
  repeated BattleLogEntry battleLogEntries = 1;
}

message BattleLogEntry {
  string winningPersonaId = 3;
  string matchGuid = 4;
  int64 matchTime = 5;
  int32 majorVersion = 6;
  int32 minorVersion = 7;
  repeated BattleLogEntryParticipant participants = 8;
  string mapId = 12;
  Enums.MatchType matchType = 15;
  ...
}

message BattleLogEntryParticipant {
  string personaId = 1;
  string playerName = 2;
  int32 trophiesBeforeMatch = 3;
  Deck deck = 4;
  PlayerGuildData guildData = 7;
  int32 trophyChangeFromMatch = 8;
  int32 playerLevel = 9;
  bool isBot = 16;
  ...
}
```

That’s the in-game battle log, and it has both decks, both players, the trophy swing and the winner for every recent match. It rides along inside `PlayerData`, which comes back from `init` (every launch), `getPlayerState`, `getPlayerProfile` and `refreshGuild`. All of those are plain REST calls to `prod.scorpion-ea.com`, the same traffic mitmproxy could already see. So, no WebSocket required

(Fun aside: `PlayerData.progression.player_stats.currentSeasonDeckStats` is a map of `Deck` → wins/losses. The server already tracks per-deck records for the season. It just doesn't show you)

The plan, then

1. A small HTTPS proxy that only decrypts `prod.scorpion-ea.com`. Everything else, including EA logins and the battle service, is passed through as an untouched TCP tunnel. I don't want my tracker anywhere near account tokens
2. Decode the battle log out of any response that carries `PlayerData`
3. Store each match once (keyed by `matchGuid`) in SQLite, from my point of view
4. Run some SQL

I developed this in C++, with OpenSSL for TLS, Asio for sockets, zlib for gzip and SQLite for storage, all from vcpkg. It's about 900 lines, so I'll just hit the highlights here. It builds cleanly with MSVC (on Windows, from an x64 Native Tools command prompt) and passes its tests, including an end-to-end run through the proxy

### Decoding without generated code

I could run the recovered `.proto` files through `protoc`, but I only need about 20 fields. A protobuf message is just a list of `(field number, wire type, value)` triples, so a tiny reader plus the field numbers from the schema does the job

```cpp
BattleLogEntry decode_entry(std::string_view bytes) {
    BattleLogEntry e{.raw = std::string{bytes}};
    pw::Reader r{bytes};
    while (auto f = r.next()) {
        switch (f->number) {
        case 3: e.winning_persona_id = f->bytes; break;
        case 4: e.match_guid = f->bytes; break;
        case 5: e.match_time = f->i64(); break;
        case 6: e.major_version = f->i32(); break;
        case 7: e.minor_version = f->i32(); break;
        case 8: e.participants.push_back(decode_participant(f->message())); break;
        case 12: e.map_id = f->bytes; break;
        case 15: e.match_type = f->i32(); break;
        }
    }
    return e;
}
```

Unknown fields are skipped, so if EA adds fields in a later version nothing breaks. The raw entry bytes are kept in the database too, so I can re-decode old matches if I want more fields later

Figuring out which response is which is easy, since the server says so itself. The proxy reads `X-Protobuf-Message` (falling back to the URL path) and looks up which field holds `PlayerData`

```cpp
static const std::map<std::string_view, std::uint32_t, std::less<>> fields{
    {"InitializeResponse", 2},        {"init", 2},
    {"GetPlayerStateResponse", 2},    {"getPlayerState", 2},
    {"GetPlayerProfileResponse", 2},  {"getPlayerProfile", 2},
    {"RefreshGuildResponse", 1},      {"refreshGuild", 1},
};
```

“Me” is the `EADP-PERSONA-ID` request header. When importing a saved response with no headers, it's the one persona that shows up in every entry of the log

### The proxy

It’s a standard `CONNECT` proxy. For hosts on the intercept list, it answers the TLS handshake with a certificate minted on the fly from a local CA, opens its own properly verified TLS connection to the real server, and shuttles HTTP/1.1 messages back and forth byte-for-byte. A decoded copy (de-chunked, gunzipped) goes to the recorder. Every other host just gets two sockets glued together

```cpp
if (req->method() == "CONNECT") {
    auto [host, port] = split_authority(req->target(), "443");
    asio::write(client, asio::buffer(std::string_view{"HTTP/1.1 200 Connection Established\r\n\r\n"}));
    if (intercept_.contains(host)) return intercept(client, host, port);

    tcp::socket upstream{io_};
    asio::connect(upstream, tcp::resolver{io_}.resolve(host, port));
    return tunnel(client, upstream);
}
```

If you set up mitmproxy from my earlier post, the tracker picks up `~/.mitmproxy/mitmproxy-ca.pem` automatically, so the phone side doesn't change. Otherwise it creates its own CA and writes `rivals-tracker-ca-cert.pem` for you to install

### Running it

```shell
# once
git clone https://github.com/microsoft/vcpkg && ./vcpkg/bootstrap-vcpkg.sh
export VCPKG_ROOT=$PWD/vcpkg

cd rivals-tracker
cmake --preset default
cmake --build --preset default
ctest --preset default

./build/rivals-tracker proxy --port 8080 --db rivals.db
```

Point the phone’s Wi-Fi proxy at your machine on port 8080 and launch the game. On launch you’ll see something like

```plaintext
using CA rivals-tracker-ca.pem
listening on 0.0.0.0:8080 (intercepting: {"prod.scorpion-ea.com"})
POST /init -> 200 (204838 bytes)
  WIN  vs Oh Zone (250 trophies)  Cmdr_Nod_Kane Unit_Nod_Fanatic Unit_Nod_Scarab Unit_Nod_CatalystGunship Unit_Nod_FireBomber Unit_Nod_Viper Unit_Nod_Artillery
  WIN  vs RaTheSunGod076 (314 trophies)  Cmdr_Gdi_Liang Unit_Gdi_Riflemen Unit_Gdi_RocketTroopers Unit_Gdi_JumpTroopers Unit_Gdi_Robodogs Unit_Gdi_MohawkGunship Unit_Gdi_Sandstorm
  WIN  vs Heckler & Koch (709 trophies)  Cmdr_Nod_Kane Unit_Nod_StormTroopers Unit_Nod_FlameTroopers Unit_Nod_Buggy Unit_Nod_TickTank Unit_Nod_Banshee Unit_Nod_Avatar
  WIN  vs Gooders 21 (636 trophies)  Cmdr_Gdi_Solomon Unit_Gdi_Riflemen Unit_Gdi_RocketTroopers Unit_Gdi_Grenadier Unit_Gdi_Wolverine Unit_Gdi_ZoneTrooper Unit_Gdi_Kodiak
  WIN  vs Alceu (272 trophies)  Cmdr_Nod_Seth Unit_Nod_ChemQuad Unit_Nod_BeamCannon Unit_Nod_Banshee Unit_Nod_Confessor Unit_Nod_Rockwyrm Unit_Nod_Cyborg
  WIN  vs Gooders 21 (645 trophies)  Cmdr_Gdi_Solomon Unit_Gdi_Riflemen Unit_Gdi_RocketTroopers Unit_Gdi_Grenadier Unit_Gdi_Wolverine Unit_Gdi_ZoneTrooper Unit_Gdi_Kodiak
  WIN  vs Gooders 21 (635 trophies)  Cmdr_Gdi_Solomon Unit_Gdi_DroneSwarm Unit_Gdi_Talon Unit_Gdi_MohawkGunship Unit_Gdi_Wolverine Unit_Gdi_ZoneTrooper Unit_Gdi_Sandstorm
  WIN  vs Dennis (700 trophies)  Cmdr_Nod_Seth Unit_Nod_StormTroopers Unit_Nod_Scarab Unit_Nod_MutantMarauder Unit_Nod_AttackBike Unit_Nod_ChemQuad Unit_Nod_ScorpionTank
  WIN  vs D3K4N000K (629 trophies)  Cmdr_Gdi_Strongarm Unit_Gdi_Riflemen Unit_Gdi_RocketTroopers Unit_Gdi_Grenadier Unit_Gdi_Talon Unit_Gdi_Orca Unit_Gdi_Sandstorm
  WIN  vs SilentDrengr818 (850 trophies)  Cmdr_Gdi_Liang Unit_Gdi_Riflemen Unit_Gdi_Rhino Unit_Gdi_Pitbull Unit_Gdi_PredatorTank Unit_Gdi_Talon Unit_Gdi_ZoneTrooper

  recorded 10 new match(es) from init
```

Since the battle log only comes down with `PlayerData`, new matches land the next time the game calls `init` (or one of the other three). In practice that means restarting the game every so often, before the log rolls over

### Stats

Then the fun part

```plaintext
./build/rivals-tracker stats --min-games 3
10 matches recorded, 10 wins (100.0%)

By my deck
                                                                games   wins   win %
  Cmdr_Gdi_Solomon,Unit_Gdi_JumpTroopers,Unit_Gdi_Orca,Unit_Gdi_Pitbull,Unit_Gdi_Riflemen,Unit_Gdi_RocketTroopers,Unit_Gdi_Talon
                                                                   10     10  100.0%

Against opponent commander
                                                                games   wins   win %
  Cmdr_Gdi_Liang                                                    2      2  100.0%
  Cmdr_Gdi_Solomon                                                  3      3  100.0%
  Cmdr_Gdi_Strongarm                                                1      1  100.0%
  Cmdr_Nod_Kane                                                     2      2  100.0%
  Cmdr_Nod_Seth                                                     2      2  100.0%

Against opponent unit (worst first)
                                                                games   wins   win %
  Unit_Gdi_DroneSwarm                                               1      1  100.0%
  Unit_Gdi_Grenadier                                                3      3  100.0%
  Unit_Gdi_JumpTroopers                                             1      1  100.0%
  Unit_Gdi_Kodiak                                                   2      2  100.0%
  Unit_Gdi_MohawkGunship                                            2      2  100.0%
  Unit_Gdi_Orca                                                     1      1  100.0%
  Unit_Gdi_Pitbull                                                  1      1  100.0%
  Unit_Gdi_PredatorTank                                             1      1  100.0%
  Unit_Gdi_Rhino                                                    1      1  100.0%
  Unit_Gdi_Riflemen                                                 5      5  100.0%
  Unit_Gdi_Robodogs                                                 1      1  100.0%
  Unit_Gdi_RocketTroopers                                           4      4  100.0%
  Unit_Gdi_Sandstorm                                                3      3  100.0%
  Unit_Gdi_Talon                                                    3      3  100.0%
  Unit_Gdi_Wolverine                                                3      3  100.0%

Head to head
                                                                games   wins   win %
  Gooders 21                                                        3      3  100.0%

By map
                                                                games   wins   win %
  SA_02_Canal_Row                                                   3      3  100.0%
  SA_02_Two_Fuses                                                   2      2  100.0%
  SA_02_Tiberium_Stripes                                            2      2  100.0%
  SA_01_Frozen_Road                                                 2      2  100.0%
  TR_01_Three_Sentinels                                             1      1  100.0%
```

Everything’s in two tables (`matches` and `match_units`), so anything the built-in report doesn't cover is one query away. For example, "which of my decks does worst against Venom?"

```sql
SELECT m.my_deck, COUNT(*) AS games, AVG(m.won) AS win_rate
FROM matches m JOIN match_units u USING (match_guid)
WHERE u.side = 'opp' AND u.unit_id = 'Unit_Nod_Venom'
GROUP BY m.my_deck ORDER BY win_rate;
```

A quick word on scope: this is strictly read-only. It never changes a request or a response, it only decrypts the one game host, and it only stores what the game already shows you in the battle log. It’s a stats notebook, not a cheat. And for now it’ll likely stay local to prevent any malicious behavior

### Wrap

So, that’s what I was able to piece together: an unfinished 2020 dump, a 2026 trip into `libapp.so`, and a re-read of the old captures with the schemas in hand. The JSON services (auth, personas, friends, alliances) are honestly pretty approachable, and the game server turned out to be too, once I realized the schemas were sitting right there the whole time

It’s worth repeating that the captures are from around May 2020 and the .apk is 1.14.0, so some of the details above have certainly drifted. I’ve tested the tracker end to end against hand-built battle logs, but if EA has changed things since 1.14.0, the `--dump` flag will save every request and response body so you can check them against you own recovered protos

Still, I hope it’s a fun look under the hood of a game I really enjoy

See you on the battlefield Commander!
