Fraud detection for a Unity reward game: emulators, device farms and multi-accounts
A game that pays out for levels, offers and play time is a payout machine to anyone who can run it a hundred times at once. Farms run reward games on PC emulators, on cloud phones and on racks of cheap devices with auto-clickers, each copy a new account. The proof is on the device, so the question for a Unity game is how to read it from C#.
Short answer
On Android, a Unity game calls CashoutGuard's native Android SDK from C# through JNI: one dependency added with the External Dependency Manager (or the Gradle templates), Init once at startup, and Collect before signup, offer clicks and cashouts. Collect hands your callback a request ID on Unity's main thread, which your server sends with its decision request; after two seconds or on any error it gets null and your server still decides.
- Unity on Android
- The native Android SDK from C# through JNI; one helper file, no plugin to buy.
- Lines to add
- One dependency, Init once, Collect before each check.
- What it checks
- Emulators, cloud phones, root and hooking tools, auto-clickers, a VPN on the device, a device ID that survives reinstalls.
- If it fails
- The callback gets null after 2 seconds: the game never waits or crashes.
- iOS
- No native SDK yet: the server API and your offerwalls' postbacks still check every account.
Why reward games draw device farms
A reward game earns when its players complete offers and watch ads, and passes part of it back as coins that turn into gift cards or crypto. Every level reached, every offer and every daily bonus is worth a few cents, and a few cents a thousand times a day is a business for a farm. Idle and clicker games are the easiest to farm, because they need no skill: an auto-clicker or a script plays them as well as a person.
The farm's setup is the same from one game to the next: a PC running several Android emulators side by side, Android containers rented in a data center, or a shelf of old phones, each copy with its own account and a residential proxy so the IPs look like real homes. The offerwall reverses the farmed conversions weeks later, after the game has already paid the coins out.
On a small game the pattern shows in the payouts: a wave of new accounts that each reach the minimum cashout in the first days, all through the same two or three high-paying offers, all asking for the same payout method. Counting devices instead of accounts is what turns forty suspicious players into a handful of machines you can stop.
What C# alone cannot see
Unity tells a game little about the phone it runs on: SystemInfo gives a model name and a graphics card, both of which an emulator sets to whatever it likes. The proof lives on the Android side: build properties an emulator leaves, files and processes of root and hooking tools such as Magisk and Frida, the accessibility services an auto-clicker needs, a VPN active on the device. CashoutGuard's Android SDK reads those natively and sends them to the server, where they are scored with the account's history, its network and the other accounts seen on the same device or payout address.
Identity is the other half. Reinstalling the game or clearing its data gives a farm a fresh player in seconds, and an install ID counts the same phone again and again. The SDK derives a device ID that survives reinstalls, so the account asking for a cashout today can be tied to the five accounts banned on that phone last week.
The setup, step by step
1. Add the Android SDK. With the External Dependency Manager (EDM4U), which most games with ads already have, create Assets/Editor/CashoutGuardDependencies.xml:
<dependencies>
<androidPackages>
<repositories><repository>https://cashoutguard.com/maven</repository></repositories>
<androidPackage spec="com.cashoutguard:cashoutguard-android:1.1.0" />
</androidPackages>
</dependencies>Without EDM4U, tick Custom Main Gradle Template and Custom Gradle Settings Template in Player Settings, then add the repository to settingsTemplate.gradle and the dependency to mainTemplate.gradle. The SDK brings its own R8 keep rules, so minified builds keep working.
2. Drop cashoutguard_unity.cs anywhere under Assets. It calls the SDK through AndroidJavaClass, marks its callback with Preserve so IL2CPP's code stripping keeps it, and returns null in the Editor and on iOS.
3. Start it once with your public key, and ask for a request ID before signup, offer clicks and cashouts:
CashoutGuard.Init("pk_live_YOUR_PUBLIC_KEY");
CashoutGuard.Collect("cashout", requestId => {
// send requestId to your server with the cashout request;
// your server asks POST https://cashoutguard.com/v1/evaluate with your secret key
});The callback comes back on Unity's main thread, so it can start a UnityWebRequest directly. Your secret key stays on your server and never goes into the game.
4. Test it on an emulator first. Build to the Android Studio emulator, sign up, and open the dashboard: the event appears within seconds with the emulator flagged. Then build to a real phone and compare. If no event appears, check that the public key matches the site, that the dependency was resolved into the build, and that your server sends the request_id it received.
Where to check, and what to do with the answer
- Signup and login: ties new accounts to devices and payout addresses already seen, so a farm's second account is visible on day one.
- Offer clicks: the device on the click is what the offerwall's conversion is matched to later.
- Cashout: the check that saves money. Hold a cashout for review when the account shares a device or a payout address with others, or runs on an emulator, instead of paying first and learning from the reversal.
Each answer carries a decision (allow, review or block), a score from 0 to 100 and the reasons in plain words. Start in shadow mode: every decision is shown in the dashboard and nothing is blocked until you choose to. Most games switch to enforce on cashouts first. When an offerwall reverses a conversion, report it to /v1/outcomes and the accounts and devices behind it weigh more next time.
Payout addresses matter as much as devices: a farm with many phones often cashes out to one PayPal account, one gift card email or one wallet, and that shared address ties its accounts together as well.
Waiting for the next release?
The SDK ships with your next build. Until then, point your offerwalls' postbacks at a CashoutGuard relay: no change to the game. Each conversion is checked before you credit it (the player, the IP, the offer's own reversal history) and forwarded to your server as before. See the postback relay guide. Both run on the same account, so what the relay learns is kept when the device data arrives.