#!/bin/bash
#Put your sdk-dir/tools directory to your path first!

echo "Downloading the base qwertz layout from the phone..."

adb pull /system/usr/keylayout/trout-keypad-qwertz.kl ./
adb pull /system/usr/keychars/trout-keypad-qwertz.kcm.bin ./

echo "Remounting phone's filesystem rw..."

adb remount

echo "Overwrite qwerty layout..."

adb push ./trout-keypad-qwertz.kl /system/usr/keylayout/trout-keypad-v3.kl
adb push ./trout-keypad-qwertz.kcm.bin /system/usr/keychars/trout-keypad-v3.kcm.bin

echo "Reboot phone and delete temporary files..."

adb reboot
rm ./trout-keypad-qwertz.kl
rm ./trout-keypad-qwertz.kcm.bin

echo "Thank you for use! http://apoth.hu"
exit 0
