yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Themes and Apps] mawster:
Thanks! Worked great on my SGS running 2.3.6

Thanks alot for this!

Worked like a charm!

So easy, just run it and voila! Great packaging! Wow!

I am running a close to stock rom, 2.3.6. (the "DeStockRom 1.3.1, very close to stock 2.3.6) on a samsung galaxy s.

Just ran it so I have to wait and see for more, but so far it works great.

Thanks alot!

(where does one click to register a "thanks"? cant see it, and I really looked...)
[Galaxy S II Themes and Apps] nfribeiro:
Sorry guys but I need your help. I'm a little confused...

The solution is to run the apply-patch while the phone is connected to the pc or to replace a email.apk? Where is this file?
[Galaxy S II Themes and Apps] dorongr:
Hi!

I've used the patch successfully on any Android 2.3.x, and now I'm running CM9 - any chance of making the same patch for ICS?
[Galaxy S II Themes and Apps] mawster:
Yes, dl zip file. You must have cell connected to pc and have Kies installed (but not running). Then run from commandprompt.

godd luck!
[Galaxy S II Themes and Apps] nfribeiro:
Thank you for your help but it doesn't work. Nothing happened...:(
[Galaxy S II Themes and Apps] rustyx3:
Updated smali - please try the new patch version 1.2 attached to the original post. Let me know if it works, as I don't have an actual ICS device to test atm.
[Galaxy S II Themes and Apps] aHcVolle:
i tried it and this was my output:

Cleaning up ...
Waiting for USB connection...
Checking device...
Model: GT-I9100, build IML74K, android 4.0.3 (API Level 15)
/system mounted on /dev/block/mmcblk0p9, mode rw
checking root access. root uid: 0
Pulling Email app ...
Pulling libs ...
Decompiling ...

*** Unable to apply patch. Class SecurityPolicy.PolicySet not found.

Press Enter to exit ...

do you need anything more to make this work?

Thanks!
[Galaxy S II Themes and Apps] rustyx3:
This means unfortunately that it is impossible to apply my patch to Android 4.0.3, as the basic structure isn't there anymore.

You'll have to wait until someone else makes a patch for your phone ...or until I get mine upgraded :D My contract runs until May though... so it may be a while...
[Galaxy S II Themes and Apps] aHcVolle:
That doesn't sound too good :<

i've uploaded the "work" directory of your patch, maybe someone can work out something useful with this data..

Link: www.activehitzclan.de/Volle/work.zip

(sorry, can't post external links because of my post count... )

Thanks for your great work!

[Edit]

this Email.apk did work for me:

http://xdaforums.com/showpost.php?p=21406216&postcount=122

Thanks to viddy
[Galaxy S II Themes and Apps] ironicsky:
Errors

Hey all,

I am trying to mod my Email.apk app as per this thread, and get the errors below when running the script.

Any advice would be awesome! I am running MIUI on my Infuse 4G. Would this cause an issue.

If I remount /system as rw I get the same error

Cleaning up ...
Waiting for USB connection...
Checking device...
Model: SGH-I997, build MIUI.1.12.23, android 2.3.7 (API Level 10)
/system mounted on /dev/block/stl9, mode ro
checking root access. root uid: 0
Pulling Email app ...
Pulling libs ...

*** Unable to pull framework jars

Press Enter to exit ...
[Galaxy S II Themes and Apps] trunzoc:
nevermind, I lied. It's not syncing
[Galaxy S II Themes and Apps] jnichols959:
Worked on Moto X with Android 4.2.2 from a mac. Thank you very much.
[Galaxy S II Themes and Apps] Therrm:
Hello guys,

Did anyone tried this on 4.3?
[Galaxy S II Themes and Apps] Fruitgull:
Works for me on Cyanogen 4.3.1 (S3). Naturally I'd to reapply it after updating to 4.3.
[Galaxy S II Themes and Apps] plexuzflexuz:
Lg g2 d802

Did not work on my LG G2 D802 4.2.2 :(
[Galaxy S II Themes and Apps] prabhjots:
Try this new kitkat email with security settings fixed.

http://xdaforums.com/showthread.php?p=47063058
[Galaxy S II Themes and Apps] gismo2004:
Has someone tried this on Nexus5? for me the mentioned apk's are crashing...

cheers

Edit: working after removing odex files?! strange isn't it?
[Galaxy S II Themes and Apps] mattsday:
Confirmed that it's working perfectly on my Nexus 5 running 4.4.

Was one of my biggest worries upgrading from Nexus 4... Ran the patch (API level 19 if that makes a diff), remounted /system read-write, deleted the existing .odex and .apk files, replaced with patched ones and rebooted...

Set up email as usual and have a nice brand new email app that's syncing with our Exchange server - no password/PIN restrictions.

Thanks!
[Galaxy S II Themes and Apps] jimbobmcginty:
I got this working great on my i9505 S4 with the most recent 4.3 UK release / BTU XXUEMJ7 (which I rooted) from 15th October, thanks to mmulq.

I've put my patched apks at http://d-h.st/U60

Remember to

- Remove any exchange accounts you have already configured

- Clear all app data for email and exchange

- use Root Explorer or similar in /system/app to rename the existing SecExchange.apk / .odex and SecEmail_J.apk / .odex files (e.g. add an extra ".backup" to the end of the name)

- copy in the new patched apk files to the same location

- reboot

If these patched apks don't work for you, please don't come asking me why - I just followed the instructions and it came good.

Again thanks to mmulq for the easy to follow instructions - the only thing I'd add is all the files in /system/framework need to be copied into workdir, not into workdir/framework. I think it was me not quite following the instructions verbatim :)
[Galaxy S II Themes and Apps] gunigugu:
Any chance you can detail exactly what you did?

When I run it I get the following:

Recompiling ...

Building Exchange2Google.apk ...

Updating device ...

*** Unable to remount system partition for writing (are you root?).
[Galaxy S II Themes and Apps] myeyez:
I get the same error. Nexus 5, stock rom, rooted, twrp.
[Galaxy S II Themes and Apps] mattsday:
I use a Mac where the process is more manual, but my guess is you first need to do the following:

adb shell
su
# at this point you may need to tap "grant" on your device
mount -o remount,rw /system

Then run the application again to do the recompilation. Once done, reboot your device.

Here's the exact process I run. You may wish to run line by line on a Unix-style box:

mkdir work
cd work
adb pull /system/app/EmailGoogle.apk
adb pull /system/app/EmailGoogle.odex
adb pull /system/app/Exchange2Google.apk
adb pull /system/app/Exchange2Google.odex
cd ..
cp work backup
cd work
adb pull /system/framework
cd ..
sh apply-patch-nix.sh work 19 EmailGoogle.apk Exchange2Google.apk
cd work
adb push EmailGoogle.apk /sdcard/
adb push EmailGoogle.odex /sdcard/
adb push Exchange2Google.apk /sdcard/
adb push Exchange2Google.odex /sdcard/
adb shell
su
mount -o remount,rw /system
rm /system/app/EmailGoogle.*
rm /system/app/Exchange2Google.*
cp /sdcard/EmailGoogle.apk /system/app/
cp /sdcard/Exchange2Google.apk /system/app/
chmod 644 /system/app/EmailGoogle.apk
chmod 644 /system/app/Exchange2Google.apk
rm /sdcard/EmailGoogle.apk
rm /sdcard/Exchange2Google.apk
reboot
[Galaxy S II Themes and Apps] gunigugu:
Found the answer to my own problem.

It's actually modified the email apps already in the newly created work folder on your PC, but for whatever reason isnt able to copy them over. This is easy enough to do manually.

I just copied them (EmailGoogle.apk" and "Exchange2Google.apk) to the phone, and then on the phone using a file manager with root access (I use solid explorer) copied them to "Internal"\system\apps.

Restart phone and yay! New email application with no security :)

Hope that helps and makes sense.
[Galaxy S II Themes and Apps] prabhjots:
It isn't without security. It only removes PIN and not the device admin. Try remote wiping and you'll find.
[Galaxy S II Themes and Apps] twosix:
Can anyone advice if this works on Note 3 GT-I9005?
[Galaxy S II Themes and Apps] malajo:
It asks me to install a PKCS#12-file?
[Galaxy S II Themes and Apps] pprakash:
Help Needed for Leaked SGSIII 4.3

You have to input the Email App as SecEmail_J -- Note S , E & J in caps.

But even after doing that I am getting below error. I feel we need an updated verions of the email-policy-patch.jar file which supports 4.3 Samsung Galaxy SIII.

Recompiling ...
work\out-SecEmail_J.apk\sstream\lib\objs\StoryItem.smali[0,-1] mismatched input
'<EOF>' expecting END_METHOD_DIRECTIVE
[Galaxy S II Themes and Apps] abegazo:
Help Needed for SGSIII 4.3 - SecEmail_J.apk

I also have the same issue as [MENTION=408205]pprakash[/MENTION], with the SecEmail_J.apk that came with the new 4.3 ROM for SGSIII.

C:\epp>apply-patch.cmd
Waiting for USB connection...
Checking device...
Model: GT-I9300, build XXUGMJ9 NeatROM Lite v5.3, android 4.3 (API Level 15)
/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:
SecEmail_J
Pulling libs ...
Decompiling SecEmail_J.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 ...
work\out-SecEmail_J.apk\com\android\emailcommon\service\AccountServiceProxy.smal
i[0,0] Must call setParent before comparing AnnotationDirectoryItem instances

Press any key to continue . . .

Has anybody found a workaround?
[Galaxy S II Themes and Apps] rajeshm:
Help required from OP Rustamabd

Rustamabd , Can you please look into this and port a new email security policy using SecEmail_J for the new android 4.3 release for Samsung S3 I9300.

Thanks in Advance.
[Galaxy S II Themes and Apps] ingmadal:
In my case, SG4 i9505 with 4.3, I had no issue using the hack.

I only had to manually copy email and exchange back into /system/app, due to a problem with root.

But the recompiling of the app didn't give errors.

If needed, I may post here my SecEmail_J and SecExchange already patched.

Ciao

Alessandro
[Galaxy S II Themes and Apps] rajeshm:
Yes, please attach..that will help me test.

Also, did you use email-policy-patch3.3 to to remove the security policy or any other tool.
[Galaxy S II Themes and Apps] ingmadal:
Here you are.

https://www.dropbox.com/s/k78pnnyj6o1jjr6/SecEmail_J_Hacked.zip

Yes, I used the 3.3 and it worked normally pulling aps and lib etc.

As I said, it didn't put the patched aps back on my phone, but I think it was a problem of my phone. For instance, I couldn't use ES file explorer, with root to put the patched apps, but I had to install root browser...Bah

Ciao

Alessandro

(I had to put the hacked Email on dropbox: it was too big to be uploaded here)
[Galaxy S II Themes and Apps] rajeshm:
No luck. :(. I am still getting "unfortunately email app stopped" while trying to configure exchange account.
[Galaxy S II Themes and Apps] ingmadal:
Mmmm: I'll try a couple of ideas:

1. go in recovery and wipe cache/dalvik

2. fix permissions

3. try to disable/enable exchange app

Hope that one of the aforementioned things works!

Ciao

Alessandro
[Galaxy S II Themes and Apps] rajeshm:
Same result. "Unfortunately email app stopped" while trying to configure exchange account.

Can you check if you can patch my SecEmail_J.apk and SecExchange.apk. Attached both the files.
[Galaxy S II Themes and Apps] ingmadal:
Unfortunately I cannot help you. The two files you linked are not enough for the patch to work.

There should be also the content of the folder /system/framework which is different from phone to phone, and I don't have an S3.

But, anyway, I don't think that what I could get is actually different from your files: I think there is another problem with your firmware. A part from being based on 4.3, is it official or a custom rom?

When you applied the patch, did it give you any error or not?

In case, you could try and use the manual mode.

unzip the patch in a folder in your PC, connect your S3, enable USB debug and open a command terminal on pc (cmd)

go to the folder and write patch-manual.cmd

Then follow the instruction.

Finally, if everything went well, you'll find the patched files in the work folder.

Otherwise you should adb pull /system/framework and send it to me!

Ciao

Alessandro
[Galaxy S II Themes and Apps] madvj:
nvm
[Galaxy S II Themes and Apps] Captain_Throwback:
This worked for me on the CM11 Email & Exchange APKs. Thanks for this tool!
[Galaxy S II Themes and Apps] rajeshm:
I am using the newly released Leaked Firmware I9300XXUGMJ9 (Android 4.3) - Germany

Tried to apply the patch manually too multiple times. Yet I get the below EOF and ends.

Please find my framework attached.

I have used winzip to split the framework files. So you need to compress them again to make it as a single zip file.

keep framework.zip as it is

rename framework1.zip to framework.z01

rename framework2.zip to framework.z02

rename framework3.zip to framework.z03

rename framework4.zip to framework.z04

rename framework5.zip to framework.z05

Recompiling ...
work\out-SecEmail_J.apk\sstream\lib\objs\StoryItem.smali[0,-1] mismatched input
'<EOF>' expecting END_METHOD_DIRECTIVE
[Galaxy S II Themes and Apps] B1663R:
Nexus 5 same crazy remount issue :)

So I got a nexus 5 and of course if i even want my work email on it, I cannot live with the security crap that it wants to use.

Anyway as before the patch would not apply returning the error:

unable to remount system partition for writing (are you root).

As in my previous post, I have root, ADB works fine I can do basically anything i want/need, but this patch.

Again the work around was using wugfresh's tool kit and his file permissions checker (It obviously allow write permissions) and the patch would then process and work.

Nexus 5

rooted

Stock

Android 4.4

Patched.

Thanks to the author as usual :)
[Galaxy S II Themes and Apps] nakadm:
Thanks for the instructions. Used a VM in the past just to patch mail app. With your instructions, all good on Mac Now. And my Nexus 5 was rooted and patched within first hour :)

Just got one error. There are no odex files to push to sd card, only apk's....
[Galaxy S II Themes and Apps] josurr:
.odex files get created on boot after pushing the modified APKs to the phone. they are essentially compiled versions of the APK that specifically load in the Android system.
[Galaxy S II Themes and Apps] gunigugu:
I can confirm this no longer works when using the ART run time compiler on Android v4.4 :'(

Really hoping for a fix soon. I freaking hate having a pin on my phone.
[Galaxy S II Themes and Apps] stomicron:
For those having issues, I moved on to this solution a while ago which has always worked well for me. Version 5 of that tool was just released and worked flawlessly on my my stock rooted 4.4 KRT16O Nexus 10.
[Galaxy S II Themes and Apps] gunigugu:
Yup and this version also works with the ART runtime.
[Galaxy S II Themes and Apps] ftc_osiris:
Hi all,

Version 3.3 of this still works for the Galaxy S4 after 4.3 (negaman's ROM right now). It just takes 15 minutes. Just leave it alone and it will (hopefully) finish.

One note, it didn't succeed in putting the patched Nega Email INTO System/App.

If that happens. Do this:

You have to use something like Root Explorer to

1) remove the exchange accounts if already added

2) Copy the *.patched.apk's into System/App with *.patched names (e.g. SecEmail_J.patched.apk) (the patched versions will be on the internal SD card

3) set permissions to rw-r--r--

4) delete the actual files (SecEmail_J.apk and SecExchange.apk)

5) rename the SecEmail_J.patched.apk and SecExchange.patched.apk appropriately (removed ".patched")

. . . ummmmmmm, just to be safe

6) reboot to recovery and wipe CACHE and DALVIK CACHE

Let me know by reply AND PM if you have probs.

Thanks!

Osiris
[Galaxy S II Themes and Apps] mattsday:
Thanks for this! Just tried this on both my Nexus 5 and 7 running 4.4 and it worked a treat! Strongly recommend anyone else to use this method too, much easier and because it's a replacement rather than a patch it'll likely last loner too and be less prone to breaking one day.
[Galaxy S II Themes and Apps] daoth:
HI,

Have been using this for quite awhile now, but recently seem to have issues with it.

Initially this works fine, but after some time (couple of weeks, not sure how long) the password policy is suddenly enforced anyway.

Sounds familiar for anyone ?
[Galaxy S II Themes and Apps] jsauder2:
Are you updating your ROM or anything like that? If so, the ROM update is likely replacing the email apk's and they need to be hacked again, unless you use a backup script. Otherwise, I haven't had that issue. I've had mine without a password for 3 months now.
[Galaxy S II Themes and Apps] daoth:
That would be a little bit too obvious not to have spotted myself wouldn't it?

The first time this happened, i (afterwards) cleanly reflashed the ROM, and re-modded the apk's, and it happened again after a couple of weeks.

Also no other program seems to be enforcing this either, checked that as well.

Trying this solution for now, maybe that works better
[Galaxy S II Themes and Apps] mitchparent:
I have the exact same issue. Anyone have any ideas?
[Galaxy S II Themes and Apps] PPicasso73:
I'm too. I have Android 4.3 and SIV.
[Galaxy S II Themes and Apps] jnichols959:
Thank you very much for the work you've done on this patch. I was considering adding automation for macs/Linux. Can you provide the 3.3 source code or is the only change the adb.exe?
[Galaxy S II Themes and Apps] rustyx3:
The only change in 3.3 is adb.exe.
[Galaxy S II Themes and Apps] jankluever:
Would also be very interested in an updated that fixes the mentioned problem with Android 4.3 and the Galaxy S4

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

'<EOF>' expecting END_METHOD_DIRECTIVE
[Galaxy S II Themes and Apps] glowfinger:
me too !
[Galaxy S II Themes and Apps] SpawNyK:
Yes, we need it working for 4.3

Thanks
[Galaxy S II Themes and Apps] Big_Balls:
:good:+1
[Galaxy S II Themes and Apps] daniello8:
guys... try the offline method... never failed on me

Gesendet von meinem GT-I9505 mit Tapatalk
[Galaxy S II Themes and Apps] 123chris:
E-mail hack on Kitkat

I used this hack on my Nexus 4 on Android 4.3 and I am very satisfied with it. Now, I am considering an update to Kitkat.

Did anyone try this hack on Android 4.4 and was it succesfull?

Regards
[Galaxy S II Themes and Apps] jsauder2:
Yes, it worked on kitkat on my Nexus 4.

Sent from my Nexus 4
[Galaxy S II Themes and Apps] Big_Balls:
What do you mean with "offline":confused:

Manually Patch?
[Galaxy S II Themes and Apps] daniello8:
yep

Gesendet von meinem GT-I9505 mit Tapatalk
[Galaxy S II Themes and Apps] Aelis:
I've used this patch religiously on every ROM I've ever used - having my work email on my phone is pretty much essential, but I hate having a passcode to unlock my screen, so a HUGE thanks to the original creator of this!

I just got myself a fancy new Nexus 5 and unfortunately, this script no longer seems to work! I did some fiddling and found a solution, wasn't sure how to propose it so I'm just posting it here. If the original creator wants to update the script that'd be awesome, but for anyone else, the steps are fairly easy:

1. Download the source code (available on the first page)

2. Find the path to your system partition

adb shell su -c mount

3. Manually remount your /system directory as rw:

adb shell
su
mount -o rw,remount {path-to-system} /system

3. Modify the following code on line 146 of Run.java:

int rc = runCommand(ADB, "shell", "mount");

to

int rc = runCommand(ADB, "shell", wrapSU("mount"));

Without it wrapping around su, the response returned was empty, this allows it to properly see the (now) rw mounted /system partition.

4. Rebuild the jar file and drop it into {patch-directory}/lib/email-policy-patch.jar

5. Run the apply-patch.cmd OR apply-patch-nix.sh script, depending on your OS.

**DISCLAIMER**

This is a pretty hacky way to go about this, and given a bit of time I could probably come up with a better solution, but I while trying to figure out the problem, this was the easiest hack to make it work. : ) As always, use extreme caution whenever changing low-level system settings as they have the potential to cause serious damage to your phone. When in doubt, it's always safer to ask than to guess!

This was only tested on a Google Play Nexus 5, TWRP Recovery/SuperSU and I cannot guarantee it'll work on other setups.

**END DISCLAIMER**

Hope this helps other people with a Nexus 5 out there!
[Galaxy S II Themes and Apps] extremefun:
Yes. Works on 4.4, CM11. S3 LTE
[Galaxy S II Themes and Apps] reinert012:
our new CIO just put a policy in place today that requires a pin, encryption and this is literally a FREAKING life saver. Now...to decrypt my device....
[Galaxy S II Themes and Apps] rustyx3:
Version 3.4 has been released!

Features:

* improved 4.3 support (SecEmail_J added to APK list)

* improved BOOTCLASSPATH detection which should fix decompilation issues (BETA!)

* work-around for the R/O mount reporting for non-su mount invocation (thanks to Aelis)

Please test!

BTW How do you guys stand the 4.3 ROM on your Galaxy S3?? Just installed it today to test the new release, man is it *horrible* :( rolling back asap :)
[Galaxy S II Themes and Apps] maerin:
Always used this on my Nexus 4 with Paranoidandroid 3.99

Now having a LG G2 with [AOSPA 4.4 KRT16S] PARANOIDANDROID 4.0+ (Alpha release with KitKat) V3.3 didn't work.

Just installed V3.4 without a glitch and back on track. Looks like it's working like in the old pre-KitKat days !

Many Thanks !
[Galaxy S II Themes and Apps] detmar:
Version 3.4 Working Great!

Just used version 3.4 on my VZW Moto x running 4.4 and its working great. The previous version gave me the the same reported remount issues.
[Galaxy S II Themes and Apps] nthomas51:
I just want to say that I've used this script on nearly every compatible phone I've owned - Nexus S, S3 and S4. It's invaluable! I'm using a Mac and trying to run it manually for my Nexus 5 and when I run "java -jar lib/email-policy-patch.jar patch-manual /Users/Nigel/Downloads/android-sdk-macosx/platform-tools/work 16 EmailGoogle.apk" it starts to decompile the .odex file but then throws an error:

Any idea what I'm doing wrong? I upgraded the JRE to ver 7 but still get the same error.
[Galaxy S II Themes and Apps] dbenyakar:
Hi

I've just installed version 4.3 on my phone and used the 3.4 hack to patch the email app.

The process seemed to complete fine and the phone rebooted but the application is missing from the App drawer.

When entered the /System/App I could not find the secEmail_J.apk nor the secExchange.apk but only the backkups of them which end with .BAK.

So I renamed them to .apk, ran fix permissions the reran the script and the same results. No Email app.

Has anyone encountered this problem before?
[Galaxy S II Themes and Apps] glowfinger:
SGS4 - i9505 (4.3 XXUEMJ5)

With Patch v3.3 i got the same error as pprakash, but with Patch v3.4 it works like a charm!

Thanks for this mod!

greetz
[Galaxy S II Themes and Apps] rustyx3:
Check that you don't have another java version on the PATH.

$ java -version
[Galaxy S II Themes and Apps] rustyx3:
Version 4.0-beta released!

This version has improved ADB support (will fetch ADB from Google if needed), improved Mac/Linux support and improved backup support (backs up to /sdcard instead of /system).

Please test, especially on Mac/Linux!
[Galaxy S II Themes and Apps] roopesh:
I will give it a try on Mac right now. However, does it work for 4.4? I found EmailGoogle.apk and Exchange2Google.apk and 3.3 seemed to work, but I haven't pushed the apks yet.

Edit: Worked perfectly - awesomely in fact! Love the automation. Thank you!!
[Galaxy S II Themes and Apps] the_mentor:
Is there an update to the xposed module that supports Android 4.4 kit Kat?
[Galaxy S II Themes and Apps] rustyx3:
You sure you posted in the right thread?

This patch is not an xposed module.