diff --git a/.idea/dictionaries/Hamza.xml b/.idea/dictionaries/Hamza.xml
index ab26f2853..a0b0b703f 100644
--- a/.idea/dictionaries/Hamza.xml
+++ b/.idea/dictionaries/Hamza.xml
@@ -161,6 +161,7 @@
fstrim
furiya
geolocstation
+ getjar
gles
gogh
gonçalves
@@ -357,6 +358,7 @@
shellscript
shizuku
sigsev
+ slideme
smsto
softprops
solarized
@@ -415,6 +417,7 @@
unmark
unshift
upto
+ uptodown
urbanist
usebackq
userdebug
diff --git a/app/src/main/java/app/simple/inure/constants/InstallerColors.kt b/app/src/main/java/app/simple/inure/constants/InstallerColors.kt
index 16f4ead7f..fd19433d4 100644
--- a/app/src/main/java/app/simple/inure/constants/InstallerColors.kt
+++ b/app/src/main/java/app/simple/inure/constants/InstallerColors.kt
@@ -1,33 +1,23 @@
package app.simple.inure.constants
+/**
+ * If you are developer who maintains apps that installs apps and acts as a
+ * source for them as well, you can add your signature colors here. Or open an
+ * issue for that.
+ */
object InstallerColors {
- const val UNKNOWN = 0xFF6D7291.toInt()
-
- private val colors: ArrayList by lazy {
- arrayListOf(
- 0xFFEA4335.toInt(), // Play Store
- 0xFFFFB401.toInt(), // Aurora Store
- 0xFF217AD3.toInt(), // F-Droid
- 0xFFFFA967.toInt(), // Inure
- 0xFF4CAF50.toInt(), // APKMirror
- 0xFF9E9E9E.toInt(), // System
- 0xFF673AB7.toInt(), // Aptoide
- 0xFF00C4F7.toInt(), // Amazon Appstore
- 0xFF2196F3.toInt(), // APKPure
- 0xFF3F51B5.toInt(), // Samsung Galaxy Store
- 0xFFF65C5B.toInt(), // Huawei AppGallery
- 0xFFE91E63.toInt(), // SlideME
- )
- }
-
private val colorMap = mapOf(
"com.android.vending" to 0xFFEA4335.toInt(),
"com.google.android.packageinstaller" to 0xFFEA4335.toInt(),
"com.aurora.store" to 0xFFFFB401.toInt(),
"org.fdroid.fdroid" to 0xFF217AD3.toInt(),
"app.simple.inure" to 0xFFFFA967.toInt(),
+ "app.simple.inure.debug" to 0xFFFFA967.toInt(),
+ "app.simple.inure.beta" to 0xFFFFA967.toInt(),
+ "app.simple.inure.play" to 0xFFFFA967.toInt(),
"com.apkmirror" to 0xFF4CAF50.toInt(),
+ "android" to 0xFF9E9E9E.toInt(),
"system" to 0xFF9E9E9E.toInt(),
"com.android.shell" to 0xFF9E9E9E.toInt(),
"com.aptoide.pt" to 0xFF673AB7.toInt(),
@@ -38,12 +28,12 @@ object InstallerColors {
"com.slideme.sam.manager" to 0xFFE91E63.toInt(),
"com.xiaomi.market" to 0xFFE173E5.toInt(),
"com.xiaomi.discover" to 0xFF3B56E5.toInt(),
+ "com.uptodown" to 0xFFE5E53B.toInt(),
+ "com.getjar.rewards" to 0xFF3BE5E5.toInt(),
+ "com.opera.app.discover" to 0xFF3BE53B.toInt(),
+ "com.opera.app.market" to 0xFFE53B3B.toInt(),
)
- fun getInstallerColors(): ArrayList {
- return colors
- }
-
fun getInstallerColorMap(): Map {
return colorMap
}
diff --git a/app/src/main/java/app/simple/inure/viewmodels/panels/AnalyticsViewModel.kt b/app/src/main/java/app/simple/inure/viewmodels/panels/AnalyticsViewModel.kt
index be398c3e6..669bf5f18 100644
--- a/app/src/main/java/app/simple/inure/viewmodels/panels/AnalyticsViewModel.kt
+++ b/app/src/main/java/app/simple/inure/viewmodels/panels/AnalyticsViewModel.kt
@@ -10,6 +10,7 @@ import androidx.lifecycle.viewModelScope
import app.simple.inure.R
import app.simple.inure.apk.utils.PackageUtils.getInstallerPackageName
import app.simple.inure.apk.utils.PackageUtils.safeApplicationInfo
+import app.simple.inure.constants.Colors
import app.simple.inure.constants.InstallerColors
import app.simple.inure.extensions.viewmodels.PackageUtilsViewModel
import app.simple.inure.preferences.AnalyticsPreferences
@@ -162,7 +163,8 @@ class AnalyticsViewModel(application: Application) : PackageUtilsViewModel(appli
}
installers.keys.distinct().forEach { packageName ->
- colors.add(InstallerColors.getInstallerColorMap()[packageName] ?: InstallerColors.UNKNOWN)
+ colors.add(InstallerColors.getInstallerColorMap()[packageName]
+ ?: Colors.getRetroColor()[installers.keys.distinct().indexOf(packageName)])
labels[packageName] = kotlin.runCatching {
packageManager.getApplicationLabel(packageManager.getApplicationInfo(packageName)!!).toString()
}.getOrElse {