[Android Software Development] ProcessorHog:
(edited some content and added a few more instructions on May 25 2015)

I initially posted this when my employer changed their policies to require device admin access to people's phones if they wanted to access company emails or calendars. Spent a few days reading the android source code and came up with a working apk.

This app removes the annoying popup saying that you need to give it admin permissions and add a numeric password. It also does not set any additional policies other than what you already have set on your device. It does not make the email app a device admin.

The app tells the server what it wants to hear - which is they have total control over the device, but it doesn't really do anything on the phone.

DISCLAIMER: I'm not responsible if:

You get fired (a very real possiblilty - companies fire people for far less than "circumventing security" even though most of us know that regular folks' emails have nothing valuable to the competition.

If you get in other sorts of trouble for using this

if this melts your device down or breaks it in any fashion or your ROM gets corrupted.

USE THIS AT YOUR OWN RISK.

How to install:

Copy the files onto your phone storage and install them using a file explorer.

NOTES (read this before you install):

This will install easily on phones that do not have email.apk and exchange2.apk. But if you have an AOSP ROM, you may already have these in your system/app directory. In that case, you'll have to uninstall the system apps email.apk and exchange or exchange2.apk using a root explorer. I use ES explorer's "App Manager" feature and it works well for me. Once the system apps are removed, you can install the files from this post.

If you update your ROM later, the system apps will come back and may conflict with these apks (installed in /data by default) so you'll have to do the removal/installation again.

You don't need Exchange.apk AND exchange2.apk on the same phone. If you use an ICS ROM (older phones), use exchange.apk. For JB or higher, Exchange2 is the one to use. If you already have exchange2.apk on your phone, you

don't

need to install the one from this post.

I compiled this from source, so it *should* work with all devices. There are no device-specific frameworks needed for these to run as far as I know.

I've only removed the Exchange based security. If there are any other kind of services (POP/IMAP or something else) which has similar policy enforcement, it may not work. I haven't tested it with anything other than Exchange.

UPDATE - Sep 27, 2015)

I'm sorry I disappeared - I hadn't checked back in a while and it looks like I uploaded the wrong apk. Uploading the correct one for Lpllipop.

UPDATE 4 (May 25, 2015)

Patched and compiled the Lollipop email client from CM12 sources. Google remoived exchange support from the AOSP email client, so I had to turn to CM12 for the source code.

The default Exchange2.apk from a CM or AOSP lollipop build should work so I'm not uploading it here.

UPDATE 2 (May 15, 2013)

Added Email.apk compiled from 4.2.2 sources. This gives you the nice JB style expandable notifications.

Also added higher attachment size support per a user request. The default email.apk limits the size to 5MB for atachment downloads/uploads. The attached Email-JB.apk supports 100MB download/50MB upload sizes. I'm not sure if this varies by Exchange server - I spent two whole nights because I set them too high (250M) and my exchange server threw a generic error. I spent the time troubleshooting policies where it was just the attachment size all along. Cost me 8 hours of sleep :)

Exchange2.apk is not needed if your phone already has Exchange.apk or Exchange2.apk. For people who have HTC phones, this may come in useful. This file was pulled from this ROM - which is compiled from sources. I couldn't get Exchange2 to compile and work properly from sources, but since there is nothing to be changed in here, any working APK (from a JB/ICS ROM) would suffice.

UPDATE 3 (Jan 11, 2014)

Added Email.apk compiled from 4.4.2 sources. This gives you the new gmail-style email view based on the contact pics or the first letter of the sender's name.

It will say that the policy was changed once you successfully connect to the exchange server, but no policy will be applied. You can check the device admins list once you connect - the newly connected exchange server will not be in the device admins list on your phone.

Notes:

I have not made any changes to the Exchange2_4_4_2.apk. I'm just pasting it here for convenience, for people who don't have it on their phones (certain HTC stock ROMS, or others that I don't know of).

If your server has other policies which prevent you from accessing it, this probably won't show an error message before bouncing you back because I've suppressed a few of these security related dialogs.

File List

May 25, 2015

Email-5_0.apk - Compiled from CM12 sources, exchange security and popup security dialogs removed, max attachment sizes changed to 100MB download/50MB upload from 5/5.

No exchange2.apk provided for lollipop - the one already on your phone should work. If you have any problems, please get it from a CM12 or AOSP ROM.

--- Old files----

Email.APK - Compiled from ICS (4.0.1) sources.

Exchange.apk - Compiled from ICS (4.0.1) sources.

May 15, 2013:

Email-JB.apk - Compiled from 4.2.2 sources, attachment sizes increased to 100MB/50MB down/up.

Exchange2.apk - pulled from a CM10.1 port (WFTN ROM)

Jan 11, 2014

Email-4_4_2.apk - Compiled from 4.4.2 (Kit Kat) sources, still retains the increased attachment size mod.

Exchange2-4_4_2.apk - Compiled from 4.4.2 sources [this apk is not needed unless you have a phone which does not already have this]