[Xposed Mod] Bypass Exchange Security Policy for Nexus devices and other AOSP ROMs

Search This thread

shantzg001

Inactive Recognized Developer
This mod should be used along with Xposed ( http://xdaforums.com/showthread.php?t=1574401 ).

This mod will bypass the Email app from becoming device admin for your phone and prevent it from setting up any security restrictions on your device including pin/password/remote wipe, etc. There are a couple of other mods out there none of which work right now (1 doesn't work at all and 1 doesn't work for N4 4.3)

Instructions for users
- Remove your existing email account from phone and reboot
- Install Xposed installer (from link above)
- Install this mod (Download apk from here: https://github.com/shantanugoel/Exc...geBypassForXposed/ExchangeBypassForXposed.apk )
- Enable the mod in xposed (Preferences for other devices/versions coming Soon)
- Reboot
- Add your email account again. This time, it will ask you that the email
might require security restrictions, say yes to it but it will never actually set the restrictions.
- Done. :)

Instructions for developers
- Read the xda link at the top and go through basics of xposed development
- Install xposed as an android sdk addon on your system
- Clone this git repo
- Import in Android Studio
- Make changes
- Build :)

Credits:
- rovo89 from xda (for creating xposed)
- mpcjanssen from xda (for original mod)

Source code: https://github.com/shantanugoel/ExchangeBypassXposed
Apk: https://github.com/shantanugoel/Exc...geBypassForXposed/ExchangeBypassForXposed.apk
My website: http://tech.shantanugoel.com/
My twitter: http://twitter.com/shantanugoel

Feel free to ask your questions, provide feedback here, or my website or on my twitter.

Changelog:
1.6 26-Jan-14
Cleanup. Remove Security Policy changed notification.

1.5 22-Dec-13
Allow updation of policy keys properly on Exchange server's request otherwise sync may hang

1.4 16-Dec-13
Fixing the fixes :)

1.3 15-Dec-13
Fixed random email app crashes

1.2 14-Dec-13
AOSP ROMs support. Removed some unnecessary logging.

1.1 28-Nov-13
KitKat support. Tested on Nexus 4, Nexus 5, Nexus 7 2012, Nexus 7 2013

1.0 14-Oct-13
Initial version. Working for Nexus 4 Android 4.3
 
Last edited:
G

GuestK00208

Guest
Hi! I followed the instructions, and the email app hangs at "syncing folders". I don't get a crash, it just stalls on "email is waiting to sync" or whatever that prompt is.

Nexus 5
4.4.2 stock
rooted
Other modules: GravityBox, Greenify

Thoughts? Anything additional I can provide? Thanks for your hard work!
 

veabers

Member
Apr 8, 2008
7
0
Same problem, syncing hangs

Hi! I followed the instructions, and the email app hangs at "syncing folders". I don't get a crash, it just stalls on "email is waiting to sync" or whatever that prompt is.

I am having the problem where email on the account doesn't ever sync and just hangs.

Nexus 5
KitKat 4.4.2
Modules: GravityBox
 

shantzg001

Inactive Recognized Developer
Does this work with TouchDown as well or just Exchange? My company decided (in its infinite IT wisdom) to use this app instead of the built in Exchange client.

https://play.google.com/store/apps/details?id=com.nitrodesk.droid20.nitroid&hl=en

It would be AWESOME if it did.
No, only built in app.

Hi! I followed the instructions, and the email app hangs at "syncing folders". I don't get a crash, it just stalls on "email is waiting to sync" or whatever that prompt is.

Nexus 5
4.4.2 stock
rooted
Other modules: GravityBox, Greenify

Thoughts? Anything additional I can provide? Thanks for your hard work!

I am having the problem where email on the account doesn't ever sync and just hangs.

Nexus 5
KitKat 4.4.2
Modules: GravityBox
Could you please post logcat logs when this happens?
 

veabers

Member
Apr 8, 2008
7
0
logcat for sync hanging

Could you please post logcat logs when this happens?

This looks to be the relevant section. I sanitized my email.

12-20 11:19:59.875 D/GoogleServicesManager(31716): setState: sync = true, wantedSyncState = true
12-20 11:19:59.875 D/GoogleServicesManager(31716): Enabling sync
12-20 11:19:59.905 D/SyncManager( 807): failed sync operation XXXX@XXXX.com u0 (com.google.android.exchange), com.google.android.email.provider, SERVER, latestRunTime 47454987, reason: AutoSync, SyncResult: syncAlreadyInProgress: true stats []
12-20 11:19:59.985 E/qcom_sensors_hal( 807): hal_process_report_ind: Bad item quality: 11
12-20 11:20:05.505 E/Exchange(20156): Sync: Unknown status: 144
12-20 11:20:05.505 E/Exchange(20156): CommandStatusException: 144
12-20 11:20:05.695 W/ContextImpl(20156): Implicit intents with startService are not safe: Intent { act=com.google.android.email.POLICY_INTENT } android.content.ContextWrapper.bindService:517 com.android.emailcommon.service.ServiceProxy.setTask:170 com.android.emailcommon.service.PolicyServiceProxy.setAccountPolicy:73
12-20 11:20:05.725 D/dalvikvm(20156): GC_CONCURRENT freed 383K, 3% free 18181K/18660K, paused 16ms+1ms, total 58ms
12-20 11:20:11.735 D/SyncManager( 807): failed sync operation XXXX@XXXX.com u0 (com.google.android.exchange), com.google.android.email.provider, SERVER, latestRunTime 47465030, reason: AutoSync, SyncResult: syncAlreadyInProgress: true stats []

Let me know if you need more info.
 

shantzg001

Inactive Recognized Developer
This looks to be the relevant section. I sanitized my email.

12-20 11:19:59.875 D/GoogleServicesManager(31716): setState: sync = true, wantedSyncState = true
12-20 11:19:59.875 D/GoogleServicesManager(31716): Enabling sync
12-20 11:19:59.905 D/SyncManager( 807): failed sync operation XXXX@XXXX.com u0 (com.google.android.exchange), com.google.android.email.provider, SERVER, latestRunTime 47454987, reason: AutoSync, SyncResult: syncAlreadyInProgress: true stats []
12-20 11:19:59.985 E/qcom_sensors_hal( 807): hal_process_report_ind: Bad item quality: 11
12-20 11:20:05.505 E/Exchange(20156): Sync: Unknown status: 144
12-20 11:20:05.505 E/Exchange(20156): CommandStatusException: 144
12-20 11:20:05.695 W/ContextImpl(20156): Implicit intents with startService are not safe: Intent { act=com.google.android.email.POLICY_INTENT } android.content.ContextWrapper.bindService:517 com.android.emailcommon.service.ServiceProxy.setTask:170 com.android.emailcommon.service.PolicyServiceProxy.setAccountPolicy:73
12-20 11:20:05.725 D/dalvikvm(20156): GC_CONCURRENT freed 383K, 3% free 18181K/18660K, paused 16ms+1ms, total 58ms
12-20 11:20:11.735 D/SyncManager( 807): failed sync operation XXXX@XXXX.com u0 (com.google.android.exchange), com.google.android.email.provider, SERVER, latestRunTime 47465030, reason: AutoSync, SyncResult: syncAlreadyInProgress: true stats []

Let me know if you need more info.
This looks to be an inherent issue in the exchange app or server, not caused due to the mod..
But I'll check it out later again tonight if something can go wrong in this path due to the mod
 
  • Like
Reactions: veabers

veabers

Member
Apr 8, 2008
7
0
This looks to be an inherent issue in the exchange app or server, not caused due to the mod..
But I'll check it out later again tonight if something can go wrong in this path due to the mod

Thanks for taking a look. If I remove the mod the syncing works correctly. If I revert to the previous version it will sync in between the crashes.
 

Shamus69

Senior Member
Dec 31, 2005
97
24
1.5 appears to be working! :)

v1.5 is the first version which has worked for me with no crashes/hanging. Occasionally when doing a manual refresh I get the message "Security policies have changed". Other than that it appears to be working just fine on my Nexus 5 (4.4.2)

Many thanks for this mod :)
 
G

GuestK00208

Guest
v1.5 is the first version which has worked for me with no crashes/hanging. Occasionally when doing a manual refresh I get the message "Security policies have changed". Other than that it appears to be working just fine on my Nexus 5 (4.4.2)

Many thanks for this mod :)

Same here, I also get that "security policies have changed" notification (which I'd never seen until I ran the module). But that's a non-issue compared to the fact that this now works and I can use Tasker to control when the keyguard goes on. Many thanks for a great module!

Sent from my Nexus 5 using Tapatalk
 

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    This mod should be used along with Xposed ( http://xdaforums.com/showthread.php?t=1574401 ).

    This mod will bypass the Email app from becoming device admin for your phone and prevent it from setting up any security restrictions on your device including pin/password/remote wipe, etc. There are a couple of other mods out there none of which work right now (1 doesn't work at all and 1 doesn't work for N4 4.3)

    Instructions for users
    - Remove your existing email account from phone and reboot
    - Install Xposed installer (from link above)
    - Install this mod (Download apk from here: https://github.com/shantanugoel/Exc...geBypassForXposed/ExchangeBypassForXposed.apk )
    - Enable the mod in xposed (Preferences for other devices/versions coming Soon)
    - Reboot
    - Add your email account again. This time, it will ask you that the email
    might require security restrictions, say yes to it but it will never actually set the restrictions.
    - Done. :)

    Instructions for developers
    - Read the xda link at the top and go through basics of xposed development
    - Install xposed as an android sdk addon on your system
    - Clone this git repo
    - Import in Android Studio
    - Make changes
    - Build :)

    Credits:
    - rovo89 from xda (for creating xposed)
    - mpcjanssen from xda (for original mod)

    Source code: https://github.com/shantanugoel/ExchangeBypassXposed
    Apk: https://github.com/shantanugoel/Exc...geBypassForXposed/ExchangeBypassForXposed.apk
    My website: http://tech.shantanugoel.com/
    My twitter: http://twitter.com/shantanugoel

    Feel free to ask your questions, provide feedback here, or my website or on my twitter.

    Changelog:
    1.6 26-Jan-14
    Cleanup. Remove Security Policy changed notification.

    1.5 22-Dec-13
    Allow updation of policy keys properly on Exchange server's request otherwise sync may hang

    1.4 16-Dec-13
    Fixing the fixes :)

    1.3 15-Dec-13
    Fixed random email app crashes

    1.2 14-Dec-13
    AOSP ROMs support. Removed some unnecessary logging.

    1.1 28-Nov-13
    KitKat support. Tested on Nexus 4, Nexus 5, Nexus 7 2012, Nexus 7 2013

    1.0 14-Oct-13
    Initial version. Working for Nexus 4 Android 4.3
    4
    Any plans to add new Gmail 5 with Echange Support?

    com.google.android.gm

    Thanks!

    Sent from my OnePlus One using Tapatalk

    Will try it out after L public push to AOSP. Not sure though if gmail source is released. If not, then it might be difficult.
    2
    Thanks folks who tested the beta. Have now removed the beta link and the release version can be installed from links given in OP or within the xposed module downloader.
    2
    Any plans to add new Gmail 5 with Echange Support?

    com.google.android.gm

    Thanks!

    Sent from my OnePlus One using Tapatalk
    1
    Update: This has now been tested to work successfully on all stock or nearly stock JellyBean (4.3) and KitKat (4.4) ROMs on Nexus 4 / Nexus 5 / Nexus 7