I initially posted this about an year and a half ago when my employer changed their exchange security policies to have 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.
How to install:
adb install -r /path/on/your/computer/to/Email.apk
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/anything else 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 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.
- 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).
- I have lost access to the server that I used to test my security bypass mods on. This should work, but post in this thread if you have any trouble.
- 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.
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]