[MOD] Un-restrict Facebook Contact Data [NOW WITH ZIP FOR XREC!] - XPERIA X10 Android Development

Hello!
For a while now, many users have faced the issue of Facebook Contact Pictures not appearing in some 3rd party applications. For example, ChompSMS, Handcent, GO SMS, 4rd party dialers, etc.
One way around this is to contact each application's developer and ask them to implement a solution, but, we all know, that doesn't always work...
So, I found a way to edit the contacts database, so that Facebook data will no more be restricted.
And it is a permanent solution applying to all previous and all new and updated data.
Thanks to Adolf1994, this can be done by simply flashing the attached zip via xRecovery. It should work for EVERY rom, ANY android version!
Now with the flashable zip, it's easier for ROM cookers to implement it on their ROMS.
For example, erickwill already implemented it in his super-fast optimised 2.1 X10x EWJet V009.5 ROM!
For reference, I am keeping the manual way posted here:
Manual Installation
It can be done via PC (if you have the android SDK properly set up and you are therefore familiar with adb)
or on your phone via a terminal emulator app or GScript.
Step 1: Connect your phone to your PC.
Step 2: Start->Run->cmd
Step 3: Copy and paste this on the terminal window:
adb shell sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db "CREATE TRIGGER unrestrict_new_data AFTER INSERT ON raw_contacts BEGIN UPDATE raw_contacts SET is_restricted=0 WHERE _id=NEW._id and NEW.is_restricted!=0 and NEW.account_type in ('com.facebook.auth.login'); END; CREATE TRIGGER unrestrict_updated_data AFTER UPDATE OF is_restricted ON raw_contacts BEGIN UPDATE raw_contacts SET is_restricted=0 WHERE _id=NEW._id and NEW.is_restricted!=0 and NEW.account_type in ('com.facebook.auth.login'); END; UPDATE raw_contacts SET is_restricted=0 WHERE is_restricted!=0 AND account_type in ('com.facebook.auth.login');"
You won't get any message in return, don't worry about it, it worked.
To make sure, try to run the command again, you will get this:
Error: trigger unrestrict_new_data already exists
That means it worked the first time!
Now, if you are using a terminal on your phone, copy the same command, without the adb shell (after acquiring su access of course).
su
(press Enter and wait for the # to appear, then type the following)
sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db "CREATE TRIGGER unrestrict_new_data AFTER INSERT ON raw_contacts BEGIN UPDATE raw_contacts SET is_restricted=0 WHERE _id=NEW._id and NEW.is_restricted!=0 and NEW.account_type in ('com.facebook.auth.login'); END; CREATE TRIGGER unrestrict_updated_data AFTER UPDATE OF is_restricted ON raw_contacts BEGIN UPDATE raw_contacts SET is_restricted=0 WHERE _id=NEW._id and NEW.is_restricted!=0 and NEW.account_type in ('com.facebook.auth.login'); END; UPDATE raw_contacts SET is_restricted=0 WHERE is_restricted!=0 AND account_type in ('com.facebook.auth.login');"
Or, in GScript, create new script, check "Needs SU" and paste the above command, save and run!
Step 4: Reboot and Enjoy!
FAQ (please read BEFORE posting)
Q: I can't use adb/I get adb is not recognised blah-blah-blah.
A: Check this out, thanks DoomLord!
Q: I get sqlite: permission denied.
A: Try this! Thanks gregbradley!
Q: I get adb: permission denied.
A: There's a chance you don't have shell root. Try this.
Q: Will it work for me?
A: This method works on every 2.2 ROM.
It can work on 2.1 stock too, but you need to edit the file on your PC and push it back to the phone,
because sqlite3 seems to not be included. Here is a tutorial.
Click to expand...
Click to collapse
Remember to hit the Thanks button if you find this useful and/or appreciate the effort of building this tutorial!
Kind regards,
Iris

My_Immortal said:
Hello!
For a while now, many users have faced the issue of Facebook Contact Pictures not appearing in some 3rd party applications. For example, ChompSMS, Handcent, GO SMS, 4rd party dialers, etc.
One way around this is to contact each application's developer and ask them to implement a solution, but, we all know, that doesn't always work...
So, I found a way to edit the contacts database, so that Facebook data will no more be restricted.
And it is a permanent solution applying to all previous and all new and updated data.
It is very easy, it can be done via PC or on your phone via a terminal emulator app.
Step 1: Connect your phone to your PC.
Step 2: Start->Run->cmd
Step 3: Copy and paste this on the terminal window:
adb shell sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db "CREATE TRIGGER unrestrict_new_data AFTER INSERT ON raw_contacts BEGIN UPDATE raw_contacts SET is_restricted=0 WHERE _id=NEW._id and NEW.is_restricted!=0 and NEW.account_type in ('com.facebook.auth.login'); END; CREATE TRIGGER unrestrict_updated_data AFTER UPDATE OF is_restricted ON raw_contacts BEGIN UPDATE raw_contacts SET is_restricted=0 WHERE _id=NEW._id and NEW.is_restricted!=0 and NEW.account_type in ('com.facebook.auth.login'); END; UPDATE raw_contacts SET is_restricted=0 WHERE is_restricted!=0 AND account_type in ('com.facebook.auth.login');"
You won't get any message in return, don't worry about it, it worked.
To make sure, try to run the command again, you will get this:
Error: trigger unrestrict_new_data already exists
That means it worked the first time!
Now, if you are using a terminal on your phone, copy the same command, without the adb shell.
sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db "CREATE TRIGGER unrestrict_new_data AFTER INSERT ON raw_contacts BEGIN UPDATE raw_contacts SET is_restricted=0 WHERE _id=NEW._id and NEW.is_restricted!=0 and NEW.account_type in ('com.facebook.auth.login'); END; CREATE TRIGGER unrestrict_updated_data AFTER UPDATE OF is_restricted ON raw_contacts BEGIN UPDATE raw_contacts SET is_restricted=0 WHERE _id=NEW._id and NEW.is_restricted!=0 and NEW.account_type in ('com.facebook.auth.login'); END; UPDATE raw_contacts SET is_restricted=0 WHERE is_restricted!=0 AND account_type in ('com.facebook.auth.login');"
Step 4: Reboot and Enjoy!
NOTE: This method works on every 2.2 ROM.
It can work on 2.1 stock too, but you need to edit the file on your PC and push it back to the phone,
because sqlite3 seems to not be included. If anyone is interested in applying this on 2.1 ROM, I will make a tutorial.
Kind regards,
Iris
Click to expand...
Click to collapse
it comes as " 'adb' is not recognised as internal or external command"
Pls help

a2441918 said:
it comes as " 'adb' is not recognised as internal or external command"
Pls help
Click to expand...
Click to collapse
You need to have the androidSDK installed on your PC for this to work.
Try doing it on your phone, via Terminal Emulator.
PS: Please don't quote the first post, it's huge and you posted right underneath it, we all know what you're talking about.

As a noob, i hope somebody will do a .zip file ^^
Sent from my toilet using my X10i powered by Wolf's latest CM6 Rom

Cool! I'm going to try it out! It works also with the Arc phonebook right?

PlayGunsta said:
Cool! I'm going to try it out! It works also with the Arc phonebook right?
Click to expand...
Click to collapse
No matter which phonebook app you are using it will work, as it changes the core contact database!
amus76 said:
As a noob, i hope somebody will do a .zip file ^^
Click to expand...
Click to collapse
It might come to you as a disappointment, but this is not going to happen!
You need to edit your own unique contact database!
It's easy to do though, doesn't hurt to try! Good luck!

My_Immortal said:
No matter which phonebook app you are using it will work, as it changes the core contact database!
Click to expand...
Click to collapse
Thanks! Never found those facebook_fix.zip things in WolfBreak his thread! And here it is! Finally a solution

sqlite3: permission denied
running wolf's 6.13v6

PlayGunsta said:
Thanks! Never found those facebook_fix.zip things in WolfBreak his thread! And here it is! Finally a solution
Click to expand...
Click to collapse
As I said in the OP, this fix solves problems like Facebook pictures not showing up in 3rd party apps. I don't know what the problem was on WB ROM, but since with this command Facebook data is being un-restricted, it could help you.
And, let me say, it can't cause any damage whatsoever, so feel free to try!

soblecram said:
sqlite3: permission denied
running wolf's 6.13v6
Click to expand...
Click to collapse
Did you tupe su first?

My_Immortal said:
Did you tupe su first?
Click to expand...
Click to collapse
Did it from adb command prompt...
need to find a terminal editor

My_Immortal said:
It might come to you as a disappointment, but this is not going to happen!
You need to edit your own unique contact database!
It's easy to do though, doesn't hurt to try! Good luck!
Click to expand...
Click to collapse
Could always make a .sh... seems like something a script could do... just an idea.
Good job on finding this.

soblecram said:
Did it from adb command prompt...
need to find a terminal editor
Click to expand...
Click to collapse
Here's one!

bleached45 said:
Could always make a .sh... seems like something a script could do... just an idea.
Good job on finding this.
Click to expand...
Click to collapse
Yes, you can make a script with GScript using the command in the OP.

all worked perfect for me!
cheers

soblecram said:
Did it from adb command prompt...
need to find a terminal editor
Click to expand...
Click to collapse
Actually, just changed permission on sqlite. worked fine.. just rebooting now.

Is there a way for me to copy the thing and place it on my phones sd card and then open then copy and paste into terminal emulator?

lythanhlong said:
Is there a way for me to copy the thing and place it on my phones sd card and then open then copy and paste into terminal emulator?
Click to expand...
Click to collapse
Yes, of course, make a txt with the command, place it on your SD and then open it in a text editor, copy, paste...

Tried on X10 said permisson denied. :/

lythanhlong said:
Tried on X10 said permisson denied. :/
Click to expand...
Click to collapse
Did you type su first?
Meaning, on the Terminal Emulator:
su
(press enter and wait for the # to appear)
then paste the command?

Related

Unlock Patter is blocked

Hi all, after many attempts to unlock pattern my phone says:
Please enter your google account and password. I´ve attempt enter my google account and password and don´t work..
What i do now? Any idea?
Try this...
So it happens, that my brother locked me out of my own phone :O and i didnt want to wipe, so i searched and searched, until i found this solution which worked flawlessly
Method 1 :
Step 1. Download the Android SDK (http://developer.android.com/sdk/)
Step 2. Make sure to configure the ADB usb interface drivers
Step 3. Plug your G1 into your computer (via usb). (Settings -> Application -> Development -> USB Debugging, must be enabled [it is enabled by default in JesusFreke/CM's releases i think])
Step 4. Open command prompt and enter the following:
Code:
adb -d shell
sqlite3 data/data/com.android.providers.settings/databases/settings.db
update system set value=0 where name='lock_pattern_autolock';
update system set value=0 where name='lockscreen_lockedoutpermanently';
.exit
exit
reboot
Thats it, you'r gh0od :clap:
Method 2 :
Code:
adb -d shell
su
sqlite3 data/data/com.android.providers.settings/databases/settings.db
.header on
.mode column
select * from system;
Now, in the table, find the ID of the two lines called lockscreen.l and lock_pattern, in my case; 3125 and 3126
Code:
update system set value=0 where _id=(replace with your id and remove brackets);
update system set value=0 where _id=(replace with your id and remove brackets);
.exit
reboot
Click to expand...
Click to collapse
Instructions from a slightly dodgy, copyright infringing site, so I copied and pasted them to avoid linking to warez. If you google search for a small part of it, you'll find the original source.
Obviously instructions to be followed at your own risk, since they are for the G1, but I reckon the G2 would be the same (same underlying android code).
If poss, make a nandroid backup first
anon2122 said:
Try this...
Instructions from a slightly dodgy, copyright infringing site, so I copied and pasted them to avoid linking to warez. If you google search for a small part of it, you'll find the original source.
Obviously instructions to be followed at your own risk, since they are for the G1, but I reckon the G2 would be the same (same underlying android code).
If poss, make a nandroid backup first
Click to expand...
Click to collapse
Thanks to u advanced answer...but i make wipe.

[SCRIPT] Block B&N 1.1 Update

All you need to do is extract this and run the "runme.bat"
Code:
echo off
cls
echo *********************************
echo * Please plug the USB into Nook *
echo *********************************
pause
adb kill-server
adb devices
echo *******************
echo * Blocking Update *
echo *******************
adb shell mount -o remount,rw /dev/block/mmcblk0p5 /system
adb push block-1.1.sh /system/media
adb shell sh /system/media/block-1.1.sh
ping -n 5 127.0.0.1 >NUL
echo Success
adb reboot
adb kill-server
echo *****************************
echo * You nook is rebooting *
echo * Disconnect the USB cable! *
echo * Wait until rebooted... *
echo * *
echo * BN 1.1 Update Blocked *
echo * *
echo *****************************
pause
exit
Download
Can you release an "Undo" script as well that undoes what this does?
I was under the impression that the otacert rename was a dud and the build.prop was very questionable???
found this and replied to the discussion on the subject.
IMO, Until the OTA is squashed we are going to have a repetitive debockle of blowing up everyones rooted work and would think addressing this would be of significant value:
-cut-n-paste-
I was wondering what you folks thought of this 'prevent' 1.1 hack??
http://forum.xda-developers.com/showthread.php?t=930477
seems reasonable to me, adding:
127.0.0.1 csqaint.barnesandnoble.com
(looks to be the primary check for updates?)
and
127.0.0.1 bncs.barnesandnoble.com
(just for good measure but might have unwanted consequences?)
to /etc/hosts file
I would personally like to be able to put an end to this 'forced' OTA update behind us and be able to sideload any updates from bn manually at our convienence in the future.
how bout u??????
In reviewing the script it appears to apply the build.prop spoof update?
I thought this was questionalble in overall effectiveness?? and even if it worked would have to be reapplied after every update from bn???
I noticed an interesting reply from ixampl as follows:
What I did when the first scare of an update arose was:
a) Checked in /data/data/com.bn.nook.devicemanager/databases/ for an sql file
b) Pulled the sql file.
c) Dump its contents with sqlite3.
d) In it there's an entry for OTAs... with value "auto"
e) Changed that value to "manual"
f) Pushed the modified database file to the device.
I never got any OTA updates. Still on first OS version.
This is exactly what I'm lookin for, a permenant block unless of course the database update got reversed back to auto?????
is this normal? i go into settings/device info/about your nook color. it still shows 1.0.1? where do i have to go to verify this is blocked?
C:\NC - Auto Config Script 1.0.1>adb push block-1.1.sh /system/media
32 KB/s (506 bytes in 0.015s)
C:\NC - Auto Config Script 1.0.1>adb shell sh /system/media/block-1.1.sh
cp: not found
sed: not found
sed: not found
sed: not found
sed: not found
john10101 said:
is this normal? i go into settings/device info/about your nook color. it still shows 1.0.1? where do i have to go to verify this is blocked?
C:\NC - Auto Config Script 1.0.1>adb push block-1.1.sh /system/media
32 KB/s (506 bytes in 0.015s)
C:\NC - Auto Config Script 1.0.1>adb shell sh /system/media/block-1.1.sh
cp: not found
sed: not found
sed: not found
sed: not found
sed: not found
Click to expand...
Click to collapse
You dont have busybox installed on the NC?
bonzer2u said:
In reviewing the script it appears to apply the build.prop spoof update?
I thought this was questionalble in overall effectiveness?? and even if it worked would have to be reapplied after every update from bn???
I noticed an interesting reply from ixampl as follows:
What I did when the first scare of an update arose was:
a) Checked in /data/data/com.bn.nook.devicemanager/databases/ for an sql file
b) Pulled the sql file.
c) Dump its contents with sqlite3.
d) In it there's an entry for OTAs... with value "auto"
e) Changed that value to "manual"
f) Pushed the modified database file to the device.
I never got any OTA updates. Still on first OS version.
This is exactly what I'm lookin for, a permenant block unless of course the database update got reversed back to auto?????
Click to expand...
Click to collapse
Can you elaborate a little further on what commands you used so I might be able to add it into a script.
i dont think so... what installs busybox?
No offense, but this isn't a worry any more anyway. We already have a CWM flashable update.zip that updates you to 1.1, but does not harm your root or installed aps. Why are people bothering with all this "blocking" nonsense?
From this thread:
http://forum.xda-developers.com/showthread.php?t=874871
Attached is a working sqlite3 binary. Copy it to /system/bin and you will be able to edit sqlite databases on the nook itself.
--------------------------------------------------------------------------------
Attached Files sqlite3.7z (11.9 KB, 56 views)
-----------------------------------------------------------------------------
And I found a sqlite3 sample that will need to be edited like somthing as follows:
In your terminal,
$ adb pull /data/data/com.bn.nook.devicemanager/databases/settings.db settings.db
$ sqlite3 settings.db
sqlite> update secure set value='manual' where name='an entry for OTAs???-Dont know the parameter here'
;
sqlite> .q
$ adb push /data/data/com.bn.nook.devicemanager/databases/settings.db settings.db
$ adb reboot
Hope this helps, I dont know the input name for placeholder.
xboxexpert said:
You dont have busybox installed on the NC?
Click to expand...
Click to collapse
Ok i installed busy box off the market, and ran the script!!! success. when i rebooted it told me that 1.1.0 has been installed. and it now shows 1.1.0 in the about.
i suggest noting busy box in the original post.
Divine_Madcat said:
No offense, but this isn't a worry any more anyway. We already have a CWM flashable update.zip that updates you to 1.1, but does not harm your root or installed aps. Why are people bothering with all this "blocking" nonsense?
Click to expand...
Click to collapse
not everyone wants to upgrade to 1.1, or has cwm installed.
john10101 said:
Ok i installed busy box off the market, and ran the script!!! success. when i rebooted it told me that 1.1.0 has been installed. and it now shows 1.1.0 in the about.
i suggest noting busy box in the original post.
Click to expand...
Click to collapse
It says 1.1 is installed but its really not. (Spoofed it)
john10101 said:
not everyone wants to upgrade to 1.1, or has cwm installed.
Click to expand...
Click to collapse
Uh... why? What is there about 1.1 not to want? And if you are ok with doing all of this to block an update, there is no reason not to have CWM (which is quite stable). Sorry, but this really is all just wasted effort..
Divine_Madcat said:
Uh... why? What is there about 1.1 not to want? And if you are ok with doing all of this to block an update, there is no reason not to have CWM (which is quite stable). Sorry, but this really is all just wasted effort..
Click to expand...
Click to collapse
Took me 2 seconds to throw together...took longer to upload then anything. Its just for people who want it. If you dont want it I dont want you to have it :/
xboxexpert said:
Took me 2 seconds to throw together...took longer to upload then anything. Its just for people who want it. If you dont want it I dont want you to have it :/
Click to expand...
Click to collapse
Don't get me wrong, im not knocking your work, just people's reasoning for wanting it done in the first place. I understand before the update.zip was developed, since it would break root and mess up your apps. But now, there is no reason not to take the update; thus the continued demand for this is puzzling.
If you really want the OTA update to stop, take a look at the updater-script inside the sideload_update.zip file from B&N. The first two lines read:
Code:
assert(getprop("ro.product.device") == "zoom2" ||
getprop("ro.build.product") == "zoom2");
I think those are set in the build.prop file. Change either ro.build.product or ro.product.device to something other than zoom2 (say zoom2a), and the rest of the script won't continue. This is what people are seeing when the file gets downloaded OTA and then disappears without being applied. If for some reason you must avoid it, make that change and you will stop the update cold. Not sure what the side effects of making the change are, but there would be an easy way to revert by undoing the edits, if you need to.
Wasn't this already available from another forum member?
http://forum.xda-developers.com/showthread.php?t=930382
Seems a lot easier to just copy and replace build.prop with a filemanager.
Divine_Madcat said:
Uh... why? What is there about 1.1 not to want? And if you are ok with doing all of this to block an update, there is no reason not to have CWM (which is quite stable). Sorry, but this really is all just wasted effort..
Click to expand...
Click to collapse
Yah go ahead and read thru the cwm thread and try to convince anyone in this forum that it is 100% stable. Not to suggest that anyones efforts are not welcome and appreciated but if you asked the actual devs involved I would bet they would not suggest so as well.
I for one have rooted twice (1.0 and 1.0.1) with autoroot and am 100% stable, never had a crash or the pleasure to have to restore/rebuild, not interested in the stock browser or anything else bn has to offer, quite happy and perhaps lucky with the way its workin now. I also dont appreciate being strong armed an update without a confirmation, hell even microbuddies doesnt have that kinda gawl.
I guess it will take one of the next of many 'future forced' updates from bn that bothches all the work that you have put into your NC and for whatever reason your recovery doesnt work and you are forced to rebuild from scratch before you realize that if you had a permenant block in place, you could have the time for outstanding efforts of the local devs to stabilize an upgrade path before you pulled the trigger?
The database hack appears to be best way to permanently kill OTA, no need for future updated spoof build.prop scripts (before you get hit) and no worries about being updated and possibly blown up while your sleepin and bn pushes an update out before you get the news.
or maybe its just me..........
Exactly! If you are not diligently checking the forum everyday, you wouldn't know BN is pushing out 1.1 update and you wouldn't know there is a pre-nootered 1.1 version available. BN will update you OTA before you know any better and screw up your rooted setup. Hence the need for a permanent update block.

How to make bash the default shell on ICS?

Hi. I'm using ICS (AOKP with some CM9 patches). I'd like "adb shell" to bring up bash instead of mksh. Is there any way to do this? I tried linking /bin/sh to `which bash`, but that caused system problems--I lost USB debugging completely and had to restore from nandroid backup.
Anybody figure this out yet?
fenstre said:
Hi. I'm using ICS (AOKP with some CM9 patches). I'd like "adb shell" to bring up bash instead of mksh. Is there any way to do this? I tried linking /bin/sh to `which bash`, but that caused system problems--I lost USB debugging completely and had to restore from nandroid backup.
Anybody figure this out yet?
Click to expand...
Click to collapse
in /etc/mkshrc add to the end:
bash
exit
tgwaste said:
in /etc/mkshrc add to the end:
bash
exit
Click to expand...
Click to collapse
Thanks, that worked! But a note for anybody else reading this: You should absolutely, absolutely add this line WITHOUT the "exit" for testing purposes first. Bash may not be present during boot (/system/xbin may not be part of the path during boot, for example). After you test it and it works, you can write "exec bash" instead of "bash; exit" because it means you won't have one extra mksh process running and doing nothing.

[APP] ICS/JB AOSP Email Client for Motorola RAZR HD.

So while I am quite satisfied with the factory firmware on the XT925/926 as-is, the email client is rather clunky and I prefer the AOSP version. Good news guys, the factory firmware can use the AOSP Email.apk!
Credit goes to kabadisha for the original, easy to follow instructions.
Before You Start...
[MANDATORY] First and foremost, the phone needs to be rooted. If you haven't done so, check out this thread: http://forum.xda-developers.com/showthread.php?t=1943851
[MANDATORY] ADB on your computer or Terminal Emulator app on the phone. If you want ADB, the email-policy-patch in this thread has the file in the 'lib' folder: http://forum.xda-developers.com/showthread.php?t=1117452
[RECOMMENDED] Titanium Backup for backing up and removing the stock Motorola Email client. If you want to save these files, do this before proceeding to the instructions below. The APK files you need to backup/remove are MotoEmail.apk and MotoEmailConfig.apk.
Instruction for ADB Users
Connect the phone to the computer.
Download the corresponding Email.apk and Exchange.apk in the attachment section at the end of this post. Get the ones with the prefix 'ICS_' if you are on 4.04 Ice Cream Sandwich firmware, OR 'JB_' if you are on the 4.1.2 Jellybean firmware. DO NOT mix them or use the wrong ones, as they may not work correctly. Rename them to Email.apk and Exchange.apk respectively and place them in the root directory of your phone's internal SD card.
Go to the directory where you put your ADB executable. Hold SHIFT key, right-click anywhere in the window in this directory and select 'Open Command Prompt Here'.
Type the following in the command prompt and press Enter:
Code:
adb shell
If the Motorola driver is installed correctly and the phone is plugged to the PC, it should change the prompt to '[email protected]'. Type the following and press Enter, and the prompt should change to '[email protected]':
Code:
su
Now you're ready to actually do the work of getting the AOSP Email client on the phone. First, we need to set the /system partition to allow us to read/write to that directory, and remount it to make sure the permissions are updated. Type the following and press Enter:
Code:
mount -o rw,remount /system
...Let's change the current active directory to where all of the phone's installed apps are kept. Type the following in the command prompt and press Enter:
Code:
cd /system/app
Type the following in the command prompt and press Enter to copy the Email.apk that you downloaded earlier into this directory:
Code:
cp /sdcard/Email.apk /system/app/Email.apk
Type the following in the command prompt and press Enter to copy the Exchange.apk that you downloaded earlier into this directory:
Code:
cp /sdcard/Exchange.apk /system/app/Exchange.apk
Almost there! The last thing we need to do is change the permissions of these copied files so the OS can handle them properly. Type the following and press enter:
Code:
chmod 744 Email.apk
Code:
chmod 744 Exchange.apk
*Thanks to vrus1 for pointing this out*
Code:
Go to Settings > Manage App > Email and select 'Clear Data'.
Reboot the phone. Do this the ol' fashion way by directly interfacing with the device or enter the following in the prompt:
Code:
exit
Code:
exit
Code:
adb reboot
Click to expand...
Click to collapse
Instruction for Terminal Emulator Users
Connect the phone to the computer.
Download the corresponding Email.apk and Exchange.apk in the attachment section at the end of this post. Get the ones with the prefix 'ICS_' if you are on 4.04 Ice Cream Sandwich firmware, OR 'JB_' if you are on the 4.1.2 Jellybean firmware. DO NOT mix them or use the wrong ones, as they may not work correctly. Rename them to Email.apk and Exchange.apk respectively and place them in the root directory of your phone's internal SD card.
Open the Terminal Emulator app. Type the following in the command prompt and press Enter:
Code:
su
Now you're ready to actually do the work of getting the AOSP Email client on the phone. First, we need to set the /system partition to allow us to read/write to that directory, and remount it to make sure the permissions are updated. Type the following and press Enter:
Code:
mount -o rw,remount /system
...Let's change the current active directory to where all of the phone's installed apps are kept. Type the following in the command prompt and press Enter:
Code:
cd /system/app
Type the following in the command prompt and press Enter to copy the Email.apk that you downloaded earlier into this directory:
Code:
cp /sdcard/Email.apk /system/app/Email.apk
Type the following in the command prompt and press Enter to copy the Exchange.apk that you downloaded earlier into this directory:
Code:
cp /sdcard/Exchange.apk /system/app/Exchange.apk
Almost there! The last thing we need to do is change the permissions of these copied files so the OS can handle them properly. Type the following and press enter:
Code:
chmod 744 Email.apk
Code:
chmod 744 Exchange.apk
*Thanks to vrus1 for pointing this out*
Code:
Go to Settings > Manage App > Email and select 'Clear Data'.
Reboot the phone.
Click to expand...
Click to collapse
Once the phone has been rebooted, you should now have the AOSP Email Client in the application menu. Set it up as normal and you should be ready to roll. So far I have not run into any sync issues or anything out of the ordinary. If you are experiencing otherwise, please let us know!
Closing Notes
If you encounter any issues following these steps, please let me know so I can correct it.
Other Motorola ICS/JB device users: This should work for your devices as well as the firmwares between our devices are nearly identical.
Using the AOSP Email client will now allow you to use the Exchange Security Policy Bypass script that is not compatible with the Motorola client. Please be aware that by doing this, you may be violating your company's security policies which may place you under severe disciplinary actions or job termination at your company's discretion. Others that have provided the tools and instructions to perform this, including myself, cannot be held responsible if the worse case scenario occurs. You have been warned.
Sorry to bother.
Could these files be used for ICS 4.0.4 Samsung Galaxy SIII?
I've been trying like crazy to get the AOSP Email apk working.
Thanks for any feedback or recommendation.
Sent from my Nexus 7 using Tapatalk 2
Hobbes2099 said:
Sorry to bother.
Could these files be used for ICS 4.0.4 Samsung Galaxy SIII?
I've been trying like crazy to get the AOSP Email apk working.
Thanks for any feedback or recommendation.
Sent from my Nexus 7 using Tapatalk 2
Click to expand...
Click to collapse
No guarantees. While this method uses generic Unix commands that all Android devices will understand, it all depends on how the manufacturer has their firmware setup since some may have the Email client integrated into their launcher framework for notification counters, widgets, etc. You can attempt this and see if it works, and worst case scenario, simply delete the two files from \system\app to reverse the process.
For the Galaxy S III, I believe your Email client is SecEmail.apk and Exchange.apk. Backup and remove those before using the files in the attachment.
Worked great on my Droid Razr Maxx - thanks!
Thankss
Anybody try this on the RAZR Max HD with vrz
Sent from my DROID RAZR HD using Tapatalk 2
This is awesome. Thanks for posting this info. Works great on Bionic ICS.
Is this the black version?
Sent from my XT910 using xda app-developers app
Does this disable the exchange security?
mikeymax said:
Anybody try this on the RAZR Max HD with vrz
Sent from my DROID RAZR HD using Tapatalk 2
Click to expand...
Click to collapse
Yes, this procedure was done successfully on a RAZR MAXX HD.
zhzaen said:
Does this disable the exchange security?
Click to expand...
Click to collapse
No, it takes you halfway there -- getting the AOSP Email client on your phone, which is compatible with the email-policy-patch script that can modify these APKs. You cannot disable the exchange security on the stock Email that comes on your Motorola phones because it is custom.
anyone able to get these or actual AOSP JB Email apks to work with the JB leak?
Ive tried these ICS apk and some JB apks I found. No luck on either.
I assume we could just use root explorer to do this as well right?
Gave this a go to see if it can see folders within my inbox of my corporate exchange account.. nope. back to stock for now.
Apparently the 4.0.4 version doesnt work properly in this regard and the 4.1.x can do it..
Thank you anyway.
Doesn't work on mine.. FC as soon as you try to open Email app.
I am running stock 4.0.4 Razr HD LTE from Rogers. I followed instructions to a "T". Everything worked as expected but it just wont run.
Ok.. Got it working... Before removing/renaming old Email client, go into Manage Apps, Email, CLEAR DATA.
Then rename old files and push new ones.
Reboot.
Go back into Manage Apps, Email, CLEAR DATA.
Reboot.
Works great and thank you for sharing!!! I hate the stock app because it doesnt synchronize Email Reply/Forward status and drove me crazy.
Jelly Bean Official. Now Let's Do This.
OK. So now that JB is pushed out, I really need to get working on this. If anyone has any direction or ideas, please share. The blur email is awful, plus I really want to disable Exchange security policy.
Other than the email app, the HD Maxx is the best phone out there. I went back to it from a HTC DNA.
AOSP FTW.
vrus1 said:
Ok.. Got it working... Before removing/renaming old Email client, go into Manage Apps, Email, CLEAR DATA.
Then rename old files and push new ones.
Reboot.
Go back into Manage Apps, Email, CLEAR DATA.
Reboot.
Works great and thank you for sharing!!! I hate the stock app because it doesnt synchronize Email Reply/Forward status and drove me crazy.
Click to expand...
Click to collapse
Following this procedure got it working for me. Thanks for the Clear Data tip. I think users should note, you MUST reboot after clearing data. Simply clearing data and relaunching the app does not work.
My setup is rooted OTA JB. I used rootkeeper to retain root through the OTA update. After following the OP directions, I kept getting force closes and crashes. I simply thought it was because of JB and it may have been. However after reading through the rest of the post, user VRUS1's tip got it working. This step should be added to the OP.
Thanks to both of you. I couldn't stand the MotoEmail.apk...
Thanks for this!! This was a life saver for me!!
Thank you for the feedback guys. I disappeared for a bit and now have a XT925 RAZR HD and I'm running JB firmware with AOSP Email client right now. I will update the original post with the comments and Jellybean APKs tonight.
It's been updated with Jellybean APKs and revised instructions. As usual, please provide feedback if something is off in the instructions or you experience abnormal issues.

[Q] How do I send an email from the command line shell?

Hi all
I am looking for a way to send an email, preferably with an attachment, from a command line shell script (bourn/ash/whatever-it-is). No user interaction is a requirement.
It looks like an "am start" command might be able to do it via launching another app, and I've seen some examples out there, but nothing that I've had success with.
I have a big rsync backup script that I run to back up my device to my server, but I want to be able to email myself a notification if the backup fails, along with a copy of a log file. This script runs on a regular basis via a scheduler without any user interaction, but I have noticed that rsync has been failing recently and I've needed to re-run it manually later.
I am a pro Linux sysadmin but don't know jack about Java. I do bash, python, perl, and some C. My current script is just a sh shell script.
FYI my device is a Nexus One on Cyanogen 7.2. FYI I own the mail server here. I use k9mail as my primary mail app but the gmail app could be used as well.
If there was just a "mail" command, there would be no problem here...
jmomo said:
If there was just a "mail" command, there would be no problem here...
Click to expand...
Click to collapse
Not very reliable but you can use busybox telnet and SMTP commands.
http://motersho.com/blog/index.php/2009/10/12/smtp-commands-via-bash-script-and-devtcp-device-file/
psychart said:
Not very reliable but you can use busybox telnet and SMTP commands.
http://motersho.com/blog/index.php/2009/10/12/smtp-commands-via-bash-script-and-devtcp-device-file/
Click to expand...
Click to collapse
Yes, that's pretty horrible, but I will go there if I get desperate. I could also probably just port a lightweight mail command from somewhere else.
I know I can do something like this, but I can't quite get it to work...
am start -a android.intent.action.SEND -t "text/plain" --es android.intent.extra.EMAIL "[email protected]" --es android.intent.extra.TEXT "message here" --es android.intent.extra.SUBJECT "subject here" --activity-no-user-action
But I would also need to specify the exact app used (gmail or k9mail), and I am pretty sure that EMAIL data isn't going to work.
"sendmail" is a part of busybox, but for some reason it is not in CM 7.2.
It looks like it was added to the BusyBox installer on the market recently, but when I am looking at the installer, it's not there...
http://code.google.com/p/busybox-android/issues/detail?id=6
I'll see about compiling my own busybox and installing it that way. That would solve my problem.
It would still be really nice if anyone knew how to send an email using "am start" to send the intent to an existing android app. That would be really educational for me. I've seen examples for sending an SMS out there, but I am confused about sending an email... and I have no idea how I would do an attachment.

Categories

Resources