yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Themes and Apps] nikzDHD:
Don't listen to this, post the apk up will be interesting to see what it looks like, if it's based of the Seven engine still and has the same smali files then it'll be easy to do.
[Galaxy S II Themes and Apps] AMoosa:
Thanks NikzDHD. I have attached the email and exchange apks. :)
[Galaxy S II Themes and Apps] _JKay_:
Just so you know. If you use JKay Deluxe then you don't need this mod.
[Galaxy S II Themes and Apps] AMoosa:
Hi JKay. I USED to use your mod until I got rid of the SGS2 on Friday. But just wondered why the mod wouldn't be required...
[Galaxy S II Themes and Apps] _JKay_:
If you toggle off Security Mode from quick settings panel then you don't need to enter pin code to login.
[Galaxy S II Themes and Apps] jimmyz:
How would one get this hack to work on a deodexed rom? I'm running a deodexed EI22 rom (gingerbread) on my epic 4g. Thanks in advance
[Galaxy S II Themes and Apps] rustyx3:
If your Email app is deodexed, just baksmali Email.apk instead of Email.odex.

Or, if you download the already patched Email.apk, there would be no change to the process at all.
[Galaxy S II Themes and Apps] jimmyz:
thanks- I already tried the patched Email.apk but no luck- it just force closes on me. I attached the email.apk pulled from my rom as running the patch (I'm embarrassed to say) is a little above my skill level
[Galaxy S II Themes and Apps] rustyx3:
Sorry, I missed the fact that you have a totally different device than SGS2. Of course, in this case the download apk solution won't work.

Try this file, it should work better.
[Galaxy S II Themes and Apps] nikzDHD:
Hey Jkay, Cheers for explanation but I assume it doesn't stop administration rights though like this hack. I don't like having my company having control of my device hence this mod is excellent, and yes it does also bypass the pin code issue.
[Galaxy S II Themes and Apps] jimmyz:
Thanks, works great, I'll post a link from the epic forums so others can benefit!
[Galaxy S II Themes and Apps] KcDaRookie:
Thanks rustamabd, nice work.

Made a CWM Flashable zip, hope you don't mind and hope it works ^^
[Galaxy S II Themes and Apps] mistxx:
Hey

Thanks KcDaRookie, installed your 2.3.5 version but get constant FC.. Cannot run it at all :-(
[Galaxy S II Themes and Apps] rustyx3:
Thanks KC, and great work! Can I use your solution in the first post as it seems to be the easiest way to install the patch? :)
[Galaxy S II Themes and Apps] jamesey:
using the one for Android.2.3.6 ..

Why does my exchange account say no emails for 1/2 second before my emails display? Is this normal or should I just follow the directions to mod my original apk. My device is epic touch 4g running Android 2.3.6. Thx for such great info. The one I was using prior was white and it bothered my eyes ;)
[Galaxy S II Themes and Apps] greatg:
Recently moved over to Android (about 2 weeks ago). I have a Rogers (AT&T) Galaxy Note 2, rooted and running the stock ROM. From what I have read here, version 3.2 seems to work? On my N2, when I try to set up the exchange, I keep getting the following:

"The server requires features that your Android device doesn't support, including: don't allow unsigned applications, don't allow unsigned application installers"

I have tried going into security and unchecking the allowed unassigned, but this does not solve the problem. So, my question is:

1. Will this remove the need for what ever my exchange server is looking for?

2. Should I back up my existing files before I apply this fix? What is the best way to do this?

3. Is 3.2 the latest, greatest

p.s. I'm enjoying the N2 and Android :)
[Galaxy S II Themes and Apps] fastguy:
I would say just try. If possible do a nandroid backup from recovery and you can always revert back.
[Galaxy S II Themes and Apps] greatg:
Do you mean do a backup using TWRP?
[Galaxy S II Themes and Apps] fastguy:
Yes twrp or cwm whichever you have. I don't use twrp so can't comment on its capabilities.
[Galaxy S II Themes and Apps] flybass:
Hey,

Is there any chance this will be updated to work on nexus 7 on 4.2.2?
[Galaxy S II Themes and Apps] CaspaTheGhost:
Have you tried it as is? I would have thought it works now as 4.2.2 is more of a bug fix release so wouldn't have thought there are changed to the two relevant apks.

Sent from my BAKED N4
[Galaxy S II Themes and Apps] flybass:
Yea, it looks like the little bat no longer sees my n7 as connected.
[Galaxy S II Themes and Apps] n4s:
I don't know if anyone mentioned but for Xperia phones use "semcEmail.apk" and works perfeclty

Thanks!
[Galaxy S II Themes and Apps] CaspaTheGhost:
Think that may be related to some new adb security settings I saw mentioned.

Sent from my BAKED N4
[Galaxy S II Themes and Apps] kelmar13:
FWIW, that was my initial thought as well. I updated all my SDK stuff and got to the point where the phone questions if the adb source is approved (of course I said yes) but it still wouldn't do anything for me either.

That being said... I'm not a developer so it's possible I've missed something completely obvious as well. :)

Also an N4 btw. Glad I had a backup as the version from 4.2.1 works fine.
[Galaxy S II Themes and Apps] CaspaTheGhost:
Good to know, haven't updated to 4.2.2 yet but sure something will pop up that takes my fancy.

Sent from my BAKED N4
[Galaxy S II Themes and Apps] keke7442:
Hello guys,

i guess i have the same issues than you had.

But I don't understand the alternative way of working at all!!!

you says: "I manage to patch them with patch-manual.cmd ". But when I use it, cmd window appears and desappears in few second. So I can't do nothing.

for the remaing explanations:"You will also need to copy /system/framework directory

I Copied and overwrite them with es file explorer app"

That's the same: we have to copy WHAT and WHERE?

I'm fully lost (and as i'm french, so my english doesn't help)

thx in advance for your help.
[Galaxy S II Themes and Apps] gilc8:
Just upgraded to 4.2.2 with Nexus 4 and seems that the script don't recognized the phone in debbuging mode.

after I updated the lib file with the updated adb files the script ran and finish.
[Galaxy S II Themes and Apps] Mi|enko:
This is awesome. I just grabbed the subfolder hacked email apk for jelly bean, put it on my Nexus 4 running AOKP's unofficial 4.2.2 build, then applied the patch. Now I have subfolder syncing AND no pin requirement.
[Galaxy S II Themes and Apps] kelmar13:
Are you able to link or post directions for what needs done for others?
[Galaxy S II Themes and Apps] Diliprajgor:
It worked in 4.2.2 galaxy nexus

I had this patch in 4.2.1 but with this patch i was not able to update the android to 4.2.2. So i restored it first using restore-patch.cmd. then updated 4.2.2.

After updating i was not able to apply the patch again as it was not detecting the usb connection. So i replaced the three adb files(adb.exe and two dll files) with the new files from the sdk directory and tried. It worked fine...:cowboy::o:angel:

Thank you!!!
[Galaxy S II Themes and Apps] hkk:
Also make sure you haven't lost root while doing the update to 4.2.2. I did, and had to reroot.
[Galaxy S II Themes and Apps] squire23:
Sorry for the idiot question but from reading the number of pages, I think that just flashing this should work for 4.2?

squire
[Galaxy S II Themes and Apps] trying2s3:
I just want to confirm that this method, and the file, mentioned on PG 1 - is still working or where there any updates on that?

I got to get my S3 out of this insane 8 digit password.
[Galaxy S II Themes and Apps] Mr_Q:
Attached you will find a 4.2.2 pre-patched Email.apk + Exchange2.apk.

With thanks to rustamabd for providing the tools. I used this myself as I do many rom-updates and I do not always have a computer with the required tools available. Just thought it might be usefull for others too.

Based on:

AOSP - PA 3.00 - 4.2.2 (JDQ39) - 15 Feb - Galaxy Nexus build.

Even though a Galaxy Nexus was used to patch the files, I think it will work with any AOSP-based rom.

Enjoy (and hit thanks if you like it)!
[Galaxy S II Themes and Apps] CaspaTheGhost:
I'm just using the same ones from my 4.2.1 ROM as someone said email was still on version 4.2.

Was there an update to exchange?

Sent from my N4 Asylum
[Galaxy S II Themes and Apps] Mr_Q:
That is possible, I haven't checked the version to be honest... As I had to re-install my GNex anyway I applied the patch with 4.2.2 and made a new zip-file.. :)
[Galaxy S II Themes and Apps] CaspaTheGhost:
Cool, old one working fine also. Finally got round to updating to 4.2.2...

Sent from my N4 Asylum
[Galaxy S II Themes and Apps] kwhit:
Just update my SGH-I727R to JB 4.1.2 and now when I try to apply this patch it comes up and says

"Can't find Email app. Enter the name of your Email apk or press enter to exit"

Any suggestions?

FYI, I'm rooted.
[Galaxy S II Themes and Apps] gordonzhao:
Worked for me. Using PA 3.0

Just used twrp and flashed the zip. But PA is also AOSP so that might be why it worked.
[Galaxy S II Themes and Apps] Generalgr147:
Ok so either the company I work for has some strange rules or I really messed something up. Basically I took off my account sync, then installed these apks and now when I go to add my account back it keeps saying "username/password wrong" I know they aren't wrong, I checked through my browser on the phone, and they worked before I installed these. So any ideas on what could cause that? Or how I can fix it?

Sprint Galaxy SIII Nightly CM 10.1 - 20130218

---------- Post added at 04:31 PM ---------- Previous post was at 04:12 PM ----------

Nevermind I figured out what was wrong. This is a great bit of work. THANK YOU!
[Galaxy S II Themes and Apps] Zlatko1983:
Hey, heads up - I just tried running this on my 4.2.2 AOKP S3 SHG-I747 and it doesn't seem to work anymore. Maybe I'm doing something wrong, but it's the same steps as I followed before.

Here is the cmd log file:

Cleaning up ...

Waiting for USB connection...

Checking device...

Model: SGH-I747, build d2att (4.2.2 JDQ39) Build 2.15.2013, android 4.2.2 (API L

evel 15)

/system mounted on /dev/block/platform/msm_sdcc.1/by-name/system, mode rw

checking root access. root uid: 0, secure: no, busybox: yes

Pulling app(s) ...

Pulling libs ...

Decompiling Email.apk ...

Applying patch ...

Patching com/android/emailcommon/provider/Policy.normalize()V

Recompiling ...

Building Email.apk ...

Decompiling Exchange2.apk ...

Applying patch ...

Patching com/android/emailcommon/provider/Policy.normalize()V

Patching com/android/exchange/adapter/ProvisionParser.hasSupportablePolicySet()Z

Recompiling ...

Building Exchange2.apk ...

Updating device ...

Unable to upload patched Email.apk. Please update /system/app/Email.apk manually

.

Unable to upload patched Exchange2.apk. Please update /system/app/Exchange2.apk

manually.

*** Device update failed.

Press any key to continue . . .
[Galaxy S II Themes and Apps] jamesey:
You ran out of space. Go into system/app and make room. Manually copy or just run it again
[Galaxy S II Themes and Apps] marshalllaw:
Just used app to restore the email app back up for 4.2.1 GNEX, OTA updated to 4.2.2.

The patcher does not recognise the usb connection now. Any thoughts?
[Galaxy S II Themes and Apps] fastguy:
You need latest adb from latest SDK. You can find small packages of updated adb here and there.
[Galaxy S II Themes and Apps] TuxDude:
Yes you need the newer adb which has support for public key authentication, and you need to approve the PC from your phone.

If you need the linux version of adb, I just uploaded it in this thread: http://xdaforums.com/showpost.php?p=38268626&postcount=3

The windows version is available here: http://xdaforums.com/showthread.php?t=2144709
[Galaxy S II Themes and Apps] marshalllaw:
AHHH *face palm*.

You are correct, thanks buddy. All seems to work now.

For those of you who didn't get that, download the ADB files and replace them in /lib/ folder of the patcher
[Galaxy S II Themes and Apps] eduncan911:
First of all, thanks for doing this! I've patched 2 other phones, and onto my 3rd. :)

But it is a must for me to remove remote wipe. You mentioned that most employers don't initiate remote wipe unless stolen? Not so, as two of my current clients have active IT policies that dictate "remote wipe" when an employee or contract agreement has ended.

As a matter of pure fact, one of my previous clients actually did remotely wiped my Ginerbread HTC Hero a few years ago - because it is part of their policy! I swore to never connect my phone again to a client's exchange, but with your patch I've been doing just that in the past. Now, I have another need to connect to a client's exchange server - and was looking to apply this patch, until I saw this... So basically, I am stuck until I can disable remote wipe.

How about making it optional? A simple dialog during the cmd script? And then pass it in as a parameter into the patcher?

Thanks for posting the source. I'm a C# guy myself, but I can dust off my 10-year old Java skills to see what i can do with it. My only question:

Could you point me to where to disable the remote wipe in code? Any special keyword?

I personally have two anti-virus programs that both have remote wipe capability. That's how I will wipe my phone if I ever loose it. I don't care for a client's exchange mailbox to wipe my entire phone.

Currently on CM10.1 JB 4.2.2.
[Galaxy S II Themes and Apps] frozndevl:
Waiting for USB connection...
Checking device...
Model: LG-LS970, build Imperium Initiative v1.0.2, android 4.0.4 (API Level 15)
/system mounted on /dev/block/platform/msm_sdcc.1/by-name/system, mode ro
checking root access. root uid: 0, secure: yes, busybox: yes
Pulling app(s) ...
Pulling libs ...
Decompiling Email.apk ...
Applying patch ...
Patching com/android/emailcommon/provider/Policy.normalize()V
Recompiling ...
Building Email.apk ...
Decompiling Exchange.apk ...
Applying patch ...
Patching com/android/emailcommon/provider/Policy.normalize()V
Patching com/android/exchange/adapter/ProvisionParser.hasSupportablePolicySet()Z

Recompiling ...
Building Exchange.apk ...
Updating device ...
Rebooting device ...
Done.

NOTES! PLEASE READ!

* All shortcuts to the Email app will disappear and will need to be re-created.
The Email app will appear on the last page of the application drawer.

Press any key to continue . . .

Worked just fine for me. Sprint LGOG
[Galaxy S II Themes and Apps] bharat4ever:
My mail server recently got migrated to Exchange Server 2010. I deleted my account and added it back. The exchange policy now forces me to set a pass code or a password. But does not force encryption. Am I doing something wrong, or can I help you in someway to upgrade teh hack to handle this?
[Galaxy S II Themes and Apps] jawil:
Thanks! Works perfectly on my Galaxy Note II! €5 euro donated! :)
[Galaxy S II Themes and Apps] :
For anyone else who has been beating their heads against the wall for the past month like me. To update the ADB version

1. download and unpack the email-policy-patch-3.2.zip from the opening post

2. download android-adb_fastboot-16.01.zip by following the links in TuxDude's post above

3. navigate to the lib directory under where you unpacked the email policy patch

4. replace the adb.exe, AdbWinApi.dll , AdbWinUsbApi.dll files you find there with the equivalent versions from android-adb_fastboot-16.01.zip

Now the patch will work.
[Galaxy S II Themes and Apps] Omar Essafty:
Thanks so much for your effort
[Galaxy S II Themes and Apps] koutheir:
Works like a charm!

Thank you so much for your effort! You made my day :)

The patch works on CyanogenMod nightly build 10.1-20130306-i9100 (Android 4.2.2).

I patched the Email and Exchange apps (Email2.apk and Exchange2.apk) on Linux.

To avoid issues, I cleaned the Dalvik cache after replacing the apps.

I found no issues so far, so thank you again :)
[Galaxy S II Themes and Apps] mojonba:
My company is using Google Apps Device Policy Application to enforce a pin. Would this hack work, or are Exchange policies different? Reason I am asking is that I use the Gmail application with my company Google Apps account and not the email application.

Thanks
[Galaxy S II Themes and Apps] 123chris:
What happens to my existing account?

Nevermind: found it after reading this thread for 82 pages. ;)
[Galaxy S II Themes and Apps] |Rene|:
After updating my S2 to Jelly Bean the Patch is not working anymore.

It says that email.apk cannot be found and request me to type the name of the email apk.

Anyone else with this problem? How can I fix it?
[Galaxy S II Themes and Apps] rustyx3:
JB 4.2 support added

Patch updated to support JB 4.2 ADB interface. Please try the latest version 3.3.
[Galaxy S II Themes and Apps] |Rene|:
Also not working. Got the same Error

Waiting for USB connection...

Checking device...

Model: GT-I9100, build JZO54K.I9100XWLSD, android 4.1.2 (API Level 16)

/system mounted on /dev/block/mmcblk0p9, mode ro

checking root access. root uid: 0, secure: yes, busybox: yes

Pulling app(s) ...

Can't find Email app. Enter the name of your Email apk or press <Enter> to exit:
[Galaxy S II Themes and Apps] CaspaTheGhost:
Have you typed in the name of your email app though?

The patch looks for Email.apk but if your on a Samsung based ROM then it won't be that!

Can't remember what it is but just check in system/app.

Sent from my N4 Asylum
[Galaxy S II Themes and Apps] rustyx3:
Can you run it in debug mode (apply-patch.cmd -d) and send debug.log back to me.
[Galaxy S II Themes and Apps] dave0812:
Does the rom need to be deoxed for this to work? i have ran it on deoxed roms with no problem but it is failing on one that is listed as odexed.
[Galaxy S II Themes and Apps] |Rene|:
Hi,

I attached the debug log.

The files are named as SecEmail.apk and SecExchange.apk and are located in /system/app.

I typed the names as requestes in your cmd file but it didn't work.
[Galaxy S II Themes and Apps] Widget21:
You need to enter the email app that is available on your device not what the OP states; in your case, enter 'SecEmail.apk'
[Galaxy S II Themes and Apps] |Rene|:
AW: [HACK] Removing keyguard and other security policy restrictions from Email apk

I tried different inputs. SecEmail, SecEmail.apk, /system/app/SecEmail.apk. Always got the same error.

I will try again and post the Screenshot.

Send by Tapatalk 2
[Galaxy S II Themes and Apps] rustyx3:
Hmm, it seems like your email app has been moved somewhere...

SecEmail.apk is there but it seems to be a symlink or something...

adb.exe pull /system/app/SecEmail.apk
remote object '/system/app/SecEmail.apk' not a file or directory

I've seen this happen before, but I have no automated solution for you at the moment... you can pull these manually and use the manual patch mode, then manually upload them back.
[Galaxy S II Themes and Apps] Technowolf:
How to run manual patch. when i double click the manual patch. cmd just flashes. nothing happens.
[Galaxy S II Themes and Apps] blulite:
My company does not allow exchange connections from Android to ActiveSync. How hard is it to change variables like "Device name:" that show up on the ActiveSync side of the connection. If I could hard code "iPhone" all would be good. I found some locations in :

find . -type f -exec grep -i "product.device" {} \; -print
const-string v1, "ro.product.device"
const-string v0, "ro.product.device"
const-string v0, "ro.product.device"
./com/android/emailcommon/utility/Utility.smali

I'm just not clear about the coding:

const-string v1, "ro.product.device"

invoke-static {v1}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;

move-result-object v1

invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

sput-boolean v0, Lcom/android/emailcommon/utility/Utility;->IS_DEVICE_AEGIS2:Z

Anyone help me out?

Thanks,

Jeff
[Galaxy S II Themes and Apps] cyman777:
Patch not working on N7000 (Note 1) with 4.1.2 Ultimate

Tried your patch with several ROMs on the Note, since JB it is not working. The latest 3.3 does not either. It asks for the location of Email.apk, once I enter it (/preload/symlink/system/app/SecEmail.apk) it runs and mentions it patches SecExchange.apk, pushes that back but on the phone: nothing, no difference. No error message from the script.

have tried to adopt the path to the log (with ../../ to work from root relative to /system/app) - still no success.
[Galaxy S II Themes and Apps] arifiano:
OTA will not work anymore when going from 4.1.1 to 4.1.2

I get the error:

assert failed apply_patch_check on secEmail

Ideas? Do I need to go back to stock email? Does anyone have these files?
[Galaxy S II Themes and Apps] rustyx3:
No that won't work, full paths are currently not supported, the path you type in will be stripped and replaced with /system/app.

Therefore, as I said before, for now use the manual mode (Start->Run...->cmd.exe, a shell will open, in there CD to the right directory then type: patch-manual.cmd, it will provide instructions about parameters that you have to provide), pull the SecEmail.apk+odex and SecExchange.apk+odex and the libs using ADB, run the patch, then upload patched SecEmail.apk and SecExchange.apk back to your phone replacing the old files using root explorer or something like that.
[Galaxy S II Themes and Apps] |Rene|:
Hi again,

just tried the manual patch. The patch works fine.

C:\Data\Galaxy S II\email-policy-patch-3.3

cd work

..\lib\adb.exe pull /preload/symlink/system/app/SecEmail.apk

..\lib\adb.exe pull /preload/symlink/system/app/SecExchange.apk

..\lib\adb.exe pull /system/framework/

patch-manual.cmd work 16 SecEmail.apk SecExchange.apk

Decompiling SecEmail.apk ...

Applying patch ...

Patching com/android/email/SecurityPolicy.isActive(Lcom/android/emailcommon/serv

ice/PolicySet;)Z

Patching com/android/email/SecurityPolicy.isActiveAdmin()Z

Patching com/android/email/SecurityPolicy.isSupported(Lcom/android/emailcommon/s

ervice/PolicySet;)Z

Patching com/android/email/SecurityPolicy.getInactiveReasons(Lcom/android/emailc

ommon/service/PolicySet;)I

Recompiling ...

Building SecEmail.apk ...

Decompiling SecExchange.apk ...

Applying patch ...

Patching com/android/exchange/adapter/ProvisionParser.hasSupportablePolicySet()Z

Recompiling ...

Building SecExchange.apk ...

2 apk(s) patched.

* Updated: SecEmail.apk

* Updated: SecExchange.apk

Done

Now I deleted the old APKs in /system/app and copied the new one's. After Reboot I set up my Exchange Account.
[Galaxy S II Themes and Apps] perfektt:
good, logic method - but ....

---

on my SGS Advance upgraded to recent JB (XXLQB) doesnt' work.

find dump log below:

UNEXPECTED TOP-LEVEL EXCEPTION:

org.jf.dexlib.DexFile$NoClassesDexException: zip file Se

ain a classes.dex file

at org.jf.dexlib.DexFile.<init>(DexFile.java:298

at org.jf.baksmali.main.main(main.java:269)

at sun.reflect.NativeMethodAccessorImpl.invoke0(

at sun.reflect.NativeMethodAccessorImpl.invoke(U

at sun.reflect.DelegatingMethodAccessorImpl.invo

at java.lang.reflect.Method.invoke(Unknown Sourc

at jpatch.emailPolicy.Run.runIsolated(Run.java:7

at jpatch.emailPolicy.Run.applyPatch(Run.java:43

at jpatch.emailPolicy.Run.main(Run.java:730)

Perhaps upgraded appplications?

I will check that.

Anyway - good job for authors in this threat !