yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Themes and Apps] pslover:
Java error

When I run the apply patch script on my windows xp (32) machine, I get the following error in a cmd window: Any ideas appreciated.

Exception in thread "main" java.lang.UnsupportedClassVersionError: jpatch/emailP

olicy/Run (Unsupported major.minor version 50.0)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Press any key to continue . . .

---------- Post added at 12:14 PM ---------- Previous post was at 11:59 AM ----------

Looks like this is a result of running an old java runtime version. Strange, because te Windows control panel reports 1.6.0_43 , while cmd line query java-version shows 1.3.1_01

---------- Post added at 01:07 PM ---------- Previous post was at 12:14 PM ----------

Found an old jre for the previous version of java runtime. Deleted the folder and it's working now....
[Galaxy S II Themes and Apps] gordonzhao:
I tried the one for 4.1 when I was running stock tw on 4.1.1 on my Note and PA 4.2.2, worked on both. Now I have 4.1.2 TW installed, doesn't work anymore. Anyone on the same boat?

Edit: I see there's an update, I still had the old zip from February

Edit 2: confirmed I can't flash from recovery;failed.
[Galaxy S II Themes and Apps] squire23:
Great that this Hack has been updated and it works great (i9100, Supernexus 2.0). Just wish it would get contacts sorted out as well.
[Galaxy S II Themes and Apps] daoth:
For the record, patch is working perfectly on GT-I9300 on XXEMA2 firmware
[Galaxy S II Themes and Apps] Pete_79:
Trying this on a Nexus 7 with SilmRom and francos kernel, no luck :( It says "no connection"

Any help would be appreciated.
[Galaxy S II Themes and Apps] wellaflex:
OK

It's work thanks
[Galaxy S II Themes and Apps] xmfpdlemalnz@hotmail.com:
Could you please provide step by step how to patch it manually.

didn't get from "pull the SecEmail.apk+odex and SecExchange.apk+odex and the libs using ADB, run the patch, then upload patched SecEmail.apk..."

how do you exactly do that.

Thanks!
[Galaxy S II Themes and Apps] os2baba:
Worked like a charm again on Sprint Galaxy S3 JellyBean 1.4.2 MB1. Thanks!
[Galaxy S II Themes and Apps] pimpinonline:
Google Nexus 10

It sort of works for the Nexus 10... it patches the files, and doesn't require a pin or other security code to be enabled, but it does force the device administrator, and when you deactivate the device administrator, it removes all data associated with the account. Hoping that in the future this could be fixed.

Thanks for this great tool. I have used it successfully on my Galaxy S3 and Asus Transformer Prime. Great work!
[Galaxy S II Themes and Apps] fastguy:
Well device admin is supposed to remain enabled. It does not have an effect normally.
[Galaxy S II Themes and Apps] 2manyphones:
Has anyone been able to get this to work on ATT LG Optimus G running 4.0.4?

I saw the post where someone was able to get it to work on the Sprint version, but that appears to have the email files (or files named correctly) needed for this patch (email.apk and exchange.apk). In my system/app folder I found the email file is called LGEmail3, but there is no file that appears to be the exchange file. There is only one called "email-release-unsigned.apk". I have tried using these file names in the apply patch in multiple combinations and it always returns the results Unable to apply patch - file not found.

Any ideas on how I can apply this patch? I have attached the LGEmail3 apk file in case someone is able to determine if this can be patched manually.

Thanks!

This is what I am seeing:

Cleaning up ...

Waiting for USB connection...

Checking device...

Model: LG-E970, build The Base 0.7.3, 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: no, 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

Pulling libs ...

Decompiling LGEmail3.apk ...

Applying patch ...

Unable to apply patch. File not found.

Decompiling LGEmail3.apk ...

Applying patch ...

Unable to apply patch. File not found.

*** Patch aborted.
[Galaxy S II Themes and Apps] zdravke:
calendar sync

My calendar sync not working any more after the patch. Any suggestions?
[Galaxy S II Themes and Apps] carlos20h:
I was having a big issue also with the Galaxy Note N7000, but after some research I found a solution.

The problem is because of the Preload partition, the SecEmail.apk is in this partition so if you run this script, it will patch the SecEmail.apk in system/app but not the preload one, so just run the script normally and after the phone is rebooted copy the SecEmail.apk inside of the work folder to your internal memory, then on a CMD windows

1.- adb shell

2.- su

3.- mount -o rw,remount -t yaffs2 /dev/block/mmcblk0p12 /preload

4.- cd /sdcard

5.- cp SecEmail.apk /preload/symlink/system/app

Change the permissions of SecEmail.apk in preload to rw- r-- r--

Reboot your phone

Done!
[Galaxy S II Themes and Apps] shupa:
Works like a charm on Nexus S I9023 4.1.2 OTA! Thanks for your work!
[Galaxy S II Themes and Apps] s2kdriver80:
I have a Samsung Galaxy S II with LSN 4.1.2 upgrade + root. Pretty much followed Rene's step by step and got it to work. However, I also needed to pull the odex files as well, not just the apk files. The pulls didn't work properly, so I just went in the old fashioned way and copied the 4 files along with the files under framework from the phone to my computer. Ran the manual command, cranked out the updated apk files. Deleted the old apk and odex files under /system/app, then copied the updated apk files over. Reboot.
[Galaxy S II Themes and Apps] gordonzhao:
Any way you can whip up a .zip for flashing from recovery?
[Galaxy S II Themes and Apps] stomicron:
Try this

http://xdaforums.com/showthread.php?t=1749921
[Galaxy S II Themes and Apps] gordonzhao:
Thanks, though I forget if I tried this one already and it was a flop but I'll do a nandroid just in case.
[Galaxy S II Themes and Apps] stomicron:
Nandroid is never a bad idea--coincidentally it saved me today when I tried that version on my stock rooted Nexus 10 and the email app just wouldn't launch.

I had been successfully using the modded versions from that thread over the last year on my phone with multiple different ROMs so I'm not sure what's up.

Thankfully I stumbled upon this thread though.
[Galaxy S II Themes and Apps] gordonzhao:
Good thing I did make that back up, I ended up installing the old one initially, installed the new one, FC just before the final step in adding. The thing is on my Note II I'm running stock 4.1.2, but the email app is 4.0, the zip flashes 4.1 email app so I think I need to find a ICS hack.
[Galaxy S II Themes and Apps] benbeel:
Works perfect on Nexus 4!!

This works fantastically on my Nexus 4, and was exactly what I'm looking for. I can confirm that it bypassed both PIN and encryption requirements from my Exchange server. Thanks for this great patch!
[Galaxy S II Themes and Apps] Sardo Numspa:
just ran the script on my new Note 8 and it worked great.

thanks
[Galaxy S II Themes and Apps] jd1639:
Cool
[Galaxy S II Themes and Apps] musheercmr:
Confirming: working fine in Galaxy Note2 using patch version 3.3.

running on: JB 4.1.2 (N7100XXDMC3)

many thanks.
[Galaxy S II Themes and Apps] Lolento:
Like to report that this is working on my T-Mobile Galaxy S4 with the exception that I had to manually enter the Email apk (which is SecEmail_J.apk).

THANKS!!! GREAT WORK!!! I KNOW I'M SCREAMING CUZ I'M STOKED!!!
[Galaxy S II Themes and Apps] boobiestar:
Working on my S3-i9300 and also on my Note 10.1-N8010. For the N8010 I have to put the name SecEmail_Tablet when the app wasn't automatically found.

Thx a lot! Keep up the hard work. :thumbup:

Verstuurd van mijn GT-N8010 met Tapatalk
[Galaxy S II Themes and Apps] amchandr:
Hi , Can you please give me step by step instruction to apply this on galaxy note 2
[Galaxy S II Themes and Apps] ingmadal:
Hi all.

I upgraded my GS2 yerterday to Jelly Bean 4.1.2 and now, of course, I'd like to reapply the patch to my email.

But it seems I can't connect my device to PC anymore.

I remember I had a similar issue with ICS, but I cannot remember what I did to overcome it.

Now what I get from patch is:

Cleaning up ...

Waiting for USB connection...

Connect your device!

Enable USB debugging (Settings -> Applications -> Development -> USB debugging)

Did you have a connection before but not anymore? Try rebooting your PC.​

The PC I'm using is the same.

I enabled DEBUG usb, but I cannot force mass storage mode, because before I had Syiha kernek , and now Jeebo, which, as far as I know, doesn't allow this feature.

Do you think This could be the problem?

Or otherwise, could you give me any hint?

By the way, the cell phone is actually connected, I mean I can transfer files for example, but this patch doesn't work

Thank you very much

Al
[Galaxy S II Themes and Apps] hamzer11:
Thank you OP for the patch and thank you Lolento for this info. I can confirm AT&T Galaxy S4 working with the patch!

I too am very excited!
[Galaxy S II Themes and Apps] paalkr:
Does this patch work on HTC One? Anyone tried?
[Galaxy S II Themes and Apps] CaspaTheGhost:
IIRC, HTC have their own proprietary Exchange integration (came out before Android could do it on its own) so this patch doesn't work.

Sent from my BAKED N4
[Galaxy S II Themes and Apps] ingmadal:
At last I succeeded!

The culprit was, unbelievably, the PC!

Then I faced the Secemail problem, but thanks to other posts I read, I was able to patch it manually.

Al
[Galaxy S II Themes and Apps] rayburne:
Confirmed working on Samsung Captivate and CM10 (JB).

Patched using the manual cmd.

Thank you for your sharing your hard work!
[Galaxy S II Themes and Apps] pharaohseti:
Not Working After 4.1.2 Update

Hi,

I just upgraded my 9100 Galaxy S2 and tried to apply this patch again (because 3.2 was installed and after upgrade security came back) but it failed by asking the Email and Exchange apk names. What might be the reason? Thanks :crying:

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

Pulling app(s) ...

> lib/adb.exe pull /system/app/Email.apk

remote object '/system/app/Email.apk' does not exist

< returned: 1

> lib/adb.exe pull /system/app/EmailGoogle.apk

remote object '/system/app/EmailGoogle.apk' does not exist

< returned: 1

> lib/adb.exe pull /system/app/com.android.email.apk

remote object '/system/app/com.android.email.apk' does not exist

< returned: 1

> lib/adb.exe pull /system/app/SecEmail.apk

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

< returned: 1

> lib/adb.exe pull /system/app/Email2.apk

remote object '/system/app/Email2.apk' does not exist

< returned: 1

> lib/adb.exe pull /system/app/Email2Google.apk

remote object '/system/app/Email2Google.apk' does not exist

< returned: 1

> lib/adb.exe pull /system/app/Email.apk

remote object '/system/app/Email.apk' does not exist

< returned: 1

> lib/adb.exe pull /system/app/Exchange.apk

remote object '/system/app/Exchange.apk' does not exist

< returned: 1

> lib/adb.exe pull /system/app/ExchangeGoogle.apk

remote object '/system/app/ExchangeGoogle.apk' does not exist

< returned: 1

> lib/adb.exe pull /system/app/com.android.exchange.apk

remote object '/system/app/com.android.exchange.apk' does not exist

< returned: 1

> lib/adb.exe pull /system/app/SecExchange.apk

remote object '/system/app/SecExchange.apk' not a file or directory

< returned: 1

> lib/adb.exe pull /system/app/Exchange2.apk

remote object '/system/app/Exchange2.apk' does not exist

< returned: 1

> lib/adb.exe pull /system/app/Exchange2Google.apk

remote object '/system/app/Exchange2Google.apk' does not exist

< returned: 1

> lib/adb.exe pull /system/app/Exchange.apk

remote object '/system/app/Exchange.apk' does not exist

< returned: 1

> lib/adb.exe kill-server

< returned: 0
[Galaxy S II Themes and Apps] eclipxe:
Probably is SecEmail now and SecExchange
[Galaxy S II Themes and Apps] pharaohseti:
Tried those and didn't work. I also tried manual way and it didn't help. Developer should fix the JB way of doing auto fix. Thanks.
[Galaxy S II Themes and Apps] pharaohseti:
After trying several tries, it created the new apks and renamed the old ones by adding BAK in system/apps folder, but the Email icon is no where in Apps drawer. Is there an issue? Below is the result:

C:\email-policy-patch-3.3>apply-patch.cmd

Cleaning up ...

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 rw

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

Pulling app(s) ...

Pulling libs ...

Decompiling SecEmail.odex ...

Applying patch ...

Patching com/android/email/SecurityPolicy.isActive(Lcom/android/emailcommon/service/PolicySet;)Z

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

Patching com/android/email/SecurityPolicy.isSupported(Lcom/android/emailcommon/service/PolicySet;)Z

Patching com/android/email/SecurityPolicy.getInactiveReasons(Lcom/android/emailcommon/service/PolicySet;)I

Recompiling ...

Building SecEmail.apk ...

Decompiling SecExchange.odex ...

Applying patch ...

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

Recompiling ...

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

C:\email-policy-patch-3.3>
[Galaxy S II Themes and Apps] fastguy:
You can check if permissions are correct.
[Galaxy S II Themes and Apps] okgnew:
It works on Galaxy S4 (9505) if I manually specify email app name (SecEmail_J.apk).

Thank you!
[Galaxy S II Themes and Apps] bharat4ever:
Worked fine for me on the Xperia Z, but only that I had to enter the email apk's name manually (SemcEmail.apk)
[Galaxy S II Themes and Apps] L00L00:
Hello,

Just had my I9505 rooted and want to apply this patch.

I'm a little confused with all replies, for any device, without knowing wich version of patch is used...

Do I have to modify something before launching script ?

Do I have to rename/copy something manually after the script ended ?

thank you for your support
[Galaxy S II Themes and Apps] x0769:
thanks!

works great on my nexus 4 running cyanogenmod 10.1
[Galaxy S II Themes and Apps] musheercmr:
download latest policy patch (v.3.3) and install latest Samsung USB driver or Kies. then enable USB debugging from settings. then plug device in PC, then just run the patch :good:

REMEMBER: You should have root access while you run this patch.
[Galaxy S II Themes and Apps] L00L00:
THANKS

Sorry, Just find out how !

a reminder for who v3.3 in i9505 :

launched apply-patch.cmd

script doesn't found Email.apk so I provided the good one : SecEmail_J.apk

Let the script continue until it finished with message :

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

good work for this patch !
[Galaxy S II Themes and Apps] kika1992:
ACER A700 fail

Hi,

I was trying to install the patch to a rooted ACER A700 but igot following error message:

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

Pulling app(s) ...

Pulling libs ...

Decompiling Email.odex ...

Error occured while loading boot class path files. Aborting.

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

softwareimaging.acer.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)

Drücken Sie eine beliebige Taste . . .

Can anyone help me with this? Thanks a lot in advance...
[Galaxy S II Themes and Apps] kika1992:
Solved!

Issue is solved, It seems like the tablet hadn't full root access. After flashing vorbeth's iconian ROM everything worked fine.

Great Hack!

Thanks a lot.
[Galaxy S II Themes and Apps] h4rr0d:
Ok, so after hacking around my SGS2 for about an hour I managed to get it done. Here's full step by step how to on latest (as of 16.5.2013) stock ROM from http://xdaforums.com/showthread.php?t=1544487

0) Flash the 4.1.2 Stock ROM

1) Root using method 1 here: http://xdaforums.com/showthread.php?t=1746794 (I used Root_Superuser_3.1.3_Busybox_1.20.2-Update1-signed.zip)

2) start command line in the folder where you extracted this hack.

Connect to phone with USB debugging enabled (see OP)

3) lib\adb kill-server

4) lib\adb wait-for-device

Now you should be connected to your phone (you can verify it by typing 'lib\adb shell ls' without the quotes. If it works, list of items should appear on the console)

We need to change the file systems from read only to write enabled

5) lib\adb shell

6) su

7) mount -o rw,remount -t yaffs2 /dev/block/mmcblk0p9 /system

8) mount -o rw,remount -t yaffs2 /dev/block/mmcblk0p12 /preload

9) exit

10) exit (now you should be out of the shell, back in the command prompt)

Now you need to download all the files needed for patching from phone

11) mkdir work (unless the work is already there)

12) cd work

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

14) ..\lib\adb pull /preload/symlink/system/app/SecEmail.odex

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

16) ..\lib\adb pull /system/app/SecExchange.odex

17) ..\lib\adb pull /system.framework/

(optional: you might want to backup the apk and odex files for possible restoration)

18) cd ..

And run the patch

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

Push the modified apks to mobile (not to their final destination yet)

20) cd work

21) ..\lib\adb push SecEmail.apk /sdcard/SecEmail.apk

22) ..\lib\adb push SecExchange.apk /sdcard/SecExchange.apk

Now you will delete old files from your phone

23) ..\lib\adb shell

24) su

25) rm /preload/symlink/system/app/SecEmail.apk

26) rm /preload/symlink/system/app/SecEmail.odex

27) rm /preload/symlink/system/app/SecExchange.apk

28) rm /system/app/SecExchange.odex

Finally put the modified files to where they belong

29) dd if=/sdcard/SecEmail.apk of=/preload/symlink/system/app/SecEmail.apk

30) dd if=/sdcard/SecExchange.apk of=/preload/symlink/system/app/SecExchange.apk

And you are done. Just need to reboot your phone and you should have security policy free email app. I did remove and add back my Exchange account, but I'm not sure that is required.
[Galaxy S II Themes and Apps] pharaohseti:
Nope, this didn't work for me also. Hacking is fine. But after restarting the phone and removing adding back the Exchange account it gets stuck in "getting account information" step.

Update: It worked after putting the new SecEmail.apk and SecExchange.apk files into system/app via FX. It did not work with adb. Thanks for step by step guide and for this great fix.
[Galaxy S II Themes and Apps] likeicare:
Ok now i managed to get it to work, there somehow was not enough space in the system/apps/ folder so it didnt copy the whole file. There is no pin enforced too, yay!

But i cant sync any emails now even not with a normal email account not even using exchange!! No emails will be transmitted =(
[Galaxy S II Themes and Apps] SjoerdvN:
Confirmed working on i9300 ME3 leak (WanamLite 7.0)

The stock email app was supposed to be patched in the ROM, PIN lock was deactivated but SD card encryption not :(

Happy now, Thanks!
[Galaxy S II Themes and Apps] likeicare:
Finally got it to work completely!!! Flashed Neat_Lite_v4.7 custom rom using philz kernel.

Then followed h4rr0d instuctions!

Thanks h4rr0d u are a cmd god ;D
[Galaxy S II Themes and Apps] Splatters8:
AFARIA question

I saw that many people have afaria or had it on their phone.

I have a new Note II gave to me by my company, so, if I want to deactivate afaria, a pop up appear telling me that with the deactivation could be a lost of data. Before say ok, I want to know if it's true or just a default message. And if I want to reactivate it I can do it without any problems? It restart to work as before the deactivation? With the same program restriction, with the same code etc etc...

Very thanks if you could give me some answers.
[Galaxy S II Themes and Apps] ahpatel:
Confirmed to work on a rooted Galaxy S4. Just had to point the Email file to "SecEmail_J.apk"
[Galaxy S II Themes and Apps] os2baba:
Out of curiosity, where do you do that? I have always just run it on my Galaxy S line phones. I don't see anywhere that you can change the files that are to be modified.
[Galaxy S II Themes and Apps] hamzer11:
When you run the file it will tell you that email was not found and allow you to enter your own value for the email app, that's where you do it. Works great.
[Galaxy S II Themes and Apps] os2baba:
Ah. great. Thanks.
[Galaxy S II Themes and Apps] hommiedaklown:
I cannot seem to patch my T989

Getting this:

Cleaning up ...
Waiting for USB connection...
Checking device...
Model: SGH-T989, build Jedi Mind Trick JB 4, android 4.1.2 (API Level 16)
/system mounted on /dev/block/platform/msm_sdcc.1/by-num/p24, mode ro
checking root access. root uid: 0, secure: yes, busybox: yes
Pulling app(s) ...
Pulling libs ...
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 ...
Updating device ...

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

Debug log written to debug.log
Press any key to continue . . .

Any ideas?