⚡️Power Struggle

A two-player tap battle over USB-C where you physically steal battery power from your opponent

GitHub ↗

It's almost time for the last train home, both of you have phones less than 10% charge, and at this rate, neither of you will make it back. You'd rather siphon the last drop of battery from the other person so at least one of you survives and makes it home. Power Struggle is a competitive minigame where the winner literally steals battery charge from their opponent.

The winner drains battery power from the opponent
The winner drains battery power from the opponent

By hacking the USB Power Delivery specification, the app allows two smartphones connected via a single USB Type-C cable to physically battle over electric current. Launch the app and initiate the match: you both tap your screens, and whoever taps faster drains power from the other. Taking the lead dynamically triggers a role swap between USB-PD Source (provider) and Sink (receiver).

(Incidentally, in real-world testing, the supplying phone drains at around 1500mA, while the receiver phone only takes in roughly 400mA.)

How It Works

A smartphone's USB-C port can function as either a power source or a power sink. When two phones are connected with a cable, the USB Power Delivery protocol negotiates which device provides power. The standard also supports dynamic role-swapping while connected (which is the feature behind Android's built-in "Charge connected device" toggle.)

Power Struggle triggers this role swap directly from within the game. Because this operation normally demands privileged system access, the app executes the system command (dumpsys usb set-port-roles) via Shizuku, which delegates ADB developer-level permissions without requiring root. Since role switching is negotiated across the link and the peer device merely approves the request, this setup only needs to be configured on one of the two phones. The swap completes in roughly 0.5 seconds, immediately reversing the flow of approximately 4.5W of electrical power.

Game data is synchronized across the same USB cable. The host device acts as the USB host and puts the peer device into Android Open Accessory (AOA) mode. This establishes a low-latency communication channel between the two handsets to exchange tap counts and match state. Because the USB specification isolates the power rail (VBUS) from data lines, the communication stream remains uninterrupted even as the direction of power delivery violently alternates back and forth.