[APP MOD] Exchange Security Bypass (No PIN/No Admin) - Android 4.1+ [v6.0]

Search This thread

buffal0b1ll

Senior Member
Sep 5, 2012
2,643
4,367
Baltimore
Google Pixel 2
Google Pixel 2 XL
D2vzw carbon ROM 4.3.1 firmware. Downloaded and installed the 2 4.4 apk. They both upgraded existing 4.3 no pin Email. Had to re authenticate with exchange server and now email and calendar are syncing. Contacts NOT syncing. Tried reboot, toggling the sync contacts at the app and accounts level, clearing app data for both contacts and contact storage. Any ideas?

OK so I solved my own Exchange Contacts problem, but it worked out really weird and in a way that I'm actually quite please with.
I took the steps in the post above and then gave up for a while. Checked the phone a few hours later and still no Corporate Contacts syncing;-(
So I decided to delete the Corporate account and set it up again (like maybe I should have deleted my Corporate account before every installing the Email and EmailExchange apks, right?). THIS TIME when I set it up I made one setting different--I chose the "SSL/TLS (Accept all Certificates)" instead of "SSL/TLS", but I have no idea if this really made the game changing difference.
So the usual prompts came up and Email started syncing and I went over to contacts to check the progress. WHOA! There's contacts syncing, but those aren't actually in my Corporate address book---wait, I recongnize some of them---what, I don't believe it, all of my autocomplete "NK2" contacts from my outlook are moving into my Android Corporate Contacts.
At first I didn't like it. I thought it was a problem. This never happened in 4.1, 4.2, and 4.3. But then I realized that I could benefit from this. Email's biggest weakness was that I always lacked the ability to do much more than reply to messages because I don't have many of my non-global address book contacts added in my Address Book. I just rely on the Auto Complete in the TO: field that really only ever worked on a PC using the MS Outlook. NOW I have all those contacts at my fingertips on my phone, and I hide them from the People queue by ticking show only Google contacts. If I need to call one of the dozen Corporate Contacts I actually ever bothered to add to my address book, they still come up in a Search in People.
Not sure if this blessing in disguise will persist when my favorite ROM jumps the shark to 4.4, but right now in CARBONROM 4.3.1 with 4.4 EMAIL I'm loving it!
 

sshark

Senior Member
Sep 17, 2008
672
44
Can someone post unmodified Email.apk and EmailExchange.apk which will be backward compatible with4.3?

My company has notorious sec policy which checks implementation of policy every so often and when the server doesn't find or suspects tampering, the email stops syncing!

At least I would like to enjoy latest version of AOSP email if not without sec policy override feature.
 

prabhjots

Senior Member
Jul 7, 2012
492
115
Toronto
Can someone post unmodified Email.apk and EmailExchange.apk which will be backward compatible with4.3?

My company has notorious sec policy which checks implementation of policy every so often and when the server doesn't find or suspects tampering, the email stops syncing!

At least I would like to enjoy latest version of AOSP email if not without sec policy override feature.

This modified email reports to the server that everything is in order, while making no actual changes to security settings.

When server checks for security settings, you will very often see a notification,
"server updated security settings for this account; no user input required."
Enjoy :)

Sent from my GT-I9300 using Tapatalk
 

idic

Member
Jan 13, 2012
14
2
Latest version up and running successfully on KitKat (Nexus 5). Looking forward to having it updated with the new features (swipe to delete etc.) of 4.4!
 

sshark

Senior Member
Sep 17, 2008
672
44
Not to be rude but after a day or so my email stops syncing with the server.

I noticed that this problem persisted for all versions.

Going back to original question, can someone upload 4.4 Kitkat ASOP email app modified to work on 4.3? :(:confused:

Sent from my Nexus 4 using xda app-developers app
 

buffal0b1ll

Senior Member
Sep 5, 2012
2,643
4,367
Baltimore
Google Pixel 2
Google Pixel 2 XL
Going back to original question, can someone upload 4.4 Kitkat ASOP email app modified to work on 4.3? :(:confused:

Sent from my Nexus 4 using xda app-developers app
What you are asking for already exists.

The 4.4 apks that you download in the post above will upgrade your Email and Exchange services on 4.3 and work with your calendar and contacts too. I advise deleting your corporate account before upgrading.



Sent from my SCH-I535 using Tapatalk
 

luisjoseb

Senior Member
Jul 28, 2008
381
104
Medellin
luisjoseb.googlepages.com
I managed to build Email & Exchange2 apk based on 4.4_r1 aosp code plus craigacgomez's patch, it works with {ROM} 4.4 MAKO-odexed.NEXUS 5 port , I attached both, and below is the installation instruction in the adb shell with root privilege.
Given you adb push both apk to /sdcard/app/
1. mount -o remount,rw /system
2. cp /system/app/E* /sdcard/backup
3. cp /sdcard/app/Email.apk /system/app/EmailGoogle.apk
4. cp /sdcard/app/Exchange2.apk /system/app/Exchange2Google.apk
5. chmod 644 /system/app/E*.apk

All credits go to craigacgomez, i just shameless build the package:)

Thanks for share it, is working fine in 4.4 MAKO-odexed.NEXUS 5 port

I made a flasheable ZIP to flash with CWM o TWRP
 

Attachments

  • email-aosp-kk.zip
    3.9 MB · Views: 525

felixjai

Member
Jan 22, 2008
48
7
Hong Kong
For me the apks for 4.4 are crashing after server-settings tab on my NEXUS-5 are there apk's out there for nexus5?

cheers

Edit: working after removing odex files?! strange isn't it?

How did you get it to work after deleting the odex files? After deleting the odex files, the Email app is not showing up on my Nexus 5 anymore. :confused:
 

jayboyyyy

Senior Member
Oct 26, 2012
947
181
How did you get it to work after deleting the odex files? After deleting the odex files, the Email app is not showing up on my Nexus 5 anymore. :confused:

you can either remove or rename your old email.apk and exchange2.apk as well as their odex files then put these new email files in there with root explorer or whatever. change permissions to rw-r-r. then reboot the phone and it should all be working. If no email app appeared after your removed the odex files, that is because you either didn't change permissions to the new apks you moved into the system/app or because you never moved them in there in the first place, they don't need odex files to run.
 

felixjai

Member
Jan 22, 2008
48
7
Hong Kong
you can either remove or rename your old email.apk and exchange2.apk as well as their odex files then put these new email files in there with root explorer or whatever. change permissions to rw-r-r. then reboot the phone and it should all be working. If no email app appeared after your removed the odex files, that is because you either didn't change permissions to the new apks you moved into the system/app or because you never moved them in there in the first place, they don't need odex files to run.

It is working now. I just needed to restart my launcher for the Email app to show up. Thanks guys.
 
Last edited:

jayboyyyy

Senior Member
Oct 26, 2012
947
181
I tried it again and still not working. I have both apks in /system/app/, I did chmod 644 E*, and the permission is showing rw-r-r

My Nexus 5 is still running odex pure stock rom with root. I thought we need odex files if the rom is not deodexed, right?

im not a guru but I'm almost positive you don't need odex files because the deodexed apk doesn't use them to run. Meaning once you take the odex and the apk file you compile them into one apk that is now a deodexed apk. This would be the apk that is in this thread. Odex files are called onto by the apk but if it is a deodexed apk then it is built into and does not call on an odex file. I am on a moto x which has odex'd apks and i merely renamed my old email and exhcnage apks as well as my odex email and exchange files with ".bk" at the end so i can re install them easily if necessary then put the new apks in the system/app then gave them the permissions you said, then rebooted the phone and the new apks are installed on boot.
 

Evilmonkee

Member
Oct 31, 2013
9
0
I still have not been able to get this to work on my AT&T Galaxy Note 3 JB4.3. My phone has been rooted on the stock TouchWiz rom using the Universal Root method from this forum(to avoid triggering KNOX).

I'm pretty darn sure I have followed all the directions correctly. First I deleted all my email profiles and rebooted, just to be sure. The files in the system/app folder on my phone are named SecEmail_J.apk and SecExchange.apk. I renamed both files by adding .bk to the end. I copied the Email.apk and Exchange2.apk files to this folder, renamed them the same as the originals, and set their permissions to rw-r-r. Then I rebooted again.

Upon reboot, the email app keeps crashing and the phone becomes unstable because of this, until I restore the original files and reboot again.

As an aside, I've been a long time iphone user until last week when I got my first Android phone, so I'm still trying to learn/adjust to all the changes. I've also been a long time jailbreaker. TBH, jailbreaking seems a lot more straightforward than rooting has been for me. Probably because the vast amount of different devices running on the Android platform versus just the few iphone/ipad/ipod versions.

It's unfortunate that the Exchange bypass seems so complicated and elusive on this platform. On my iphone there was a simple tweak called Exchange Unlock that was easily installed via Cydia, without even having to delete your Exchange account. I'm not trying to stir the pot, just making an observation.
 

jayboyyyy

Senior Member
Oct 26, 2012
947
181
I still have not been able to get this to work on my AT&T Galaxy Note 3 JB4.3. My phone has been rooted on the stock TouchWiz rom using the Universal Root method from this forum(to avoid triggering KNOX).

I'm pretty darn sure I have followed all the directions correctly. First I deleted all my email profiles and rebooted, just to be sure. The files in the system/app folder on my phone are named SecEmail_J.apk and SecExchange.apk. I renamed both files by adding .bk to the end. I copied the Email.apk and Exchange2.apk files to this folder, renamed them the same as the originals, and set their permissions to rw-r-r. Then I rebooted again.

Upon reboot, the email app keeps crashing and the phone becomes unstable because of this, until I restore the original files and reboot again.

As an aside, I've been a long time iphone user until last week when I got my first Android phone, so I'm still trying to learn/adjust to all the changes. I've also been a long time jailbreaker. TBH, jailbreaking seems a lot more straightforward than rooting has been for me. Probably because the vast amount of different devices running on the Android platform versus just the few iphone/ipad/ipod versions.

It's unfortunate that the Exchange bypass seems so complicated and elusive on this platform. On my iphone there was a simple tweak called Exchange Unlock that was easily installed via Cydia, without even having to delete your Exchange account. I'm not trying to stir the pot, just making an observation.

there are other user friendly modules that you can run that try to bypass security. iphone and android comparison are worthless because one is only one phone with one software and all apps are driven through the software. android has many phones many softwares, and each carrier/distributor often makes their own software for the phone on top of android. Enough about that though. Is your device odexed? if so you need to rename the odex files as well. If not, Idk what else to tell you besides that it might not be compatible. Perhaps someone with more knowledge will chime in to assist you.

also, when you removed the accounts, you might as well have deleted the data for the accounts too before attempting all of this. sometimes that is an issue as well.
 

prabhjots

Senior Member
Jul 7, 2012
492
115
Toronto
I still have not been able to get this to work on my AT&T Galaxy Note 3 JB4.3. My phone has been rooted on the stock TouchWiz rom using the Universal Root method from this forum(to avoid triggering KNOX).

I'm pretty darn sure I have followed all the directions correctly. First I deleted all my email profiles and rebooted, just to be sure. The files in the system/app folder on my phone are named SecEmail_J.apk and SecExchange.apk. I renamed both files by adding .bk to the end. I copied the Email.apk and Exchange2.apk files to this folder, renamed them the same as the originals, and set their permissions to rw-r-r. Then I rebooted again.

Upon reboot, the email app keeps crashing and the phone becomes unstable because of this, until I restore the original files and reboot again.

As an aside, I've been a long time iphone user until last week when I got my first Android phone, so I'm still trying to learn/adjust to all the changes. I've also been a long time jailbreaker. TBH, jailbreaking seems a lot more straightforward than rooting has been for me. Probably because the vast amount of different devices running on the Android platform versus just the few iphone/ipad/ipod versions.

It's unfortunate that the Exchange bypass seems so complicated and elusive on this platform. On my iphone there was a simple tweak called Exchange Unlock that was easily installed via Cydia, without even having to delete your Exchange account. I'm not trying to stir the pot, just making an observation.

No wonder. This isn't meant for touchwiz or other OEM ROMs. Works best on aosp.
Sorry for spoiling your android experience, but Samsung is playing right to the galleries, even leaving behind apple. If you want a true android experience, try a nexus device.

Sent from my Nexus 7 using Tapatalk
 
Last edited:

force70

Senior Member
No wonder. This isn't meant for touchwiz or other OEM ROMs. Works best on aosp.
Sorry for spoiling your android experience, but Samsung is playing right to the galleries, even leaving behind apple. If you want a true android experience, try a nexus device.

Sent from my Nexus 7 using Tapatalk

Works just fine on tw..on my s3, s4, note 2 actually.

sent from my S4 or Note 3..nexus 5 on the way!
 

shanyel

Senior Member
Oct 18, 2010
77
5
I followed the instructions and email stops syncing after first time. So I see like 10 emails and than it stops...
Deleted my account and followed the exact instruction...
Tried on both 4.3 and 4.4
Any help?

Sent from my Galaxy Nexus using Tapatalk
 

Evilmonkee

Member
Oct 31, 2013
9
0
there are other user friendly modules that you can run that try to bypass security.
Could you elaborate?

iphone and android comparison are worthless because one is only one phone with one software and all apps are driven through the software. android has many phones many softwares, and each carrier/distributor often makes their own software for the phone on top of android. Enough about that though.
I realize this, which is why I stated I was just making an observation based on what I've experienced so far.

Is your device odexed? if so you need to rename the odex files as well. If not, Idk what else to tell you besides that it might not be compatible. Perhaps someone with more knowledge will chime in to assist you.
In response to whether my or not my device is odexed, I believe it is. But I did forget to mention that I renamed the two .odex files as well. So that doesn't seem to be the issue.

also, when you removed the accounts, you might as well have deleted the data for the accounts too before attempting all of this. sometimes that is an issue as well.
I'm not sure how to do that. When I restored the original files, I had to go back and recreate all my gmail accounts, as well as my exchange account. It didn't seem like any data was retained.

I keep searching for answers, but it's hard to pin down specifics based on my carrier/model/software. There's a lot of conflicting information(even in this thread) which makes it hard to figure it out. I don't know if anybody has been able to get it to work on an AT&T GN3, running v4.3 of Touchwiz. Searching google certainly has not been of any help other than pointing me here.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 228
    The Android Email application enforces various security policies such as PIN/password lockscreen, device administration. remote wipe, blocked attachments, etc. based on your Exchange server security requirements.

    The aim of this patch is to bypass those security enforcements and allow you to set up an Exchange account without any security restrictions. This is achieved through various code modification in the AOSP Email application where security policies are checked and enforced. These modifications bypass the creation of the various security policies and forcefully makes the application think that all the security policies are enabled. For example, one part of this modification completely bypasses the Device Administrator creation and forcefully returns a true every time the code check if the account is a device administrator.

    This modification is based on AOSP (or AOSP derivatives) and should work on any stock Google ROMs or AOSP-based ROMs like CyanogenMod, AOKP, ParanoidAndroid, Evervolv, SlimRoms, Carbon. There, however, is no guarantee that this will work on all ROMs or devices, especially OEM ROMs like Sense, Touchwiz, Blur, etc.

    IMPORTANT:
    Since this modification disables the enforcement of Exchange security policies, it may be illegal and may violate your workplace/school policies. If you chose to install and use this modification, please remember that you are doing so at your own discretion. I, craigacgomez, cannot and will not be held responsible for any issues, legal, technical or otherwise, that may arise due to the use of this modification.

    The latest version of this modification is based on AOSP android-4.4.2_r1 (KOT49H) and should work on Android 4.1+. However, should you encounter any issues, please use the previous version of this patch.

    PLEASE READ THROUGH THIS THREAD PROPERLY, ESPECIALLY THE KNOWN ISSUES AND INSTRUCTIONS


    CHANGELOG:
    v6.0
    1. Rebased to AOSP android-4.4.2_r1 (KOT49H)
    2. Made some modifications to the bypass code to fix issues with storage encryption
    3. Improved robustness of the bypass logic
    4. Added backuptools script for custom ROMs like CyanogenMod, SlimRoms, etc. which will automatically restore the mod after re-flashes and/or updates to the ROM. Credit @BlackFang171


    v5.0.1
    1. Fix manual user app install on Google Stock ROMs. Only the manual install package has been updated.

    v5.0
    1. Built using AOSP android-4.4_r1.1 (KTR16O)
    2. Rebuilt the modification from ground up and added several bypasses to improve robustness of the modification
    3. Disables remote wipe functionality
    4. No longer requires modifications in the Exchange apk. All modification are in Email apk
    4. Should also work on any Google stock/AOSP-based ROMs running Android 4.1.x, 4.2.x & 4.3.x (untested)

    v4.0
    1. Rebased to the CM-10.2 (Android 4.3) source. This release is only intended for Android 4.3.x. For prior versions of Android, flash the appropriate mod release below.

    v3.1
    1. Small bugfixes to "really" make sure that we fake that all security policies are active. This is basically making "really" sure that the device does not ask you to set up any security policies. It can be safely flashed over v3.0 without having to remove & re-setup the account. However, updating from any earlier version would still require you to remove and re-setup the account.

    v3.0
    1. Built using the latest updates from the CyanogenMod 10.1 (Android 4.2.2) source as of July 20, 2013.
    2. Published source code to GitHub (link below)
    3. Fixes and updates to the patch changes
    4. No longer requires that the account be setup as a "Device Administrator"

    v2.0
    1. Built using the CyanogenMod 10.1 (Android 4.2.2) source
    2. Some nice additions and fixes over the AOSP version like LED notification support, blocked attachment extensions selection and more.


    INSTRUCTIONS [RECOVERY VERSION]:
    1. Download the zip file named ExchangeNoPIN-xxxx
    2. Remove all existing Exchange accounts and wipe data for Email/EmailGoogle & Exchange2/Exchange2Google
    3. Make a nandroid backup (optional, but recommended)
    4. Flash the zip using ClockworkMod Recovery, TWRP or a similar recovery
    5. Wipe cache & dalvik-cache
    6. Reboot and set up you Exchange account(s)

    INSTRUCTIONS [MANUAL USER APP INSTALL]: (UNTESTED)
    1. Download the zip file named ExchangeNoPINNoRoot-xxxx
    2. Remove all existing Exchange accounts and wipe data for Email/EmailGoogle & Exchange2/Exchange2Google
    3. Make a nandroid backup (optional, but recommended)
    4. Stock ROMs: Disable/freeze EmailGoogle.apk (com.google.android.email) & Exchange2Google.apk (com.google.android.exchange)
    5. AOSP-based ROMs: Uninstall/remove Email.apk (com.android.email)
    6. Stock ROMs: Extract the zip file and install Email.apk & Exchange2.apk
    7. AOSP-based ROMs: Extract the zip file and install Email.apk
    8. Reboot and set up you Exchange account(s)

    INSTRUCTIONS [MANUAL SYSTEM APP INSTALL]:
    1. Download the zip file named ExchangeNoPIN-xxxx
    2. Remove all existing Exchange accounts and wipe data for Email/EmailGoogle & Exchange2/Exchange2Google
    3. Make a nandroid backup (optional, but recommended)
    4. Stock ROMs: Uninstall/remove EmailGoogle.apk (com.google.android.email) & Exchange2Google.apk (com.google.android.exchange)
    5. AOSP-based ROMs: Uninstall/remove Email.apk (com.android.email)
    6. Stock ROMs: Extract the zip file and copy Email.apk & Exchange2.apk to /system/app
    7. AOSP-based ROMs: Extract the zip file and copy Email.apk to /system/app
    8. Reboot and set up you Exchange account(s)

    KNOWN ISSUES
    None that I know of!

    IMPORTANT:
    1. For patch version 4.0 and earlier, you need to have a device with a custom recovery or a rooted device.
    2. Root is not required unless you wish to apply this patch manually by replacing the files in /system/app.
    3. After you flash this, make sure you DO NOT replace the Email or Exchange apks with themed versions or you will have issues.
    4. If you use the ExchangeNoPIN-xxxx zip version, you may need to reflash this every time you update your ROM.
    5. Before upgrading to a newer version of this patch (example v2.0 to v3.0), you need to remove all existing Exchange accounts.

    CREDITS:
    The base of this modification is the EmailPolicyPatch created by rustamabd. I have made these change to the AOSP source rather than smali patches to pre-compiled version and I have expanded the capabilities of the modification.

    DOWNLOAD v6.0 (Android 4.1+):
    ExchangeNoPIN-v6.0.zip
    ExchangeNoPINNoRoot-v6.0.zip


    DOWNLOAD v5.0 (Android 4.1+):
    ExchangeNoPIN-v5.0.zip
    ExchangeNoPIN-Manual-v5.0.1.zip

    DOWNLOAD v4.0 (Android 4.3.x):
    ExchangeNoPIN-4.3.x.zip

    DOWNLOAD v2.0 (Android 4.2.x):
    ExchangeNoPIN-4.2.x.zip

    DOWNLOAD v1.0 (Android 4.1.x):
    Stock OTA Android 4.1.x
    AOSP Android 4.1.x
    CM10 Android 4.1.x


    SOURCE (Android 4.4.x):
    GitHub

    SOURCE (Android 4.3.x/4.2.x):
    GitHub
    17
    CM-13.0 patch

    I've patched stock CM-13.0 Email/Exchange apk to bypass all exchange security.
    Flash it from recovery.

    Remember to reflash this package after each rom reflash as there are no OTA survival scripts.

    I'm still on CM-12.1 so please let me know if it works on your CM-13.0 rom or not.
    In case of any issues reflash your rom and the apk will be back to original.

    The package (and its later versions) can be dowloaded from here LINK

    Will it work on other roms than CM-13?
    I don't know. If your rom is based on AOSP/CM-13.0 most probably it will work, otherwise probably not.

    Where are sources of this patch?
    https://github.com/rawi666/android_packages_apps_Email
    https://github.com/rawi666/android_packages_apps_Exchange
    17
    At least in Android L Gmail 5 and AOSP E-Mail 5 can coexist on a system, no matter if patched or not. It should work with KitKat also, but I didn't test this particular scenario. My Note 10.1 just has the new Email patched, but not the Gmail Exchange as my Xperia does.

    However, KK-Users can find the patched Gmail 5 Exchange attached, Gmail itself doesn't need to be touched. Copy the APK into /system/app/ and set permissions to rw-r--r-- as usual. This should add the Exchange ActiveSync connector to Gmail 5 (remember, I didn't test this on KK).

    In my cases the sync works flawlessly, no difference to the former versions from OP or the Xposed solution (had each setup running already in the past).

    When the system asks for activation of the device administrator, just confirm - nothing will happen ;)
    14
    Updated mod in OP... non-root installable version coming soon!

    v6.0
    1. Rebased to AOSP android-4.4.2_r1 (KOT49H)
    2. Made some modifications to the bypass code to fix issues with storage encryption
    3. Improved robustness of the bypass logic
    4. Added backuptools script for custom ROMs like CyanogenMod, SlimRoms, etc. which will automatically restore the mod after re-flashes and/or updates to the ROM. Credit @BlackFang171
    12
    Going to build the Android 4.4 version today or tomorrow (as time permits)... this new version improves the robustness of this patch and even disables remote wipe! Theoretically this should work on Android 4.2+