yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Themes and Apps] arvo.bowen:
I think there might be some confusion... I myself still have the device admin, but do not need any password or lock on my phone.

I'm currently using the streamlined version (Schmitt's flashable zip) that let's you retain the patch even if you reinstall/update CyanogenMod.

Since the patch I have applied at least 4 nightly builds. So re-flashing is not the issue... I think it has to do with what the admins enforce on you.

For example...

Your email servers admins might just require you to set a password that's hard and that's it...

As where mine requires everything.. Therefore after I apply the patch I still have a device admin because there are still many things my admins have access to do... :(

I wish the OP would have just made it get rid of ALL the security enforcements!

Arvo

Device: HTC One X

ROM: CyanogenMod 10.2 (Android 4.3)
[Galaxy S II Themes and Apps] arvo.bowen:
The last post you had with an attached image shows the device admin! :p

Arvo

Device: HTC One X

ROM: CyanogenMod 10.2 (Android 4.3)
[Galaxy S II Themes and Apps] ipprof:
Yes but it is unchecked. It cannot wipe without being checked.
[Galaxy S II Themes and Apps] arvo.bowen:
Josurr (post above mine quoted) shows no device admin...

Arvo

Device: HTC One X

ROM: CyanogenMod 10.2 (Android 4.3)
[Galaxy S II Themes and Apps] ipprof:
Yes I noticed that.
[Galaxy S II Themes and Apps] aymelis:
Works on my i9505 running Touchwiz/Orange ROM XUAME2

Thanks ! Worked fine on my i9505 on original Orange (Touchwiz) ROM (XXUAME2).

I had to do it twice though: first time I had not deleted my existing Email accounts, as it was said that they would disappear anyways, and the PIN security was still required before Email allowed me to read my messages.

Second time I removed my Email accounts first (after I had replaced from adb shell the .BAK back to their original file names), and re-launched apply-patch.cmd from my windows command-line. This time it worked !

Thanks a lot :good:
[Galaxy S II Themes and Apps] john3166:
now this is something useful and handy

i was looking something like this in playstore
[Galaxy S II Themes and Apps] arvo.bowen:
Ha! Play store...

Arvo

Device: HTC One X

ROM: CyanogenMod 10.2 (Android 4.3)
[Galaxy S II Themes and Apps] arvo.bowen:
Good lord you must have a zack morris phone... the resolution on that is redonkulous....

I'm happy you have yours working like everyone else wants but that (to me at least) just means your server admins don't enforce what mine do... Yours simply wanted you to have a password on your device. Mine want EVERYTHING... They want to control my device in and out as much as possible...
[Galaxy S II Themes and Apps] bricenott:
I see. Did they gave you your phone?
[Galaxy S II Themes and Apps] weslyr:
I just want to post a (possible) solution for people who get the following error message:

"Unable to remount system partition for writing (are you root?)"

By default CM10-based ROMS only allows root access from Apps not ADB.

Go to Settings -> Developer options -> Root access, and change option to "Apps and ADB".

Now the patch should be able to detect root and remount the partition for writing.

If you prefer to apply the patch manually on a CM10-based ROM, then you will still need to change the above setting or you will get a 'permission denied' when issuing SU over adb shell.

If you get a 'device offline' message during 'adb devices' then you need to upgrade adb (to version 1.0.31)
[Galaxy S II Themes and Apps] arvo.bowen:
Not at all.... And that's why I think this should not be aloud... I and I alone should be in control of my device...
[Galaxy S II Themes and Apps] bricenott:
Bastards... Je je je, what's your company again? , so no one else makes the mistake...
[Galaxy S II Themes and Apps] zdravke:
At first, patch seemed to work. I even got few days worth of emails, but then it stopped working. No new emails arrived ever again. No errors, nothing.
[Galaxy S II Themes and Apps] arvo.bowen:
Reapply patch, maybe the app was updated or something changed...

Arvo

Device: HTC One X

ROM: CyanogenMod 10.2 (Android 4.3)
[Galaxy S II Themes and Apps] delaneybob:
Did not work for me

Did not work for me- . .

Completed with no errors

Verizon Samsung S4 4.2.2

I still get lock screen
[Galaxy S II Themes and Apps] delaneybob:
Sorry my error- it worked!
[Galaxy S II Themes and Apps] zdravke:
It says already patched and aborts.
[Galaxy S II Themes and Apps] arvo.bowen:
Did you use titanium by chance to back up the phone before hand? If so restore the original then repatch. If you used the auto patch script like I think you did then use a file manager to rename the two files from .bak to the non backed up filename after deleting those two files. Exchange2.apk and Email.apk
[Galaxy S II Themes and Apps] zdravke:
Somehow it started working - I was checking account settings and when I reapplied them, email started syncing. Thanks.

sent from W200 using xda app
[Galaxy S II Themes and Apps] arvo.bowen:
Don't be greedy with the thanks.. ;)
[Galaxy S II Themes and Apps] newyankee:
Patch not working on CM10.2 - Mobile Device ID

I have installed the patch successfully on ICS 4.0.4 (Samsung GT-P7500). Because of greatly improved performance I have moved on to JB 4.3 / CM10.2.

Exchange server denies access with CM10.2 because the mobile device ID is generic "androidc########" and not SEC###### or SAMSUNG######. Is it possible to integrate a user defined mobile device ID somewhere into the patch suspecting that this ID is stored in one of the email files.?

(adjusting host name and such with android device id apps doesn'T help)

Thanks
[Galaxy S II Themes and Apps] Bolick:
From what I see on my phone there's a file "/data/data/com.android.email/files/deviceName" that contains device name. Exactly the one "androidc####".

Why don't you try to change its contents manually and then try to connect to your Exchange server?

Another question is why are you so sure exchange server refuses your prone because of this particular device name?
[Galaxy S II Themes and Apps] newyankee:
I will try that.

I am not.

However, I can successfully connect with the same hardware using ICS 4.0.4 (Samsung Stock ROM). I am trying to narrow this down to few factors. And there is an exchange rule that can be used to exclude devices based on Mobile Device ID. Since the security in my company is extensive (keyguard, forced device encryption, that I can successfully circumvent with the patch) I suspect that the exclusion rule is active as well.

What else could be the problem?
[Galaxy S II Themes and Apps] newyankee:
I did change the Mobile Device ID - doesn't work. Access is denied. Any pointers on how to solve this? Going back to ICS is not a desirable option....
[Galaxy S II Themes and Apps] ipprof:
Which are you using? The op's methods or Schmidt's flash?
[Galaxy S II Themes and Apps] arvo.bowen:
The more we talk about it here I think Schmidt's version should be on its on thread.... Even though I use it too. ;)
[Galaxy S II Themes and Apps] newyankee:
I am using the OPs method from this thread.
[Galaxy S II Themes and Apps] arvo.bowen:
Try using Schmidt's version. Its easy. Just download it to your internal SD storage, then boot into recovery (such as twrp) and install it, then boot the phone back up and try to clear the mail apps cache then set the account back up.

Arvo

Device: HTC One X

ROM: CyanogenMod 10.2 (Android 4.3)
[Galaxy S II Themes and Apps] prabhjots:
OP, can you share the source for version 3.3, please?
[Galaxy S II Themes and Apps] gcamp0730:
Source is the same as 3.2, only the adb tools were updated.
[Galaxy S II Themes and Apps] prabhjots:
Remote Wipe

OP, Thanks for all the hard work, can you also provide a patch with remote wipe feature disabled?
[Galaxy S II Themes and Apps] arvo.bowen:
Wish it was that easy... I think it has to stay in or it breaks the app... :(
[Galaxy S II Themes and Apps] prabhjots:
I know it's not going to be easy, the first step would be to upgrade the source to include the latest smali build instructions using gradle.

The mentioned maven instructions do not work. OP, can you help here, please?
[Galaxy S II Themes and Apps] NegativeOne:
Has anyone confirmed whether this blocks remote wipe?
[Galaxy S II Themes and Apps] newyankee:
Not working

Changed device ID - not working

Tried Schmitt'S flashable: Can't flash that with TWRP, error.

I am not sure the patch is the issue at all. I can't even create the activesync account with or without the patch. "Access to sync has been denied by administrator" (or similar).

I am at al loss here. On ICS, the account and the patch were working nicely. However, ICS is rather laggy.
[Galaxy S II Themes and Apps] ipprof:
I used twrp to flash Schmidt. No problems at all.
[Galaxy S II Themes and Apps] arvo.bowen:
Sounds like a bigger issue... If the install fails in twrp then give us the error... Are you sure you rooted your phone???
[Galaxy S II Themes and Apps] wessel99:
3.3 did not work on my windows8 64 bit machine, but still worked on win7 64bit on an Xperia Z1, using semcEmail.apk as app name.
[Galaxy S II Themes and Apps] smallfrys:
Saving for when phone is rooted.
[Galaxy S II Themes and Apps] rs200z:
Can I ask if v3.3 will work with Galaxy Note 3 running Android 4.3?

Update: Ok, I went ahead and tried it on my rooted Note 3. No joy... hopefully the author will update it soon.
[Galaxy S II Themes and Apps] ashwinrajsr:
Works great on international S4 with the latest update. Thanks a lot!!
[Galaxy S II Themes and Apps] wanted008:
Could you please provide a link to (Schmidt's version).
[Galaxy S II Themes and Apps] ipprof:
It's on page 105

http://xdaforums.com/showthread.php?p=45260741
[Galaxy S II Themes and Apps] millinnium:
attempt on S4 I9505XXUEMI8 to patch did not work

Hi Guys, I read that the patch should work on Android 4.3 i tried it on Galaxy S4 runnning I9505XXUEMI8 firmware and got this error:

Checking device...

Model: GT-I9505, build JSS15J.I9505XXUEMI8, android 4.3 (API Level 16)

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

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

Pulling app(s) ...

Can't find Email app. Enter the name of your Email apk or press <Enter> to exit:

SecEmail_J.apk

Pulling libs ...

Decompiling SecEmail_J.odex ...

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 ...

work\out-SecEmail_J.apk\sstream\lib\objs\StoryItem.smali[0,-1] mismatched input

'<EOF>' expecting END_METHOD_DIRECTIVE

Press any key to continue . . .

Do you know this error means?
[Galaxy S II Themes and Apps] wessel99:
Update: although the script seemed to work well, I still get the question to update my security profile and choose a password :(
[Galaxy S II Themes and Apps] fastguy:
I've seen that on Touchwiz, the actual apk are in /preload partition. When I did automatic patching, it did not fail but did not remove the policy neither. Then I patched them manually, removed the apk from /preload and pushed the hacked versions to /system. After a reboot, everything is good.
[Galaxy S II Themes and Apps] mpcjanssen:
Same happens on the latest Note II 4.3 leak. This probably means that the code has changed in such a way that after doing the text replacements in the smali code, the result cannot be compiled anymore. This requires an update of the patch jar.

EDIT: The compile error is not in one of the patched smali files. So I suspect it needs a newer smali/baksmali version. Will check this and report back.

EDIT2: If you manually deodex the odex files (using smali and baksmali 2.0b6) and create a deodexed apk then using patch-manual with that works. Explaining how to deodex goes a bit too far for this thread.

EDIT3: Also confirmed that the patched deodexed files actually work.
[Galaxy S II Themes and Apps] drquest:
Just applied this to my Samsung S3 and so far so good :good:
[Galaxy S II Themes and Apps] ntquartex:
Anybody tried on htc email app?

Sent by Tapatalk 4 on HTC OneX...
[Galaxy S II Themes and Apps] bigjobber69:
Can anyone confirm this working for sgs3 with cm10.1?
[Galaxy S II Themes and Apps] fastguy:
Yes it was working for me when I was on cm 10.1 on n7000.
[Galaxy S II Themes and Apps] bigjobber69:
I used the flash version and it borked me pretty good. I deleted the account first and re-added it and it wouldnt work then couldnt add it at all. Maybe I was suppose to leave the account alone not sure. Anywho Had to reflash rom and start fresh. Wont be trying this again.
[Galaxy S II Themes and Apps] zdravke:
Is this supposed to work on cm10.2, cos it fails for me with some storage mount errors
[Galaxy S II Themes and Apps] fastguy:
Do you have root access on USB adb connection? Maybe have a look at developer options
[Galaxy S II Themes and Apps] zdravke:
Spot on, root access was not enabled through adb. Did not get any errors on second run, should work I guess. Thanks!
[Galaxy S II Themes and Apps] Bromsoket:
rustamabd,

Big thanks for this excellent patch, its been working perfectly on my Xperia Z

but on the latest FW (10.3.1.A.2.67) its not working anymore.

Its not working on the new Xperia Z1 either (FW 14.1.G.1.534)

Any chance (or if it is possible) to update the patch/script to support the new FW and Xperia Z1 ?

Thanks :)

Regards
[Galaxy S II Themes and Apps] laithe:
Works with Droid Maxx!

So I know the OP says that this doesn't work with Motoblur, but it does work with the new Droid MAXX. It may be because now that Motorola is owned by Google they have a much better (and nearly stock) experience? No more motoblur?

Anyway, just be sure to use MotoEmail.apk for the Email APK name when asked, and leave the exchange APK name blank. It worked just fine!

This patch is fantastic, and makes life so much better when using the email app.

(Sorry if this has been posted before)
[Galaxy S II Themes and Apps] prepo1:
Hi, I have allways this error:

Unable to remount system partition for writing (are yout root).

https://www.dropbox.com/.................

Can anybody help me?

details about my phone:

philz_touch_5.15.0-n7100

UPDATE-SuperSU-v1.65

more info in screen on dropbox

Thanks.
[Galaxy S II Themes and Apps] jsauder2:
Seems like that is happening a lot to people. You can do it manually and it will work. If the script made it that far, the apk's are already patched, it just ran into issues when trying to push them back to your phone. All you need to do is go into the work folder that the script created, and pull the email and exchange apk's (these will differ depending on what device you are using). Then transfer them to your phone. Backup the original apk's from system/app/ then delete those files and put the patched ones in system/app/. Make sure the permissions are set to the same as other apps in that folder, wipe data for the email and exchange apps and reboot. Then you should be good to go.

If you don't want to have to do that every time you flash an update, someone posted a zip file a ways back that has a backup script in it. If you find the zip, pull the script out of the system/addon.d folder and put it in the system/addon.d folder on your device, set permissions, and reboot. Then as long as you don't wipe system, they email apk's will stay patched through a ROM update.
[Galaxy S II Themes and Apps] mpegripper:
that seems to be a problem with 4.3 roms

the workaround listed above me does work.
[Galaxy S II Themes and Apps] ipprof:
The Schmidt zip file works though.
[Galaxy S II Themes and Apps] bigjobber69:
What phone/rom you have set up?

did you erase the corporate account then re add it. or flash while still had the corp account enabled? Cause I erased then tried to re add it and didnt work and had to wipe data. Wh
[Galaxy S II Themes and Apps] ipprof:
Actually what i did was to flash the rom again after flashing the zip file. I think that helps activate it. Then I had to set up my account again. But no time did I wipe data.

Att note1 running on tmo
[Galaxy S II Themes and Apps] bigjobber69:
no i mean I deleted my corp account, then flashed this zip. then tried setting it up and it just hung and never pushed through. I couldnt get my account back so I had to wipe data and reflash my base rom. Someone made me a flash a while back for cm10 that worked brilliantly but i cant emulate it for cm10.1.
[Galaxy S II Themes and Apps] zdravke:
I had to go back to stock 4.3 due to issues with CM10.2, so now this script fails to mount system in rw:

Recompiling ...

Building Exchange2Google.apk ...

Updating device ...

*** Unable to remount system partition for writing (are you root?).

Nexus 4 is rooted for sure and busybox is installed. I see that someone resolved this by pushing files manually, but I would like to resolve this properly, as I might need to do it quite often. Any ideas?
[Galaxy S II Themes and Apps] jsauder2:
I know this isn't technically answering your question, but you can always just leave a copy of the apk's on your internal memory. Then just copy them over to system/app when you need to. That's faster anyway. There is also a backup script that will save them between ROM updates.

Sent from my Nexus 4
[Galaxy S II Themes and Apps] zdravke:
Good idea, but too late to try it now...
[Galaxy S II Themes and Apps] zdravke:
I tried pushing the two patched apk files manually from /work to system/apps with root explorer, but with new files exchange option does not show - only pop and imap.

What is the exact procedure for manual patched apk install?
[Galaxy S II Themes and Apps] jsauder2:
Are you sure you copied the apk for exchange too? And set the permissions/owner? Sounds like it's not seeing the apk needed for exchange.

Sent from my Nexus 4
[Galaxy S II Themes and Apps] zdravke:
Thanks for that, there was a permissions issue which is fixed now and exchange does appear. However, the files I thought were patched were actually not, so I got prompted for full blown security measures again, like nothing happened. Back to square one.
[Galaxy S II Themes and Apps] askim40:
I could deodex the odex files using baksmali, but then how to create deodexed apk is kinda out of my knowledge, could you please give a hint to do that?

Regards,
[Galaxy S II Themes and Apps] mpcjanssen:
After deodexing you will have an out directory. You will need to use smali to create a classes.dex file from this. You can then add this file directly into the apk. Rename the apk to ....zip and using a zip client add the classes.dex file in the root of the zip, then rename it back to apk.
[Galaxy S II Themes and Apps] mpasanthosh:
Help for Note 2 Leaked ROM.

Can some one please upload me the patched apk file for the note 2 leaked rom android 4.3.

I am getting the mount error when i try to run the patch with secemail_j.apk.

Thanks in advance.

Cleaning up ...

Waiting for USB connection...

Checking device...

Model: GT-N7100, build JSS15J.N7100XXUEMI6, android 4.3 (API Level 16)

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

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

Pulling app(s) ...

Can't find Email app. Enter the name of your Email apk or press <Enter> to exit:

secemail_j.apk

Pulling libs ...

Decompiling SecExchange.odex ...

Applying patch ...

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

Recompiling ...

Building SecExchange.apk ...

Updating device ...

*** Unable to remount system partition for writing (are you root?).

When i see the work folder i only have the secexchange.apk and not the email file.
[Galaxy S II Themes and Apps] gordonzhao:
I had to use this on my past devices but mow with the note 3 I just use knox and problem solved!
[Galaxy S II Themes and Apps] flakz0r:
Ron Amadeo just posted the new Email app from KitKat on G+:

https://plus.google.com/104025431341062052230/posts/N6AzgJdGCF7

:)
[Galaxy S II Themes and Apps] sordna:
Could you explain how Knox works?
[Galaxy S II Themes and Apps] scorneil:
Anyone tried this? I assume installing this breaks the hack but just wondering...
[Galaxy S II Themes and Apps] flakz0r:
Yeah, the hack stops working. Didn't try to patch it yet, i doubt it will work... we'll probably need an update.
[Galaxy S II Themes and Apps] Chahk:
Tried it, and it reported success. Since you still need to allow device admin to Email, is there a way to find out if it's really working? I mean other than pissing off your IT department into trying to wipe your phone ;)
[Galaxy S II Themes and Apps] litso:
You will know it worked if you are not required to set a PIN lock on your phone. If you can set the lock screen to the slider mode, the the patch worked.

I haven't been able to get the patch to work on my HTC One running the latest CM10.2 nightly. Has anyone else had any success? Someone on G+ said that they were able to bypass Exchange security using an Xposed mod, but I can't get that working either.
[Galaxy S II Themes and Apps] zard:
I've attached in my post just before yours.
[Galaxy S II Themes and Apps] zard:
Anyone has an untouched SGS II email.apk for me to do some troubleshooting for my Note? Thanks.
[Galaxy S II Themes and Apps] rustyx3:
@zard, can you pls run adb shell mount in a console and PM me the output? I'll update the script.
[Galaxy S II Themes and Apps] rocky_pratik:
Thanks bro
[Galaxy S II Themes and Apps] rjhuang:
The patch v1.1 works for Taiwan version Galaxy Note!

Hi rustamabd,

I tried the new patch on my Taiwan version Galaxy Note (ZSKK1) and it works with no error. So far works like a charm! My only question is that the patched Email.apk is much smaller (4.x mb) than the S2 version (7.x mb). But it works anyway. Just want to report you the test result! Thank you so much for the awesome work!
[Galaxy S II Themes and Apps] zard:
@rustamabd,

May I know what are you looking for? Do you want the output with my source email.apk with Exchange email account configured or do you need me to apply your Taiwan patch before doing the dab shell mount?

Fyi, I'm currently testing my own patched email.apk from source 2.3.5 KL1 using information from another thread and testing it since last night. So far for about 12 hours, no "IRM not supported" has not shown up, which normally pops up after after my pushed email schedule changes to manual sync at the end of the day.

I will be able to PM you earliest tonight or tomorrow morning after you let me know what you need.
[Galaxy S II Themes and Apps] zard:
Looks like something is not right with my modded email.apk or the method I used doesn't solve the wrong "IRM not supported"

because I still encountered again. Looks like I have to check what I had and do more testing. :-[
[Galaxy S II Themes and Apps] zard:
@rustamabd Check your PM for the Output from "adb shell mount" from my Note with source email files.
[Galaxy S II Themes and Apps] zard:
I believe my modded email.apk for the Samsung Note using 2.3.5 KL1 source firmware is working. Here's the link: http://xdaforums.com/showpost.php?p=19974013&postcount=1
[Galaxy S II Themes and Apps] 99olliver99:
HELP

SORTED!

newbie here, trying out my Samsung Galaxy S2 (2.3.5), leaving my iPhone behind

want to get rid of exchange password policy on my SGS2

copied patched email.apk to /mnt/sdcard/download and then tried to copy it into /system/app with Root Explorer. Says not enought space and now email.apk is gone and with it my email application

I'm not really getting the understanding for Rooting my Samsung but have managed to do so with SuperOneClick, then trying to get into the phone with DroidExplorer without success, just can see any files there

Any assistance appreciated, pls step-by-step as this is a new world coming from jailbreaking iPhones with success for some years now

Thanks