# The Mobile Game That Trusted My Phone Too Much
*Or: a week of reverse-engineering a game I've played for eight years, expecting to find a trivial cheat, and finding something more honest instead — an auth layer made of theater, standing in front of a server that actually fought back.*
---
I've played Archero for eight years. It's a mobile roguelite built, like the whole genre, around grind: the later chapters ask for more runs than I have thumbs or evenings for. Normal people accept this. I got curious about the machinery underneath it — when I finish a stage, what exactly does my phone tell the server, and how much of that does the server take on faith?
That question turned into a week-long reverse-engineering project. It did not go the way I expected. I thought I'd spend a day finding a soft spot and the rest writing it up. Instead I spent most of the week just getting to the point where I *could* ask the question, and then the answer turned out to be more interesting — and more to the game's credit — than "I win."
I'm writing up the journey and the finding. I'm deliberately not publishing a working cheat, the signing secret, or account identifiers, and I'll explain that choice near the end.
## It didn't start as a protocol attack. It started with "can I even run my own build?"
Before you can watch an app talk to its server from the inside, you usually have to repackage it — decompile, change one thing, sign it with your own key, reinstall. I pulled the game's XAPK apart into its base APK and its split packs, made a trivial change, re-signed everything with my own debug key, installed it, and launched.
It launched. Then it killed itself. Then it launched and killed itself again, forever.
Buried in the native code was a self-integrity check: the app computes the SHA-1 of its own signing certificate and compares it against a hash pinned inside the binary. Mine didn't match (of course it didn't — I'd re-signed it), so it printed `sign failed!!!`, called `exit(0)`, and started over. A game stuck in a loop of refusing to be itself.

*Reconstructed from logcat; certificate hashes redacted. The fix was to point the pinned hash at my own key instead of fighting it.*
The fix is conceptually simple — replace the pinned hash with the hash of the key I was actually signing with — but finding the right constant and getting it to stick was the first of many small archaeology sessions.
## Build hell, a brief tour
Rebuilding an Android app that was never meant to be rebuilt is its own genre of suffering. The resource compiler exploded on filenames an ad SDK had shipped with literal `$` characters in them. The older `aapt` refused the resource table outright with the gloriously unhelpful `First type is not attr!`. The newer `aapt2` wanted a specific build-tools version that wasn't on my `PATH`.

*The rebuild, on about the fifth attempt. Strip the `$` filenames, force the newer resource compiler, and it finally produces an APK.*
None of this is interesting on its own. I mention it because this is what "reverse engineering" actually is most of the time: not a cinematic breakthrough, but an afternoon spent convincing a toolchain to do the obvious thing.
## The black screen that ate two days
Signed, installed, and — according to logcat — *running*. The game logged its launcher waking up. It successfully pinged its own API host. It started wiring up the UI.
The screen was completely, perfectly black.
This was the low point. The process was alive and networking happily, and showed me nothing. Two separate problems were tangled together. First, an old split I'd left installed from an earlier experiment was loading an instrumentation gadget, and the main UI thread was getting stuck inside it during engine startup — a classic Application Not Responding, except the "not responding" was invisible because there was nothing on screen to not respond to. Second, even after I fixed that, the renderer was throwing shader link errors and a stale local session was poisoning the first frame.

*Alive, online, rendering nothing. The cure was embarrassingly mundane: clear the app's local data and let it start clean.*
The thing that finally broke it loose was clearing the app's local data so it rebuilt its session from scratch. The game came up, rendered the tutorial, and was playable. Two days to see a picture I'd normally take for granted. Only *now* was I actually in a position to study the protocol — which had been the entire point.
## Now let me see the traffic
With a build I controlled, I did the boring first move: point the game at an intercepting HTTPS proxy and read what it says.
Nothing. Not "nothing interesting" — *nothing*. The game's own traffic refused to appear while everything else on the device flowed through fine. That's the signature of **certificate pinning**: the app ships with its own idea of what the server's certificate should be and rejects my proxy's substitute, no matter how trusted my CA is to the operating system.
Pinning is the correct thing for a game to do. It's also a wall, and getting past it on your own device is most of the work.
## Getting inside the app instead of in front of it
If you can't sit *between* the app and the server, you sit *inside* the app. On a device you control, a dynamic instrumentation toolkit lets you attach to the running process and replace functions at runtime — including the one deep in the TLS stack that decides "is this certificate the one I pinned?"
This was fiddly in a way specific to Unity games. The networking didn't go through the usual Android/Java TLS classes where every tutorial's one-liner works — it went through the engine's own native stack, so the pin check lived down in native code. I had to find that function and neuter *it*, not the Java layer everyone writes hooks for. Once the right check always answered "yep, looks good," the game's requests finally showed up. And they were not JSON.
## The packets aren't text
What came across the wire was binary. After lining up enough captured requests, the framing fell out: a marker byte, a little-endian message-type number that says *what kind of request this is* (log in, enter a battle, settle a battle, claim a reward…), a length, and then a body. The body itself opens with a small fixed header — protocol version, device identifier, account identifier — followed by the fields specific to that message type.

*The shape of a request. I'm showing the structure, not the magic constants — the layout is the educational part; the salt isn't.*
Mapping message numbers to meanings was just patient cross-referencing: do a thing in the game, watch which number appears, write it down. Within an afternoon I had a little dictionary of the ones I cared about. But every request carried one more thing I couldn't fake without understanding it.
## The signature
Every request carried a check value — a hash the server verifies before it will even look at your packet. Get it wrong and you're rejected outright. This is the thing standing between "I can *read* the protocol" and "I can *speak* it."
Finding how it was built meant going into the game's own compiled code and walking through the routine that computes it. I'll describe the *shape* without handing over the recipe: it's a salted hash — a constant baked into the client, concatenated with a timestamp and the request body, run through SHA-256. Two things about the implementation stood out:
- **The salt is a static constant in the binary.** It's identical in every install, forever, until they ship a new build. A secret that every copy of the app already contains is a secret only from people who haven't looked.
- **The timestamp window is generous.** The server accepts a loose range around "now," so a signature isn't tied to a single instant.
Together these mean: anyone who can open the APK can produce a valid signature for *any* body they like. Which brought me, finally, to the question I started the week with — how much does the server actually check?
## The part I expected to be the whole story
First I tested the weakest possible claim: is a signature fresh-only, or can it be reused? I took a perfectly ordinary read request, signed it, got my `HTTP 200` and a few hundred bytes of account state back. Then I re-sent the *exact same request* using a signature and timestamp I'd captured roughly **twenty-two hours earlier**.

*A signature from the day before was accepted as if it were minted that second. No freshness window, no nonce.*
It came back `HTTP 200`, same shape of response. A day-old signature was as good as a new one. So the authentication story was, by this point, pretty damning: a static secret everyone has, plus no replay protection. In a lot of write-ups this is where the author declares victory and drops a script.
I almost did. Then I actually pushed on the thing that matters — the economy — and the game stopped being a pushover.
## The part that made it a real story: the server fought back
The interesting messages are the ones that *change* something: finishing a battle and reporting the result, converting currency, claiming a reward. So I carefully probed the battle-result path against my own account, and the server turned out to have a whole second line of defense that has nothing to do with signatures.

*Every state-changing path I pushed on pushed back — a server-side anti-cheat value, an idempotency gate, and a transaction failure on anything out of order.*
Three things happened, and all three were the server doing its job:
- When I got the packet's field order slightly wrong, it rejected it as malformed instead of guessing what I meant.
- When I sent a currency value, the server **compared it against its own reference** and flagged the mismatch — a real server-side anti-cheat check on the exact field I'd have wanted to forge.
- When I replayed a battle-result transaction, it answered `DATA_EXIST` and did nothing. An **idempotency gate**: the same transaction can't be processed twice. Coins, diamonds, level, max stage, XP — every delta came back zero.
So here's the honest verdict, which is more nuanced than the clickbait version of this post would be:
> The **authentication** is theater — a forgeable static secret and no replay protection, a genuine high-severity flaw. But authentication is not the same as authorization or validation, and on the paths that touch the economy the server **does** validate server-side and **does** enforce idempotency. A broken front door, yes. But the valuables aren't sitting in the hallway.
That distinction is the finding. I confirmed a real authentication weakness, and I confirmed that it does **not**, by itself, amount to a proven economy exploit — because there's independent server-side checking behind it. I stopped there deliberately: no other accounts touched, no purchases, no reward claims, nothing crawled. The point was to understand the design, not to drain it.
## Why "auth ≠ validation" is the whole lesson
This is the most common real-world security mistake there is, and it shows up far outside games: a system that spends enormous effort proving *who* is talking (pinning, signatures, tokens) and treats that as proof of *what they're saying*. It isn't. "This request came from a real client" tells you nothing about whether the request is true.
Archero gets the second half more right than the first. The cryptography out front is impressive-looking and, on its own, bypassable — but behind it the server still keeps its own books on the numbers that matter. The lesson for anything you build: count how much effort your system spends proving identity, compare it to how much it spends checking whether the claim is *possible*, and worry when the second number is zero. Here it wasn't zero. That's why I don't have a cheat to show you.
## Why I'm not shipping the tool
I built scaffolding to drive all of this end-to-end against my own account, because that's how you test any of it. I'm not releasing it, and I'm not publishing the salt, the exact signing routine, or account-level specifics. The difference between *"here's how a system can get authentication wrong"* and *"here's a turnkey thing you can point at the live servers"* is the difference between security writing and handing strangers a lever against someone else's production service. The first is worth sharing. The second isn't mine to give away — and given where the server actually holds the line, it wouldn't even deliver the fantasy people would download it for.
So this is where the customary **Try It Yourself** repo link goes, and this time, on purpose, there isn't one. The transferable part was never the script. It was the shape of the mistake, and the shape of the thing the game got right.
## One more thing
I've been playing this game for eight years, and I've paid for it the whole way — the small purchases, the season passes, the occasional weak-moment gem pack. Taking a week to pull it apart down to the bytes isn't theft from it; it's the most attention I've ever paid it. If anything, understanding exactly how it defends itself — and finding that it defends the part that matters — made me respect it more, not less. Spending this much of myself trying to take something from a game I love is, in its own backwards way, the most I've ever given back to it.
Now if you'll excuse me, I have some stages to clear. The slow way.