-
Notifications
You must be signed in to change notification settings - Fork 20
The Proxy way for Noobs
- Get an android emulator. I recommend Nox (works fine on Windows and on Mac). Obtain the root permission on the emulator. In Nox is easy as that
Mac Version |
---|
Windows Version |
---|
-
Install the patched ClashRoyale apk . To use the proxy way is needed a "special" version of the Clash Royale apk that you can download from here. (Important: this method only work with the most updated version of the apk that you can find here).
-
Install Host Editor on the emulator. Host editor is an app (works only with root permission) that can redirect the traffic coming from one of your app to whatever you want. We are using Host Editor to redirect traffics from Clash Royale app to our own computer (where the proxy will be running) and then the proxy will be connected to Clash Royale servers.
- Find the local IP of your computer (e.g. 192.168.0.5). Open Host Editor and click on
Add Host
. Put in theIP Address:
the local IP of your computer and in theHostname:
game.clashroyaleapp.com
. And then pressAdd Hostname
.
Two proxy are been developed for Clash Royale: one is written in Python, the other in JavaScript. The functions in both proxy are very similar and the only things that change are the commands
Important: the JavaScript version is now under maintenance break, only python version works at the moment.
- Download on your computer cr-proxy. The proxy will intercept all the traffic between Clash Royale app and Clash Royale servers and will also save the packets. You can download the proxy using the git commands:
git clone --recursive https://github.com/S1M0N38/cr-proxy
cd cr-proxy
pip install twisted pynacl pyblake2
- Inside the cr-proxy folder, create a file called
config.json
and inside the file write:
{
"replayDirectory": "replay"
}
-
Inside the cr-proxy folder, create an empty folder called
replay
. Here will be stored all the packets that will be caught from the proxy. -
Ok, ready to start? To start the proxy type the command:
python proxy.py
This command will activate the proxy and also save the packets to replay folder. -
Start Clash Royale app on the android emulator and all should work. You should see the packets intercepted by the proxy print out in the window where proxy is running. You can play Clash Royale as you always do but a new Clash Royale profile is created.
The packets contain many information about the game status and user data (for more info visit cr-messages) but we are interested in a specific packet: 10101.bin. This packet is sent from the Client (Clash Royale app) to Server (Clash Royale servers) and contain the information about the login. In particular the accountId (low and high) and the passToken. Here is and example of decode 10101.bin packet
Login: {
"accountId": 48733533517,
"passToken": "yywg123jb23p6phncwe9f34ca3de7kd2nzzg2hxj"
...
To decode the 10101.bin packet you need to find the last 10101.bin packet in the directory (e. g. 0025-10101.bin) and then from the cr-proxy directory, type the command:
python replay.py 25
In this case I typed 25
because 0025
came before of my last 10101.bin packet. In fact every packet caught by the proxy is save in the replay folder and numerated (lower is the number, older is the packet).
The accountId and (Id low + Id high) are the same thing, just a different representation.
-
Download on your computer node-cr-proxy. The proxy will intercept all the traffic between Clash Royale app and Clash Royale servers and will also save the packets. You can download the proxy using the git commands:
git clone https://github.com/royale-proxy/node-cr-proxy
cd node-cr-proxy
npm install
-
Inside the node-cr-proxy folder, create a file called
settings.json
and inside the file write:
{
"serverKey" : "980CF7BB7262B386FEA61034ABA7370613627919666B34E6ECF66307A381DD61"
}
This is the server key, when Clash Royale will be update the key could be changed. Came back here to find the most updated key
-
Inside the node-cr-proxy folder, create an empty folder called
packets
. Here will be stored all the packets that will be caught from the proxy. -
Ok, ready to start? To start the proxy type the command:
node index --dump ./packets
This command will activate the proxy and also save the packets to packets folder. If you want to know more type commandnode index --help
-
Start Clash Royale app on the android emulator and all should work. You should see the packets intercepted by the proxy print out in the window where proxy is running. You can play Clash Royale as you always do but a new Clash Royale profile is created.
The packets contain many information about the game status and user data (for more info visit cr-messages) but we are interested in a specific packet: 10101.bin. This packet is sent from the Client (Clash Royale app) to Server (Clash Royale servers) and contain the information about the login. In particular the accountId (low and high) and the passToken. Here is and example of decode 10101.bin packet
accountId: {low: 1162291,
high: 33,
unsigned: false},
passToken: "ba1cc8k293f2wxssf3rzhyad7a386ghbcazs6s56",
...
To access decode the 10101.bin packet, from the node-cr-proxy directory, type the command:
node index --replay ./packets/10101.bin
If you want to decode other packet, substitute 10101.bin with whatever packet you want to decode.
When you have completed the tutorial and played at least one match versus a real opponent, you can donate the Clash Royale account just created to cr-api sending the credential to Selfish on Discord.
If you want to create more Clash Royale accounts, after you save the credential of the account just created (node-cr-proxy: accountId low, accountId high, passToken) (cr-proxy: accountId, passToken) , you can go in the android setting and then delete data for Clash Royale app. Doing this when you open the Clash Royale app again, a new account will be created.