[MOD][XPOSED][5.0+] Bypass Exchange Policies (Outlook & Gmail)

Search This thread

rfgamaral

Senior Member
Nov 19, 2009
880
136
Porto
Bypass Exchange Policies

Bypass Exchange security policies for Microsoft Outlook and Gmail.

This Xposed module will attempt to bypass the security policies that e-mail applications might want to enforce when you add new Exchange accounts. Currently only Microsoft Outlook and Gmail for devices running Lollipop and above are supported. Some applications - like Gmail - apply obfuscation (with a tool like ProGuard) to prevent tampering with the code. It's possible that this module stops working for future Gmail updates if classes and/or class members receive new random names compared to the previous version. Feel free to submit pull requests fixing bugs or version incompatibilities or adding support for new applications.

Download

Please refer to the GitHub releases page to download the Xposed module until the module is not made available in the Xposed Repository.

Changelog

Please refer to the CHANGELOG file for the full changelog details.

Credits

  • rovo89: Xposed, a framework for changing the system/applications behaviour without touching any APKs.
  • Shantanu Goel: Exchange security bypass Xposed module for Nexus and AOSP Android devices.
  • diwulechao: Exchange security bypass for Android Lollipop Xposed module.
Source

 

lokety

Senior Member
Dec 31, 2010
51
10
Auckland
www.lokety.com
I've just tried this module but it doesn't work for me unfortunately. I want to add my work e-mail account so that I can sync its calendar into my phone.

LG Nexus 5
Android 6.0.1 MOB30M Stock+ ROM by @tupac4u
Xposed framework version 85
Bypass Exchange Policies version 1.0.0

After filling in the Exchange connection details, I was brought to the following screens:

Remote security administration
Account options
Activate device administrator?
Your account is set up and email is on its way!
Security update required

So, I'd say the module isn't working for me. :(
 

rfgamaral

Senior Member
Nov 19, 2009
880
136
Porto
I'm using Gmail 6.6.125987275.release.
As I suspected, since Gmail is obfuscated with ProGuard, new versions generate new random names for class names/members and the Xposed hooks fail because it can't find the proper methods.

I'm afraid it won't be possible to have an Xposed module that works consistently for Gmail. It would need to be updated every time a new version is released and that's not feasible for me, sorry.

I've made the code open-source for lots of reasons and one of those is so that people can submit pull requests to fix problems like this. I currently don't have the time to look into this, maybe someone else might take a look. In the mean time here's what you can try if you want:

  • Remove your Exchange accounts.
  • Downgrade to 6.5-1.123769152.release.
  • Enable the module (don't forget to reboot).
  • Configure your Exchange account.
  • Upgrade to latest version available.
Xposed log attached.
I can't read this log file, it looks like a binary file instead of a text file...
 

rfgamaral

Senior Member
Nov 19, 2009
880
136
Porto
Ok, I just took a quick look to the latest Gmail version, compared both applications decompiled source and only found a single difference of relevance.

That difference was in the dialog popup that appears when setting up an account with Exchange policies. If that is really the only difference, when you get that dialog, just press "OK" to "accept" the dialog and continue with the account process creation. After this step, can you finish the setup configuration without being asked to setup a device administrator or it still doesn't work?
 

rfgamaral

Senior Member
Nov 19, 2009
880
136
Porto
Ok, I just took a quick look to the latest Gmail version, compared both applications decompiled source and only found a single difference of relevance.

That difference was in the dialog popup that appears when setting up an account with Exchange policies. If that is really the only difference, when you get that dialog, just press "OK" to "accept" the dialog and continue with the account process creation. After this step, can you finish the setup configuration without being asked to setup a device administrator or it still doesn't work?
Nevermind, test this myself. It doesn't work...
 

FlyOnTheWall43

Senior Member
May 17, 2014
97
12
Holland, MI
I'm not sure if I'm doing something wrong or if what I'm trying to do isn't in the scope of this, but I can't seem to get this module to stop my company's Exchange security settings from disabling Smart Unlock.

Any help would be greatly appreciated,
Fly
 

rfgamaral

Senior Member
Nov 19, 2009
880
136
Porto
I'm not sure if I'm doing something wrong or if what I'm trying to do isn't in the scope of this, but I can't seem to get this module to stop my company's Exchange security settings from disabling Smart Unlock.

Any help would be greatly appreciated,
Fly
Are you using Gmail or Outlook?

Make sure you have the latest version installed for the app you use (check http://www.apkmirror.com and download new version if necessary).

For this module to work, you'll need to remove your Exchange account from the e-mail client (check the settings, accounts and device admins and make sure everything related to that account is removed) and then re-add it with the module activated. Don't forget to reboot your phone after enabling the module in Xposed Installer.

If this didn't help, please be more specific. Detail exactly what you are trying to do, post screenshots or record a short video demonstrating the issue.
 
  • Like
Reactions: FlyOnTheWall43

FlyOnTheWall43

Senior Member
May 17, 2014
97
12
Holland, MI
Are you using Gmail or Outlook?

Currently, both. I use the Outlook app to view/reply to my work emails, and I use the Gmail (connected to the same account) in order to get my meetings to show up in my Google Calendar (if this is possible - I can't find the setting - to do this only using the Outlook app, I'm all ears).

Make sure you have the latest version installed for the app you use (check http://www.apkmirror.com and download new version if necessary).

Currently running Outlook Version: 2.1.33 (Current per http://www.apkmirror.com/?s=outlook&post_type=app_release&searchtype=apk)

Currently running Gmail Version: 6.5-1.123769152.release (Not sure why I haven't been upgraded to the 6.6.125987275.release version available. I'll update to that and try again.)

For this module to work, you'll need to remove your Exchange account from the e-mail client (check the settings, accounts and device admins and make sure everything related to that account is removed) and then re-add it with the module activated. Don't forget to reboot your phone after enabling the module in Xposed Installer.

I attempted to do this, but I didn't ensure that Smart Lock was allowed after removing the account and re-adding it, so I'll try again, including this step, and report back.

Thanks again for your time,
Fly
 

rfgamaral

Senior Member
Nov 19, 2009
880
136
Porto
Currently, both. I use the Outlook app to view/reply to my work emails, and I use the Gmail (connected to the same account) in order to get my meetings to show up in my Google Calendar (if this is possible - I can't find the setting - to do this only using the Outlook app, I'm all ears).
I don't think it's possible, that's a limitation on the Outlook app. A really frustrating one.



Currently running Outlook Version: 2.1.33 (Current per http://www.apkmirror.com/?s=outlook&post_type=app_release&searchtype=apk)

Currently running Gmail Version: 6.5-1.123769152.release (Not sure why I haven't been upgraded to the 6.6.125987275.release version available. I'll update to that and try again.)
I wasn't it either, just update the app manually and use v1.0.1 of the module, should work :)
 
  • Like
Reactions: FlyOnTheWall43

FlyOnTheWall43

Senior Member
May 17, 2014
97
12
Holland, MI
Currently, both. I use the Outlook app to view/reply to my work emails, and I use the Gmail (connected to the same account) in order to get my meetings to show up in my Google Calendar (if this is possible - I can't find the setting - to do this only using the Outlook app, I'm all ears).
I don't think it's possible, that's a limitation on the Outlook app. A really frustrating one.



Currently running Outlook Version: 2.1.33 (Current per http://www.apkmirror.com/?s=outlook&post_type=app_release&searchtype=apk)


I wasn't it either, just update the app manually and use v1.0.1 of the module, should work :)

All is working. Thanks!
 

Zwing

Member
Jun 27, 2006
37
6
Hi, Nuzgulled, v1.0.1 running with Outlook Version: 2.1.33 worked. Thanks for the great work!
Just want to check if you will extend the support to Email app, I'm using Email version 12.0.A.0.9, which should be AOSP compatible.
Thanks in advance for any feedback.
 

rfgamaral

Senior Member
Nov 19, 2009
880
136
Porto
Hi, Nuzgulled, v1.0.1 running with Outlook Version: 2.1.33 worked. Thanks for the great work!
Just want to check if you will extend the support to Email app, I'm using Email version 12.0.A.0.9, which should be AOSP compatible.
Thanks in advance for any feedback.
Not sure what e-mail app is that... Point me to the .apk on APK Mirror please. However, I don't really have time to work on this right now, but pull requests are welcome :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    Bypass Exchange Policies

    Bypass Exchange security policies for Microsoft Outlook and Gmail.

    This Xposed module will attempt to bypass the security policies that e-mail applications might want to enforce when you add new Exchange accounts. Currently only Microsoft Outlook and Gmail for devices running Lollipop and above are supported. Some applications - like Gmail - apply obfuscation (with a tool like ProGuard) to prevent tampering with the code. It's possible that this module stops working for future Gmail updates if classes and/or class members receive new random names compared to the previous version. Feel free to submit pull requests fixing bugs or version incompatibilities or adding support for new applications.

    Download

    Please refer to the GitHub releases page to download the Xposed module until the module is not made available in the Xposed Repository.

    Changelog

    Please refer to the CHANGELOG file for the full changelog details.

    Credits

    • rovo89: Xposed, a framework for changing the system/applications behaviour without touching any APKs.
    • Shantanu Goel: Exchange security bypass Xposed module for Nexus and AOSP Android devices.
    • diwulechao: Exchange security bypass for Android Lollipop Xposed module.
    Source

    4
    For the latest version of Gmail 6.11.6.140557227 i updated only two class names and the result looks ok. I only used for several minutes but i got my emails/meetings without having to accept any security policy.
    When i added the exchange account in Gmail i did not received any request to accept Exchange policy. I do not know if this behavior is impacted by the fact that i still have Microsoft Outlook as administrator (account added as Office365), policies from Office365 are more relaxed then policies from Exchange.

    I guess that latest version Microsoft Outlook is not enabled by this module since i could not find the class/methods defined in BypassOutlookPolicy.java

    Code:
    18c18
    <     private static final String SECURITY_REQUIRED_DIALOG_CLASS = "azu";
    ---
    >     private static final String SECURITY_REQUIRED_DIALOG_CLASS = "bbv";
    52c52
    <     private static final String EMAIL_NOTIFICATION_CONTROLLER_CLASS = "ati";
    ---
    >     private static final String EMAIL_NOTIFICATION_CONTROLLER_CLASS = "ave";

    Try to build yourself the app or sign attached apk.
    Hope that helps ...
    2
    I just made a new pull request that fixes issue with latest gmail app. Tested on cm-13.0-20160818 on LG D855 with latest gapps and xposed v86
    Just updated Xposed repository with the new version. Thanks for your contribution.
    2
    If one is able to fix this, feel free to make a pull request on GitHub. I currently don't have the time :(

    I just made a new pull request that fixes issue with latest gmail app. Tested on cm-13.0-20160818 on LG D855 with latest gapps and xposed v86
    1
    Yes @Nazgulled, version 1.0.1 sure does work for Gmail 6.6.125987275! Thanks man.