Like to be free? ... then: Fight for Freedom
Hacks for Motorola Defy (MD525)
Here are some information and files about hacks on the Motorola Defy
which cost me some time. Most should work for other android phones as
well, especially the kernel modules which should work with all androids
running 2.1 / Eclair. I hope it is helpful for someone out there.
Warranty
This information is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Your are hacking on your own risk.
USB OTG
Officially OTG is not supported. However, on the Internet are some
information that it works with some hacks. On my Defy it
works. Requirements:
- Defy with old android: 2.1 (Eclair), Kernel 2.6.29
Angler Gábor found out, that Motorola has disabled the OTG
support in kernels of later versions. This was tested on Android
2.2 (Froyo) with the kernel 2.6.32. The OTG support cannot be
loaded by kernel modules. Because of the closed boot-loader it
is not possible to exchange the kernel on the Defy (As far as I
know Canogenmod just replaces the system by replacing the init
but not the kernel itself). Unfortunately a downgrade to the old
kernel version is not possible. Thank you, Motorola!
- Rooted Defy with shell excess
- USB OTG cable (German)
- Powered USB Hub
- Mobile USB AccuPack to power the USB Hub (only if you need
to be independent of wall sockets, e.g. for Dead Dropping)
- Kernel Modules
- Script to load modules and mount
the devices.
It assumes that quicksshd is installed, that kernel modules can be found under /data/data/com.teslacoilsw.quicksshd/home/ko/, and that busybox can be found under /data/data/de.schaeuffelhut.android.openvpn/confs/busybox is available. Please adapt the script according to your environment.
Howto
- Switch off the Defy
- Plug in the OTG adapter, connect the USB Hub and power it
with an
external power source, because the defy does not deliver
enough energy to power any device
Please note that for me it was
not required to toggle any bit of the micro usb-connector as
suggested by other websites.
- Boot the Defy
- Wait for the external storage (micro sd card in defy) to be checked
- Connect USB-sticks, disks, etc (more than one at a time
possible)
I tries a cdrom-drive. But it was very
unstable. To use cdroms, copy the corresponding kernel-modules and uncomment the lines from
the script.
- (label mount) start the script, wait for command line
- Use your preferred filemanager to access the drive using the
corresponding subfolder under
/sdcard/mnt/ (/mnt under non-root-mode). e.g. with Ghost Commander File Manager Ghost Commander File Manager
- After your finished, type C-d or exit into the shell to
umount the external drives - or just reboot your Defy
- You can remove the drive from the hub and attache another
one. In this case please continue on (label mount)
- If you once removed or unpowered the hub you have to start
with the first step to mount another drive
- Remove the OTG cable
- You can reboot the Defy to ensure all unused kernel modules
are freed and the system is in a defined state. (I reboot the
most of the times, but had no problems without the reboot)
Hints
- A keyboard can be used to test the OTG mode without
installing any kernel-modules. Just connect the keyboard to
the hub and alphabetic keys should show up in the text input if
pressed.
- You should use a powered USB-Hub and
not an home-made Y-shaped USB cable.
The USB Hub will not transfer the power back to the
phone. Furthermore, it is not sufficient to connect three
lines of the phone (GND, and 2x data)
together with a +5V (from another source) to an usb-device,
because the usb-device will tell the android-phone, that it
needs extra power, and the android-device will deactivate
it. You really need a good powered usb hub!
- In my experience on the Defy it's
important that the USB hub is connected (and powered) before the
android-phone is switched on. You can than connect, remove,
and reconnect other USB-devices later to the hub.
But if you once removed the usb hub, you have to reboot th phone.
References
OpenVPN
I can't believe that google does not support OpenVPN
out-of-the-box! However, it can be use:
All you need to do is to install the app, load the kernel module,
configure and start...
Filesystem Encryption
- Kernel Modules
- cryptsetup Binary
- You could create another partition on the internal micro sd
card. This can be done with cfdisk under a normal Linux. On my
Defy /dev/block/vold/179:1 is the first partition of the micro
sd card, :2 would be the second and so on. But you can find
out this with the df command on the shell.
- LUKS works as well
- Please refer to the cryptsetup-man-page. Examples can be found in the Internet.
Execution of Scripts
Scripts can be executed from the normal user interface
Other Binarys
Kernel Modules
I compiled most of the kernel modules. Maybe need one.
Kernel Modules for
Android 2.1 on Defy (may work with others)
Last modified: Fri Apr 13 15:27:48 CEST 2012