FICTURE7 / CoCSharp

Clash of Clans library, proxy and server written in .NET [Unmaintained]
MIT License
109 stars 57 forks source link

CoCSharp.Proxy - Crashes due to new encryption #57

Closed Project-Black closed 8 years ago

Project-Black commented 8 years ago

Hello when ever i start my game the proxy crashes.

image

Then when i click on server it crashes

image

devinvisible commented 8 years ago

Did you patch your libg.so?

FICTURE7 commented 8 years ago

For the proxy it looks like you did not patch your libg.so. You can find how to patch it with some unix commands here.

For the server, it currently does not support the latest encryption but that error message with CSV files should not happen. Thanks for notifying me, will take a look at it. :]

maithanhtan commented 8 years ago

Hi Sir, Can you give me the last patched libg.so file?

devinvisible commented 8 years ago

My problem was I either didn't specify the adb push command correctly (forgot the filename in the last argument) or I tried to push while it was in use. Either way, works for me now - thanks!

tc-maxx commented 8 years ago

Hi I've patched my x86 libg.so but I get this error: error

Can you help me?

Thankz maxx

FICTURE7 commented 8 years ago

Thats odd, the proxy should not be decrypting 20100. Are you sure you did not do anything wrong while setting it up?

devinvisible commented 8 years ago

I swore I had patched mine too the first time... but after I re-pushed my patched libg.so (to the correct location) it worked without any issues. I'd help you look at this now (Webex or Google Hangout) if you had the time within the next hour.

FICTURE7 commented 8 years ago

I've patched the apk using winrar to view the assets of the original apk then I extracted libg.so from it. I took the x86 version because am running on BlueStacks, then I patched it with the commands. You could do it using a hex editor as well. After I patched it, I dropped it back in the apk and resigned it. Not sure if the resigning is important but I did. I then uninstalled the original apk which I've downloaded from Playstore then install the patched apk.

tc-maxx commented 8 years ago

Thank you guys :) I was too stupid to patch the file correctly :) Another trouble was the wrong file permissions. Correct -> 755

devinvisible commented 8 years ago

So is this working now tc?

I use Genymotion (similar to BlueStacks but lighter weight, imho). I installed the game and then used adb to pull the x86 libg.so. Because I'm working on CoCSharp, I just dropped libg.so onto Visual Studio and it opens it as a hex editor. I went to the appropriate offset (found https://github.com/clugh/coc-proxy/wiki/Key-Offsets) and changed the value to 72f1a4a4c48e44da0c42310f800e96624e6dc6a641a9d41c3b5039d8dfadc27e, the public key from our well-defined key-pair. I pushed libg.so back to where I grabbed it from. No apk signing or any of that was necessary. I didn't need to change the file permission either, but 755 would work. Don't typo the public key if you're writing it by hand.

tc-maxx commented 8 years ago

Hi dev,

Yes now it works! running

I wrote me a small universal file patcher for it. Libg.soPatch

I pushed the file back in the bluetacks shared folder and than i moved it with root explorer to "data/data/com.supercell.clashofclans/."

circa94 commented 8 years ago

Hi tc-maxx! Can you explain me how you patched the libg.so file? i am not able to patch it :(

tc-maxx commented 8 years ago

@circa94: just use the Libg.soPatch for patch it.

circa94 commented 8 years ago

i have patched the libg.so file with your tool. thank you so far! Did i have to resign now the apk? beacause when i am try to install the apk with patched libg.so file i run in the error: Apk Installation failed: INSTALL_PARSE_FAILED_NO_CERTIFICATES

FICTURE7 commented 8 years ago

If you're using the winrar method, yes you do need to resign the apk.

FICTURE7 commented 8 years ago

Everything seems to be working fine, so I guess I can close this.