[Nexus 4 General] IndianKarmas:
We all have FB & ever since ICS days FB syncing was disabled. A lot of us want to be able to sync images for contacts from fb. I personally don't like adding more & more apps as they can have some impact on performance or battery. But most importantly I dont want to share my fb info with other apps.

**Just a update....Purity Rom has this enabled as of 01/29/2014 N4 build....so Purity users please skip this...its more useful for other Roms***

I had mentioned it in one of the forums, and few people had messaged me in private regarding it so I am just putting it out there in simple noob friendly manner. The steps do seem long, but once you get through it couple of times these are very very simple. For me this method has worked great over time, worth the effort for me atleast.

So I found a method back in the ICS days to be able to sync fb images with client profiles following Niranjan's method (I take no credit for it whatsoever and just providing information and can help someone if they need any guidance) but subsequently author stopped posting/responding the thread. So I will try to recompile a easy guide that can prove useful for anyone who wants to do it on their own. Please note Sense n other OEM roms already have this capability so u won't need this method.

Drawbacks

1. Slightly time consuming joining contacts.

2. Have to redo process everytime you update rom (dirty flash keeps older syncs but doesn't update)

Requirements

:

1. Root and su - since you will be modifying system file.

2. Download and install aShell and aSqlLiteManager from google store - both free by developer Andsen thanks for his contributions. Also once u are done...u can simply uninstall these two apps.

3. Be able to decompile & compile apk files or alternatively

I could do it for u but never try to rush or demand from me

....I am doing it as a courtesy so never try to push me for it. You could always quote me (so I get notified) or send me a message in case I don't respond in a day.

Steps

1. We need to retrieve your current contactsprovider.apk file. Depending on your version of Android it can be located in different folder within the root directory:

a. Kitkat: /system/priv-app

b. Jellybean/ICS: /system/app/

2. Make sure to do a backup of the apk file before proceeding. If you want me to modify your apk file then upload it for me to modify and skip step 3-5.

3. Save the copied apk as contactsprovider1.apk Decompile (I used this guide in starting...noob friendly) the contactsprovider.apk and call it contacts. Rename attached arrays.xml.txt file to arrays.xml and add to decompiled apk's res/values/ folder.

4. Once you have added the file you should a total of 4 files (including the one you added). Recompile the apk folder as contacts.apk. Using Winrar/7-zip copy resources.arsc from contacts.apk and replace the file in contactprovider1.apk.

5. Upload the new contactsprovider1.apk to its correct directory and since you have the original

backed up safetly

you can rename the file to contactsprovider.apk after setting the permissions. Set permissions to -rw-r--r--

6. Open aShell (installed earlier), grant it superuser permissions. You will come across few tip boxes, so just close through them. Tick Root checkbox. Click File Explorer. Navigate to Data/Data/com.android.providers.contacts/databases and click on contacts2.db. Allow aSQLd mime sqlite to open the db. Click Open database with aSQLiteManager. Click Query. Enter following query "alter table raw_contacts add column is_restricted VARCHAR;" (

don't include quotes

). Click Run & you are done.

7. Press back button until you get a popup message asking you to save the changes you committed and you say

YES

to it.

8. Now login into your FB app and go to app settings and you will have a option at the bottom for sync. Select Sync all and give it about 5 minutes to sync through. You can open your contacts/people app and see if the names/images start coming through from FB.

9. One last step (boon for some curse for others) is you have to open up your contacts/people app and go to the contact who you want to sync with fb. Go to Edit, go to join and your FB contact will show up there and you join them together.