yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Themes and Apps] arvo.bowen:
Still not working even though it's patched...

So I ran the patch...

C:\android\email-policy-patch-3.3>apply-patch.cmd
Cleaning up ...
Waiting for USB connection...
Checking device...
Model: One X, build cm_evita-userdebug 4.3 JSS15J eng.jenkins.20130821.003343 test-keys, android 4.3 (API Level 15)
/system mounted on /dev/block/mmcblk0p33, mode ro
checking root access. root uid: 0, secure: yes, busybox: yes
Pulling app(s) ...
Pulling libs ...
Decompiling Email.apk ...
Applying patch ...
Patching com/android/emailcommon/provider/Policy.normalize()V
Recompiling ...
Building Email.apk ...
Decompiling Exchange2.apk ...
Applying patch ...
Patching com/android/emailcommon/provider/Policy.normalize()V
Patching com/android/exchange/adapter/ProvisionParser.hasSupportablePolicySet()Z
Recompiling ...
Building Exchange2.apk ...
Updating device ...
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 . . .

Seems like it patched just fine... Tried to add the account and after it was complete, it asked me to accept the security policies... I said yes (allow) and then all my mail started pooring in... Checked device administrators and sure enough it was in there... Just like the patch never happened... So I tried the patch again ...

C:\android\email-policy-patch-3.3>apply-patch.cmd
Cleaning up ...
Waiting for USB connection...
Checking device...
Model: One X, build cm_evita-userdebug 4.3 JSS15J eng.jenkins.20130821.003343 test-keys, android 4.3 (API Level 15)
/system mounted on /dev/block/mmcblk0p33, mode ro
checking root access. root uid: 0, secure: yes, busybox: yes
Pulling app(s) ...
Pulling libs ...
Decompiling Email.apk ...
Applying patch ...
- Already patched.
Decompiling Exchange2.apk ...
Applying patch ...
- Already patched.

*** Patch aborted.

Press any key to continue . . .

Ideas?
[Galaxy S II Themes and Apps] Captain_Throwback:
I'm confused. The patch did what it was supposed to. What is it you need help with? It didn't make you set a PIN unlock, did it?
[Galaxy S II Themes and Apps] arvo.bowen:
Patch Falls Short For Me...

Yes about 30 seconds before you posted I just realized that it DOES NOT do what the old one did... (remove the entire policy)

As much as I appreciate the OP's efforts in making this patch for everyone, I was mislead when reading the OP on page 1. I was given the impression it removes the policy, not just the parts he felt were annoying...

I'm personally not OK with giving anyone aside from me the ability to remote wipe my phone. I can't see why anyone would! You and everyone else have the ability yourself, why give that ability to someone else...

Anyway, thanks for the follow up, this patch will not work for me as it only does "some" of what I need done.

Thanks ;)
[Galaxy S II Themes and Apps] bricenott:
I don't think you did this right, I'm on the latest firmware for the SGS4 4.2.2 AND WITH ONLY ONE ADMINISTRATOR: MYSELF.
[Galaxy S II Themes and Apps] arvo.bowen:
That's weird... Going back through the thread it says all over that it would not remove it completely but only around 6 things, one being keylock required... Did you use the patch from the ORIGINAL post?
[Galaxy S II Themes and Apps] v1rtu41m4n:
Can't make it work on 4.3

I attached the log, help please!!!
[Galaxy S II Themes and Apps] bricenott:
Of course, the latest one, V3.3... It does everything, no key lock, no encryption, no no admins, thanks against to the OP.. :D
[Galaxy S II Themes and Apps] empiremaster23:
Will this patch work on the following secemail.apk (restores the email widget that verizon left off the Note II).

http://xdaforums.com/showthread.php?t=2036678&page=4
[Galaxy S II Themes and Apps] bricenott:
It will work for any name, if it's not in the list it will ask for the name.. Samsung is SecEmail_J.apk
[Galaxy S II Themes and Apps] arvo.bowen:
Capabilities of this patch...

Should this patch eliminate ALL of the policies enforced or just certain ones? There seems to be some confusion by either others or myself in this regards... It seems for me it does in fact eliminate the requirement for a 7 digit pin and I can now use my pattern. But it keeps device administrator in the security settings. Should this patch eliminate the device administrator requirement?

Thanks!
[Galaxy S II Themes and Apps] arvo.bowen:
I think you still have device admin "mail" installed...

I don't even see how that is possible based on the quote below... :)

... unless you are not using Jelly Bean maybe?
[Galaxy S II Themes and Apps] 123chris:
Unable to remount for writing (Nexus 4)

I am having the same problems as more users in here. The patch can''t update the device in the end.

Nexus 4

Stock Android 4.3 (JWR66Y)

unlocked and rooted with SuperSU V1.51

Using version 3.3 of the email patch.

Cleaning up ...
Waiting for USB connection...
Checking device...
Model: Nexus 4, build JWR66Y, 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) ...
Pulling libs ...
Decompiling EmailGoogle.odex ...
Applying patch ...
Patching com/android/emailcommon/provider/Policy.normalize()V
Recompiling ...
Building EmailGoogle.apk ...
Decompiling Exchange2Google.odex ...
Applying patch ...
Patching com/android/emailcommon/provider/Policy.normalize()V
Patching com/android/exchange/adapter/ProvisionParser.hasSupportablePolicySet()Z

Recompiling ...
Building Exchange2Google.apk ...
Updating device ...

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

Debug log written to debug.log
Druk op een toets om door te gaan. . .

Can someone please help me with this. The only reason why I rooted my phone was te apply this patch and get rid of the annoying lockscreen.

Thanks
[Galaxy S II Themes and Apps] arvo.bowen:
Do you have superuser installed? Do you have access to adb enabled in superuser? Can you open command prompt and do the following...

adb devices

adb shell

su

Check your phone to see if it asks you for permission, prompt on PC should be at a # prompt showing root access achieved...
[Galaxy S II Themes and Apps] 123chris:
Works!

Hi,

Thanks for your help. I had my settings straight, but that didn't help.

Anyway,I fixed it allready, with the hint of B1663R in post http://xdaforums.com/showpost.php?p=44474250&postcount=1005.

Just like him I checked the permissions of /system with wugfresh's tool and while this tool was still opened I ran the patch and... it worked... I am happy now, but I still dont know what the real issue was.

Thanks anyway.
[Galaxy S II Themes and Apps] NegativeOne:
So do you know another way to kill remote wipe and retain the mail app on 4.2+?
[Galaxy S II Themes and Apps] daniello8:
for one .. I didn't have .odex files but still patch seemed to work. I went the offline way and build a small flashable zip to remove the old apps and put the new ones in place. Then, when the phone is up all seems well except that the front page widgets don't load anymore .. and everything takes very long i.e. is very laggy. Then after about a minute or two the phone restarts.

Possibly someone already fixed this behaviour .. I'll look deeper into it tomorrow.

Any help is appreciated.

edit: I don't know what exactly caused this .. but it wasn't the mail patch. Fixed!
[Galaxy S II Themes and Apps] B1663R:
4.3 JWR66Y Update (1.7mb)

Ok just thought i would come back. the OTA (4.3 JWR66Y) will fail now with a rooted device (Or if you have any modified system files) so you have to use a modified update found here if you want to keep root:

Because of the new way root is gained in 4.3 we are no longer able to flash the ota while rooted with the stock OTA link. If you try to do so you'll see: "set_perm: some changes failed"

There are two ways to get around this:

1) Unroot before applying the OTA

2) Flash this OTA file located here provided by [MENTION=1566190]efrant[/MENTION]

3) ensure to put the newest SU on your SD card so you and update it in recovery mode as well (it supposedly keeps root with the method above but I did this just to be safe) link

4) Finally it would still not mount as it has done in the past for me (Yes ADB is working- and permissions seem fine for everything else) so i used wugfreshs toolkit to check permissions (I am sure you can do this possibly manually in ADB) and then run the apply patch (I am in Windows)

And VIOLA it works again :) thanks for the great patch!

---------- Post added at 01:06 PM ---------- Previous post was at 12:58 PM ----------

Would this method work for stock (no custom ROM) as well? I appreciate it as I just tried to use titanium to restore my files and it did not work (Maybe I am doing something wrong).

---------- Post added at 01:13 PM ---------- Previous post was at 01:06 PM ----------

I am Stock and rooted and backed up Accounts/Exchange/Email prior to updating to 4.3 (JWR66Y) on my nexus 4. It still didnt work any tips on what I could do next time to make the titanium backup work?
[Galaxy S II Themes and Apps] Sirchuk:
THANK YOU!

I've tried everything from ROM's claiming it's built in, to patched .apk's, to special mods packs that should install it, to the instructions in the OP's post without any success. They all still required a PIN unlock.

These steps worked! I'm thrilled. Thank you so much!

Now I've got to copy these instructions down so I don't forget.
[Galaxy S II Themes and Apps] DoomSoldier:
After every flash of CM i must execute the patch procedure. Titanium Backup can't backup all patched files. Is it possible to backup the patches?
[Galaxy S II Themes and Apps] Sirchuk:
So every time you flash you overwrite the original APK. You could create a backup of that individual file after the patch, and then copy it back. You would need access to the /system/app/SecEmail_J.apk & /system/app/SecExchange.apk or whatever the ones you have are. Just look for email and exchange apps.

That's my guess at least..
[Galaxy S II Themes and Apps] Sardo Numspa:
what ive done in the past is kept a copy of the modded email and exchange apks, then using root explorer on my phone, unzipped the rom file, copied the 2 apk to the system/app folder, then rezipped all the files. that way i have a complete rom zip for unmodded and modded email. this may or may not work for you, but its what i do and havent had an issue.

i do it this way, that way when i dirty flash a rom update, i dont have to re-enter all my exchange info again, just in case the company is watching how many devices i connect to the account, i dont want it to look like i am adding 4 or 5 phones a month.
[Galaxy S II Themes and Apps] Nandrew:
Or just make a flashable zip that nukes the ROM email and exchange apk then injects the "modified" versions. In this way you never have to repack the ROM and as long as you don't forget to install the zip, your email will work and you will never have to re-enter anything.

Thanks OP for this awesome tool!
[Galaxy S II Themes and Apps] cschmitt:
Yes, I put the modified APKs into a flashable zip that includes a CM backup\restore script in \system\addon.d\90-email.sh. Every time a CM update is flashed the modified Email.apk and Exchange2.apk are backed up and restored following the ROM flash. This is the same method used to persist the GApps package.
[Galaxy S II Themes and Apps] arvo.bowen:
Not yet, I'm hoping the OP changes it in his patch... :/ Or at least give us an open in the patch script... It would be VERY easy to do from what I can see...
[Galaxy S II Themes and Apps] ipprof:
I flashed your zip, rebooted, reflashed my ROM (unofficial 10.2), removed the security administrator, and any pin requirements in security and of course email didn't have my exchange account any more. I then reinstalled the account under corporate, it said I had to change my security settings to which I agreed but did nothing, and when I went back to email the account is all restored...but no pin requirement! This is perfect. I have one question very important to me. Can I undo this if I have to? I can't imagine wanting to because this is like email heaven but let's just say.... How would I undo it? Oh and of course I did a nandroid before I did any of this but I don't want to use that because in a year or so

would have lost a lot that the nandroid won't have.
[Galaxy S II Themes and Apps] arvo.bowen:
Yes, it should make a back up. Just delete the two patched files then rename the bak files to the original file names.

Arvo - HTC OneX
[Galaxy S II Themes and Apps] ipprof:
could you tell me the files location and names?
[Galaxy S II Themes and Apps] arvo.bowen:
APK Locations

I would start by looking in the following location...

/system/app/

Try targeting the files....

Email.apk (Email.apk.BAK)
Exchange.apk (Exchange.apk.BAK)
SecExchange.apk (SecExchange.apk.BAK)
SecEmail_J.apk (SecEmail_J.apk.BAK)

All of the files above will not be used for you. Depending on the ROM/Device you're using it could be a combination of the files above, so check all.
[Galaxy S II Themes and Apps] ipprof:
I have not one of those files anywhere in my phone. But the hack works beautifully.
[Galaxy S II Themes and Apps] LiquidSolstice:
I'm trying to get the lockscreen to ignore my corporate Google domain's policy of disabling lockscreen widgets. Is there anything that anyone in this thread can suggest doing?
[Galaxy S II Themes and Apps] arvo.bowen:
Maybe try searching for "mail". See if you can find something on your phone? Not sure where it would be otherwise...

Arvo - HTC OneX
[Galaxy S II Themes and Apps] ipprof:
I think I wrote too fast and ambiguously. I have the mail files you mention but no backups anywhere. I found a couple of

image backups having nothing to do with it but there are definitely no mail related backups. And yet the hack works perfectly.
[Galaxy S II Themes and Apps] nos1609:
This hack works great on Xperia tablet z 4.2.2
[Galaxy S II Themes and Apps] prepo1:
Work on Note 2

Working on stock rom Galaxy Note 2 (N7100)

ROM VER. N7100XXDME6
[Galaxy S II Themes and Apps] arvo.bowen:
Not sure what to tell ya... If you ran the patch correctly with no issues it should make the backup copies. Maybe you ran the "manual" patch script or something? But the latest version of it and running the auto version should do the backups... Maybe see if you can ask on the forums for the exact version of the originals? Myself could give you the originals for HTC One X running the CyanogenMod 10.2 (Android 3.2)...

Arvo - HTC OneX
[Galaxy S II Themes and Apps] ipprof:
What i

used was cschmitt's flashable zip. It did the trick but left no backups.
[Galaxy S II Themes and Apps] arvo.bowen:
:banghead:

Well there is your problem... This is a thread supporting rustamabd's patch ... Not sure how you got here getting support for something cschmitt made. :p

Arvo

Device: HTC One X

ROM: CyanogenMod 10.2 (Android 4.3)
[Galaxy S II Themes and Apps] ipprof:
I got it right here, two pages back on this thread. http://xdaforums.com/showthread.php?p=45260741

It seemed a lot easier than the rest of

the thread because it just automates it all.
[Galaxy S II Themes and Apps] arvo.bowen:
And what exactly does the OP's post not make automated? All you have to do is run one file and it does everything for you...

I just looked back at that post you are talking about... Your kidding right?

It TOTALLY explains the backup process right in the post does it not?!
[Galaxy S II Themes and Apps] ipprof:
I'm not sure what you're trying to say. It says what is supposed to happen. But it didn't happen. Why would I kid you? I don't even know you.

I think the ops method requires a pc. This doesn't. Why create unnecessary steps?
[Galaxy S II Themes and Apps] cschmitt:
The flashable zip that I posted does not backup the existing Email and Exchange apk files, if you need them download a CM zip and grab the unmodified apks out of \system\app in the zip.

If you want to 'undo' the mod use a file explorer to delete the /system/addon.d/90-email.sh script, boot into recovery and flash a CM zip-- the modified apks will be overwritten by the unmodified files in the ROM zip.
[Galaxy S II Themes and Apps] arvo.bowen:
Ahh ok I see, but this thread was meant for the original patch and everything I have said as of yet was talking about the processing of that script.

Besides... Anyone who has rooted had to use the PC/adb... :P
[Galaxy S II Themes and Apps] audino:
I hate the pin code entering, therefor Ive treid your patch but Im getting following issue:

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

Its an S4 with this rom http://xdaforums.com/showthread.php?p=45444308#post45444308

and root access trough SuperSU.
[Galaxy S II Themes and Apps] ipprof:
Hey guys I think all my questions have been answered. Thanks!
[Galaxy S II Themes and Apps] arvo.bowen:
audino, check out an old post of mine above... Look for the "Things that people should try who are having issues..." section.
[Galaxy S II Themes and Apps] ErezTavor:
Sony Xperia Tablet Z

Hi.

The hack worked perfect on my Sony Xperia Tablet Z SGP311 running Sony stock 4.2.2.

Thanks alot for your effort.

---------- Post added at 03:24 PM ---------- Previous post was at 03:22 PM ----------

After running the patch, you should open you device and than you will be asked to apply permissions by SU.

Did you see it?
[Galaxy S II Themes and Apps] audino:
Sry coulndt find this post...
[Galaxy S II Themes and Apps] ipprof:
It's right above you on this page

http://xdaforums.com/showthread.php?p=45447022
[Galaxy S II Themes and Apps] arvo.bowen:
I'm not sure what you're getting at in regards to that specific comment you quoted of mine. But in my case no... I needed to install a DIFFERENT version of a super user app. Also one very important thing was I never specify gave su access to adb! ;)

Note: There are at least 3 different flavors of Super User applications.. ;) I'm sure they do not all have the same methodology.

---------- Post added at 03:16 PM ---------- Previous post was at 03:16 PM ----------

Thanks! ;)
[Galaxy S II Themes and Apps] machmandp:
Disable Remote Wipe

Hi

after reading through the forum i believe that the Remote Wipe function is left enabled

Personally i would like it disabled , can i do this without you having to release another version ?

Thanks
[Galaxy S II Themes and Apps] ipprof:
[HTML][HTML][HTML][HTML][HTML][HTML]

[/HTML][/HTML][/HTML][/HTML][/HTML][/HTML]

I'm not sure but I think with Schmitt's flashable zip it is disabled only because I remember looking at the security details and the symbol for remote wipe was unchecked. I could be wrong.
[Galaxy S II Themes and Apps] nunuxx:
can anyone confirm this is working on 4.3?

Error below: (i'm pretty sure i'm rooted, my superSU, busybox works normally)

Cleaning up ...

Waiting for USB connection...

Checking device...

Model: Nexus 4, build JWR66Y, 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: yes

Pulling app(s) ...

Pulling libs ...

Decompiling EmailGoogle.odex ...

Applying patch ...

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

Recompiling ...

Building EmailGoogle.apk ...

Decompiling Exchange2Google.odex ...

Applying patch ...

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

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

Recompiling ...

Building Exchange2Google.apk ...

Updating device ...

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

Debug log written to debug.log

Press any key to continue . . .
[Galaxy S II Themes and Apps] arvo.bowen:
4.3 yes...

Even though you think your root you might not be... Open superSU and see if it tells you to reinstall... You might need to install superSU from the recovery GUI (such as twrp). You might need to enable apps and adb access inside superuser if using a ROM such as CyanogenMod.

Arvo

Device: HTC One X

ROM: CyanogenMod 10.2 (Android 4.3)

---------- Post added at 09:28 PM ---------- Previous post was at 09:25 PM ----------

Really????? I might have to look that mod up! Where can I find info on it? I hate them having the ability to remote wipe!!!

Arvo

Device: HTC One X

ROM: CyanogenMod 10.2 (Android 4.3)
[Galaxy S II Themes and Apps] ipprof:
It's in this thread a few pages back. You can download it from his post.

http://xdaforums.com/showthread.php?p=45260741
[Galaxy S II Themes and Apps] arvo.bowen:
O gezz that's the one you were talking about having trouble with. Did you ever get it to work?

Arvo

Device: HTC One X

ROM: CyanogenMod 10.2 (Android 4.3)
[Galaxy S II Themes and Apps] ipprof:
It's working perfectly. It just doesn't make backups but he posted instructions in a later post about how to revert if you ever want to.
[Galaxy S II Themes and Apps] arvo.bowen:
Guess I'll have to try that one out then... Mine just broke today... Updated cm to latest nightly he he.

Arvo

Device: HTC One X

ROM: CyanogenMod 10.2 (Android 4.3)
[Galaxy S II Themes and Apps] arvo.bowen:
Negative on that Houston! Just ran the patch by Schmitt and still have the device admin lingering over my phone... Dang! I was hopeful after you made that comment too. hehe
[Galaxy S II Themes and Apps] ipprof:
I would try two things. First reboot but more importantly reflash your ROM. That will give it a chance to reset all your security settings. Just a guess but it works for me.
[Galaxy S II Themes and Apps] kenguy79:
Moto X woes

I've tried this a couple of times on my new Moto X and have had no success. I have previously used this on a gnex, N4, GS3 and 4 so I feel like I know how to use it, but I'm hoping I can get some guidance.

I do have root and when I run this is shows to be successful but it still prompts me for a pin or password. One time, that I noticed, the exchange2.apk was patched but couldn't be uploaded. The progarm put it on the SC card and I was able to move it to they system/app folder with root explorer but still no dice.

I also attempted to build this manually and while the build seemed successful, it gave the same result -- prompted for a pin or password.

Anyone have any suggestions?
[Galaxy S II Themes and Apps] ipprof:
I think it always prompts but then goes right to email without requiring it
[Galaxy S II Themes and Apps] kenguy79:
In this case, it forces me to the security page and all the options are greyed out except PIN and Password. Agree, in the past, it would ask me to activate, but then nothing more. Now it will send me to the security page every time I try to open the app.

Thoughts?
[Galaxy S II Themes and Apps] ipprof:
My only thought is that you should reflash a cm ROM which will trigger the script to run, including that part that effectively inactivates these options.
[Galaxy S II Themes and Apps] bricenott:
One more thought, doesn't the patch ask you to enter the name of the file? This happens if you don't enter the name or you write it incorrectly (including case). Which version is your Android?
[Galaxy S II Themes and Apps] ipprof:
No the patch is all automatic. You just flash it.
[Galaxy S II Themes and Apps] okgnew:
Sony xperia Z Ultra

Does this patch work with Sony xperia Z Ultra?
[Galaxy S II Themes and Apps] ipprof:
See the beginning of the thread. The op gives some general idea of what it will work with and what it won't
[Galaxy S II Themes and Apps] joemamahey:
Manual Method working on T-MO GS4

The "Apply Patch didn't work for me either (same device). I used the manual method in the command prompt following your directions(below) and it worked flawlessly. I, like you, have no other admins added! Perfect. Thanks for the CODE!