Add comprehensive gamepad/controller support to the Downwell Android game.
This patch adds full gamepad controller support to Downwell, allowing you to play with Xbox, PlayStation, or other compatible controllers on Android devices. The patch converts controller inputs into touch events that the game can understand.
🤝 Contributions Welcome: We would appreciate contributions to make this patch work across different screen sizes! If you'd like to help improve device compatibility, please consider contributing dynamic screen size detection and coordinate scaling.
Controller Support:
- D-pad: Left/Right movement, Up→Left, Down→Right
- Face buttons (A,B,X,Y): Jump
- Shoulder buttons (L1,L2): Left movement
- Shoulder buttons (R1,R2): Right movement
Technical Details:
- Uses exact diff patching to preserve bytecode integrity
- No bytecode verification errors
- Works with Android 10.0+ devices
- Maintains original game performance
- Python 3.x installed on your system
- apktool for APK decompilation/compilation
- Java JDK for APK signing (keytool, jarsigner)
- ADB for device installation (optional)
- Original Downwell APK file
macOS (with Homebrew):
brew install apktool
brew install --cask temurinWindows:
- Download apktool from https://ibotpeaches.github.io/Apktool/
- Install Temurin from https://adoptium.net/installation
Linux (Ubuntu/Debian):
sudo apt install apktool default-jdkYou need the original Downwell APK file. This patch was designed for:
Target APK Version:
- File:
Downwell_v1.1.11001001_optimized_sign1.apk - MD5:
8c8c56037b764a9ea9806e29af582ac8 - Version: 1.1.11001001
This can be obtained from:
- Google Play Store (using APK extractors)
- Your existing Downwell installation
- APK download sites (ensure MD5 matches for compatibility)
Run the patcher script:
python3 apply_diff_patch.py input.apk output.apkExample:
python3 apply_diff_patch.py Downwell_v1.1.11001001.apk Downwell_Gamepad.apkVia ADB:
adb install Downwell_Gamepad.apkVia File Manager:
- Copy the patched APK to your device
- Enable "Unknown Sources" in Settings > Security
- Install the APK file
- Connect Controller: Pair your gamepad with your Android device via Bluetooth
- Launch Game: Start the patched Downwell app
- Play: Use controller inputs as described in Features section
The patch modifies the GamepadHandler_API12.smali file to:
- Intercept controller inputs before normal processing
- Convert to touch events at specific screen coordinates
- Handle button conflicts (e.g., cancel left when right is pressed)
- Maintain game compatibility with original touch controls
apply_diff_patch.py- Main patcher scriptgamepad_handler_diff.patch- Unified diff patch fileREADME.md- This documentation
"apktool command not found":
- Install apktool following the installation instructions above
"keytool command not found":
- Install Java JDK following the installation instructions above
"Patch failed to apply":
- Ensure you're using the original, unmodified Downwell APK
- Check that the APK version matches the patch expectations
- Verify MD5 hash matches:
8c8c56037b764a9ea9806e29af582ac8
"App won't install":
- Uninstall existing Downwell app first:
adb uninstall com.devolver.downwell_rerelease - Enable "Unknown Sources" in device settings
"Controller not working":
- Ensure controller is properly paired and connected
- Test controller with other apps to verify it's working
- Some controllers may need additional mapping software
"Buttons not responsive/misaligned":
- This patch was designed for 480x800 screen resolution (Magicx Zero 40)
- Different screen sizes may have misaligned touch coordinates
- Try adjusting your device's display settings or scaling
- Consider contributing dynamic screen size support
- The patch preserves original bytecode structure to avoid verification errors
- Uses reference counting for directional inputs to handle multiple sources
- Implements priority logic to prevent conflicting movement commands
- Touch events use specific pointer IDs to avoid conflicts with finger touches
- Screen size dependency: Touch coordinates are hardcoded for 480x800 resolution
- Potential improvements: Dynamic coordinate scaling based on device screen size
This patch is for educational and personal use only. Downwell is owned by Ojiro Fumoto and published by Devolver Digital.
For issues or questions:
- Check the Troubleshooting section above
- Verify all dependencies are correctly installed
- Ensure you're using a compatible APK version