Showing posts with label hacks. Show all posts
Showing posts with label hacks. Show all posts

Friday, 8 August 2014

How to hack Clash Of Clans: Unlimited Shield [UPDATE]

Introduction
*updates on the bottom
I've played for over a year with Clash of Clans: a very nice mobile games.
Day by day, the game become more and more difficult to play without spending money.
It's the classical in-app purchase free game mechanism: pay to survive.


The hack
During the game you have a limited shield, that can save your village from attacks for others player for a max of 16 hours.
Of course you can extends the shield with money.
When you have no shield, the others people can't attack you if you are online and connected.
My first attempt was to put the display of the phone in a "never sleep" mode and leave the app open but this was not a working solution, clash of clans see that you aren't do nothing and it disconnects.

Later I was thinking about an hardware solution with arduino, that could simulate at least the swipes on the touch screen, something like this hack for another game: https://www.youtube.com/watch?v=SnUH6f_Mv8o but there was an easier solution.

UiTesting with UiAutomator
One of the android's tools is called uiautomator http://developer.android.com/tools/testing/testing_ui.html it is used to test UI on apps, so it is possible to write test/programs that simulate click, swipe and other actions on apps running on the phone.
What I have done, it has been write a simple uiautomator test that:

1 - it presses home
2 - it searches clash of clans in the list of apps
3 - it launches clash of clans
4 - it waits 15 seconds for the app to start
5 - it does swipes movement
6 - it waits some seconds
7 - it repeats from 5

I tested the app on my phone (no root required) and my village was opened for over 10 hours(see update #) without any disconnection and of course, none attack! :)


Update #1: 18 Aug 2014
Yesterday I posted on reddit this post, to understand the reaction of some players and what they are thinking about it.
On reddit I've discovered that after 6 hours of game, Clash Of Clans automatically disconnect the client for 5-10 minutes... but, my hack (I'm lucky) keep on try to reconnect during this period and at the end of this period it is correctly reconnected.

I have also discovered there are some hacks out there that works with rooted phone and works in similar way.

Sunday, 24 March 2013

Putting a webserver inside a Phone!

The Project SmartBerryBox

This project born during an hackathon at CodeMotion Conference in Rome.
Thanks to this project I won a wonderful BlackBerry Z10.
The idea is showed in the following video:



What does it happens?
It is an HTML5 game running in the browser.. and the phone, a blackberry 10 devalpha device, it is used as a pad/controller.

This project is full of different tecnology:

  • a standalone webserver: mongoose runs inside the phone
  • the communication between the phone and the browser is made with websockets
  • html5, canvas, jaws js, javascript for drawing and moving the game

How?
1. The server is inside the phone and the browser download the html5 game files, at first connection; like a visit of an html page.
2. The browser establish a websocket connection with the web server.
3. Whenever an event from the controller/the phone touchscreen, occur, the phone send with websocket the controller event(left,right,fire pressure) to the html5 game that update the movement of the player ship, on the canvas.

Why?
Your phone can do more and more..
Don't you want to use those CPU Cores for something useful and funny? :)
Smartphones are replacing portable console but they can replace home console, at least for casual gaming!
And this is just Today!
You just need a browser with HTML5 and websocket capability and your phone.
The browser (inside a smartTv for example) became the screen, the phone is the pad.
Your phone is something that it is able to adapt to different context and games,  just changing UI or use different hardware like the accelerometer.

Imagine a multiplayer game context, where every phone is connected each other and it is able to act as a controller: you and your friends playing in front of the tv: a quiz game, a car race, etc.
Cool, isn't it?

All the code I did, run on a BlackBerry 10 device, but since it is full of opensource tecnology it is easy to port the code to Android, maybe IOS.. with Native SDK.
The fundamental part is running mongoose with USE_WEBSOCKET flag.

I don't think windowsphone is able to run it, due to platform limitation: no native c/c++ code..as I know..

I will give all the code to the community in the next days, a blog post will follow and the source code on github also.
Do you like it?