alexstyl / contactstore

A modern, strongly-typed contacts API for Android.
https://alexstyl.github.io/contactstore
Apache License 2.0
440 stars 15 forks source link

Possible issues with LinkedAccountMimeType #12

Closed NLLAPPS closed 2 years ago

NLLAPPS commented 2 years ago

I found that certain apps, for example Telegram can have different package types for different app stores but use same/original package name as account type when adding account mimes to Android system.

For example, Telegram's Play Store version has package name org.telegram.messenger but Web download version has org.telegram.messenger.web package name and org.telegram.messenger.web version add account mime with package name/account type "org.telegram.messenger" which prevents us from matching to LinkedAccountMimeType.packageName we extract with AccountInfoResolver.kt

Getting mime types and matching according to mime types account type would possibly be a solution

alexstyl commented 2 years ago

Hi! I noticed that the LinkedAccountMimeType.packageName is not really used. The matching (in ContactQueries#340) is done using the mimetype of the account and what is stored in the database, which I think is the account type.

I noticed that you mention 'possible' in the title. Have you noticed this issue happening in production?

alexstyl commented 2 years ago

Closing this because of inactivity. Happy to go through this again if it is indeed a problem.