Clarity - Contact thumbnails you don't mind looking at.

Search This thread

Kevin M

Inactive Recognized Developer
Jul 31, 2011
457
775
kmark.io
Code:
Clarity is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

Introduction
Clarity is an Xposed module and root Android application for increasing the size and quality of contact thumbnails in the Android contacts database. It's comprised of two components. An Xposed modification and a root-required Database Processor.

Clarity also increases the quality and size of locally stored album art.

Xposed Mod
Android stores two versions of contact images. The contact photo and the contact thumbnail. While both are downscaled appropriately from the original image, the two are very different in size. Contact photos clock in at around 720×720 pixels or so depending on the original image. Contact thumbnails are a measly 96×96 pixels. Contact photos are used in places where contact imagery is going to be distinctively large like the KitKat/Lollipop Phone app. Or when you receive an incoming call. Thumbnails are used for notifications, messaging applications, and other roles which the full contact photo is unnecessarily big. Unfortunately, as screen PPIs have skyrocketed since the 96×96 limit was put in place, contact thumbnails are now too small for their original purpose. Regardless, most applications continue to use contact thumbnails.

Clarity forces Android to use a user-defined size (defaulting to 256×256) when adding contact thumbnails to the database. While these new images are larger and look much better they will load slightly slower and increase memory requirements. For newer devices this should not be a problem. For reference, I have not witnessed any side effects on my Galaxy S4 using the default 256×256 setting. Since the size can be adjusted you can optimize it for your device.

In the name of simplicity, Clarity does not change the method Android uses to downscale contact thumbnails, just the final dimensions. However since Clarity allows you to increase the size of the thumbnail and consequently decrease the magnitude of the downscale, there will be noticeably fewer artifacts in your new thumbnails.

The Xposed module does not magically increase the quality of thumbnails already added in the database. It only affects newly added/updated contacts and images. To upgrade your entire contacts database either use the Database Processor detailed below or re-import the contacts. Re-importing may require you to deconnect/desync the account the contacts are associated with and then reconnect/resync the account. Some sync applications may have a force refresh option and that should work nicely. For instance, HaxSync has a Force redownload option under its contact settings.

When the Xposed module is activated, Clarity will also up the size of locally stored album art (for instance, MP3s on the external storage). Just like the contact thumbnail part of the module, existing album art is unaffected. To get Android to reprocess all the album art on your device you must delete all the files found in the albumthumbs directory. This is usually found somewhere on your external storage. Popular paths are /storage/emulated/legacy/Android/data/com.android.providers.media/albumthumbs and /storage/sdcard0/Android/data/com.android.providers.media/albumthumbs. Different devices and ROMs can have different paths but the last /Android/data/com.android.providers.media/albumthumbs bit should stay the same. Once that directory has been cleared out, higher quality album art will be regenerated by Android on demand (as they are needed). See Android issue 73635 for more information about the album art problem.

Database Processor
In addition to the Xposed-based modification described above, Clarity includes a Database Processor. This powerful feature forcibly updates every contact thumbnail in your database. It rips out the internal contacts database file, finds all your contacts with photos and puts in new thumbnails. It'll then replace the old database with the new one. It is highly recommended to immediately reboot after processing to avoid Android going berserk. It will if you don't. :)

While powerful, the Database Processor is also extremely dangerous. I am not responsible for any damage to your device as a result of using Clarity. It performs several operations as root and modifies core Android files that were never meant to be touched by anything other than Android itself. I highly recommend a full recovery-based backup of your device alongside the built-in backup feature. Please use the dry-run feature first (hell, multiple times even) to ensure the operation will succeed for your ROM. It is possible a successful dry-run could still fail when doing the real-deal so, as I mentioned before, backup your stuff. The built-in contact backups will be saved to a Clarity folder on your "primary" external storage. What primary means depends on your ROM and device. It could be your actual external SD card or it could be an internal storage location. Regardless, the current backup location will be noted, assuming backups are enabled, in the processor's log. As an added bonus, if the backup feature is on it will also save the log file alongside your backups!

The Database Processor has been tested on CM (CyanogenMod) 10 (based on Android 4.1.2), CM 11 (based on Android 4.4.4), CM 12 (based on Android 5.0.2), and CM 13 (based on Android 6.0.1). It should work on any AOSP-based ROM from Ice Cream Sandwich (4.0) to Marshmallow (6.0). For stock ROMs and anything created by carriers I have no idea. If it works for you please report back! If it doesn't, well, report that too.

Images
  • Settings
  • Database Processor
  • Raw Comparison
    RawComparison.gif
  • Google Messages Comparison
    MessagesComparison.gif
  • Google Hangouts Comparison
    HangoutsComparison.gif
  • Android Wear Comparison
    WearComparison.gif
  • More!

Features
  • Simple lightweight Xposed modification
  • Powerful database processor for forcibly updating contact thumbnails
  • Also clarifies locally stored album art
  • Should work on nearly any AOSP-based ROM like CyanogenMod
  • Free and open-source software. No nags. No data collection. No secrets.

Known Issues
  • Does not appear to work with Google-synced contact photos.
  • May not work with all devices and ROMs. See the following post.

Installation
  1. Make certain you have Xposed installed before continuing.
  2. Install the app by a) searching for it in the Xposed Installer or b) manually through the APK provided on GitHub or the Xposed website.
  3. Configure the app in its settings panel. It can be accessed through the module section of the Xposed Installer or by the launcher shortcut.
  4. Enable the module in the Xposed Installer.
  5. Reboot.
  6. Done!
  7. The Xposed module will only update contact photos that are modified or added to the database after it is turned on. The database processor will attempt to update the contact photos in place and right away. To avoid using the database processor your contact photos must be manually refreshed. How/if this can be done and how easily is dependent on how you sync your contacts. For instance, if you use HaxSync you can update all your photos by going to Settings app -> Accounts -> HaxSync -> Advanced Settings -> Contact Settings -> Check Force redownload. Hit back twice. Select your account name at the top. Click Contacts to uncheck it. Recheck it and wait for sync to finish.

Changelog
See the GitHub repository for the definitive changelog.
Code:
v1.2-cfad189 - 03 Jul 2016 - Stable
------------
This release introduces the following improvements:
* Added a Spanish translation
  (thanks to Jose Artuñedo @ XDA)
* Fix a SELinux-related issue with the Database Processor
  on Marshmallow
* Support Marshmallow's new permission system
* Added some additional debugging info to the processor log
* Tested on CyanogenMod 13 (Android 6.0.1)

Code:
v1.1-93b7945 - 03 May 2015 - Stable
------------
This release introduces the following improvements:
* The database processor will no longer fail if contacts2.db-journal
  cannot be found. It will note the absence of the journaling file
  in the log and proceed as normal
* Will now increase the size and quality of locally stored album art.
  Suggested by @Karamvir Singh. See [url=http://xdaforums.com/showpost.php?p=60499753&postcount=55]this post[/url] for more
  information.
* An XXXHDPI icon
* Updated donation links
* Minor log bug fix
* Better shell usage
* Less condescending toast notifications
Code:
v1.0-917d899 - 25 Mar 2015 - Stable
------------
Initial release. Make sure to see the README or XDA thread!

Downloads

FAQ
Q: Something went horribly wrong! How do I restore from one of the backups?
A: Ouch! Clarity stores backups on your "external storage." Depending on your device and ROM this could be an actual SD card or internal. If your device has two check both. It will be in a directory named Clarity. In the Clarity backup directory there will be sub-directories with dates. Select the one before everything went to hell. You'll find up to three files: contacts2.db contacts2.db-journal, and dbprocessor.log The .db file(s) are the actual contacts databases. The dbprocessor.log is your log file and has lots of great information for us to use. Now that we have located everything we need let's get restoring.

Method #1 - By hand
If your device still boots and you can navigate around (even if things are crashing every few seconds) try this. If you have a custom recovery that supports adb then this will work as well if you boot into it.
  1. Grab the adb command line tool. For Windows check here. For Linux and Mac see here.
  2. Now put your device in debug mode. Go to the settings app. Tap About phone. Keep tapping Build number until it says you are a developer. Go back and select Developer options. Turn the development options "on" if needed. Under Debugging turn on Android debugging.
  3. Now connect your device to your computer. It should say something about debugging being enabled in the status bar. Make certain your phone is unlocked. If it says something about allowing the computer debug access to your phone please accept it.
  4. Open up a command line or terminal. On Linux I'm going to assume you know what to do. On Mac it's the Terminal app. On Windows it's C:Windowssystem32cmd.exe
  5. Type adb version and hit enter. If your get something about it being not found then adb isn't installed in your PATH or you're not in the directory in which adb was extracted. You can navigate to that directory with the cd command. So to navigate to the system32 folder on Windows, for instance, I'd type cd C:Windowssystem32 and hit enter.
  6. Type adb shell and hit enter. This will dump us into a shell instance directly on your device.
  7. Type id and hit enter. If the first bit is not uid=0 then unlock your device and type su and hit enter. If your device prompts for superuser access please grant it.
  8. Navigate to the directory in which your backups are stored on your device. For me this would be something like cd /storage/emulated/legacy/Clarity/2015-Something
  9. You should now see the backup files if you type ls and hit enter. Great. Now to move these into place.
  10. Open your dbprocessor.log file on your device through a file manager or move it onto your computer to read its contents. You can read it through the command line if you wish but it's much more convenient to be able to copy and paste if needed.
  11. Note the Contacts UID and Contacts directory. Mine is 10006 and /data/data/com.android.providers.contacts respectively.
  12. Execute cp contacts2.db /your/contacts/directory/databases/contacts2.db and hit enter. For me this full command is cp contacts2.db /data/data/com.android.providers.contacts/databases/contacts2.db
  13. If you have a contacts2.db-journal file do the same except with that file. For me this is: cp contacts2.db-journal /data/data/com.android.providers.contacts/databases/contacts2.db-journal
  14. Now to correct the permissions. Type chown +UID:+UID /your/contacts/directory/databases/contacts2.db* and hit enter. For me this is chown +10006:+10006 /data/data/com.android.providers.contacts/databases/contacts2.db*
  15. Reboot immediately by typing reboot and hitting enter.
  16. All done. Your contacts database has been restored.

Method #2 - Recovery
Took a backup with your custom recovery before processing? Just restore from the backup to get your device back to normal.

Credits

Licensing
Copyright © 2015-2016 Kevin Mark. Clarity is licensed under the GNU General Public License, Version 3, which can be found in LICENSE.md

Clarity is developed in my spare time and will always remain free and open-source software. If you find this application useful please feel free to donate.

XDA:DevDB Information
Clarity, Xposed for all devices (see above for details)

Contributors
Kevin M
Source Code: https://github.com/kmark/Clarity

Xposed Package Name: com.versobit.kmark.clarity

Version Information
Status: Stable
Current Stable Version: v1.2-cfad189
Stable Release Date: 2016-07-03

Created 2015-03-25
Last Updated 2016-07-23
 

Attachments

  • SettingsActivity.png
    SettingsActivity.png
    96 KB · Views: 11,346
  • DbProcessor.png
    DbProcessor.png
    153.1 KB · Views: 11,364
Last edited:

Kevin M

Inactive Recognized Developer
Jul 31, 2011
457
775
kmark.io
Clarity

ROM Compatibility
Clarity should work with CyanogenMod and other closely AOSP-based ROMs. Other ROMs like the stock ones found on most popular Android devices may not work with Clarity. If you have a device or ROM that Clarity works or does not work with (and is not already on the below list) please tell me!

LG G2
  • CyanogenMod 12

LG G3
  • SkyDragon (Lollipop)

Motorola Droid X2
  • CyanogenMod 10

Nexus 6
  • Temasek

OnePlus One
  • BlissPop 2.2
  • Temasek 5.0.2

Samsung Galaxy Note II N7100
  • CyanogenModX 5.0.2

Samsung Galaxy Note 4
  • CyanogenMod 12 (3/24 nightly)
  • Stock (doesn't work? try this)

Samsung Galaxy S4
  • CyanogenMod 11
  • CyanogenMod 12
  • CyanogenMod 13

Xperia J
  • Xperia Revolution ROM

ROM Incompatibility
Moto X (2013)
  • Stock (Android 4.4)
 
Last edited:
D

Deleted member 308374

Guest
This is awesome, especially for Android wear!! Does it help with WhatsApp too? I fear not since it has different pictures...which are ugly because of an 8bit definition worth of MS-DOS "prince of persia"!!
So, that said, which apps are affected in addition to messenger and hangouts? Textra maybe? Others?
Cheers and keep up the good work!!

N7100 - CyanogenModX 5.0.2 @240 dpi
 

Kevin M

Inactive Recognized Developer
Jul 31, 2011
457
775
kmark.io
Works fabulously with BlissPop 2.2 OPO !
Excellent wok :)

Thanks! Both the DB processor and the Xposed mod seem to be working well?

This is awesome, especially for Android wear!! Does it help with WhatsApp too? I fear not since it has different pictures...which are ugly because of an 8bit definition worth of MS-DOS "prince of persia"!!
So, that said, which apps are affected in addition to messenger and hangouts? Textra maybe? Others?
Cheers and keep up the good work!!

N7100 - CyanogenModX 5.0.2 @240 dpi

It will help with any application or system software that makes use of the contact thumbnail stored in the database. From my personal experience this is a majority of applications. It's also why Clarity fixes contact imagery on Android Wear apps/notifications. It will not work for any apps that use their own contact system instead of the built-in Android one. A good example is Google Hangouts which will use its own contact photos for your Google+ contacts. Luckily the Google+ photos tend to be pretty decent quality-wise. Hangouts will fall back to your contacts database if that person does not have a Google+ profile and so Clarity will help there.
 

M3gAtR0N

Senior Member
Mar 26, 2013
159
78
Thanks! Both the DB processor and the Xposed mod seem to be working well?
/QUOTE]

yes both are working smoothly ! This is something that should be done by Google themselves !
Tested on BlissPop and Temasek 5.0.2 Lollipop for OnePlus One !

---------- Post added at 10:29 PM ---------- Previous post was at 10:27 PM ----------

Thanks! Both the DB processor and the Xposed mod seem to be working well?

Yes both are working seamlessly !
Tested on BlissPop and Temasek 5.0.2 Lollipop for OPO !
 

Kevin M

Inactive Recognized Developer
Jul 31, 2011
457
775
kmark.io
Thanks! Both the DB processor and the Xposed mod seem to be working well?
/QUOTE]

yes both are working smoothly ! This is something that should be done by Google themselves !
Tested on BlissPop and Temasek 5.0.2 Lollipop for OnePlus One !

---------- Post added at 10:29 PM ---------- Previous post was at 10:27 PM ----------



Yes both are working seamlessly !
Tested on BlissPop and Temasek 5.0.2 Lollipop for OPO !

Great, thanks again. The Xposed modification that Clarity makes to Android can actually be done by ROM devs (or of course Google). I'm assuming at least someone out there does this.

If you're a ROM maintainer consider adding Clarity's simple modification to your ROM. Reference the XClarity.java file for implementation details.
 

CCJ22

Senior Member
Jun 11, 2011
1,066
179
Little Rock
I've always wondered what the hell is going on when I get a new phone and some contacts images are blurry when they never were before in the previous phone. Happens everytime. Downloading now.
 

mcdavid

Senior Member
Apr 5, 2010
1,141
563
SF Bay Area
app seemed to work great on TMO Note 4 with CM 3/24 nightly . . . . until I pushed the Home button. I am then asked which launcher I want to use as Home and I choose Nova (which I already chose before). Then I get message that says "Unfortunately Android System has stopped." This happens every time I hit the home button. It happens if I choose Google Now Launcher too. This problem happened immediately after installing the mod and hadn't happened before. Still happens if I disable mod and reinstall Nova. Any ideas?

EDIT: if I go to settings - home and choose launcher there, it fixes it. Not sure why that is necessary. You should be able to choose default launcher when it ask you if you always want to use that launcher....
 
Last edited:

Kevin M

Inactive Recognized Developer
Jul 31, 2011
457
775
kmark.io
app seemed to work great on TMO Note 4 with CM 3/24 nightly . . . . until I pushed the Home button. I am then asked which launcher I want to use as Home and I choose Nova (which I already chose before). Then I get message that says "Unfortunately Android System has stopped." This happens every time I hit the home button. It happens if I choose Google Now Launcher too. This problem happened immediately after installing the mod and hadn't happened before. Still happens if I disable mod and reinstall Nova. Any ideas?

EDIT: if I go to settings - home and choose launcher there, it fixes it. Not sure why that is necessary. You should be able to choose default launcher when it ask you if you always want to use that launcher....

Quite odd. Did you reboot after running the DB processor?
 
  • Like
Reactions: mcdavid

mcdavid

Senior Member
Apr 5, 2010
1,141
563
SF Bay Area
Quite odd. Did you reboot after running the DB processor?
Like an idiot, I didn't read the entire OP. So, I just installed it and rebooted and had the issues I mentioned. In other words, I hadn't even tried the DB Processor yet. I have since read the OP and ran the DB Processor and had no issues. All is well. Still not sure why what I described happened. As long as others know they might have to assign home launcher via settings, it's not a big deal. Thanks for your fast response.
 

cambunch

Senior Member
Sep 11, 2009
861
1,485
So, in theory, would you be able to install this and run the DB processor to create hi-res thumbnails and then remove the app? I ask because Xposed is not stable on my device (it works, but causes random reboots), so running this and getting it setup then removing Xposed would be ideal for me. Or I can just try and modify my ROM to get it to work without Xposed (I haven't read the implementation details yet).

EDIT: To answer my own question - YES, this works :) Made a nandroid, got everything setup, removed Clairty and Xposed, and restored my /system partition. Good to go!
 
Last edited:

rgshah3

Senior Member
Apr 19, 2011
1,714
439
Mumbai
What size are y'all using? 256 or increased it?

---------- Post added at 09:53 AM ---------- Previous post was at 09:49 AM ----------

It refuses to change detect contacts

Out of all, it only finds 1 photo and claims it's not even square

Any help?

d431a36fb9f26e6ea4a16dcf9ed0f448.jpg
 

qusak808

Senior Member
May 28, 2014
87
20
I don't see any differences. LG G2 with CM 12.

ok it works now.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 44
    Code:
    Clarity is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    Introduction
    Clarity is an Xposed module and root Android application for increasing the size and quality of contact thumbnails in the Android contacts database. It's comprised of two components. An Xposed modification and a root-required Database Processor.

    Clarity also increases the quality and size of locally stored album art.

    Xposed Mod
    Android stores two versions of contact images. The contact photo and the contact thumbnail. While both are downscaled appropriately from the original image, the two are very different in size. Contact photos clock in at around 720×720 pixels or so depending on the original image. Contact thumbnails are a measly 96×96 pixels. Contact photos are used in places where contact imagery is going to be distinctively large like the KitKat/Lollipop Phone app. Or when you receive an incoming call. Thumbnails are used for notifications, messaging applications, and other roles which the full contact photo is unnecessarily big. Unfortunately, as screen PPIs have skyrocketed since the 96×96 limit was put in place, contact thumbnails are now too small for their original purpose. Regardless, most applications continue to use contact thumbnails.

    Clarity forces Android to use a user-defined size (defaulting to 256×256) when adding contact thumbnails to the database. While these new images are larger and look much better they will load slightly slower and increase memory requirements. For newer devices this should not be a problem. For reference, I have not witnessed any side effects on my Galaxy S4 using the default 256×256 setting. Since the size can be adjusted you can optimize it for your device.

    In the name of simplicity, Clarity does not change the method Android uses to downscale contact thumbnails, just the final dimensions. However since Clarity allows you to increase the size of the thumbnail and consequently decrease the magnitude of the downscale, there will be noticeably fewer artifacts in your new thumbnails.

    The Xposed module does not magically increase the quality of thumbnails already added in the database. It only affects newly added/updated contacts and images. To upgrade your entire contacts database either use the Database Processor detailed below or re-import the contacts. Re-importing may require you to deconnect/desync the account the contacts are associated with and then reconnect/resync the account. Some sync applications may have a force refresh option and that should work nicely. For instance, HaxSync has a Force redownload option under its contact settings.

    When the Xposed module is activated, Clarity will also up the size of locally stored album art (for instance, MP3s on the external storage). Just like the contact thumbnail part of the module, existing album art is unaffected. To get Android to reprocess all the album art on your device you must delete all the files found in the albumthumbs directory. This is usually found somewhere on your external storage. Popular paths are /storage/emulated/legacy/Android/data/com.android.providers.media/albumthumbs and /storage/sdcard0/Android/data/com.android.providers.media/albumthumbs. Different devices and ROMs can have different paths but the last /Android/data/com.android.providers.media/albumthumbs bit should stay the same. Once that directory has been cleared out, higher quality album art will be regenerated by Android on demand (as they are needed). See Android issue 73635 for more information about the album art problem.

    Database Processor
    In addition to the Xposed-based modification described above, Clarity includes a Database Processor. This powerful feature forcibly updates every contact thumbnail in your database. It rips out the internal contacts database file, finds all your contacts with photos and puts in new thumbnails. It'll then replace the old database with the new one. It is highly recommended to immediately reboot after processing to avoid Android going berserk. It will if you don't. :)

    While powerful, the Database Processor is also extremely dangerous. I am not responsible for any damage to your device as a result of using Clarity. It performs several operations as root and modifies core Android files that were never meant to be touched by anything other than Android itself. I highly recommend a full recovery-based backup of your device alongside the built-in backup feature. Please use the dry-run feature first (hell, multiple times even) to ensure the operation will succeed for your ROM. It is possible a successful dry-run could still fail when doing the real-deal so, as I mentioned before, backup your stuff. The built-in contact backups will be saved to a Clarity folder on your "primary" external storage. What primary means depends on your ROM and device. It could be your actual external SD card or it could be an internal storage location. Regardless, the current backup location will be noted, assuming backups are enabled, in the processor's log. As an added bonus, if the backup feature is on it will also save the log file alongside your backups!

    The Database Processor has been tested on CM (CyanogenMod) 10 (based on Android 4.1.2), CM 11 (based on Android 4.4.4), CM 12 (based on Android 5.0.2), and CM 13 (based on Android 6.0.1). It should work on any AOSP-based ROM from Ice Cream Sandwich (4.0) to Marshmallow (6.0). For stock ROMs and anything created by carriers I have no idea. If it works for you please report back! If it doesn't, well, report that too.

    Images

    Features
    • Simple lightweight Xposed modification
    • Powerful database processor for forcibly updating contact thumbnails
    • Also clarifies locally stored album art
    • Should work on nearly any AOSP-based ROM like CyanogenMod
    • Free and open-source software. No nags. No data collection. No secrets.

    Known Issues
    • Does not appear to work with Google-synced contact photos.
    • May not work with all devices and ROMs. See the following post.

    Installation
    1. Make certain you have Xposed installed before continuing.
    2. Install the app by a) searching for it in the Xposed Installer or b) manually through the APK provided on GitHub or the Xposed website.
    3. Configure the app in its settings panel. It can be accessed through the module section of the Xposed Installer or by the launcher shortcut.
    4. Enable the module in the Xposed Installer.
    5. Reboot.
    6. Done!
    7. The Xposed module will only update contact photos that are modified or added to the database after it is turned on. The database processor will attempt to update the contact photos in place and right away. To avoid using the database processor your contact photos must be manually refreshed. How/if this can be done and how easily is dependent on how you sync your contacts. For instance, if you use HaxSync you can update all your photos by going to Settings app -> Accounts -> HaxSync -> Advanced Settings -> Contact Settings -> Check Force redownload. Hit back twice. Select your account name at the top. Click Contacts to uncheck it. Recheck it and wait for sync to finish.

    Changelog
    See the GitHub repository for the definitive changelog.
    Code:
    v1.2-cfad189 - 03 Jul 2016 - Stable
    ------------
    This release introduces the following improvements:
    * Added a Spanish translation
      (thanks to Jose Artuñedo @ XDA)
    * Fix a SELinux-related issue with the Database Processor
      on Marshmallow
    * Support Marshmallow's new permission system
    * Added some additional debugging info to the processor log
    * Tested on CyanogenMod 13 (Android 6.0.1)

    Code:
    v1.1-93b7945 - 03 May 2015 - Stable
    ------------
    This release introduces the following improvements:
    * The database processor will no longer fail if contacts2.db-journal
      cannot be found. It will note the absence of the journaling file
      in the log and proceed as normal
    * Will now increase the size and quality of locally stored album art.
      Suggested by @Karamvir Singh. See [url=http://xdaforums.com/showpost.php?p=60499753&postcount=55]this post[/url] for more
      information.
    * An XXXHDPI icon
    * Updated donation links
    * Minor log bug fix
    * Better shell usage
    * Less condescending toast notifications
    Code:
    v1.0-917d899 - 25 Mar 2015 - Stable
    ------------
    Initial release. Make sure to see the README or XDA thread!

    Downloads

    FAQ
    Q: Something went horribly wrong! How do I restore from one of the backups?
    A: Ouch! Clarity stores backups on your "external storage." Depending on your device and ROM this could be an actual SD card or internal. If your device has two check both. It will be in a directory named Clarity. In the Clarity backup directory there will be sub-directories with dates. Select the one before everything went to hell. You'll find up to three files: contacts2.db contacts2.db-journal, and dbprocessor.log The .db file(s) are the actual contacts databases. The dbprocessor.log is your log file and has lots of great information for us to use. Now that we have located everything we need let's get restoring.

    Method #1 - By hand
    If your device still boots and you can navigate around (even if things are crashing every few seconds) try this. If you have a custom recovery that supports adb then this will work as well if you boot into it.
    1. Grab the adb command line tool. For Windows check here. For Linux and Mac see here.
    2. Now put your device in debug mode. Go to the settings app. Tap About phone. Keep tapping Build number until it says you are a developer. Go back and select Developer options. Turn the development options "on" if needed. Under Debugging turn on Android debugging.
    3. Now connect your device to your computer. It should say something about debugging being enabled in the status bar. Make certain your phone is unlocked. If it says something about allowing the computer debug access to your phone please accept it.
    4. Open up a command line or terminal. On Linux I'm going to assume you know what to do. On Mac it's the Terminal app. On Windows it's C:Windowssystem32cmd.exe
    5. Type adb version and hit enter. If your get something about it being not found then adb isn't installed in your PATH or you're not in the directory in which adb was extracted. You can navigate to that directory with the cd command. So to navigate to the system32 folder on Windows, for instance, I'd type cd C:Windowssystem32 and hit enter.
    6. Type adb shell and hit enter. This will dump us into a shell instance directly on your device.
    7. Type id and hit enter. If the first bit is not uid=0 then unlock your device and type su and hit enter. If your device prompts for superuser access please grant it.
    8. Navigate to the directory in which your backups are stored on your device. For me this would be something like cd /storage/emulated/legacy/Clarity/2015-Something
    9. You should now see the backup files if you type ls and hit enter. Great. Now to move these into place.
    10. Open your dbprocessor.log file on your device through a file manager or move it onto your computer to read its contents. You can read it through the command line if you wish but it's much more convenient to be able to copy and paste if needed.
    11. Note the Contacts UID and Contacts directory. Mine is 10006 and /data/data/com.android.providers.contacts respectively.
    12. Execute cp contacts2.db /your/contacts/directory/databases/contacts2.db and hit enter. For me this full command is cp contacts2.db /data/data/com.android.providers.contacts/databases/contacts2.db
    13. If you have a contacts2.db-journal file do the same except with that file. For me this is: cp contacts2.db-journal /data/data/com.android.providers.contacts/databases/contacts2.db-journal
    14. Now to correct the permissions. Type chown +UID:+UID /your/contacts/directory/databases/contacts2.db* and hit enter. For me this is chown +10006:+10006 /data/data/com.android.providers.contacts/databases/contacts2.db*
    15. Reboot immediately by typing reboot and hitting enter.
    16. All done. Your contacts database has been restored.

    Method #2 - Recovery
    Took a backup with your custom recovery before processing? Just restore from the backup to get your device back to normal.

    Credits

    Licensing
    Copyright © 2015-2016 Kevin Mark. Clarity is licensed under the GNU General Public License, Version 3, which can be found in LICENSE.md

    Clarity is developed in my spare time and will always remain free and open-source software. If you find this application useful please feel free to donate.

    XDA:DevDB Information
    Clarity, Xposed for all devices (see above for details)

    Contributors
    Kevin M
    Source Code: https://github.com/kmark/Clarity

    Xposed Package Name: com.versobit.kmark.clarity

    Version Information
    Status: Stable
    Current Stable Version: v1.2-cfad189
    Stable Release Date: 2016-07-03

    Created 2015-03-25
    Last Updated 2016-07-23
    3
    Clarity

    ROM Compatibility
    Clarity should work with CyanogenMod and other closely AOSP-based ROMs. Other ROMs like the stock ones found on most popular Android devices may not work with Clarity. If you have a device or ROM that Clarity works or does not work with (and is not already on the below list) please tell me!

    LG G2
    • CyanogenMod 12

    LG G3
    • SkyDragon (Lollipop)

    Motorola Droid X2
    • CyanogenMod 10

    Nexus 6
    • Temasek

    OnePlus One
    • BlissPop 2.2
    • Temasek 5.0.2

    Samsung Galaxy Note II N7100
    • CyanogenModX 5.0.2

    Samsung Galaxy Note 4
    • CyanogenMod 12 (3/24 nightly)
    • Stock (doesn't work? try this)

    Samsung Galaxy S4
    • CyanogenMod 11
    • CyanogenMod 12
    • CyanogenMod 13

    Xperia J
    • Xperia Revolution ROM

    ROM Incompatibility
    Moto X (2013)
    • Stock (Android 4.4)
    3
    Looks Promising !!!!

    Thank you. The application is now available.
    2
    Thank you for the bug reports. I have 6.0.1 on my test device now and I'll be looking into the issue when I can. Unfortunately I have no plans to widen support to devices/ROMs that have heavily modified their contacts system. If it almost works on a given device we can try to work it out but no promises. ;)
    2
    v1.1-93b7945

    Hey guys. A new version of Clarity is now available. Below is the changelog for your convenience.

    Code:
    v1.1-93b7945 - 03 May 2015 - Stable
    ------------
    This release introduces the following improvements:
    * The database processor will no longer fail if contacts2.db-journal
      cannot be found. It will note the absence of the journaling file
      in the log and proceed as normal
    * Will now increase the size and quality of locally stored album art.
      Suggested by @Karamvir Singh.
    * An XXXHDPI icon
    * Updated donation links
    * Minor log bug fix
    * Better shell usage
    * Less condescending toast notifications

    From the README on the album art fix:
    When the Xposed module is activated, Clarity will also up the size of locally stored album art (for instance, MP3s on the external storage). Just like the contact thumbnail part of the module, existing album art is unaffected. To get Android to reprocess all the album art on your device you must delete all the files found in the albumthumbs directory. This is usually found somewhere on your external storage. Popular paths are /storage/emulated/legacy/Android/data/com.android.providers.media/albumthumbs and /storage/sdcard0/Android/data/com.android.providers.media/albumthumbs. Different devices and ROMs can have different paths but the last /Android/data/com.android.providers.media/albumthumbs bit should stay the same. Once that directory has been cleared out, higher quality album art will be regenerated by Android on demand (as they are needed). See Android issue 73635 for more information about the album art problem.

    The first and second posts have also been updated with some helpful information like how to restore your contacts from the backups and which devices are known to be compatible / incompatible. Enjoy.