yashsingh1/xdaforums huggingface dataset:
[Xposed Framework Modules] agentdr8:
I built this module at [MENTION=4757538]mew1033[/MENTION]'s request. Thanks to the guide by [MENTION=4414119]pogi1100[/MENTION], I was able to mimic the steps needed to get this working. This has been tested on CM11 4.4.4 Nightly from 06-19-14, but it should work on older CM/AOSP releases as well. Most OEM builds from HTC, Samsung, LG, Sony, etc don't require this, as they modify the ContactsProvider themselves to allow Facebook syncing.

This module made it to the XDA Portal! Thanks!

Install steps:

Make sure you have the latest Xposed Framework installed

Make sure you enable the app_process from within Xposed Installer and reboot

Install attached apk, just like you would any other apk

Enable module in Xposed Installer, but don't reboot/soft-reboot just yet

Open Settings->Accounts. If you have a Facebook account already added, remove it

Click on your Google account, and under its sync preferences, uncheck the Contacts item

Go back to Settings->Apps. Go to the All tab and find Contacts Storage. Clear the data

Now you can soft/hard reboot

When the phone is booted, go back into Settings->Accounts, select your Google account. Re-check your Contacts item

When the Contacts are finished syncing, open the Facebook app and enter your login info

Open Facebook->Settings and scroll all the way down to Sync Contacts

Check either to Sync All, or Sync with Existing Names

Go back to Settings->Accounts, pick your Facebook account

You should see Contacts as an item and it should show the syncing status

When the sync is done, open People and you should see all your FB contacts, with phone numbers and email addresses

Known Issues

If you have Privacy Guard, AppOps or any sort of privacy enhancer/app firewall, make sure you disable it for the Facebook app. This can prevent contact syncing from working.​

The module has been reported to work on the KK and older version of the FB app from v14 and older. Also reported to work on the most recent stable LP FB app (v34.0.0...) and for some, the most recent alpha version (v35.0.0...)​

Available via Xposed Repo as well (currently under Beta).

Source code can be found at my github

I've attached some screens showing the steps outlined above. It's pretty straight forward, but should be done in that order.

The latest version of the module now has a module icon (thanks to [MENTION=3336974]-DM-[/MENTION]) in Xposed Installer. If you don't like it or are offended by it, continue to use v1.2.5. The module icon is the only change.
[Xposed Framework Modules] Persechini:
Hmm, I followed al the steps, Facebook setting show the option to sync contacts, but if I chose all contacts it auto changes to existing contacts, and despite Facebook showing up on the contacts app correctly now, even after letting all contacts sync, when showing only Facebook contacts the list is empty.Maybe some Facebook configuration is causing this trouble? It has all signs that it's working, but friends list visibility could mess this up right? Or its something else?

Enviado de meu Nexus 4 usando Tapatalk
[Xposed Framework Modules] PeppeBove:
Could be useful (for others) to write instructions That appear when you click on module ;)

Inviato dal mio ST15i utilizzando Tapatalk
[Xposed Framework Modules] jembot:
Works great on XNote Touchwiz ROM! Finally a working facebook contact sync with phone numbers!..and no apk modification needed. Great work!

Btw, is there a way to backup the synced contact numbers to a file or merge it with your google account? I want to keep/archive the synced facebook info.
[Xposed Framework Modules] freedomtigers:
i did all things you described here

fb shows sync atlast

after it synced all contacts,

there is no fb contact.... (gmail contacts are there. no issue with them. and my phone contacts too)

the field is empty for fb contact

i did exactly as you described

and i selected contact display option for gmail and fb

still there is no fb contacts......

please help me......
[Xposed Framework Modules] MaKTaiL:
Does this work on stock/almost stock Android (Nexus, Moto X/G/E)?
[Xposed Framework Modules] Persechini:
Ok my nexus 4 and 7 it enables sync options, but sync zero contacts from Facebook

Enviado de meu Nexus 4 usando Tapatalk
[Xposed Framework Modules] agentdr8:
I can do some further testing tonight. I only added a single Google contact to my test account, so there weren't any contacts to match names with for the FB sync. I'm wondering if maybe that's throwing it off. I know that when I picked to display only FB contacts, the single Google contact disappeared and I only saw FB contacts.
[Xposed Framework Modules] agentdr8:
Not a bad idea. I can add a built-in howto.
[Xposed Framework Modules] agentdr8:
Contact merging is usually handled by the Contacts/People app itself I think. It doesn't merge the data together, but just combines multiple contacts with the same name under a single contact entry. If you want to extract data from one contact type and add to another, you'd probably want to export all contacts from say FB and then import them into your Google account via the web.

Try displaying only FB contacts and there might be an Import/Export option in the menu.
[Xposed Framework Modules] agentdr8:
That indicates that the database wasn't successfully modified with the new column. Is your contacts2.db located at /data/data/com.android.providers.contacts/databases?
[Xposed Framework Modules] agentdr8:
In theory it should work on any 4.1+ rom that has the contacts2.db file located at /data/data/com.android.providers.contacts/databases. If it's located somewhere else (maybe under /data/data/com.android.contacts/databases?) let me know and I can adjust the mod accordingly.
[Xposed Framework Modules] Persechini:
on aosp contacts2.db is indeed in the /data/data/com.android.providers.contacts/databases folder, so that doesn't looks like it's the issue

PS: it would be cool if you added this module in the xposed repository (setting this build as experimental to avoid overly heated complaints, of course), you might gather enough user/developer attention to help spread this feature that, in my opinion, is long overdue. Thanks for taking a shot to make it work
[Xposed Framework Modules] agentdr8:
I can post up a debug build if you're willing to send a logcat/error.log from Xposed

Done. Link on OP.
[Xposed Framework Modules] Persechini:
I'm game for that

Enviado de meu Nexus 4 usando Tapatalk
[Xposed Framework Modules] agentdr8:
There's a debug version in the xposed repo that's marked as Experimental. Give it shot and post up the error.log.
[Xposed Framework Modules] Wondersnite:
This has been long overdue in the Facebook app! Is there any way this could sync photos in higher quality though?
[Xposed Framework Modules] Persechini:
Here it the error.log

-----------------
24/06/2014 02:54:24 UTC
Loading Xposed v54 (for Zygote)...
Running ROM 'KTU84P' with fingerprint 'google/occam/mako:4.4.4/KTU84P/1227136:user/release-keys'
Loading modules from /data/app/com.dr8.xposed.XFBSync-1.apk
Loading class com.dr8.xposed.XFBSync.Mod
[2014-06-23 23:54:47] XFBS: init contacts providers package
[2014-06-23 23:54:47] XFBS: db has been modded, no need to check
[2014-06-23 23:55:06] XFBS: in facebook platformstorage class
[2014-06-23 23:55:08] XFBS: in facebook platformstorage class
[Xposed Framework Modules] freedomtigers:
yes

there are 4 files

contacts2.db[2.41mb], contacts.db-journal[8.52kb], profile.db[308kb], profile.db-journal[0.00kb]

i'm now using not a stock rom

it from mr. cmahendra called "SLD V3"

http://xdaforums.com/showthread.php?t=2525542
[Xposed Framework Modules] agentdr8:
When you installed this version, did you start over and reset your contacts/accounts?
[Xposed Framework Modules] agentdr8:
Yep. The module was designed to fulfill a very specific request, and at the time of release, it did just that. I'm glad it still seems to have some use left in it for some, but the chances of anything getting added to it at this point is pretty much nil. The module code is up on my github though, free for anyone to take and do what they please.

I'm not partial to FB and/or their apps either; I only use FB so that my contacts have pictures associated with them. Sync.Me works well for my use-case.
[Xposed Framework Modules] minibootsmann:
Keeping the old Facebook app is working, so there is still a way to use Your module. All other solutions like Haxsync/Ubersync/Sync.Me/etc. are dependant on your Facebook friends settings concerning third party apps. I have several contacts which deny this, so I won't see them in Android. That's why I will stay with the V14 version of the Facebook app as long as possible. :)
[Xposed Framework Modules] rahib172:
Hey can you please share the APK for old Facebook app which is working with this xposed module? I have tried facebook. 14.0.0.17.13, But it didnt showed the Sync contact option under settings.
[Xposed Framework Modules] minibootsmann:
Shure am I willing to share the APK, but I don't know whether it is against the forum rules to make it public. With a size of >20 MB it's difficult to send it by e-mail. Do you know how to achieve this?
[Xposed Framework Modules] agentdr8:
Post it up on dev-host or androidfilehost and link it here. I don't think it's against the forum rules if it's just a backup of a previously-available free app.
[Xposed Framework Modules] Ferhat78:
What is the facebook version plz ? Because i cant do this with the leasted version of facebook, any one can upload the apk plz ?
[Xposed Framework Modules] minibootsmann:
Here we go:

http: // d-h.st / Xgx

(As I do not have enough posts here, I am not allowed to post outside links. So please copy the url and remove the blanks)

Hope it helps! :)
[Xposed Framework Modules] rahib172:
Thanks for uploading this :)
[Xposed Framework Modules] Ferhat78:
I have installed facebook 14 and xposed module too but i can't sync my contacts ( i can't obtain phone numbers of my friends) so can someone creat an apps. Who show who i called with messanger app ? Plz
[Xposed Framework Modules] rahib172:
Same here, it just brings my fb friends names along with their profile pic into my contacts.. not sycing numbers :/
[Xposed Framework Modules] THEVAN3D:
guys, I've been using this module and then I had to reinstall Facebook app. after that sync is gone.

how do i bring it back? :(
[Xposed Framework Modules] agentdr8:
Are you using the newer or older Facebook apk?
[Xposed Framework Modules] THEVAN3D:
the latest one on the play store
[Xposed Framework Modules] sapplegater:
Using this with the most current Alpha 35.0.0.0.272 and sync is working flawlessly also the setting for activating hi-res photo download is located in the database file at /data/data/com.facebook.katana/databases/prefs_db you need to change the following strings' key values all to 1 using sqlite:

/config/gk/values/fb4a_contactsync_highres

/config/gk/values/contacts_sync_android

/config/gk/values/fb4a_contactsync_enabled

hopefully there is a way to add this to the module or make a module out of it.

Thanks to [MENTION=1547526]nonexiztense[/MENTION] for the steps in the following topic: Facebook Contact Sync for Lollipop AOSP/CM12/CM12.1 ROMs
[Xposed Framework Modules] agentdr8:
Thanks! I'll add those settings into the mod.
[Xposed Framework Modules] agentdr8:
New version on OP has the changes recommended above. Per the post here, the module will set the values to 1 if they are not 1 every time the FB package runs. This should prevent the app from resetting to the default value of 0 after a short while.
[Xposed Framework Modules] ts_mpls:
Is the new one the v1.0.1 version? I installed it and it didn't seem to change the setting. Here are the only messages in the log related to this:
[Xposed Framework Modules] sapplegater:
Reboot your device after activation it should be there:
[Xposed Framework Modules] scottjay:
Thanks OP. Are you going to be updating it in the xposed repo also?
[Xposed Framework Modules] agentdr8:
I took that section out of the latest version. Let me try reuploading it. Maybe I picked the wrong one.

EDIT: Try redownloading from the OP. It should be the right one now.
[Xposed Framework Modules] agentdr8:
Yep. Will be up there shortly.

EDIT: It's up now.
[Xposed Framework Modules] ts_mpls:
I see a couple of these:

And it didn't work at first. But I rebooted and now it seems to work. I still see some exceptions like that but I also see messages like "high-res pic setting already set".
[Xposed Framework Modules] agentdr8:
I uploaded a newer build that should resolve those spurious log messages.
[Xposed Framework Modules] Koboldchen:
Thanks! Works great even without unsyncing/clearing Facebook and Google contacts account on stock Nexus 4 5.1.1.
[Xposed Framework Modules] Koneesha:
Does this module write to the system? I have a droid turbo and the system is still write protected.
[Xposed Framework Modules] agentdr8:
No, only to /data/data/com.facebook.katana/databases/prefs_db and /data/data/com.android.providers.contacts/databases/contacts2.db
[Xposed Framework Modules] Koneesha:
Hmmm. I can't seem to get it to work. It kinda seems like these some system functions that it trys to access.
[Xposed Framework Modules] agentdr8:
That error means you're running a version of the Facebook app that doesn't have the contactsync method located where it is in other versions.
[Xposed Framework Modules] ggogolewski:
Me too :) Stock Nexus 5 5.1.1 :D
[Xposed Framework Modules] andrewk36:
I noticed that for me, the photos keep reverting back to none high resolution versions. This happens in tandem with the "use high resolution photos" vanishing from the Facebook. The option only seems to reappear after a reboot, which then requires a complete resync of photos. And even then, they will randomly revert. Any ideas for a fix? I'm on a nexus 6 with 5.1.1
[Xposed Framework Modules] agentdr8:
How odd. I'm sure it would require a deeper look into how the FB contact sync adapter works, and when it decides to use the settings found in the database vs. the ones it thinks it should be using. Maybe someone in the CM12 FB thread can shine some light on this.
[Xposed Framework Modules] THEVAN3D:
is it normal that i have sync option in FB app but nothing in accounts section? o.O

link 1: http://i.imgur.com/HVRuKcE.jpg

link 2: http://i.imgur.com/dg1LcJf.jpg
[Xposed Framework Modules] sapplegater:
You have to clear all data from the Facebook and sign in again for it to show up in accounts.
[Xposed Framework Modules] andrewk36:
I hope so. What's the thread? because I was so excited to see your Xposed module updated since Facebook's recent graph API change broke all old 3rd party sync methods. And it appears to work flawlessly except for the high resolution pictures. It's sooo close haha.
[Xposed Framework Modules] onesolo:
@agentdr8 With what version from Facebook app this should work?? Can u point that in the OP??

Responding to myself, just installed it on my N5 5.1.1 stock rom. It works with the latest alpha version of Facebook !!!

The only problem is the picture quality that is very very bad...
[Xposed Framework Modules] agentdr8:
This is the thread that was linked by [MENTION=4015855]sapplegater[/MENTION] where the high-res picture syncing info came from. I just adapted it to my module. You may need to resync all FB contacts after installing the mod, enabling it, and rebooting.

I tested the mod on v34.0.0.43.267 and it seems to be working. At least all my FB contact pictures seem to be higher quality than they usually are.
[Xposed Framework Modules] agentdr8:
That's odd that it can't find the PlatformStorage class on your device running the same version of the FB app that I'm using. Can you try a different version of the FB app? Some had posted success with the latest alpha version.

Also, I am trying to open the database only when it's readable and not locked by another process, but I'm guessing it's hitting a concurrency issue. Will see what can be done about this.
[Xposed Framework Modules] agentdr8:
The DexPathList should include all jars from the framework; it isn't something I specify in the module. I'll try and grab the latest alpha and see if our md5s match up. I know in the past, some FB versions/apks didn't have the contactsync package, and others did.
[Xposed Framework Modules] Vankog:
Just check my last post, I edited in my APK for you. ;)
[Xposed Framework Modules] agentdr8:
7zip doesn't recognize that apk as a valid zip file. Maybe GDrive munged it. I've downloaded it twice and it still comes up as invalid.

Can you try reuploading it?
[Xposed Framework Modules] Vankog:
Oh, it was an issue with ES File Explorer. Copying directly from data\app over SMB to a network folder always corrupts the file. Copying it to the SD card first did the trick:

https://drive.google.com/file/d/0B05zqyLPy4m1cmFrb1dMYzJ2ZDQ/view?usp=sharing
[Xposed Framework Modules] agentdr8:
Yep, tried the version you posted and it can't find the contactsync.PlatformStorage class. Try this version I pulled from my G2:

https://drive.google.com/file/d/0ByIdD6e4M1ywa2h0dkZvdkxhUlk/view?usp=sharing
[Xposed Framework Modules] Vankog:
Hm... and there seems to be the source of all this:

"Parse error: There was a problem parsing the package."

when I try to install it. On both of my devices. :-/

The archive itself is not corrupt, but just to be sure: I have those values for your file:

MD5: a1bede7b7278341b6258344b51983787

SHA1: bc87987fcf5d41564a386620bc3101b5263ec8d0

Damn, so it seems they have different variants of the app. I guess either for different Android versions or for different CPUs (I have Arm v7-Neon & KK 4.4.4 in/on both).

So either my variant has no contacts sync at all, or it might be hidden somewhere else. What do you think?
[Xposed Framework Modules] agentdr8:
Yep, the checksums match on my end as well. Can you try downloading the most recent stable release of the FB app on the Play Store and post that up? I'll compare it to the one I posted and see if I can find the differences.

EDIT: Nevermind, I figured it out already. The FB app I have is targeting API 21, which is LP. That definitely wouldn't work on your KK devices. You can still post up your stable version, and I'll try and locate the contactsync class.
[Xposed Framework Modules] Vankog:
Here we go

https://drive.google.com/file/d/0B05zqyLPy4m1NEliVFBwS3c5YXM/view?usp=sharing

com.facebook.katana_34.0.0.43.267_KitKat.apk
[Xposed Framework Modules] agentdr8:
Unfortunately it would seem you're out of luck on this version (and most likely any current version for KK), as FB removed the entire contactsync package from the apk. I recall that this change happened a while back version-wise, so it's possible if you go back far enough, you can get an older version (<14) that will still work with this mod. No idea if the high-res picture additions would apply to the older versions though.

I didn't realize until today that their "current" version for KK is actually their old codebase, and the current version for LP is their newer codebase, with the contactsync stuff re-added (which is almost like their really old codebase).
[Xposed Framework Modules] Vankog:
That's what I figured.

Well, I think in this case I will just leave it as it is. I will update my tablet to 5.1 in the next weeks or so, depending on the developments in the XPosed area. The only downside is that my Galaxy Nexus is too old for a stable lollipop ROM and will never receive FB sync again as it seems.

I'd suggest these information might be a good thing to put into your OP, don't you agree?

Thanks so far! :)
[Xposed Framework Modules] navdra:
What is the latest Facebook version that works with this mod fully, including high res pics?
[Xposed Framework Modules] agentdr8:
Yep. I'll update the OP with this info.

I guess it depends on if your device is on LP or KK (or older). I don't know if the high-res picture syncing works on the FB version for older devices. But if you're on LP, the latest stable (34.0.0...something) and the latest alpha (35.0.0...something) have been reported to work.
[Xposed Framework Modules] navdra:
35.0.0.22.273 not working here.

CM12.1 with latest xposed.

It did work with version before this one, but without high resolution pictures.
[Xposed Framework Modules] agentdr8:
Try the stable version from the Play Store. Clear FB data and re-setup/re-sync FB contacts. See if the high res pictures show up.
[Xposed Framework Modules] navdra:
Removed FB account, uninstalled FB beta, opted out from beta, reinstalled latest stable (34.0.0.43.267).

I didn't get the option to sync contacts at all. :(
[Xposed Framework Modules] agentdr8:
Can you post the Xposed Installer log?
[Xposed Framework Modules] fcastillousfq:
I tried the latest facebook version with latest Xposed on Android 5.1.1. Facebook sync works but no high res pictures at all. I've clear the app and resync but nothing.... Is there any workaround for this?
[Xposed Framework Modules] agentdr8:
Try the latest version on the OP. I moved some stuff around to try and address the FB app changing the high res setting back to 0.

If it still doesn't work, enable debug by creating the files directory in /data/data/com.dr8.xposed.XFBSync/ and place an empty file named debug in it. Then reboot and provide me the xposed installer error.log
[Xposed Framework Modules] fcastillousfq:
I just tried the the new 1.2.2 version (I downloaded it from the Xposed repository). High resolution pictures are working correctly now. I see the option under Facebook settings to download them Always, Wi-Fi only, or Never.

Thanks for the update!!
[Xposed Framework Modules] navdra:
New version solves everything for me!
[Xposed Framework Modules] agentdr8:
Awesome. Glad it's working :)
[Xposed Framework Modules] estapagu:
Thanks a lot for the update!

I'm wondering... Would it be possible to add a feature to overwrite contact pictures on Google account? I mean, just like haxsync option.
[Xposed Framework Modules] st40611:
First of, thanks for doing this - after Facebook killed off API v1 it's pretty much impossible to get any Facebook contact sync done on AOSP builds. This module is pretty much the only hope we have left as Stock/GPE/etc users. :/

Anyways, after a lot of trial error, I have v34 FB running on my 5.1.1 GPE m8, with both Sync & High Quality Pictures on (had to kill all FB-related services for the second one to show up). Works great now!
[Xposed Framework Modules] navdra:
I posted it to soon. High res option suddenly disappeared. [emoji20]
[Xposed Framework Modules] agentdr8:
Possible yes, but something that I'll likely add, probably not. I think it's a bit out of scope for what I had envisioned for this module. The good thing is this module is open source, so anyone can grab a copy from my github and add whatever features they may want.

The option in settings disappeared, or the high res pictures disappeared? If it's the latter, then it's something else within the FB app that I would need to find and block to prevent it from reverting to low res pics during sync. Probably not something I'll investigate due to time constraints, but if someone finds a solution, I can definitely look at adding it to the module.
[Xposed Framework Modules] 0.0:
With v1.2.2, it caused the option to sync pics to disappear. It would appear for a short while though, after boot. With v1.2, it was working
[Xposed Framework Modules] agentdr8:
Ok I'll revert the change and put the db checking in multiple places.
[Xposed Framework Modules] voetbalremco:
Oh well..

The syncing worked, but the "sync only with existing contacts" did not.

Now I have all my Facebook contacts in my contacts app, even without number.
[Xposed Framework Modules] mangordi89:
Anyone got this to work on the Moto X with 4.4.4? I followed all the steps but the sync contacts option doesn't come up under app settings. I'm on the newest Facebook update. Thanks!