• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[APP][4.4+][ROOT] Contacts Sync - sync your address book contacts

Search This thread

AndroidDeveloperLB

Senior Member
Mar 30, 2014
1,910
451
WARNING: This app requires a rooted device. It's recommended to backup your contacts before using it.

Background
Seeing that the only app that allows to sync your contacts photos is SyncMe, yet it can't sync with WhatsApp (and there is a good reason for this), I've decided to create this app.

What this app does
Its purpose is to sync your contacts photos on the address book with those on WhatsApp.

Download


APK mirror:
https://www.apkmirror.com/apk/androiddeveloperlb/contacts-sync-requires-root/
ApkPure:
https://apkpure.com/contacts-sync-requires-root/com.lb.contacts_sync

Requirements and permissions explanation
  1. WhatsApp app being installed and working well. Tested on version 2.16.306 (build 451445).
  2. A rooted device. It is needed for getting the HQ contacts images, for auto-granting the other permissions, and for the automation of the entire process.
  3. Internet connection - allows WhatsApp to download the photos. Don't have any app to download stuff in the background. Otherwise it might fail to get the images in one way or another.
  4. Contacts permissions - the app needs to modify your contacts...
  5. Phone and usage-access permissions, so that the app could monitor WhatsApp Internet activity.
  6. Draw on top permission- for allowing to halt the process, and for staying on portrait mode during the process.

Isn't there a non-rooted version?
It is highly possible that I can make one. I started by using accessibility service to handle the automation, and I made it work for a single contact that has a photo.
It will take a long time till I can finish it, but it was a step in the right direction.
However, sadly, Google has recently warned all apps that use accessibility service for purposes that are not for disabled users (many articles about it, including here, here and here) , so for now this work is on hold, till I find out what is really going on.
They might remove the app or even my own Google account, according to these articles. I do not want to take this risk, after so much time working on it.
That being said, I might put here on XDA the app some day. Will take some time though. I may have made progress, but I didn't handle everything that needs to be handled.
In any case, this app is only for rooted devices. If I have non-rooted solution, I'm might need to make a new app for it.

Recommended
  1. A good Internet connection
  2. Android 5.0 and above
  3. Have all contacts saved into Google.

How it works
It currently only has 3 simple steps:
- grant permissions (needed only once).
- fetch photos by first checking which are new and then go over each of them.
- sync the photos.

All phases are easy to go by (just press a single button) , and are all automatic and based on things any power user can do anyway, given enough time and patience.
The last step can even be done in the background if you wish.

Do note that as it highly depends on how WhatsApp works, it is possible that one day a new version of WhatsApp will change too much, that it won't work.

If you've found any bug, please let me know.

Why no fully automatic background sync?
This is a bit problematic because :
  • it works in the foreground, and not the background
  • if you have a lock screen, the app will need to bypass it, which might be an issue.
  • it emulates touch operations, so if you are not aware of what's going on, it might have some risks in using it in the background
.

That being said, you can enable the scheduler feature that will schedule a check if it seems there are new updates that you can sync.
This operation is so efficient that it doesn't require Internet connection and you can safely set it to run every day without worrying about the battery. Just remember to let the app have root access and contacts permission.

Would it work with modded WhatsApp ?
Maybe, as long as the package name of it is the same as the official one (meaning "com.whatsapp"). Last time I checked the GBWhatsapp app (available here, called "GBWAPlus"), it worked fine with it.
Might not work in the future or on other mods.

Why not support more chatting apps? Telegram? Messenger? Viber? Skype? ...
I've spent an entire week finding what can be done with each of the top chatting apps, and failed to find a way to work with them.
Even Telegram, which is supposed to be open sourced, was found too complex to work with, and even if I did manage to work with it, its terms are that my app should be a chatting app too, with all of the basic features of a chatting app.
This will all take so much more time that I can afford for a spare time app, and it's out of the scope for the app to be a chatting app, just to sync photos.

The app says I don't have contacts. How come?
You probably didn't let it to sync with your address book yet. Let it have the permission it needs (mainly Contacts permission), and then run it, then run my app.
If all fail, uninstall and re-install both apps, and grant the needed permission to both, and then run my app.

The app used to work before I've switched to a new ROM, and now it doesn't. How come?
Some ROMs mess with how Android handles contacts on the address book. I have no idea why and I have no idea in which way, so sadly I have nothing to do about it other than recommend using better ROMs... :)

The app fails to sync contacts or crashes even before. How come?
There are some issues related to address book that are out of this app's scope and responsibility.

Here are some possible workarounds:
1. Try to clear data of WhatsApp, of Contacts Storage , of Contacts, restart device, open your Contacts app, let it sync with the address book for some time. Then Try my app again.

2. One user wrote this:
may be suggest him the way it works for me,export contacts from phone to vcf file,delete contacts from hone,through web, import vcf file to google,through phone sync contacts to google,through phone sync contacts to whatsapp, sync photos with your app

3. Another solution someone wrote is that clearing the data of "com.android.providers.contacts" package name and restart of the OS fixed it.

4. Some users say the app doesn't sync their contacts. I'm still investigating this issue, but for now, you can try to convert all your contacts to be on Google account. Some users said it helped, and some said that moving to another rom helped. Sorry if the app doesn't work for you even after those actions. Hope to find the reason for this.
One user said this helped: backup contacts to vcf file. delete all contacts. Import vcf file in web browser into Google account. Let it sync on device. Use the app.

I have "parallel apps" feature (AKA "cloning" of apps) on my phone , allowing multiple instances of apps. Why can't this app work well when it's turned on?
This feature that some devices have is not native Android feature and can cause real issues and break things. Sadly I couldn't find a way to overcome it (wrote about this here)https://stackoverflow.com/q/49930676/878126. It even doesn't work well in general, not allowing you to put widgets of the second one. Same goes for sharing. Please disable it before syncing using my app.

Tested devices and Android versions
Nexus 5X with Android 6.0.1 , Android 7.0 and Android 7.1.1.
HTC One M8 with stock Android 5.0.2
Nexus 6P Android 7.1.1 DP1
asus zenfone 2 lazer (ze550kl) 6.0.1 stock
Moto G3 with 7.0
Nexus 5 with CM13 (Android 6.0.1).
and more...

App translation
https://crowdin.com/project/com-lb-app_manager

Beta testing
Links for the beta testing group:
- https://play.google.com/apps/testing/com.lb.contacts_sync

Articles

Privacy policy ?
Written on this post.

XDA:DevDB Information
Contacts Sync, App for the Apps & Games

Contributors
AndroidDeveloperLB

Version Information
Status: Testing

Created 2016-11-27
Last Updated 2017-01-04
 
Last edited:

AndroidDeveloperLB

Senior Member
Mar 30, 2014
1,910
451
Updated version. What's new:
1. Fixed super user permissions granting issues.
2. Tweaked fetch images phase by using a safer (yet sadly slower) method. Hopefully will not miss any image now.
3. While fetching images, prevents screen from being automatically turned off, so that it won't fail later.

EDIT: I think I know why the app won't sync with some contacts. This happens in the case of a lot of contacts. I will have to fix this.
 
Last edited:
  • Like
Reactions: ojessie

AndroidDeveloperLB

Senior Member
Mar 30, 2014
1,910
451
Updated version.
What's new:

1. Fixed issue of missing images.
2. Massive speed improvement of syncing phase. On some devices you won't even believe it did anything.
3. From now on, only new images will sync. This is another improvement in terms of efficiency.
 

AndroidDeveloperLB

Senior Member
Mar 30, 2014
1,910
451
Does this sync pictures to google account, so I only have to do the sync once and then the pictures are stored to Google contacts in web?

Short answer is yes, but ...

It syncs with all your contacts, whether they are in Google or on the device.
If they are Google contacts, the photos will also be saved on Google's servers.

However, Google tends to save only low quality images, so I think that if, for example, you do a factory reset and get the contacts back, the photos you will have from Google will have low quality.

This is what I saw last time I checked it, using SyncMe app (which I also still use to sync my contacts) , but maybe it changed, because it was a long time ago.
 

biglo

Senior Member
Jul 18, 2009
1,027
170
OnePlus 7 Pro
Worked great for me, finally nice work. Any donate button around here? Can't wait to see future improvement for maybe updating just one contact.
 

AndroidDeveloperLB

Senior Member
Mar 30, 2014
1,910
451
Worked great for me, finally nice work. Any donate button around here? Can't wait to see future improvement for maybe updating just one contact.

I'm not sure if I should publish this app on the Play store, so donating is not possible at the moment.

Share the app instead. :)
Or, try my other app, here.

BTW, there is no update mechanism, so I'd like to know how to add "follow project" for users here, so that they will get a notification on the forum whenever there is a new update.

Anyone knows how to do it?
 
  • Like
Reactions: GerManiac

biglo

Senior Member
Jul 18, 2009
1,027
170
OnePlus 7 Pro
I'm not sure if I should publish this app on the Play store, so donating is not possible at the moment.

Share the app instead. :)
Or, try my other app, here.

BTW, there is no update mechanism, so I'd like to know how to add "follow project" for users here, so that they will get a notification on the forum whenever there is a new update.

Anyone knows how to do it?
Ok I don't have any knowledge on that updating feature, i thought you would have setup a PayPal account for donations.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 35
    WARNING: This app requires a rooted device. It's recommended to backup your contacts before using it.

    Background
    Seeing that the only app that allows to sync your contacts photos is SyncMe, yet it can't sync with WhatsApp (and there is a good reason for this), I've decided to create this app.

    What this app does
    Its purpose is to sync your contacts photos on the address book with those on WhatsApp.

    Download


    APK mirror:
    https://www.apkmirror.com/apk/androiddeveloperlb/contacts-sync-requires-root/
    ApkPure:
    https://apkpure.com/contacts-sync-requires-root/com.lb.contacts_sync

    Requirements and permissions explanation
    1. WhatsApp app being installed and working well. Tested on version 2.16.306 (build 451445).
    2. A rooted device. It is needed for getting the HQ contacts images, for auto-granting the other permissions, and for the automation of the entire process.
    3. Internet connection - allows WhatsApp to download the photos. Don't have any app to download stuff in the background. Otherwise it might fail to get the images in one way or another.
    4. Contacts permissions - the app needs to modify your contacts...
    5. Phone and usage-access permissions, so that the app could monitor WhatsApp Internet activity.
    6. Draw on top permission- for allowing to halt the process, and for staying on portrait mode during the process.

    Isn't there a non-rooted version?
    It is highly possible that I can make one. I started by using accessibility service to handle the automation, and I made it work for a single contact that has a photo.
    It will take a long time till I can finish it, but it was a step in the right direction.
    However, sadly, Google has recently warned all apps that use accessibility service for purposes that are not for disabled users (many articles about it, including here, here and here) , so for now this work is on hold, till I find out what is really going on.
    They might remove the app or even my own Google account, according to these articles. I do not want to take this risk, after so much time working on it.
    That being said, I might put here on XDA the app some day. Will take some time though. I may have made progress, but I didn't handle everything that needs to be handled.
    In any case, this app is only for rooted devices. If I have non-rooted solution, I'm might need to make a new app for it.

    Recommended
    1. A good Internet connection
    2. Android 5.0 and above
    3. Have all contacts saved into Google.

    How it works
    It currently only has 3 simple steps:
    - grant permissions (needed only once).
    - fetch photos by first checking which are new and then go over each of them.
    - sync the photos.

    All phases are easy to go by (just press a single button) , and are all automatic and based on things any power user can do anyway, given enough time and patience.
    The last step can even be done in the background if you wish.

    Do note that as it highly depends on how WhatsApp works, it is possible that one day a new version of WhatsApp will change too much, that it won't work.

    If you've found any bug, please let me know.

    Why no fully automatic background sync?
    This is a bit problematic because :
    • it works in the foreground, and not the background
    • if you have a lock screen, the app will need to bypass it, which might be an issue.
    • it emulates touch operations, so if you are not aware of what's going on, it might have some risks in using it in the background
    .

    That being said, you can enable the scheduler feature that will schedule a check if it seems there are new updates that you can sync.
    This operation is so efficient that it doesn't require Internet connection and you can safely set it to run every day without worrying about the battery. Just remember to let the app have root access and contacts permission.

    Would it work with modded WhatsApp ?
    Maybe, as long as the package name of it is the same as the official one (meaning "com.whatsapp"). Last time I checked the GBWhatsapp app (available here, called "GBWAPlus"), it worked fine with it.
    Might not work in the future or on other mods.

    Why not support more chatting apps? Telegram? Messenger? Viber? Skype? ...
    I've spent an entire week finding what can be done with each of the top chatting apps, and failed to find a way to work with them.
    Even Telegram, which is supposed to be open sourced, was found too complex to work with, and even if I did manage to work with it, its terms are that my app should be a chatting app too, with all of the basic features of a chatting app.
    This will all take so much more time that I can afford for a spare time app, and it's out of the scope for the app to be a chatting app, just to sync photos.

    The app says I don't have contacts. How come?
    You probably didn't let it to sync with your address book yet. Let it have the permission it needs (mainly Contacts permission), and then run it, then run my app.
    If all fail, uninstall and re-install both apps, and grant the needed permission to both, and then run my app.

    The app used to work before I've switched to a new ROM, and now it doesn't. How come?
    Some ROMs mess with how Android handles contacts on the address book. I have no idea why and I have no idea in which way, so sadly I have nothing to do about it other than recommend using better ROMs... :)

    The app fails to sync contacts or crashes even before. How come?
    There are some issues related to address book that are out of this app's scope and responsibility.

    Here are some possible workarounds:
    1. Try to clear data of WhatsApp, of Contacts Storage , of Contacts, restart device, open your Contacts app, let it sync with the address book for some time. Then Try my app again.

    2. One user wrote this:
    may be suggest him the way it works for me,export contacts from phone to vcf file,delete contacts from hone,through web, import vcf file to google,through phone sync contacts to google,through phone sync contacts to whatsapp, sync photos with your app

    3. Another solution someone wrote is that clearing the data of "com.android.providers.contacts" package name and restart of the OS fixed it.

    4. Some users say the app doesn't sync their contacts. I'm still investigating this issue, but for now, you can try to convert all your contacts to be on Google account. Some users said it helped, and some said that moving to another rom helped. Sorry if the app doesn't work for you even after those actions. Hope to find the reason for this.
    One user said this helped: backup contacts to vcf file. delete all contacts. Import vcf file in web browser into Google account. Let it sync on device. Use the app.

    I have "parallel apps" feature (AKA "cloning" of apps) on my phone , allowing multiple instances of apps. Why can't this app work well when it's turned on?
    This feature that some devices have is not native Android feature and can cause real issues and break things. Sadly I couldn't find a way to overcome it (wrote about this here)https://stackoverflow.com/q/49930676/878126. It even doesn't work well in general, not allowing you to put widgets of the second one. Same goes for sharing. Please disable it before syncing using my app.

    Tested devices and Android versions
    Nexus 5X with Android 6.0.1 , Android 7.0 and Android 7.1.1.
    HTC One M8 with stock Android 5.0.2
    Nexus 6P Android 7.1.1 DP1
    asus zenfone 2 lazer (ze550kl) 6.0.1 stock
    Moto G3 with 7.0
    Nexus 5 with CM13 (Android 6.0.1).
    and more...

    App translation
    https://crowdin.com/project/com-lb-app_manager

    Beta testing
    Links for the beta testing group:
    - https://play.google.com/apps/testing/com.lb.contacts_sync

    Articles

    Privacy policy ?
    Written on this post.

    XDA:DevDB Information
    Contacts Sync, App for the Apps & Games

    Contributors
    AndroidDeveloperLB

    Version Information
    Status: Testing

    Created 2016-11-27
    Last Updated 2017-01-04
    4
    New version. What's new:

    - Hopefully fixed the issues that for some people, the sync didn't sync anything, or even created duplicates contacts.
    - improved fetching phase a bit.

    Now the downloads are here:
    http://forum.xda-developers.com/devdb/project/?id=18089#downloads
    4
    Updated version.
    This time, I've fixed an issue that has probably affected all Android 4.4 (and maybe below) devices, which would make it unable to sync the contacts.

    If you have an old version of Android on one of your devices, please try this app and tell me if it works fine. Older than 4.4 will also be great.

    I hope that in the near future, I will add the feature people have asked for: to show and customize which contacts should be synced.

    I plan to show a list/grid of them, and there should be a few states for each:

    1. always sync
    2. never sync
    3. sync only from next time

    For each contact in the list, I should write :

    1. display name
    2. formatted phone number
    3. current image vs available new image

    Later, I want to allow to show the images in full screen, to compare them, but that's not basic enough for now...

    What do you guys think? Have I forgot about an important/basic feature for this ?
    I want to plan it well before I make it work.
    3
    Today I've made a new feature of auto-check for contacts-updates.
    It's not actively checking them though. Only if there is a reason to see that they exist.
    This is why it's very efficient and quick, but also might miss some cases.
    If you see a notification from it, it will show you the minimal number of potential contacts updates.

    If anyone wishes to try it out, please let me know.
    3
    I received an XDA notification of an update, but after checking the thread, the latest release is still of 23-Dec.

    False alarm?

    Yes, false alarm. I'm about to publish the app on the Play Store though, with the option to customize which contacts to sync, and a few minor bugs fixes
    :)