yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Themes and Apps] kbravery:
Please...

Can Optimus G?

Please~~~ ;)

Cleaning up ...

Waiting for USB connection...

Checking device...

Model: LG-F180S, build IMM76L, android 4.0.4 (API Level 15)

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

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:

LGEmail3

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

continue: LGEmail3.apk

Pulling libs ...

Decompiling LGEmail3.odex ...

Error occured while loading boot class path files. Aborting.

org.jf.dexlib.Util.ExceptionWithContext: Cannot locate boot class path file com.

qualcomm.secureservices.pkcs.pkcs11.callback.jar

at org.jf.dexlib.Code.Analysis.ClassPath.loadBootClassPath(ClassPath.jav

a:207)

at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:14

1)

at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPathFromOdex(Cla

ssPath.java:103)

at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:94)

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

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at jpatch.emailPolicy.Run.runIsolated(Run.java:791)

at jpatch.emailPolicy.Run.applyPatch(Run.java:432)

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

Press any key to continue . . .
[Galaxy S II Themes and Apps] snempaa:
On my Huawei U8950D running 4.0.4, it seems to fail. After I applied the patch on Email.apk & Exchange.apk and I overwrite the original ones, deleted the odex files, rebooted and added the emailaccount. After I accepted the securitypolicy I still can't disable my lockscreen protection (this is a correct test right?).

Any tips?
[Galaxy S II Themes and Apps] tutuco:
It works great. I have a Galaxy S3 running JB 4.1.2.

Thanks
[Galaxy S II Themes and Apps] manujk25:
Emil.apk

Hi,

Where did you download the Email.apk file? I am not able to find in this thread.

Regards,

Manuj
[Galaxy S II Themes and Apps] Widget21:
I can confirm this method as described in OP works like a charm...on a Samsung Galaxy Note 10.1 Wifi N8010 - Stock JB 4.1.1

However it wasn't all plain sailing...First it didn't update device so went on forever, restarted the whole hacking process again, you need to enter the name of the email app that applies to your device, in my case it is 'SecEmail_Tablet.apk' and nothing else to delete, the script will take care of any other linked email app like .odex and exchange.apk and ~.odex.
[Galaxy S II Themes and Apps] bharat4ever:
I can confirm that this works properly on an S3 running CM 10.1. But I had one issue. It is unable to get root with Superuser app. It seems to work only with SuperSU app.

Do check this.
[Galaxy S II Themes and Apps] foogama:
Works on GSM Galaxy Nexus w/ 4.1.2

Confirmed working on my GSM Galaxy Nexus w/ stock Jelly Bean 4.2.1, build JOP40D.

I was skeptical after the phone restarted and I still had to enter my PIN, but after you re-setup the Exchange account and restart the phone, you can go in to settings and remove whatever PIN settings you want, and the email client still works just fine.

Thank you!!
[Galaxy S II Themes and Apps] ingmadal:
Hi all.

Trying to apply this patch, apparently it worked pulling email and exchange, decompiling, patching and recompiling, but at the end the script wasn't able to put the modified apps back.

Here's the log:

Checking device...
Model: GT-I9100, build OlloSII MoNsTeR, android 4.0.3 (API Level 15)
/system mounted on /res/dev/system, mode ro
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 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 ...
Unable to upload patched Email.apk. Please update /system/app/Email.apk manually.
Unable to upload patched Exchange.apk. Please update /system/app/Exchange.apk manually.

*** Device update failed.

Do I need to overwrite patched apps to the original ones manually?

What about permissions?

Is it better to fc email and exchange before overwriting?

Thanks for your help!

Bye

Ale
[Galaxy S II Themes and Apps] CaspaTheGhost:
Yes, you'll need to put the two patched apk's in system/app as the only issue was writing back to system. They are located on your SD somewhere IIRC.

Best bet it to rename the existing apk's with a .bak suffix, then copy the patched ones over and reboot.

Sent from my Nexus 4
[Galaxy S II Themes and Apps] ingmadal:
OK, done.

Modified email and exchange are in work directory on my pc, where I launched the script.

Copied in system/app, reboot and it worked!

Thanks to all,

Al
[Galaxy S II Themes and Apps] WUZAKING:
doesn´t work

Doesn´t work for me on the LG Optimus 4X HD, can anyone help?

Cleaning up ...

Waiting for USB connection...

Checking device...

Model: LG-P880, build IML74K, android 4.0.3 (API Level 15)

/system mounted on /dev/block/platform/sdhci-tegra.3/by-name/APP, 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:

LGEmail.apk

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

continue: EmailWidget.apk

Pulling libs ...

Decompiling LGEmail.odex ...

Applying patch ...

Unable to apply patch. File not found.

Decompiling EmailWidget.odex ...

Applying patch ...

Unable to apply patch. File not found.

*** Patch aborted.
[Galaxy S II Themes and Apps] mhoepfin:
Works perfectly on Sprint Note 2.
[Galaxy S II Themes and Apps] PDADoc:
Anyone know exactly where I would find these files on a Galaxy S III? I'm rooted, but for some reason, I can't see these files.
[Galaxy S II Themes and Apps] CaspaTheGhost:
Re: [HACK] Removing keyguard and other security policy restrictions from Email ap

Find what files? If you mean the ones that need to be patched, they are system apps so located in system/app.

Sent from my Nexus 4
[Galaxy S II Themes and Apps] PDADoc:
I found them. I was looking for email and exchange, but they were named secmail and secexchange.

I'll try and figure out the rest as I go, thanks. :)
[Galaxy S II Themes and Apps] CaspaTheGhost:
Yeah, that's them if you're on a Samsung based ROM.

Sent from my Nexus 4
[Galaxy S II Themes and Apps] gcamp0730:
Are you having trouble using this script? I have successfully patched my SGS3 in the stock rom, CM10, and just today CM10.1. The only thing that trips me up when I forget is not selecting root access for ADB (Settings -> Developer Options -> Root access, select "Apps and ADB").
[Galaxy S II Themes and Apps] PDADoc:
Yes, I am. For one thing, while I'm definitely rooted, I don't have any menu item under Developer Options for root access. Using an AT&T SGS3 on stock 4.1.1.

I'm going to try it again one last time and if I can't get it to go, I'll either try and get someone to walk me through it, or I'll just leave it for now.
[Galaxy S II Themes and Apps] PDADoc:
Well, I finally got it figured out enough to give it a go, and it seemed like it was all going well, but in the end, I ended up with this error message:

Cleaning up ...

Waiting for USB connection...

Checking device...

Model: SAMSUNG-SGH-I747, build JRO03L.I747UCDLK3, android 4.1.1 (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) ...

Pulling libs ...

Decompiling SecEmail.odex ...

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

UNEXPECTED TOP-LEVEL EXCEPTION:

org.jf.dexlib.DexFile$NoClassesDexException: zip file SecExchange.apk does not c

ontain 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(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at jpatch.emailPolicy.Run.runIsolated(Run.java:791)

at jpatch.emailPolicy.Run.applyPatch(Run.java:432)

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

Press any key to continue . . .

What does this mean, and what needs to be done to get it sorted?
[Galaxy S II Themes and Apps] twilightgod:
Thanks, it works for Xperia.
[Galaxy S II Themes and Apps] Hossy923:
Confirmed working on AT&T S3 4.1.1 UCDLK3 Stock ROM.

Thank you!!!!!
[Galaxy S II Themes and Apps] blitz_7:
Confirmed working on my Droid incredible 2. Thanks a million.
[Galaxy S II Themes and Apps] dbrown2:
Solved

Been working with CM 10.0, but after upgrade and a complete erase and install of 10.1 (4.2.1) email patch 3.2 does not work on my Galaxy Nexus Toro. The patch seems to work, but after reboot and creating the email account (for the first time) i get "security update required". If I flash back to 10.0 CM then all works fine.

Thoughts?

Checking device...

Model: Galaxy Nexus, build cm_toro-userdebug 4.2.1 JOP40D eng..20130120.202641 t

est-keys, android 4.2.1 (API Level 15)

/system mounted on /dev/block/platform/omap/omap_hsmmc.0/by-name/system, mode ro

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

Pulling app(s) ...

Pulling libs ...

Decompiling Email2.apk ...

testApplying patch ...

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

Recompiling ...

Building Email2.apk ...

Decompiling Exchange2.apk ...

testApplying patch ...

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

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

Recompiling ...

Building Exchange2.apk ...

Updating device ...

Rebooting device ...

Done

Solved, I did have to active administrator rights, but now working.
[Galaxy S II Themes and Apps] PDADoc:
Nobody can help me out?
[Galaxy S II Themes and Apps] MrNetwork:
I got this working on my VZW Galaxy Note 2--sort of.

I am able to bypass the PIN requirement, but for some silly reason it imposed a policy to refuse HTML email. So it is rather useless for email, but it works well to sync my Exchange calendar.

I use Maildroid in IMAP mode for mail, and it works very well. It's kind of a funky workaround.
[Galaxy S II Themes and Apps] CaspaTheGhost:
Have you checked the rest of this thread to see if it works on Sammy based ROMs at all?

Not sure whether they use the same exchange protocol as AOSP, the message refers to there not being a classes.dex file in their exchange app which makes me think that.

I know HTC use their own exchange protocol but I've always flashed AOSP, CM or AOKP on all my devices so haven't run into any issues myself.

Sent from my BAKED N4
[Galaxy S II Themes and Apps] PDADoc:
I did read through all the posts, and nothing indicated that it was incompatible with the S III. In fact, there seem to be quite a few users who've done it.

I finally got through the process and installed the certs through the mail app but when I send signed messages the certificate is invalid. So I tried to install the certificate through the security settings but it asks for a PIN and won't allow me to proceed without setting one up.

So something is wrong somewhere but I don't know what it could be. I've given up for now, but at least you responded to my query when no one else did, so thanks for that. :)
[Galaxy S II Themes and Apps] CaspaTheGhost:
Damn.

Only suggestion would be to use another ROM, so AOSP or CM for the S3 as they definitely work.

Even though its worked with the S3 previously I'm not sure build they were exactly.

Sent from my BAKED N4
[Galaxy S II Themes and Apps] PDADoc:
I might do that down the road. I'm new to Android so I want to get a little more experience with it before I start experimenting.

For now, it's on the back burner.

Thanks again!
[Galaxy S II Themes and Apps] CaspaTheGhost:
No worries man, I'm a proper pure Android fan. Don't like any of the manufacturer versions of it really, even if some do offer additional features.

Sent from my BAKED N4
[Galaxy S II Themes and Apps] gcamp0730:
I wonder if it's related to sending signed messages. Can you send normal email without problems? If so, then it might indicate the patch worked, but *doesn't* work when sending signed msgs. I don't have a cert or I would try it on my S3.
[Galaxy S II Themes and Apps] fastguy:
CM10.1 nightlies & patched email

Dears, I'm using this patch without issues on CM10.1 and I'm pretty happy. I know this has been discussed some time ago & I've gone through them again (page 52 if I remember right), but I'm having the policy enforcement problem each time I do a nightly update.

- If I re-patch it, the accounts get deleted and I have to re-create it all, I know this is because system is running & when we delete the apks, the account & data goes along with it.

- I create a ZIP file for CWM including only the patched apks. This is flashed after the nightly, but again, I am presented with the security policy enforcement.

I don't understand why, even if the apk's are replaced at CWM, I'm gain facing the enforcement? Could there be other files somewhere that are out of the APKs?

There's no other Email2.apk or Exchange2.apk in the filesystem.

Is the only way, as I've read in one of the post, to download the nightly to your computer, replace the apk in that ZIP with the patched ones, then transfer to the phone and flash that one?

Thanks a lot for any insight on this.
[Galaxy S II Themes and Apps] pbakula:
Thanks!

This* method works on SGS2 XWLS8 stock ROM.

*[Copy SecEmail apk+odex, SecExchange apk+odex and the content of /system/framework to the working directory and patch manually.]
[Galaxy S II Themes and Apps] CaspaTheGhost:
Have you tried flashing the nightly, letting it boot first, then back into CWM to flash the zip you made with the patched version?

The best way is actually via a script, specifically the one contained in Gapps that keeps them in tack after nightlies. You can add the two apks to the list.

Sent from my BAKED N4
[Galaxy S II Themes and Apps] cillin89:
Would anyone be so kind to give me a hand with this. I've done it 2 times with succes on both phones. This time I'm trying it on a Jiayu G3 with JB. Automatic nor manual patching works. I've also tried it with some pre-patched JB apk's from this topic without succes.

It'll be greatly appreciated if someone with a bit more technical knowledge would take a look at it.

I've attached the files in a zip: dl.dropbox.com/u/2634886/lib.7z

Thx in advance!
[Galaxy S II Themes and Apps] mygti02:
UPDATE: I figured this out....the rom that I am running has a spot under development tools where i can allow root for apps or ADB or both App and ADB...it was set to APPs only by default....changing it to Apps and ADB fixed the issue :)
[Galaxy S II Themes and Apps] Ninja Potatoe:
So, basically, I can set my password as only 1 character?
[Galaxy S II Themes and Apps] CaspaTheGhost:
Post that as a link mate, not just text as I can't just click it!

Sent from my BAKED N4

---------- Post added at 06:11 AM ---------- Previous post was at 06:11 AM ----------

Set it to what you like, its not enforced.

Sent from my BAKED N4
[Galaxy S II Themes and Apps] fastguy:
Hi. I fixed the issue. Basically, the update-script in the ZIP that I created was faulty. I took another ZIP file known to work for CM10.1 on N7000 and edited to it match for the Email2.apk and Exchange2.apk. Now it works :)

I'm attaching it in case someone would make use of it. Note that I only tested it on N7000 with CM10.1 nightly.
[Galaxy S II Themes and Apps] mygti02:
Has anyone got this working on a Stock rooted Nexus 10 tablet yet? I tried but Email.apk and exchange.apk keep Force Closing
[Galaxy S II Themes and Apps] tanpantsman:
Confirming that it worked flawlessly on SCH-i535 VRBLK3 4.1.1 root stock. Thanks!
[Galaxy S II Themes and Apps] andyandcait:
Fastguy, how do you run this? Should I just run the 2 APKs individually or is there another way?
[Galaxy S II Themes and Apps] fastguy:
If you are using cm10.1 like I do, then you just flash this in CWM each time you do a nightly update.

I will send a better method tomorrow hopefully.
[Galaxy S II Themes and Apps] Rithina:
Seems this one does not support LG. I I having the same issue with you for my Optimus G

Sent from my LG-E975
[Galaxy S II Themes and Apps] fastguy:
Hi, just extract this ZIP and put the extracted file to the /system/addon.d/ folder. With this, each time you update your nightly, your existing patched CM10.1 email2.apk and exchange2.apk will be backed up and restored automatically. However, we shall check changelog to make sure there are no updates to these apps.

Nothing else todo.

I would like to thank the developers & users in the GT-N7000 CM10.1 user discussion thread who gave me this hint.
[Galaxy S II Themes and Apps] ajadaah:
good subject

but i really want to know how to build source code of Email
[Galaxy S II Themes and Apps] MustGoFast:
I've used this successfully on my phone (Gnex) & tablet (Xoom - Wingray) in the past. Today I updated my tablet to CM10.1 and tried running this and it completes successfully but then after the tablet reboots the email app is no longer anywhere on the device that I can find.

Any thoughts as too why? I can't go back to our draconian policies.. Please help.
[Galaxy S II Themes and Apps] saqaw:
For me all the patching works ok on XWLS8, but when I configure the email and hit the activate button to enforce security policies I get a FC on Exchange services, ....any idea what could be happening here?
[Galaxy S II Themes and Apps] mygti02:
Anyone?
[Galaxy S II Themes and Apps] MustGoFast:
I can't figure out why this doesn't work on CM10.1 Works on all the other 4.2 ROMS I've tried it against, but on CM10.1 on my Xoom it runs successfully then after reboot there's no email anywhere on the device anymore and I have to reflash the ROM to get it back.

Anyone that can provide me some assistance here would be greatly appreciated.
[Galaxy S II Themes and Apps] fastguy:
It does work fine on my N7000 with CM10.1.

Have you checked if there's free space on your device system partition and if permissions are correct? Also try doing manually. Did you enable root for both adb and apps in developer settings?
[Galaxy S II Themes and Apps] saqaw:
Can somebody quote a complete procedure on how to make hacked AOSP email working on XWLS8?.

I have tried it, but after email configuration, the Exchange services keep on giving a error and then get closed.
[Galaxy S II Themes and Apps] MustGoFast:
I have significant free space and yes root is enabled for both adb and apps in developer settings. I'm not sure what permissions could be wrong (suggestions) - I've done this on several custom roms in the past on my GNex & Xoom and never had issues until the 10.1 build on my Xoom.

Also what do you mean by trying it manually?

The odd part like I said is the script seems to succeed as it always did in the past but after reboot email is just gone from the app list.
[Galaxy S II Themes and Apps] marc.ientilucci:
can anyone confirm that this patch works on mmuzzy's latest French Vanilla AOSP ROM for the GNex? (4.2.1) - also does it keep the widget in tact?
[Galaxy S II Themes and Apps] pradeepb:
Is it work for international s3 running on 4.2.1???
[Galaxy S II Themes and Apps] fastguy:
I recommend you to check the permission in system/app and make sure email and exchange apk has the same permission as other apk.

Manual, I mean there's a manual patch script in the package. You can also try it.
[Galaxy S II Themes and Apps] tutuco:
Yes. It works. I have one S3 Internation running Cyanogenmod 4.2.1. I recommend. :)
[Galaxy S II Themes and Apps] marc.ientilucci:
does this let you use the lockscreen widget?
[Galaxy S II Themes and Apps] CaspaTheGhost:
Yes, even if you still decide to use PIN like I do, they are still available.

Sent from my BAKED N4
[Galaxy S II Themes and Apps] BurningSoul:
Thanks! Have always wanted to do this and getting APKs with every update is just too slow.
[Galaxy S II Themes and Apps] nimchip:
Hey, is there supposed to be an entry under Settings>Security>Device Administrators for email after applying this patch? I know it says that you will get prompted, but I'm not sure if this is actually working considering the entry in Device Admins.

I vaguely remember a hacked apk that gave you the prompt but no entry under Device Admins, so perhaps this patch doesn't work that way.

Just wondering. Trying it out on CM10.1 M1 Galaxy Nexus.
[Galaxy S II Themes and Apps] EricCJacobson:
Might the modified apk be named "out-SecExchange.apk"?

After getting the "Unable to upload patched SecExchange.apk. Please update /system/app/SecExchange.apk manually." message, I tried manully moving over the file. I found it, I think, in the work dir on my pc, of the folder I launched the cmd file from. The only thing that seems off is that the file shows as a folder on my PC and when I tried to copy out-SecExchange.apk to /system/app, I renamed the file to "SecExchange.apk" but it does not display as an email icon.

Did I do something wrong?

SOLVED: Got it working after re-running the cmd script. Pretty cool script! Thanks to the OP!!!
[Galaxy S II Themes and Apps] MustGoFast:
Permissions are correct or at least to be expected and they match those on my other devices/roms where this works. I'm not sure how to use the manual script on here. Can you link me to a guide?

---------- Post added at 04:32 PM ---------- Previous post was at 04:09 PM ----------

I'm also updating to the latest CM10.1 nightly in case that helps...
[Galaxy S II Themes and Apps] nybble:
Unfortunately this doesnt seem to work.

I just tested on a Nexus 7 with CM10.1.

Ran the patching, all looked good. Associated the device to an exchange server that I can control.

After done, I initiated a remote wipe. My device rebooted and everything was gone.
[Galaxy S II Themes and Apps] ajislav:
this hack does not remove the remote wipe ability. see one of my older posts or search the thread
[Galaxy S II Themes and Apps] nybble:
I must have missed that. thanks for clarifying.
[Galaxy S II Themes and Apps] mko000:
Didn't know that either, thanks for the info. It would be great if this hack removed that too!
[Galaxy S II Themes and Apps] skatastic:
I'm running imnuts Infinity ROM on the droid charge. This works well for receiving emails and the security is indeed bypassed. The problem is that everytime I try to compose an email I get FC. Things I noticed is that the rom i'm using has the email apk named OzMail.apk. I renamed the apk in the op to match. I also tried without renaming. In either case I still got the same FC. Also there was no odex file to remove. Any idea how to fix the FC?
[Galaxy S II Themes and Apps] rustyx3:
Version 2.3.5 from XWKJ1 has been added to the first post.
[Galaxy S II Themes and Apps] redhatted:
Worked like a charm! Thanks a lot.

That password thing was beginning to become really annoying.
[Galaxy S II Themes and Apps] AMoosa:
I know this is a little off topic, but is it possible to hack the email.apk from the galaxy nexus ICS? If I post it here, would you be able to mod it?
[Galaxy S II Themes and Apps] rustyx3:
no. galaxy nexus has nothing in common with the galaxy 2 (no samsung code like touchwiz on which the samsung email app is based).