Skip to content

TobseF/exit-game-bomb-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

61 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’£ ExitGame Bomb - Android App

Kotlin Kotlin-Coroutines LibGDX

Bomb Photo

This bomb is part of an ExitGame where payers have to deactivate a bomb by coding challenges.

The Bomb runs on an Android Device. It starts with a countdown before it explodes. It's not accessible for the players. Players have to deactivate the bomb with coding challenges. The deactivation commands are sent to an REST interface of the Bomb app.

πŸ“¦ Dowload

The players read the Bomb Instruction Manual which helps them to stop the bomb. Print it for them.

πŸ“‘ Remote Control

The players solve the puzzle by trigger unit tests which access the bombs REST API. There are two projects which can control the bomb:

  1. Bomb-Coding-Challenge.
    The client code with empty unit tests and access the the puzzle endpoints. The players try to disable the bomb remotely with this tests.
  2. Bomb-Client-App
    The admin UI which can change settings of the bomb an check the bombs state. This is of course not available for the players.

πŸš€ Start

The App runs on Android and Desktop. So you can run, test and develop it without an Android device or emulator. To start the app run the Gradle task:

  • Run Desktop: desktop > Tasks > other > run
  • Run Android: android > Tasks > other > run
  • Build Android: android > Tasks > build > build

You can also run the DesktopLauncher class direct and skip the gradle build - which can be faster. Then you have to set the Working directory of the Run Configuration to ${your-path}\bomb-app\android\assets.

After an android build, the apps apks are present in bomb-app\android\build\outputs\apk\debug and ...\release. You can install them with:
adb install -r "${full-path}\bomb-app\android\build\outputs\apk\debug\android-debug.apk"

Run Gradle tasks with at least Gradle 5.5 and ensure it runs with a Java 1.8 JDK. You can check this here:
IntelliJ > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JVM

πŸ’‘ External Hardware

πŸ’‘ The comb can be paired with external Hardware. It connects to a Phillips Hue bridge and controls lights. So lights switch to πŸŸ₯[red] if the bomb gets activated and to 🟩[green] if it gets disarmed. See HueService or yetanotherhueapi for details.

πŸ”Š To bomb also plays audio files, so it may be a good idea to connect it with an external Bluetooth speaker.

⏰ The bomb can connect to an external Arduino hardware based 7-segment countdown timer.
This optional project is available here: Arduino-Countdown-Timer. See TimerService for interface details.

βœ‰ As part of the game, a fake Email Frontend - SecureMail is used. There the players have to hack into the inbox by using the "Forgot Password" option.

⌨ Controls

Available if debug switch is on:

  • Press Space or touch ste screen to switch to the next screen.
  • Press Enter to trigger an action on a screen.

πŸ”§ Config

The settings screen allows you to change the bombs configuration.

Setting Description
Bomb time * The time before the bomb explodes in minutes.
Timer IP IP Address of the external timer.
Hue IP IP Address of Phillips Hue bridge.
Hue Room Name of the room with the Hue Lights. Change it in the Phillips Hue App.
Hue Key API Key from a paired HUE. Pair the Hue to retrieve it.
Debug If selected, you can switch the screens by Space or touch.
* The Bomb time can be also changed by the REST interface.
Button Description
Reset Hue Clear the Hue API key, so you have to pair the Hue again.
Pair Pair the bomb with the Phillips Hue bridge. Creates a new API key.
Start Start the bomb in inactive mode.

πŸ”Œ Endpoints

The bomb can be controlled by a REST endpoint on port 5000.

Endpoint Type Description
start PUT Start the bomb with a specific time in minutes.
stop PUT Stops the bomb the bomb with the time.
reset PUT Start the bomb with a specific time in minutes.
info GET Reads the bomb state: screen:LoginPuzzle;finish:1566910090308.
connect PUT Try to solve the the ConnectPuzzle.
numbers PUT Try to solve the the NumbersPuzzle.

For endpoint details check the com.libktx.game.endpoint and com.libktx.game.puzzle packages. You can find a sample implementation to control the bomb in the Bomb-Client-App. If you want to solve the puzzles, check out the Bomb-Client.

🐞 Troubleshooting

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: 
Couldn't load file: icons/icon_16.png

You forgot to to set the Working directory of the Run Configuration to ${your-path}\bomb-app\android\assets.


Could not resolve all files for configuration ':core:compileClasspath'.
   > Could not find io.github.tobsef:yetanotherhueapi:1.3.0.

You need the yetanotherhueapi maven dependency. For now it may be not present int the maven central. So check it out and manual install it with:
git clone https://github.com/TobseF/yetanotherhueapi.git
mvn install -DskipTests


android:mergeDexDebug FAILED
DexArchiveMergerException: Error while merging dex archives
Program type already present: com.libktx.game.AndroidLauncher

Run a android > Tasks > build > clean with gradle, and try it again.


Error running 'Run Desktop': Class 'com.libktx.game.desktop.DesktopLauncher' not found in module 'desktop'

Just launch it again.


Exception in thread "main" java.lang.UnsupportedClassVersionError: com/intellij/junit5/JUnit5IdeaTestRunner : 
Unsupported major.minor version 52.0

Ensure you run unit tests with an Java 1.8 JDK.

About

πŸ’£β° Bomb App for an Exit Game

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages