royale-proxy / cr-messages Goto Github PK
View Code? Open in Web Editor NEWClash Royale protocol definitions
Clash Royale protocol definitions
Hi, sorry if i open an issue, but is the only way to get in touch with you.
i'm a developer and i'm really interested in reverse clash royale protocol. I love clash royale and on reddit i usually datamine csv files. However i want to learn more. I know python, and with some help i can work on this project.
First of all i want to set up the proxy. I used a modified version of coc-patcher to try to patch the apk file. However the url is a problem to me. i really don't know what to write as the url in the json config file.
Can youi help me to setup my environment?
I'm not sure this is the best way to reach you about this, but here goes.
I'm looking to create a tool that can extract blow-by-blow combat logs (like what World of Warcraft produces with the /combatlog command) as a first step toward automating after-action review. I figure the safest and easiest way to do this, despite requiring a rooted/jailbroken device, is with a packet sniffer running as a separate app. But to do this, I need definitions for the messages that carry unit movement, attacks and casting. How close are you to deciphering those?
Clash Royale was updated nowadays. Could you update your content for us?
By the way, thank you for your remarkable resources!
Hi!
I'm currently working on the clan chat message structure.
The thing is that the messages are obfuscated, so we have to go on low-level contents.
This is a raw chat message content
5ef800003800000200819eec561d8ed0051d8ed00500000005416c676f7506040000000000194a276169206c6f6f746572206c65207072696e6365203a2d29
5ef8
= 24312
is the message type id (AllianceStreamEntry by cocdp).
In the part 00003800000200819eec561d8ed0
there is normally the post time, but I didn't found it...
416c676f750604
= Algou, the author's name
0000000000194a
is a separator (at least 0000000000 I think)
276169206c6f6f746572206c65207072696e6365203a2d29
= "J'ai looter le prince :-)", it's the message content
How can we get this with the json selector?
I tried to figure out some message structures, but I encountered some problems, which I hope someone else already figured out :).
I started with the message pair 14324 (SearchAlliances)
and 24310 (AllianceList)
.
First my "beta" structures:
{
"id": 14324,
"name": "SearchAlliances",
"fields": [
{"name": "searchString", "type": "STRING"},
{"name": "clanLocation", "type": "?3BYTE"},
{"name": "minMembers", "type": "INT"},
{"name": "maxMembers", "type": "INT"},
{"type": "BYTE"},
{"type": "BYTE"},
{"name": "trophyLimit", "type": "2BYTE"},
{"name": "joinable", "type": "BOOLEAN"},
{"type": "INT"},
{"type": "INT"}
]
}
{
"id": 24310,
"name": "AllianceList",
"fields": [
{"name": "searchString", "type": "STRING"},
{"name": "searchEntries", "type": "SearchEntry[]"}
]
}
{
"name": "SearchEntry",
"fields": [
{"name": "clanId", "type": "LONG"},
{"name": "clanName", "type": "STRING"},
{"name": "clanBadge", "type": "3BYTE"},
{"name": "memberCount", "type": "BYTE"},
{"name": "trophies", "type": "2BYTE"},
{"type": "BYTE"},
{"name": "requiredTrophies", "type": "?2BYTE"},
{"type": "BYTE"},
{"type": "2BYTE"},
{"type": "2BYTE"},
{"type": "2BYTE"},
{"type": "INT"}
]
}
memberCount
can only be max 50 so only 1 byte is used. No big problem, but it makes it hard reading those hex dumps.trophies
, gold
, gems
, etc.. Again from looking at the hex dumps of 24310 (AllianceList)
the trophies
field needs some math to get the real value. Something like:base_value + trophy_count * factor
base_value
and factor
changes if you compare it to different clans. Same with requiredTrophies
, but a different formula.clanLocation
can have a length between 1-3.Any = 0x00, Europe = 0x3900, Zimbabwe = 0x398404
SearchEntry
does not work as it is, because the length also changes and I don't know why, mainly because of problem 2 und 3 :).So does anyone has some hints/tips how to handle these problems or has someone done some debugging?
16002 payload length: 16 version: 0
00000000: 3e 82 00 00 10 00 00 00 00 00 0c 66 61 66 61 66 |>..........fafaf|
00000010: 61 66 61 66 61 66 61 |afafafa|
26005 Error: 'Message definition missing (26005).'
26005 payload length: 44 version: 0
00000000: 65 95 00 00 2c 00 00 00 00 00 0c 66 61 66 61 66 |e...,......fafaf|
00000010: 61 66 61 66 61 66 61 00 00 00 00 00 00 00 00 00 |afafafa.........|
00000020: 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 00 |................|
00000030: 00 00 00```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.