[Android Software/Hacking General [Developers Only]] klaus27:
Removing Keyguard Password Policy due to Exchange (HTC Sense & Milestone & Froyo)

Introduction

Hi Everybody,

when synchronizing your HTC, Motorolla or Froyo Androids with Exchange, it might be that your device needs to be locked by a password. Having to enter this password on every unlock is quite annoying. It would be great to use Androids unlock pattern instead of the cumbersome on-screen keyboard or disable the unlock password at all. To achieve this, I have written a small app.

Unlike other workarounds, this one let's you keep using your stock unlock screen.

Android 2.1 Download (HTC/Milestone)

HTC Sense:

Install the app

Choose which mode you want (password disabled, password enabled or lockpattern enabled)

Click Save

If you have enabled "Lockpattern":

Click "Set lockpattern"

change lockpattern

click "Done setting lockpattern"

Consider a small donation

Motorola:

Attention: You need to be rooted and you need the sqlite3 binary. If the program won't do anything, the missing sqlite3 binary is most likely the cause. The easiest way is to install another ROM with busybox and sqlite3 binary installed. Otherwise:

get it from somewhere, push it to "/sdcard", open shell with "adb shell" and:

mount -o remount,rw /dev/system/mtdblock6 /system
cp /sdcard/sqlite3 /system/xbin/sqlite3
chmod 755 /system/xbin/sqlite3
chown root.shell /system/xbin/sqlite3

Then go ahead with my app.

Need help? Have a look here

Choose whether to disable or enable password

Click Save

Please report if it is possible with disabled password to set a lockpattern. If not we can try to work this out together. I don't have a Motorola Droid, so I can't test. Please send me a private message.

Please check as well if there is a popup that your device needs security enabled or whatever.

Consider a small donation

Android 2.2 - Froyo (Sense & AOSP) - Android 2.3 Gingerbreas AOSP Download

Attention: Root is necessary. You need to replace the original email app with a patched one. The email apps are usually on /system/app, so you definately need root to replace it.

Because I do not want to run into any licensing issues, I have written a toolkit named "FroyoMailUnlocker" which you can use to patch your own email app. I currently support HTC Sense Froyo Mail.apk and Android AOSP (like Cyanogenmod 6 & Cyanogenmod 7) Email.apk. As I do not own a Motorolla, I have no idea if this will work there as well. This toolkit has proven to patch all stock Email apks from Froyo and Gingerbread.

Prerequesites:

You need to have Java Runtime Environment (JRE) installed. Make sure that your Java Home is part of the %PATH% variable. You can test this by issuing start -> run -> cmd -> java -version

And this version is for Windows at the moment. I can easily do one for Linux as well if there is a proper need to.

Basic usage instructions common for both brands:

Pull the apk you want to patch from your ROM

Download the "FroyoMailUnlocker" and extract it

Move the apk to the folder "put_apk_here"

Run the file "FroyoMailUnlocker.exe"

Push the new apk from the folder "put_apk_here" to the root of your SDcard

Boot your phone into recovery

Open a shell with "adb shell" and issue the following commands:

mount /system
mount /sdcard

...continue with instructions below specific for your brand

Instructions for Sense:

cp /sdcard/Mail.apk /system/app/

reboot

Setup your Exchange account

Accept the policy, set your Pin-Code

Open up Settings -> Security -> Device Administrator

Remove device administrator

Accept every warning that your Exchange account will be wiped

Still in Security, disable screen lock

Enjoy your policy-free HTC Sense on Froyo

Consider a small donation

Instructions for AOSP:

cp /sdcard/Email.apk /system/app/

reboot

Setup your Exchange account

Consider a small donation

Appendix

Note 1:

My solution does not require a background service which runs all the time. It sets the desired configuration persistantly and survives a policy reenforcement without having to run any more. You can safely set your configuration and uninstall the app. But you need to be rooted.

Note 3:

Please take a short rest and think about why your company has applied these restrictions over their mobile users. If you say "I don't care", then this app is probably for you. If not, stick to the password unlock. :p

Important Note for HTC devices:

If you don't use the lockscreen shipped by HTC, it is possible to disable password lock, but you should not reenable password lock again! The issue appears if the lockscreen is enabled again. HTCs framework will then try to configure the HTC Lockscreen and won't find it which ends up in an error. This could prevent your device from booting up. You can fix it by booting into recovery and issuiing the following commands from an "adb shell" and reboot.

mount /system
mount /data
sqlite3 /data/data/com.android.providers.settings/databases/settings.db
update system set value='0' where name='lockscreen.lockexchange.enable';