yashsingh1/xdaforums huggingface dataset:
[HTC Sensation] YACO:
1. Get rid of accounts, force close, clear data.

yes

2. From ES File Explorer, delete /system/app/Mail+nonprime.apk

yes

3. Do I need to delete Mail+nonprime.odex?

yes (cleaner)

4. Paste the downloaded file into /system/app

yes

5. Do I need to rename the downloaded file?

no need

6. Reboot into recovery, fix permissions.

sure

7. Reboot and it works?

yup

---------- Post added at 11:23 PM ---------- Previous post was at 11:18 PM ----------

also, you may use adb run these commands

(mount system)

adb remount

(delete old mail.apk)

adb rm /system/app/Mail+nonprime.apk

(delete data)

adb rm -R /data/data/com.htc.android.mail

(copy patched mail.apk)

adb push patched_mail.apk /system/app/Mail.apk

adb reboot

---------- Post added at 11:27 PM ---------- Previous post was at 11:23 PM ----------

Yeah... followed the steps... it was confusing a bit at some point but it worked nicely... props should be given to whoever came up with the hack.
[HTC Sensation] dl:
FYI, got this working by renaming the new file to Mail.apk. Then opened it to install.
[HTC Sensation] avplaya:
Does this Sense 5 apk have the calendar sync bug? I have Trickdroid installed on my One and the fix it provided can't sync Calendar properly. Can someone who has this version installed check?

---------- Post added at 04:00 PM ---------- Previous post was at 03:15 PM ----------

Just installed it and Calendar Sync is still not working. I guess I'll have to rely on HTC Sync to get my outlook calendar events to my HTC One in the mean time.
[HTC Sensation] teknixxx:
I'm wondering if anyone would like to assist me with removing the exchange security from the e-mail app on this new ROM I'm using. It's santod's UnSenseROM Jelato. I'm not sure if one of the attachments in the first post will work for me or not. I've attached the email.apk if anyone would like to assist.
[HTC Sensation] jndrfq:
HTC Sensation Hypernonsense ROM

Hi,

I have tried each and every way to disable the exchange unsuccessfully. Not sure if there is a way but previously with tens of ROMs I have been able to achieve this.

Appreciate if anyone can help !!

http://xdaforums.com/showthread.php?t=1581619&highlight=hypernonsense
[HTC Sensation] twosix:
This works for me. I can sync all including calendar. :)
[HTC Sensation] cat2115:
Work great on [ROM][BETA] TrickDroid 10.0.0 | Sense 5.0 | APM | EQS | Tweaks but sometime i get "Alert - Login failed" This is on Yahoo account

Anyone getting this alert when using the above mail.apk? how do you fix it?

Anyone has a fix so that stock mail work on yahoo account,

thanks
[HTC Sensation] alidsd:
is it working on Albino 10.2 or Lungu Rom

Can anybody confirm that is it working for Albino CM 10.2 or Lunch ROM ( 4.2.2) ? i need to disable admin rights.

Thanks
[HTC Sensation] shantur:
OP updated. Added Mail+nonprime from Sense JB for Sensation.

You will need to use the new script.

It is a new kind of hack so you will have to enable the exchange admin but it will not enable restrictions.
[HTC Sensation] magic.hand:
I saw your update.

Downloaded the file for Mail+nonprime.

Here are my steps:-

- settings --> apps --> mail, do force close and clear data.

- used es file explorer with root permission, renamed original app to Mail.apk.bak.

- copied over the Mail+nonprime.apk, changed permission to 644.

- reboot

- setup my exchange email again.

**** result, still failed. Same error message as I posted before.

Question, is this hack only for Revelation? Can't it work on ViperS?

FYI, I am on ViperS 3.1.0.

Sent from my HTC Sensation XE with Beats Audio Z715e
[HTC Sensation] shantur:
Did you remove the accounts as well?

I would suggest you do that as well.

The base for ViperS 3.1.0 is Revelation so it should work with both of them.

If you can give me test account i might be able to help.
[HTC Sensation] magic.hand:
Agree that ViperS is based on Revelation, but I noticed that in /system/app, there is no Mail+nonprime.apk which is existed in Revelation. When I ran the script, it returns as following

Tue 07/09/2013
10:38 PM
remount succeeded
rm failed for /system/app/Mail+nonprime.apk, No such file or directory

That still not the main problem as I can simply rename it to Mail.apk or just leave Mail+nonprime.apk in the /system/app/

I noticed something is not right. No matter which apk file I used to replaced the original Mail.apk, app info (Settings/Apps/) still showing the same size. For example, your new file is 2.68 Mb in size, but it showing 4.05 Mb in apps info? Refer my snapshot. Could it be referring to some other apps that I failed to see?

Unfortunately, I can't provide you with test account as I am not the server admin. I'll try to ask one, and provide you if possible later.
[HTC Sensation] shantur:
Try doing these steps from adb.

1. Delete all accounts from settings.

2. adb shell rm /system/app/Mail+nonprime.apk ( remove the backup apk as well )

3. adb push <New mail.apk> /system/app/Mail+nonprime.apk

I am not sure about renaming, in theory it should not matter but just to rule out other problems i would suggest keeping it Mail+nonprime.apk
[HTC Sensation] magic.hand:
thanks for your quick reply. still failed.

I'll do another round of full wipe installation and this time i will start with setting up exchange mail first before anything else.

will keep you posted on the result.

EDIT:

After series of exhaustive tries, I still unable get this working on my phone. I got stuck at "unable to create account. Please try again later".

Tested using Revelation and ViperS, both same result.

I am now back to ViperS without selecting "Disabled security exchange" during aroma installation. :'(
[HTC Sensation] shantur:
Is it working for you without disabling security? on ViperS 3.1.0 or Revelation
[HTC Sensation] magic.hand:
none working :( on both ROMs. I can get pass thru the security warning, then "Continue" then failed. not sure where is the problem. attached is the original apk. maybe you can have a look at it.
[HTC Sensation] daheufster:
I second this. Both Revelation and ViperS 3.1.0 are having this problem. All goes well up to the end "creating the account. see pic below. Now get this: Even when trying to set up hotmail using MS hotmail (live) isn't functional. So i think that problem is not the mail.apk but is somewhere else. I even check mail.db too see if settings for '_easSvrProtocol' are set right (2.5) but this is oke.
[HTC Sensation] Iceberger:
I came with a workaround, look here
[HTC Sensation] magic.hand:
I followed your steps.

Sadly, I still ended up in the same result.

Not sure what else I missed.

Sent from my HTC Sensation XE with Beats Audio Z715e
[HTC Sensation] daheufster:
Its working for me..
[HTC Sensation] nickluck:
It's working also for me, but I can't download contacts, nor I can see the accounts in settings...
[HTC Sensation] magic.hand:
Good for both of you [MENTION=288942]daheufster[/MENTION] and [MENTION=2189855]nickluck[/MENTION] as its working. If you can see it in your account settings.

I think I have another way to make it work. I just need sometime to get it done.
[HTC Sensation] nickluck:
Only the mail works. I can't see the account in the settings...
[HTC Sensation] daheufster:
Did you also backup and restore "accounts" with titanium? I must admit I also backup-ed and restored "contacts storage" and "agenda storage" data (displayed in green text) from 3.0.0 to 3.1.0 / 3.1.1.

Don't forget to do a soft reset afterwards so changes can take effect.
[HTC Sensation] nickluck:
Nope. I will try that (at least account)
[HTC Sensation] magic.hand:
finally I got my mail working. still using the same method by [MENTION=1472681]Iceberger[/MENTION] just from different ROM. I used Elegancia 7.5.0, setup my mails and backup the settings, then restored it in my ViperS.

Mails flowing in, just not appearing in System/Account & Sync.
[HTC Sensation] ulrakhma:
Works for HTS Sensation (T-mobile). No need to encrypt device and SD card. Thanks.

---------- Post added at 02:44 PM ---------- Previous post was at 02:40 PM ----------

what is difference between Mail.apk and Mail4.apk? Do I need to reinstall it, I am using Android 4.0.3 with sense 3.6
[HTC Sensation] ipaq6300:
it worked for my sensaton insertcoin 4.6.1, tks alot !
[HTC Sensation] :
Thanks! This works flawlessly on sense-o-maniac 4.0.3 Sense 3.6. I love not having to put a pin in my phone because my employer is enforcing security policies.
[HTC Sensation] shantur:
Mail4.apk is for Sense 4.0 ( Virtuous S4X Rom )
[HTC Sensation] ahassouna:
how can u do this?

or will this work?

using titanium backup pro - i can select mail.apk file and convert to user then uninstall then install new one then convert to system?

pls confirm if this way can work
[HTC Sensation] shantur:
I think, it would be easier approach to download the scripted patch and install using a double click.
[HTC Sensation] ahassouna:
i can do that?

i though both attachements in 1st post was only to be done via adb?

of i can just install the mail.apk do i need to put it in system/app or do i just run the file via explorer and insall on current app?

btw thanks for the reaply :)
[HTC Sensation] shantur:
Follow the steps above
[HTC Sensation] ahassouna:
thx dude :)
[HTC Sensation] EDD!E:
I didn't try titanium backup. :)

---------- Post added at 06:39 PM ---------- Previous post was at 06:38 PM ----------

Tested on ARHD 6.4.0, works perfectly !!!
[HTC Sensation] shantur:
Updated Mail.apk from ARHD 6.4.0 and implemented a new mod that disables all the security features instead of just pin and sd encryption.
[HTC Sensation] shantur:
Updated Mod to Version 2.0

This disables the Exchange Admin completely. You can see uknown sources and it doesnt prompt you to enable Exchange Administrator
[HTC Sensation] EDD!E:
Found any issue/bug. The moment on 3.6 v2 SD Card will be lock and can't detect at recovery.

Revert back to 1st version access recovery without issue.

I think some parameter need to revise ... :)
[HTC Sensation] shantur:
Can you explain "SD Card will be lock and can't detect at recovery" ?
[HTC Sensation] EDD!E:
Just like original Mail.apk security parameter ...
[HTC Sensation] shantur:
Try this

1. Remove your Exchange Account

2. Goto Settings > Security > Device Administrator > Exchange Policy

3. Select it and it will ask to disable the Administrator.

4. Now install Mail.apk v2 and add your account again.
[HTC Sensation] EDD!E:
Done that before posting the issue.

I even reboot twice before reinstall the v2 APK.

went in account to remove, force stop, clear data, reboot then repeat the steps then install ...
[HTC Sensation] shantur:
Strange...

V2 is working fine here with ARHD 6.4.0 here.

Did you try removing the old apk first. If not try these commands on command prompt.

adb remount

adb shell rm /system/app/Mail.apk

Now use the script to install the new attached apk.
[HTC Sensation] shantur:
Did you explicitly remove Exchange Device Admin?
[HTC Sensation] shantur:
Added Mod for ARHD 6.5.0. Mail.apk was different in new version of ROM
[HTC Sensation] AcheronXI:
What about contacts ? Syncing too ?
[HTC Sensation] magic.hand:
Syncing won't be a problem.

For contacts, I don't store my contacts in outlook. Searching phonebooks on server when you're composing email works fine.

Sent from my HTC Sensation XE with Beats Audio Z715e
[HTC Sensation] sdeft:
Hi rathore4u

Have you noticed that the AOSP email app always tries to sync on first run even though the sync option is disabled ? Is there a way to disable this if we mod the email.apk or the exchange one ?
[HTC Sensation] shantur:
I havent tried this case. I think it wants to show you the latest email. Why do you want to stop it, just curious. :confused:
[HTC Sensation] daheufster:
All Works fine, syncing contacts, calendar, mail and task...
[HTC Sensation] arvo.bowen:
rathore4u, I have been following this thread for a while now. Since I started I have upgraded my HTC One X to CM 10.2 (Nightly) running the AOSP version of JellyBean 4.3...

I did the following...

1) I grabbed the following mod from this thread via my phone's tapatalk app.

- Exchange2_AOSP_JB.apk - [Click for QR Code] (827.4 KB, 920 views)

2) I killed all running email/exchange applications.

3) I backed up my current files...

- Email.apk -> Email.apk.bak.

- Exchange2.apk -> Exchange2.apk.bak.

4) I copied Email.apk.bak to Email.apk (because this was not included in your mod).

5) I cleared the cache from the Email and Exchange applications.

6) I rebooted the phone.

7) I ran the Yellow email app on my phone.

- Was prompted to re-enter all my info to set up the account.

- Asked me to enable device administrator settings, so I clicked activate.

Everything seems to be working fine now... But I still have an Email device administrator! :( Shouldn't that NOT be there with this mod?

Thanks!!
[HTC Sensation] shantur:
For AOSP mod, it still enables the Administrator but it doesnt enable the password restriction. Is this working for you?
[HTC Sensation] arvo.bowen:
It is indeed working if that was the intended effect. I already had that working from using the patch over at this thread.

Why would you only remove the password restrictions? Why not remove the entire device admin like you do for the non AOSP ROMs?
[HTC Sensation] shantur:
Because this is what i could do without breaking the AOSP Email app. Sense Email is completely different from AOSP email.
[HTC Sensation] arvo.bowen:
Well that stinks. But thanks for all you do. ;)

Arvo

Device: HTC One X

ROM: CyanogenMod 10.2 (Android 4.3)
[HTC Sensation] sdeft:
For sure it wants to sync the email but since the poll inbox frequency is set to none it shouldn't. Just want to stop this behavior due to 3G data charges. K9 mail is ok but doesn't support active sync. Can you guide me to the correct smali files for this in case you know ?
[HTC Sensation] dizzy2604:
YACO how did you patched it please?
[HTC Sensation] twilightgod:
How do you get it?

I do myself following the guide in first post, but it doesn't work.
[HTC Sensation] arvo.bowen:
Is this still the case as of today rathore4u? Or has there been a change that allows device admin to be completely removed?

Arvo

Device: HTC One X

ROM: CyanogenMod 10.2 (Android 4.3)
[HTC Sensation] PittBrad:
Can somebody help me with mail.apk for Sensation ARHD 7.3. Thx!
[HTC Sensation] Tead:
CM11 Exchange2.apk

Can somebody help me to patch the Exchange2.apk from CM11? I tried to follow the howto but I can't solve this step:

I think I need an other howto to patch the Exchange2.apk. Does somebody have it?
[HTC Sensation] MohElShafei:
Dear All,

I just had installed the Lollipop 5.02 and I was facing the problem of locating the email app to disable the security policy. I tried many ways, and hence I got to solve the issue finally by applying these steps:

1. I pulled out the Lollipop 5.02 email apps (Email.apk and Exchange2.apk) and place them in the root directory of the System/app.

2. I run the Patch CMD and let it do all the required steps to patch it. This is the only way to make the CMD Patch do the work, as it always search on the Root folder, and the Lollipop 5.02 placed these apps in folders instead.

3. After the phone restarts, I took the patched files back to their folders Email and Exchange2 on the same directory. I had to remove the old apps first. And place the patched ones in their locations.

4. Resatrted the phone, and voila, the app is not asking for pin anymore :D :D

I have attached the patched version of the Lollipop 5.02 (Email.apk and Exchange2.apk) with the post, so that you can replace them with the app you have directly :) :)

Note: Do not use the attached files as a flash recovery zip file. It is only zip file you extract to replace the apps manually using ES File explorer or any File Management software.

Best of luck.

Sincerely,

Mohamed ElShafei
[HTC Sensation] hyperhamster:
Thanks a lot! Very good mod!
[HTC Sensation] EDD!E:
I tried twice not working, however I wipe and reinstall the ROM.

And magically it works ... :D
[HTC Sensation] shantur:
Yay!!!! :)
[HTC Sensation] ulrakhma:
looks like Send/receive settings are not saved. Every time I change Message format from plain text to HTML, and Include Attachment option, it revert back to original settings.
[HTC Sensation] shantur:
I remember people complaining about this in the original unmodified APK in some threads. Which rom version and mail mod version are you using?

if its based on Sense 3.6 try using Mail-Sense-3.6-ARHD-6.5.0.apk as this is the latest with bug fixes from Htc.

I am using this one currently and I have checked that i am able to save settings.
[HTC Sensation] ulrakhma:
It is Sense 3.6 ARHD-6.5.0.apk. It does allow to change settings, but they will be reverted back after some time. I don't know yet the pattern.
[HTC Sensation] shantur:
It would be nice if you can identify the pattern. Is it that your Exchange server is not happy about HTML mails on your phone?

I didn't change anything for that so shouldn't be because of this. I just changed the Security things.
[HTC Sensation] sjgore:
Excellent mod!

Can the disabled security be detected by exchange servers, or are they unaware, I.e. they think the security is being enforced but it actually isn't?

Is there an AOSP Email.apk for Android 4.0.3 with all security disabled available anywhere?
[HTC Sensation] shantur:
As far as code looks like, the exchange servers let Mail clients handle the Security Features.

If you are not able to find any mod for Email.apk, give it to me and i will try doing that for you.
[HTC Sensation] dmoses1969:
Could you fix this one up for the Rezound for me? Or do you think the script will work?

Thanks
[HTC Sensation] shantur:
If you are coming from HTC Sense 3.6 Rom then try Mail-Sense-3.6-ARHD-6.5.0-v2.0.apk. It should work. If not then let me know I will mod this one.
[HTC Sensation] dmoses1969:
Thanks, I will give it a try. The only other difference is the rezound has a higher resolution, xdpi, not sure how its going to look.

Thanks
[HTC Sensation] dmoses1969:
The one you suggested did work but it doesn't look right do to the resolution of the display on the Rezound. If I use the script and follow the instructions in the op I should be able to use the mail.apk from the rom I am using and fix it up correct?
[HTC Sensation] shantur:
I will try to mod your apk.

The script doesn't mod anything it is just used to replace the original apk in phone.
[HTC Sensation] shantur:
Here you go... Try the attached APK. If it works let me know the Sense version and Rom you are using.

PS : Attachment moved to OP
[HTC Sensation] Catnap:
I don't want to rain on your parade but you might want to bear in mind that if your workplace admins require certain security features when you pick up work email on your personal phone and you're bypassing them, you may find yourself in serious trouble, especially if your industry is regulated to require data protection/security and so forth.

It highly depends on your workplace of course, but if you're part of a medical organisation then breaching data security laws can mean very large fines if not worse.

Just throwing it out there.
[HTC Sensation] shantur:
Agreed.

But what if user is using Exchange email apps from market that ignore the security, like EnhancedEmail.

By using this mod people are aware that they are ignoring security features, but when we use EnhancedEmail, it doesn't even tell user that it is ignoring security.
[HTC Sensation] Catnap:
It's up to the IT department to say who can have company mail on a personal device. Locking people out of company email that's not Outlook is pretty simple to do these days on Exchange.

Therefore, if they let you use company email on your personal device without looking at it first to make sure it complies, it's their problem really. That's not to say you wouldn't get in trouble as well though, especially if your device is reporting that all the security features are enabled and being used and it turns out they're not because you have modified software on the device.
[HTC Sensation] shantur:
Microsoft ActiveSync just provides the security policy doesn't ask what all are being used.

Its completely users responsibility what ever they do with their mailboxes, exchange server, outlook accounts, phones...
[HTC Sensation] Catnap:
[Edit] Mis-read what you said. No, it doesn't actively check. However, if you bypass Device Administrator you're effectively telling the server that you support a bunch of features that it may require, when you don't.

Yes, agreed. If they want to avoid getting fired or fined, then they should make sure they're not circumventing whatever security is required at work.

Like I said, I'm not trying to rain on your parade; I'm just pointing out that end-users of this modified mail client should be aware of the potential risks of doing so.
[HTC Sensation] dmoses1969:
Yes that worked. Thanks

CleanROM ICSE 3.6 - ★| ICS 4.0.3
[HTC Sensation] shantur:
Glad it worked for you. Can you please let others in Rezound forum know about the patch. I have updated the OP with Rezound apk.
[HTC Sensation] EDD!E:
6.5.0.V2 works on 6.5.1.XE too
[HTC Sensation] shantur:
Thanks for the confirmation.
[HTC Sensation] bs android:
Could this be done with email.apk for the senseless roms ? There is one mod but that only remove the decrypt and not the pin code request.
[HTC Sensation] shantur:
I am not sure, I can try modifying the apk. Can you give me one?
[HTC Sensation] bs android:
http://xdaforums.com/attachment.php?attachmentid=923580&d=1330436695
[HTC Sensation] shantur:
Does this support Exchange Active Sync?

I tried using this apk it ask for if the account is POP or IMAP.

I am on Sense ROM and tried installing on it.
[HTC Sensation] baste07:
Would be good if this is something we can flash throug recovery
[HTC Sensation] baste07:
Tested it out on arhd 6.5.1 xe and as previous poster said it still works, excellent. Wish there was something like this for may tab aswell
[HTC Sensation] shantur:
I dont want to manage different zips that is why i have separated the apk and install script
[HTC Sensation] shantur:
Send me the apk, i will try modding it
[HTC Sensation] Panchulo77:
Hi Guys,

If you can do the same for AOSP users would be great!
[HTC Sensation] shantur:
I can try if someone gives me the apk and is ready to test.
[HTC Sensation] EDD!E:
Yes. I'm using it now.
[HTC Sensation] shantur:
Are you using the apk on Sense 3.6 Rom or AOSP rom?

I tried on my sensation and it asked me to select if the account is POP or IMAP
[HTC Sensation] Panchulo77:
AOSP Virtous inquisition mail Apk

Ok this is what i have found RMK rom, when i try to connect to exchage, this are the apk that are running, sorry if i'm completly mistaken but i,m not very experienced in messing inside the roms
[HTC Sensation] shantur:
Download the attached apk and try this

1. Remove your exchange email account from your phone. Using email app.

2. Confirm no exchange account is there in Settings.

3. In command prompt do following

adb remount
adb uninstall com.android.exchange
adb shell rm /system/app/com.android.exchange.apk
adb push com.android.exchange /system/app/

4. Add your exchange account, it might ask you to enable the device admin if not enabled already, just enable it.

It should not ask you for device passwords or encryption.

For now it just ignores the passwords and encryption, it doesn't disable the admin completely.

If you can document the steps, i will update the OP as i dont have AOSP rom.

<Moved Attachment to OP>
[HTC Sensation] shantur:
Did anyone test the aosp version?
[HTC Sensation] Panchulo77:
I have just see the post today, while I'm traveling :( but I will test as soon I can and report back
[HTC Sensation] froggymike911:
Here are the files i used on an AOSP rom on the inspire 4g to bypass the pin. needed them both to not get force closes
[HTC Sensation] Rechinica:
LiquidSmooth ROM

Hi,

I'm using LiquidSmooth 1.1 on my Galaxy Nexus device.

We change we can have the same non security love? :)

ROM details: http://xdaforums.com/showthread.php?t=1555667

Thanks,
[HTC Sensation] froggymike911:
Can you modify this Mail.apk? It is from a HTC One V rom that is being ported to a bunch of phones (sense 4.0a, which may be why the other 4.0 doesnt work).

Thanks!