[HACK] Removing keyguard and other security policy restrictions from Email apk
This patch was originally created for Samsung Galaxy S II (GB and ICS) and Galaxy S III (ICS), but it might work for other devices* running Android 2.3 or 4.0 because it patches the Email application that you have on your phone. This is not a pre-patched Email.apk.
* Motorola Blur (Droid) and HTC Sense - based ROMs are not supported!
What does it do?
It will make the Email app ignore Exchange-pushed policy on your device, including things like mandatory pin lock (a.k.a. keyguard), minimum password length, encryption, etc.
How to apply this patch?
Root your phone. Your phone must be rooted. It is impossible to apply this patch without root access. You need root to proceed.
Get USB drivers (for Samsung, install Kies or just the drivers). Most likely you already have this because of step 1.
Enable USB debugging on the phone (Settings->Applications->Development->USB debugging)
* For CM9 users, also go to Settings > Developer Options > Root access, and select ADB.
Download and unzip attached patch
Run apply-patch.cmd
* Mac/Linux users: run apply-patch-nix.sh for further instructions
Note 1: Although the Email app will prompt you for device admin access, it won't actually enforce any policy on your device. Let the app install the device admin!
Note 2: any shortcuts to the Email app as well as any Exchange accounts will disappear and will need to be re-created.
Note 3: The patch will reboot your phone, this is needed for the changes to take effect.
Note 4: If you already installed another Email application and it doesn't work, first restore your original Email application before applying this patch.
A Special Note to those experiencing performance issues! This is not an issue of my patch. This is an issue in the Email app itself. Sometimes calendar sync can't finish properly, causing battery drain. It often happens after you just added a new exchange account. A reboot usually solves this issue. Again, this is not my issue!
Change Log
3.3 - JB 4.2.x support (updated adb)
3.2 - Improved Jelly Bean support
3.1 - Added Jelly Bean support (alpha, do not use), minor optimization and cleanup
3.0 - Added Galaxy S III support
2.8 - Fixed an issue with latest ICS ROMs (mv cross-device link)
2.7 - Minor documentation cleanup and optimization
2.6 - Added support for ROMs without debugging info (AT&T)
2.5 - Added support for *nix
2.4 - Bugfix release
2.3 - Will now patch both Email.apk and Exchange.apk, added patch for ProvisionP****r.hasSupportablePolicy(), courtesy of boost252525
2.2 - added ICS isSupported() patch
2.1 - added support for EmailGoogle.apk
2.0 - New patch method based on patching SecurityPolicy's isActive() and isActiveAdmin()
1.1 - Fixed a bug with /system remounting
1.0 - Initial revision based on patching SecurityPolicy.PolicySet <init>
Did the patch work for you? Donations are welcome!
Thanks so much for your effort. just want to get one thing clear, since you provided the patched Email.apk can i just install it directly, or do i need to be in recovery mode for example. because in your note you mentioned not to install!
1) Put Email.apk on your sdcard
2) Go to /system/app and press mount rw
3) remove Email.apk and Email.odex
4) move Email.apk from /sdcard/ to /system/app/
Then you need to setup your email again!
I had to clear the data also in applications -> email
Edit1:
your Email.apk is weird. When i reboot i get the notification that i need to set extra security. But when i press it nothing happends.
And after the email.apk the phone doesn't feel as smooth.. weird
Edit: removed Email.apk (modified) and wen't back to stock! phone is smooth again and works fine
Quote:
Ex Samsung Galaxy S I9000 owner Ex HTC Nexus One owner Ex Samsung Galaxy SII i9100 owner Ex ASUS Transformer Prime TF201 owner Ex Samsung Galaxy SIII i9300 owner Google Nexus 7 owner Sony Xperia Z owner
May I ask why u use const/16 ?
const/4 goes from -8 to 8 (2^4) and should be preferred for small constants I think
const/4 has also a limited range of destination register numbers, and with the p-format in smali the mapping of p-registers to actual v-registers depends on the number of v-registers. It may happen that in the future more v-register are added, and an existing p-register does not fit in const/4 anymore. Using const/16 is thus more or less future proof.
At first to all, I used tool "FroyoMailUnlocker" to generate my new mail.apk and it worked fine for SGSII on 2.2.3 and also on GT7100 on Honeycomb 3.0.1.
Only problem is that after flashing new OS it need to be installed again.
Does anybody what settings should/can be saved to have an easier restore of the mailbox setup (for my exchange and hotmail accounts)?
Most of us take the simple act of waking up our devices and having a quick glance at the … more
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer?