├── .github
└── workflows
│ ├── auto-author-assign.yml
│ ├── dependent-issues.yml
│ ├── rebase-default-branch.yml
│ └── semantic-commit.yml
├── .gitignore
├── AppIntegrity
├── build.gradle.kts
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ ├── main
│ └── kotlin
│ │ └── com
│ │ └── infomaniak
│ │ └── core
│ │ └── appintegrity
│ │ ├── ApiClientProvider.kt
│ │ ├── AppIntegrityManager.kt
│ │ ├── AppIntegrityRepository.kt
│ │ ├── AppIntegrityRoutes.kt
│ │ ├── exceptions
│ │ ├── ApiException.kt
│ │ ├── AppIntegrityException.kt
│ │ ├── IntegrityException.kt
│ │ ├── NetworkException.kt
│ │ ├── UnexpectedApiErrorFormatException.kt
│ │ └── UnknownException.kt
│ │ └── models
│ │ ├── ApiError.kt
│ │ ├── ApiResponse.kt
│ │ └── ApiResponseStatus.kt
│ └── test
│ └── kotlin
│ └── com
│ └── infomaniak
│ └── core
│ └── appintegrity
│ └── ApiClientProviderTest.kt
├── Compose
├── Basics
│ ├── build.gradle.kts
│ ├── consumer-rules.pro
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ └── kotlin
│ │ └── com
│ │ └── infomaniak
│ │ └── core
│ │ └── compose
│ │ └── basics
│ │ ├── CallableState.kt
│ │ ├── FlowForwarding.kt
│ │ └── ScreenUtils.kt
└── MaterialThemeFromXml
│ ├── build.gradle.kts
│ └── src
│ └── main
│ └── kotlin
│ └── com
│ └── infomaniak
│ └── core
│ └── compose
│ └── materialthemefromxml
│ └── MaterialThemeFromXml.kt
├── FileTypes
├── build.gradle.kts
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ └── main
│ └── kotlin
│ └── com
│ └── infomaniak
│ └── core
│ └── filetypes
│ ├── FileType.kt
│ ├── FileTypeGuesser.kt
│ ├── FileTypeIcons.kt
│ └── icons
│ ├── Archive.kt
│ ├── Audio.kt
│ ├── Calendar.kt
│ ├── Code.kt
│ ├── Folder.kt
│ ├── Font.kt
│ ├── Image.kt
│ ├── Pdf.kt
│ ├── Points.kt
│ ├── Sheet.kt
│ ├── Text.kt
│ ├── Unknown.kt
│ ├── Vcard.kt
│ └── Video.kt
├── FragmentNavigation
├── build.gradle.kts
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ └── main
│ └── java
│ └── com
│ └── infomaniak
│ └── core
│ └── fragmentnavigation
│ └── FragmentNavigationExt.kt
├── InAppReview
├── build.gradle.kts
├── proguard-rules.pro
└── src
│ ├── fdroid
│ └── kotlin
│ │ └── com
│ │ └── infomaniak
│ │ └── core
│ │ └── inappreview
│ │ └── reviewmanagers
│ │ └── InAppReviewManager.kt
│ ├── main
│ └── kotlin
│ │ └── com
│ │ └── infomaniak
│ │ └── core
│ │ └── inappreview
│ │ ├── AppReviewSettingsRepository.kt
│ │ └── BaseInAppReviewManager.kt
│ └── standard
│ └── kotlin
│ └── com
│ └── infomaniak
│ └── core
│ └── inappreview
│ └── reviewmanagers
│ └── InAppReviewManager.kt
├── InAppStore
├── build.gradle.kts
├── proguard-rules.pro
└── src
│ └── main
│ └── kotlin
│ └── com
│ └── infomaniak
│ └── core
│ └── inappstore
│ └── InAppStoreExt.kt
├── Ktor
├── build.gradle.kts
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ └── main
│ └── kotlin
│ └── com
│ └── infomaniak
│ └── core
│ └── ktor
│ └── InputStreamToOutgoingContent.kt
├── LICENSE
├── Legacy
├── AppLock
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── infomaniak
│ │ │ └── lib
│ │ │ └── applock
│ │ │ ├── DisplayState.kt
│ │ │ ├── LockActivity.kt
│ │ │ └── Utils.kt
│ │ └── res
│ │ ├── drawable-night
│ │ └── ic_lock_screen.xml
│ │ ├── drawable
│ │ ├── ic_lock_screen.xml
│ │ └── ic_logo.xml
│ │ ├── layout
│ │ └── activity_lock.xml
│ │ ├── navigation
│ │ └── app_lock_navigation.xml
│ │ ├── values-de
│ │ └── strings.xml
│ │ ├── values-es
│ │ └── strings.xml
│ │ ├── values-fr
│ │ └── strings.xml
│ │ ├── values-it
│ │ └── strings.xml
│ │ └── values
│ │ ├── attrs.xml
│ │ └── strings.xml
├── BugTracker
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── infomaniak
│ │ │ └── lib
│ │ │ └── bugtracker
│ │ │ ├── BugTrackerActivity.kt
│ │ │ ├── BugTrackerFileAdapter.kt
│ │ │ └── BugTrackerViewModel.kt
│ │ └── res
│ │ ├── drawable
│ │ └── ic_bug_tracker_close.xml
│ │ ├── layout
│ │ ├── activity_bug_tracker.xml
│ │ └── item_bug_tracker_file.xml
│ │ ├── navigation
│ │ └── bug_tracker_navigation.xml
│ │ ├── values-de
│ │ └── strings.xml
│ │ ├── values-es
│ │ └── strings.xml
│ │ ├── values-fr
│ │ └── strings.xml
│ │ ├── values-it
│ │ └── strings.xml
│ │ └── values
│ │ └── strings.xml
├── Confetti
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── infomaniak
│ │ │ └── lib
│ │ │ └── confetti
│ │ │ ├── CommonConfetti.kt
│ │ │ ├── ConfettiManager.kt
│ │ │ ├── ConfettiSource.kt
│ │ │ ├── ConfettiView.kt
│ │ │ ├── ConfettoGenerator.kt
│ │ │ ├── Utils.kt
│ │ │ └── confetto
│ │ │ ├── BitmapConfetto.kt
│ │ │ ├── CircleConfetto.kt
│ │ │ ├── Confetto.kt
│ │ │ └── ShimmeringConfetto.kt
│ │ └── res
│ │ └── values
│ │ └── dimens.xml
├── Stores
│ ├── build.gradle
│ └── src
│ │ ├── fdroid
│ │ └── java
│ │ │ └── com
│ │ │ └── infomaniak
│ │ │ └── lib
│ │ │ └── stores
│ │ │ ├── AppUpdateScheduler.kt
│ │ │ ├── StoreUtils.kt
│ │ │ ├── reviewmanagers
│ │ │ └── InAppReviewManager.kt
│ │ │ └── updatemanagers
│ │ │ ├── InAppUpdateManager.kt
│ │ │ └── WorkerUpdateManager.kt
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── infomaniak
│ │ │ │ └── lib
│ │ │ │ └── stores
│ │ │ │ ├── BaseInAppReviewManager.kt
│ │ │ │ ├── BaseInAppUpdateManager.kt
│ │ │ │ ├── StoresSettingsRepository.kt
│ │ │ │ ├── StoresUtils.kt
│ │ │ │ ├── StoresViewModel.kt
│ │ │ │ ├── UpdateScheduler.kt
│ │ │ │ └── updaterequired
│ │ │ │ ├── UpdateRequiredActivity.kt
│ │ │ │ └── data
│ │ │ │ ├── api
│ │ │ │ ├── ApiRepositoryStores.kt
│ │ │ │ └── ApiRoutesStores.kt
│ │ │ │ └── models
│ │ │ │ ├── AppPublishedVersion.kt
│ │ │ │ └── AppVersion.kt
│ │ └── res
│ │ │ ├── drawable-night
│ │ │ └── illu_update_required_example.xml
│ │ │ ├── drawable
│ │ │ └── illu_update_required_example.xml
│ │ │ ├── layout
│ │ │ ├── activity_update_required.xml
│ │ │ └── alert_dialog_review.xml
│ │ │ ├── navigation
│ │ │ └── update_required_navigation.xml
│ │ │ ├── values-de
│ │ │ └── strings.xml
│ │ │ ├── values-es
│ │ │ └── strings.xml
│ │ │ ├── values-fr
│ │ │ └── strings.xml
│ │ │ ├── values-it
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ ├── attrs.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ └── standard
│ │ └── java
│ │ └── com
│ │ └── infomaniak
│ │ └── lib
│ │ └── stores
│ │ ├── AppUpdateScheduler.kt
│ │ ├── StoreUtils.kt
│ │ ├── reviewmanagers
│ │ └── InAppReviewManager.kt
│ │ ├── ui
│ │ └── dialogs
│ │ │ └── ReviewAlertDialog.kt
│ │ └── updatemanagers
│ │ ├── InAppUpdateManager.kt
│ │ └── WorkerUpdateManager.kt
├── build.gradle
├── schemas
│ └── com.infomaniak.lib.core.room.UserDatabase
│ │ ├── 1.json
│ │ ├── 2.json
│ │ ├── 3.json
│ │ ├── 4.json
│ │ └── 5.json
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── infomaniak
│ │ └── lib
│ │ └── core
│ │ └── HttpUtilsTest.kt
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── infomaniak
│ │ └── lib
│ │ └── core
│ │ ├── InfomaniakCore.kt
│ │ ├── MatomoCore.kt
│ │ ├── api
│ │ ├── ApiController.kt
│ │ ├── ApiRepositoryCore.kt
│ │ ├── ApiRoutesCore.kt
│ │ └── InternalTranslatedErrorCode.kt
│ │ ├── auth
│ │ ├── CredentialManager.kt
│ │ ├── TokenAuthenticator.kt
│ │ ├── TokenInterceptor.kt
│ │ └── TokenInterceptorListener.kt
│ │ ├── extensions
│ │ └── AppCompatActivityExtensions.kt
│ │ ├── fdroidTools
│ │ ├── FdroidApiTools.kt
│ │ └── FdroidRelease.kt
│ │ ├── githubTools
│ │ ├── GitHubRelease.kt
│ │ └── GitHubViewModel.kt
│ │ ├── models
│ │ ├── Address.kt
│ │ ├── ApiError.kt
│ │ ├── ApiResponse.kt
│ │ ├── ApiResponseStatus.kt
│ │ ├── OrganizationAccount.kt
│ │ └── user
│ │ │ ├── ContactMethod.kt
│ │ │ ├── Email.kt
│ │ │ ├── Phone.kt
│ │ │ ├── User.kt
│ │ │ └── preferences
│ │ │ ├── Country.kt
│ │ │ ├── Language.kt
│ │ │ ├── OrganizationPreference.kt
│ │ │ ├── PreferenceTemplate.kt
│ │ │ ├── Preferences.kt
│ │ │ ├── TimeZone.kt
│ │ │ └── security
│ │ │ ├── AuthDevices.kt
│ │ │ └── Security.kt
│ │ ├── networking
│ │ ├── AccessTokenUsageInterceptor.kt
│ │ ├── GZipInterceptor.kt
│ │ ├── HttpClient.kt
│ │ ├── HttpClientConfig.kt
│ │ └── HttpUtils.kt
│ │ ├── room
│ │ ├── UserDao.kt
│ │ ├── UserDatabase.kt
│ │ └── UserMigration.kt
│ │ ├── ui
│ │ └── WebViewActivity.kt
│ │ ├── utils
│ │ ├── ApiErrorCode.kt
│ │ ├── ApiTokenExt.kt
│ │ ├── CoilUtils.kt
│ │ ├── CustomDateTypeAdapter.kt
│ │ ├── DownloadManagerUtils.kt
│ │ ├── Extensions.kt
│ │ ├── FilePicker.kt
│ │ ├── MediaStoreUtils.kt
│ │ ├── NotificationUtilsCore.kt
│ │ ├── OkHttpClientExt.kt
│ │ ├── SentryLog.kt
│ │ ├── SharedValues.kt
│ │ ├── SingleLiveEvent.kt
│ │ ├── SnackbarUtils.kt
│ │ ├── Utils.kt
│ │ └── UtilsUi.kt
│ │ └── views
│ │ ├── DividerItemDecorator.kt
│ │ ├── EndIconTextInputLayout.kt
│ │ ├── LoaderAdapter.kt
│ │ ├── LoaderCardView.kt
│ │ ├── LoaderConstant.kt
│ │ ├── LoaderController.kt
│ │ ├── LoaderImageView.kt
│ │ ├── LoaderTextView.kt
│ │ └── LoaderView.kt
│ └── res
│ ├── drawable-hdpi
│ └── splashscreen_branding_image_legacy.png
│ ├── drawable-mdpi
│ └── splashscreen_branding_image_legacy.png
│ ├── drawable-night-hdpi
│ └── splashscreen_branding_image_legacy.png
│ ├── drawable-night-mdpi
│ └── splashscreen_branding_image_legacy.png
│ ├── drawable-night-xhdpi
│ └── splashscreen_branding_image_legacy.png
│ ├── drawable-night-xxhdpi
│ └── splashscreen_branding_image_legacy.png
│ ├── drawable-night-xxxhdpi
│ └── splashscreen_branding_image_legacy.png
│ ├── drawable-night
│ └── splashscreen_branding_image.xml
│ ├── drawable-xhdpi
│ └── splashscreen_branding_image_legacy.png
│ ├── drawable-xxhdpi
│ └── splashscreen_branding_image_legacy.png
│ ├── drawable-xxxhdpi
│ └── splashscreen_branding_image_legacy.png
│ ├── drawable
│ ├── placeholder.xml
│ └── splashscreen_branding_image.xml
│ ├── font
│ ├── suisseintl_bold.otf
│ ├── suisseintl_medium.otf
│ ├── suisseintl_regular.otf
│ ├── suisseintl_regular_italic.otf
│ └── suisseintl_semibold.otf
│ ├── layout
│ ├── activity_webview.xml
│ └── item_loading.xml
│ ├── navigation
│ └── webview_navigation.xml
│ ├── values-de
│ └── strings.xml
│ ├── values-es
│ └── strings.xml
│ ├── values-fr
│ └── strings.xml
│ ├── values-it
│ └── strings.xml
│ ├── values-night
│ └── colors.xml
│ └── values
│ ├── attrs.xml
│ ├── colors.xml
│ ├── dimens.xml
│ └── strings.xml
├── Matomo
├── build.gradle.kts
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ └── main
│ └── kotlin
│ └── com
│ └── infomaniak
│ └── core
│ └── matomo
│ └── Matomo.kt
├── MyKSuite
├── build.gradle.kts
├── consumer-rules.pro
├── proguard-rules.pro
├── schemas
│ └── com.infomaniak.core.myksuite.ui.data.MyKSuiteDatabase
│ │ └── 1.json
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── infomaniak
│ │ └── core
│ │ └── myksuite
│ │ └── ui
│ │ ├── components
│ │ ├── MyKSuiteChips.kt
│ │ ├── MyKSuiteGradient.kt
│ │ ├── MyKSuitePrimaryButton.kt
│ │ ├── TextWithIcon.kt
│ │ └── WeightOneSpacer.kt
│ │ ├── data
│ │ ├── MyKSuiteData.kt
│ │ ├── MyKSuiteDataDao.kt
│ │ ├── MyKSuiteDataManager.kt
│ │ ├── MyKSuiteDatabase.kt
│ │ ├── kSuiteDrive.kt
│ │ └── kSuiteMail.kt
│ │ ├── network
│ │ └── ApiRoutes.kt
│ │ ├── screens
│ │ ├── MyKSuiteDashboardScreen.kt
│ │ ├── MyKSuiteUpgradeBottomSheet.kt
│ │ ├── MyKSuiteUpgradeFeature.kt
│ │ └── components
│ │ │ ├── ExpandableItemView.kt
│ │ │ ├── InformationBlock.kt
│ │ │ ├── LimitedFunctionnalities.kt
│ │ │ ├── MyKSuiteButtonType.kt
│ │ │ ├── MyKSuiteTextItem.kt
│ │ │ ├── ProductsStorageQuotas.kt
│ │ │ └── UpgradeFeature.kt
│ │ ├── theme
│ │ ├── ColorsDark.kt
│ │ ├── ColorsLight.kt
│ │ ├── Dimens.kt
│ │ ├── Margin.kt
│ │ ├── Theme.kt
│ │ └── Type.kt
│ │ ├── utils
│ │ ├── MatomoMyKSuite.kt
│ │ └── MyKSuiteUiUtils.kt
│ │ └── views
│ │ ├── BaseMyKSuiteChipView.kt
│ │ ├── MyKSuiteChipView.kt
│ │ ├── MyKSuiteDashboardFragment.kt
│ │ ├── MyKSuitePlusChipView.kt
│ │ └── MyKSuiteUpgradeBottomSheetDialog.kt
│ └── res
│ ├── drawable-night
│ ├── ic_logo_my_ksuite.xml
│ ├── ic_logo_my_ksuite_plus.xml
│ ├── illu_banner.xml
│ └── illu_dashboard_background.xml
│ ├── drawable
│ ├── ic_chevron_down.xml
│ ├── ic_chevron_up.xml
│ ├── ic_circle_i.xml
│ ├── ic_cross_thick.xml
│ ├── ic_drive_cloud.xml
│ ├── ic_envelope_bold.xml
│ ├── ic_enveloppe_italic.xml
│ ├── ic_folder_circle_filled_arrow_up.xml
│ ├── ic_gift.xml
│ ├── ic_logo_my_ksuite.xml
│ ├── ic_logo_my_ksuite_plus.xml
│ ├── ic_padlock.xml
│ ├── ic_paperplane.xml
│ ├── illu_banner.xml
│ └── illu_dashboard_background.xml
│ ├── navigation
│ └── my_ksuite_navigation.xml
│ ├── values-de
│ └── strings.xml
│ ├── values-es
│ └── strings.xml
│ ├── values-fr
│ └── strings.xml
│ ├── values-it
│ └── strings.xml
│ ├── values-night
│ └── colors.xml
│ └── values
│ ├── attrs.xml
│ ├── colors.xml
│ └── strings.xml
├── Network
├── build.gradle.kts
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── kotlin
│ └── com
│ └── infomaniak
│ └── core
│ └── network
│ └── NetworkAvailability.kt
├── Notifications
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── kotlin
│ └── com
│ └── infomaniak
│ └── core
│ └── notifications
│ └── NotificationsUtilsCore.kt
├── Onboarding
├── build.gradle.kts
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ └── main
│ └── kotlin
│ └── com
│ └── infomaniak
│ └── core
│ └── onboarding
│ ├── HorizontalPagerIndicator.kt
│ └── OnboardingScaffold.kt
├── README.md
├── RecyclerView
├── build.gradle.kts
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ └── main
│ └── kotlin
│ └── com
│ └── infomaniak
│ └── core
│ └── recyclerview
│ ├── CoroutineScopeViewHolder.kt
│ ├── ResettableLazy.kt
│ └── hack
│ └── BindAwareViewHolder.kt
├── Sentry
├── build.gradle.kts
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ └── main
│ └── kotlin
│ └── com
│ └── infomaniak
│ └── core
│ └── sentry
│ └── SentryLog.kt
├── Thumbnails
├── build.gradle.kts
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ └── main
│ └── kotlin
│ └── com
│ └── infomaniak
│ └── core
│ └── thumbnails
│ └── ThumbnailsUtils.kt
├── UserAvatar
├── build.gradle.kts
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── infomaniak
│ │ └── core
│ │ └── useravatar
│ │ ├── AvatarData.kt
│ │ ├── AvatarDisplayState.kt
│ │ ├── component
│ │ ├── DefaultIconColor.kt
│ │ ├── InitialsTextAvatar.kt
│ │ └── UnknownUserIcon.kt
│ │ └── exposed
│ │ └── UserAvatar.kt
│ └── res
│ ├── drawable-night
│ └── ic_person.xml
│ └── drawable
│ └── ic_person.xml
├── WebView
├── build.gradle.kts
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── kotlin
│ └── com
│ └── infomaniak
│ └── core
│ └── webview
│ └── ui
│ ├── WebViewActivity.kt
│ └── components
│ └── WebView.kt
├── build.gradle.kts
├── consumer-rules.pro
├── gradle
└── core.versions.toml
├── proguard-rules.pro
└── src
├── main
├── kotlin
│ └── com
│ │ └── infomaniak
│ │ └── core
│ │ ├── AtomicCoroutines.kt
│ │ ├── AutoCancelScope.kt
│ │ ├── CacheExpirationScope.kt
│ │ ├── DownloadManager.kt
│ │ ├── DynamicLazyMap.kt
│ │ ├── DynamicLazyMapCacheManager.kt
│ │ ├── DynamicLazyMapCacheManagerCountBased.kt
│ │ ├── DynamicLazyMapOfSharedFlow.kt
│ │ ├── Flow.kt
│ │ ├── ForegroundService.kt
│ │ ├── FormatterFileSize.kt
│ │ ├── HumanReadableErrors.kt
│ │ ├── Lifecycle.kt
│ │ ├── NotTestedNorUsed.kt
│ │ ├── Result.kt
│ │ ├── SendChannel.kt
│ │ ├── StateFlow.kt
│ │ ├── Uri.kt
│ │ ├── WakeLock.kt
│ │ ├── extensions
│ │ ├── BundleExt.kt
│ │ ├── ContextExt.kt
│ │ ├── IntentExt.kt
│ │ ├── PackageManagerExt.kt
│ │ └── StringExt.kt
│ │ ├── io
│ │ └── InputStream.kt
│ │ └── utils
│ │ ├── DateUtils.kt
│ │ ├── DownloadManagerUtils.kt
│ │ ├── EmailUtils.kt
│ │ ├── EnumUtils.kt
│ │ ├── NumberUtils.kt
│ │ └── UserAgentUtils.kt
└── res
│ ├── values-de
│ └── strings.xml
│ ├── values-es
│ └── strings.xml
│ ├── values-fr
│ └── strings.xml
│ ├── values-it
│ └── strings.xml
│ └── values
│ └── strings.xml
└── test
└── kotlin
└── com
└── infomaniak
└── core
├── DynamicLazyMapCacheTest.kt
├── DynamicLazyMapTest.kt
└── FormatterFileSizeTest.kt
/.github/workflows/auto-author-assign.yml:
--------------------------------------------------------------------------------
1 | name: Auto Author Assign
2 |
3 | on:
4 | pull_request_target:
5 | types: [ opened, reopened ]
6 |
7 | permissions:
8 | pull-requests: write
9 |
10 | jobs:
11 | assign-author:
12 | runs-on: ubuntu-latest
13 | steps:
14 | - uses: toshimaru/auto-author-assign@v2.1.0
15 |
--------------------------------------------------------------------------------
/.github/workflows/dependent-issues.yml:
--------------------------------------------------------------------------------
1 | name: Dependent Issues
2 |
3 | on:
4 | issues:
5 | types:
6 | - opened
7 | - edited
8 | - closed
9 | - reopened
10 | pull_request_target:
11 | types:
12 | - opened
13 | - edited
14 | - closed
15 | - reopened
16 | # Makes sure we always add status check for PRs. Useful only if
17 | # this action is required to pass before merging. Otherwise, it
18 | # can be removed.
19 | - synchronize
20 |
21 | jobs:
22 | check:
23 | runs-on: ubuntu-latest
24 | steps:
25 | - uses: z0al/dependent-issues@v1.5.2
26 | env:
27 | # (Required) The token to use to make API calls to GitHub.
28 | GITHUB_TOKEN: ${{ github.token }}
29 |
--------------------------------------------------------------------------------
/.github/workflows/semantic-commit.yml:
--------------------------------------------------------------------------------
1 | name: 'PR and Commit Message Check'
2 | on:
3 | pull_request_target:
4 | types:
5 | - opened
6 | - edited
7 | - reopened
8 | - synchronize
9 |
10 | jobs:
11 | check-commit-message:
12 | name: Check Commit Message
13 | runs-on: ubuntu-latest
14 | steps:
15 | - name: Check Commit Message
16 | uses: gsactions/commit-message-checker@v2
17 | with:
18 | pattern: '^Merge .+|(^(feat|fix|chore|docs|style|refactor|perf|ci|test)(\(.+\))?: [A-Z0-9].+)'
19 | error: 'Commit messages and PR title should match conventional commit convention and start with an uppercase.'
20 | excludeDescription: 'true'
21 | excludeTitle: 'false'
22 | checkAllCommitMessages: 'true'
23 | accessToken: ${{ secrets.GITHUB_TOKEN }}
24 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.aab
2 | *.apk
3 | /app/release/baselineProfiles
4 | **/build
5 | **/captures
6 | .cxx
7 | .DS_Store
8 | env.properties
9 | .externalNativeBuild
10 | .gradle
11 | **/.idea
12 | *.iml
13 | .kotlin/errors
14 | .kotlin/sessions
15 | **/local.properties
16 |
--------------------------------------------------------------------------------
/AppIntegrity/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/AppIntegrity/consumer-rules.pro
--------------------------------------------------------------------------------
/AppIntegrity/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/AppIntegrity/src/main/kotlin/com/infomaniak/core/appintegrity/AppIntegrityRoutes.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.appintegrity
19 |
20 | object AppIntegrityRoutes {
21 |
22 | private val BASE_URL_V1 = "${BuildConfig.APP_INTEGRITY_BASE_URL}/1/attest"
23 |
24 | internal val requestChallenge = "$BASE_URL_V1/challenge"
25 | internal val requestApiIntegrityCheck = "$BASE_URL_V1/integrity"
26 | const val demo = "https://api-core.devd471.dev.infomaniak.ch/1/attest/demo"
27 | }
28 |
--------------------------------------------------------------------------------
/AppIntegrity/src/main/kotlin/com/infomaniak/core/appintegrity/exceptions/ApiException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.appintegrity.exceptions
19 |
20 | /**
21 | * Thrown when an API call fails due to an error identified by a specific error code.
22 | *
23 | * This exception is used to represent errors returned by an API, with an associated error code
24 | * and message describing the problem.
25 | *
26 | * @param errorCode The specific error code returned by the API.
27 | * @param errorMessage The detailed error message explaining the cause of the failure.
28 | */
29 | internal open class ApiException(val errorCode: String, errorMessage: String) : Exception(errorMessage)
30 |
--------------------------------------------------------------------------------
/AppIntegrity/src/main/kotlin/com/infomaniak/core/appintegrity/exceptions/AppIntegrityException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.appintegrity.exceptions
19 |
20 | /**
21 | * Thrown when any step of the App Integrity check fails
22 | *
23 | * @param message A detailed message describing the error.
24 | */
25 | class AppIntegrityException(message: String) : Exception(message)
26 |
--------------------------------------------------------------------------------
/AppIntegrity/src/main/kotlin/com/infomaniak/core/appintegrity/exceptions/IntegrityException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.appintegrity.exceptions
19 |
20 | /** An error has occurred when verified by api play integrity or our remote api */
21 | class IntegrityException(override val cause: Throwable? = null) : Exception()
22 |
--------------------------------------------------------------------------------
/AppIntegrity/src/main/kotlin/com/infomaniak/core/appintegrity/exceptions/NetworkException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.appintegrity.exceptions
19 |
20 | /**
21 | * Thrown when a network-related error occurs, such as connectivity issues or timeouts.
22 | *
23 | * @param message A detailed message describing the network error.
24 | */
25 | class NetworkException(message: String) : Exception(message)
26 |
--------------------------------------------------------------------------------
/AppIntegrity/src/main/kotlin/com/infomaniak/core/appintegrity/exceptions/UnexpectedApiErrorFormatException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.appintegrity.exceptions
19 |
20 | /**
21 | * Thrown when an API call returns an error in an unexpected format that cannot be parsed.
22 | *
23 | * This exception indicates that the API response format is different from what was expected,
24 | * preventing proper parsing of the error details.
25 | *
26 | * @param statusCode The HTTP status code returned by the API.
27 | * @param bodyResponse The raw response body from the API that could not be parsed.
28 | */
29 | internal class UnexpectedApiErrorFormatException(val statusCode: Int, val bodyResponse: String) : Exception(bodyResponse)
30 |
--------------------------------------------------------------------------------
/AppIntegrity/src/main/kotlin/com/infomaniak/core/appintegrity/exceptions/UnknownException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.appintegrity.exceptions
19 |
20 | /**
21 | * Represents an unknown exception that can occur during the execution of the application.
22 | *
23 | * This exception is used to encapsulate unexpected or unknown errors that are not covered
24 | * by other specific exception types.
25 | *
26 | * @property message The detailed message describing the error.
27 | * @property cause The underlying cause of this exception, if any.
28 | *
29 | * @constructor Creates an instance of `UnknownException` with a detailed error message and an optional cause.
30 | *
31 | * @param cause The underlying exception that caused this exception.
32 | */
33 | internal class UnknownException(cause: Throwable) : Exception(cause) {
34 | override val message: String = cause.message ?: cause.toString()
35 | }
36 |
--------------------------------------------------------------------------------
/AppIntegrity/src/main/kotlin/com/infomaniak/core/appintegrity/models/ApiError.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.appintegrity.models
19 |
20 | import kotlinx.serialization.Serializable
21 |
22 | @Serializable
23 | internal data class ApiError(
24 | val errorCode: String = "",
25 | val message: String = "",
26 | )
27 |
--------------------------------------------------------------------------------
/AppIntegrity/src/main/kotlin/com/infomaniak/core/appintegrity/models/ApiResponse.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.appintegrity.models
19 |
20 | import kotlinx.serialization.Serializable
21 |
22 | @Serializable
23 | internal data class ApiResponse(
24 | val result: ApiResponseStatus = ApiResponseStatus.UNKNOWN,
25 | val data: T? = null,
26 | val error: ApiError? = null,
27 | ) {
28 | fun isSuccess() = result == ApiResponseStatus.SUCCESS
29 | }
30 |
--------------------------------------------------------------------------------
/AppIntegrity/src/main/kotlin/com/infomaniak/core/appintegrity/models/ApiResponseStatus.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.appintegrity.models
19 |
20 | import kotlinx.serialization.SerialName
21 | import kotlinx.serialization.Serializable
22 |
23 | @Serializable
24 | internal enum class ApiResponseStatus {
25 |
26 | @SerialName("error")
27 | ERROR,
28 |
29 | @SerialName("success")
30 | SUCCESS,
31 |
32 | @SerialName("asynchronous")
33 | ASYNCHRONOUS,
34 |
35 | @SerialName("unknown")
36 | UNKNOWN;
37 | }
38 |
--------------------------------------------------------------------------------
/Compose/Basics/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | alias(core.plugins.compose.compiler)
5 | }
6 |
7 | val coreCompileSdk: Int by rootProject.extra
8 | val coreMinSdk: Int by rootProject.extra
9 | val javaVersion: JavaVersion by rootProject.extra
10 |
11 | android {
12 | namespace = "com.infomaniak.core.compose.basics"
13 | compileSdk = coreCompileSdk
14 |
15 | defaultConfig {
16 | minSdk = coreMinSdk
17 |
18 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
19 | consumerProguardFiles("consumer-rules.pro")
20 | }
21 |
22 | buildTypes {
23 | release {
24 | isMinifyEnabled = false
25 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
26 | }
27 | }
28 | compileOptions {
29 | sourceCompatibility = javaVersion
30 | targetCompatibility = javaVersion
31 | }
32 | buildFeatures {
33 | compose = true
34 | }
35 | composeOptions {
36 | kotlinCompilerExtensionVersion = "1.5.14"
37 | }
38 | kotlinOptions {
39 | jvmTarget = javaVersion.toString()
40 | }
41 | }
42 |
43 | dependencies {
44 | implementation(project(":Core"))
45 | implementation(platform(core.compose.bom))
46 | implementation(core.compose.runtime)
47 | implementation(core.compose.ui.tooling)
48 | implementation(core.splitties.collections)
49 | }
50 |
--------------------------------------------------------------------------------
/Compose/Basics/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Compose/Basics/consumer-rules.pro
--------------------------------------------------------------------------------
/Compose/Basics/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/Compose/Basics/src/main/kotlin/com/infomaniak/core/compose/basics/ScreenUtils.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.compose.basics
19 |
20 | import android.annotation.SuppressLint
21 | import android.content.pm.ActivityInfo
22 | import androidx.compose.runtime.Composable
23 | import androidx.compose.runtime.LaunchedEffect
24 | import androidx.compose.ui.platform.LocalContext
25 | import com.infomaniak.core.extensions.findActivity
26 |
27 | @Composable
28 | fun LockScreenOrientation(isLocked: Boolean) {
29 | if (!isLocked) return
30 |
31 | val context = LocalContext.current
32 | LaunchedEffect(Unit) {
33 | val activity = context.findActivity() ?: return@LaunchedEffect
34 |
35 | @SuppressLint("SourceLockedOrientationActivity")
36 | activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/FileTypes/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | alias(core.plugins.compose.compiler)
5 | }
6 |
7 | val coreCompileSdk: Int by rootProject.extra
8 | val coreMinSdk: Int by rootProject.extra
9 | val javaVersion: JavaVersion by rootProject.extra
10 |
11 | android {
12 | namespace = "com.infomaniak.core.filetypes"
13 | compileSdk = coreCompileSdk
14 |
15 | defaultConfig {
16 | minSdk = coreMinSdk
17 |
18 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
19 | consumerProguardFiles("consumer-rules.pro")
20 | }
21 |
22 | buildTypes {
23 | release {
24 | isMinifyEnabled = false
25 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
26 | }
27 | }
28 | compileOptions {
29 | sourceCompatibility = javaVersion
30 | targetCompatibility = javaVersion
31 | }
32 | kotlinOptions {
33 | jvmTarget = javaVersion.toString()
34 | }
35 | buildFeatures {
36 | compose = true
37 | }
38 | composeOptions {
39 | kotlinCompilerExtensionVersion = "1.5.14"
40 | }
41 | }
42 |
43 | dependencies {
44 | implementation(core.androidx.core.ktx)
45 | implementation(platform(core.compose.bom))
46 | implementation(core.compose.foundation)
47 | implementation(core.compose.ui)
48 | implementation(core.compose.ui.tooling.preview)
49 |
50 | testImplementation(core.junit)
51 | androidTestImplementation(core.androidx.junit)
52 | debugImplementation(core.compose.ui.tooling)
53 | }
54 |
--------------------------------------------------------------------------------
/FileTypes/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/FileTypes/consumer-rules.pro
--------------------------------------------------------------------------------
/FileTypes/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/FileTypes/src/main/kotlin/com/infomaniak/core/filetypes/FileTypeIcons.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.filetypes
19 |
20 | import androidx.compose.ui.unit.dp
21 |
22 | internal object FileTypeIcons {
23 | val previewSize = 250.dp
24 | }
25 |
--------------------------------------------------------------------------------
/FragmentNavigation/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | }
5 |
6 | val coreCompileSdk: Int by rootProject.extra
7 | val coreMinSdk: Int by rootProject.extra
8 | val javaVersion: JavaVersion by rootProject.extra
9 |
10 | android {
11 | namespace = "com.infomaniak.core.fragmentnavigation"
12 | compileSdk = coreCompileSdk
13 |
14 | defaultConfig {
15 | minSdk = coreMinSdk
16 |
17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18 | consumerProguardFiles("consumer-rules.pro")
19 | }
20 |
21 | buildTypes {
22 | release {
23 | isMinifyEnabled = false
24 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
25 | }
26 | }
27 | compileOptions {
28 | sourceCompatibility = javaVersion
29 | targetCompatibility = javaVersion
30 | }
31 | kotlinOptions {
32 | jvmTarget = javaVersion.toString()
33 | }
34 | }
35 |
36 | dependencies {
37 | implementation(core.androidx.core.ktx)
38 | implementation(core.navigation.fragment.ktx)
39 | }
40 |
--------------------------------------------------------------------------------
/FragmentNavigation/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/FragmentNavigation/consumer-rules.pro
--------------------------------------------------------------------------------
/FragmentNavigation/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/InAppReview/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | }
5 |
6 | val coreCompileSdk: Int by rootProject.extra
7 | val coreMinSdk: Int by rootProject.extra
8 | val javaVersion: JavaVersion by rootProject.extra
9 |
10 | android {
11 | namespace = "com.infomaniak.core.inappreview"
12 | compileSdk = coreCompileSdk
13 |
14 | defaultConfig {
15 | minSdk = coreMinSdk
16 |
17 | consumerProguardFiles("consumer-rules.pro")
18 | }
19 |
20 | buildTypes {
21 | release {
22 | isMinifyEnabled = false
23 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
24 | }
25 | debug {
26 |
27 | }
28 | }
29 |
30 | compileOptions {
31 | sourceCompatibility = javaVersion
32 | targetCompatibility = javaVersion
33 | }
34 |
35 | kotlinOptions {
36 | jvmTarget = javaVersion.toString()
37 | }
38 |
39 | flavorDimensions += "distribution"
40 | productFlavors {
41 | create("standard") {
42 | isDefault = true
43 | }
44 | create("fdroid")
45 | }
46 | }
47 |
48 | dependencies {
49 | implementation(project(":Core:WebView"))
50 | implementation(project(":Core:Sentry"))
51 | implementation(project(":Core"))
52 |
53 | implementation(core.play.review)
54 | implementation(core.play.review.ktx)
55 | implementation(core.androidx.datastore.preferences)
56 | implementation(core.appcompat)
57 | }
58 |
--------------------------------------------------------------------------------
/InAppReview/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/InAppReview/src/fdroid/kotlin/com/infomaniak/core/inappreview/reviewmanagers/InAppReviewManager.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.inappreview.reviewmanagers
19 |
20 | import androidx.activity.ComponentActivity
21 | import com.infomaniak.core.inappreview.BaseInAppReviewManager
22 |
23 | class InAppReviewManager(private val activity: ComponentActivity) : BaseInAppReviewManager(activity)
24 |
--------------------------------------------------------------------------------
/InAppStore/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | }
5 |
6 | val coreCompileSdk: Int by rootProject.extra
7 | val coreMinSdk: Int by rootProject.extra
8 | val javaVersion: JavaVersion by rootProject.extra
9 |
10 | android {
11 | namespace = "com.infomaniak.core.inappstore"
12 | compileSdk = coreCompileSdk
13 |
14 | defaultConfig {
15 | minSdk = coreMinSdk
16 |
17 | consumerProguardFiles("consumer-rules.pro")
18 | }
19 |
20 | buildTypes {
21 | release {
22 | isMinifyEnabled = false
23 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
24 | }
25 | }
26 |
27 | compileOptions {
28 | sourceCompatibility = javaVersion
29 | targetCompatibility = javaVersion
30 | }
31 |
32 | kotlinOptions {
33 | jvmTarget = javaVersion.toString()
34 | }
35 | }
36 |
37 | dependencies {
38 | implementation(project(":Core"))
39 | implementation(core.play.review)
40 | implementation(core.play.review.ktx)
41 | }
42 |
--------------------------------------------------------------------------------
/InAppStore/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/InAppStore/src/main/kotlin/com/infomaniak/core/inappstore/InAppStoreExt.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.inappstore
19 |
20 | import android.content.Context
21 | import com.google.android.play.core.review.ReviewManagerFactory
22 | import com.infomaniak.core.extensions.findActivity
23 |
24 | fun Context.openReviewBottomSheet() {
25 | val manager = ReviewManagerFactory.create(this)
26 | manager.requestReviewFlow().addOnCompleteListener { request ->
27 | val activity = findActivity() ?: return@addOnCompleteListener
28 | if (request.isSuccessful) {
29 | manager.launchReviewFlow(activity, request.result)
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Ktor/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | }
5 |
6 | val coreCompileSdk: Int by rootProject.extra
7 | val coreMinSdk: Int by rootProject.extra
8 | val javaVersion: JavaVersion by rootProject.extra
9 |
10 | android {
11 | namespace = "com.infomaniak.core.ktor"
12 | compileSdk = coreCompileSdk
13 |
14 | defaultConfig {
15 | minSdk = coreMinSdk
16 |
17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18 | consumerProguardFiles("consumer-rules.pro")
19 | }
20 |
21 | buildTypes {
22 | release {
23 | isMinifyEnabled = false
24 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
25 | }
26 | }
27 | compileOptions {
28 | sourceCompatibility = javaVersion
29 | targetCompatibility = javaVersion
30 | }
31 | kotlinOptions {
32 | jvmTarget = javaVersion.toString()
33 | }
34 | }
35 |
36 | dependencies {
37 | api(core.ktor.client.core)
38 | implementation(core.kotlinx.coroutines.core)
39 | }
40 |
--------------------------------------------------------------------------------
/Ktor/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Ktor/consumer-rules.pro
--------------------------------------------------------------------------------
/Ktor/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/Legacy/AppLock/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'androidx.navigation.safeargs.kotlin'
4 |
5 | def legacyCompileSdk = rootProject.ext["legacyCompileSdk"]
6 | def legacyMinSdk = rootProject.ext["legacyMinSdk"]
7 | def javaVersion = rootProject.ext["javaVersion"]
8 |
9 | android {
10 | namespace 'com.infomaniak.lib.applock'
11 | compileSdk legacyCompileSdk
12 |
13 | defaultConfig {
14 | minSdk legacyMinSdk
15 | targetSdk legacyCompileSdk
16 | }
17 |
18 | compileOptions {
19 | sourceCompatibility javaVersion
20 | targetCompatibility javaVersion
21 | }
22 |
23 | kotlinOptions { jvmTarget = javaVersion }
24 |
25 | buildFeatures { viewBinding true }
26 | }
27 |
28 | dependencies {
29 | implementation project(':Core:Legacy')
30 |
31 | implementation 'androidx.biometric:biometric-ktx:1.2.0-alpha05'
32 | implementation("com.louiscad.splitties:splitties-appctx:3.0.0")
33 | implementation("com.louiscad.splitties:splitties-mainhandler:3.0.0")
34 | implementation("com.louiscad.splitties:splitties-systemservices:3.0.0")
35 | }
36 |
--------------------------------------------------------------------------------
/Legacy/AppLock/src/main/res/values-de/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | Entsperren
20 | Anwendung gesperrt
21 |
22 |
--------------------------------------------------------------------------------
/Legacy/AppLock/src/main/res/values-es/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | Desbloquear
20 | Aplicación bloqueada
21 |
22 |
--------------------------------------------------------------------------------
/Legacy/AppLock/src/main/res/values-fr/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | Déverrouiller
20 | Application verrouillée
21 |
22 |
--------------------------------------------------------------------------------
/Legacy/AppLock/src/main/res/values-it/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | Sblocca
20 | Applicazione bloccata
21 |
22 |
--------------------------------------------------------------------------------
/Legacy/AppLock/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Legacy/AppLock/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | Unlock
20 | Application locked
21 |
22 |
--------------------------------------------------------------------------------
/Legacy/BugTracker/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'androidx.navigation.safeargs.kotlin'
4 |
5 | def legacyCompileSdk = rootProject.ext["legacyCompileSdk"]
6 | def legacyMinSdk = rootProject.ext["legacyMinSdk"]
7 | def javaVersion = rootProject.ext["javaVersion"]
8 |
9 | android {
10 | namespace 'com.infomaniak.lib.bugtracker'
11 | compileSdk legacyCompileSdk
12 |
13 | defaultConfig {
14 | minSdk legacyMinSdk
15 | targetSdk legacyCompileSdk
16 | }
17 |
18 | compileOptions {
19 | sourceCompatibility javaVersion
20 | targetCompatibility javaVersion
21 | }
22 |
23 | kotlinOptions { jvmTarget = javaVersion }
24 |
25 | buildFeatures { viewBinding true }
26 | }
27 |
28 | dependencies {
29 | implementation project(':Core:Legacy')
30 | }
31 |
--------------------------------------------------------------------------------
/Legacy/BugTracker/src/main/res/drawable/ic_bug_tracker_close.xml:
--------------------------------------------------------------------------------
1 |
18 |
24 |
27 |
28 |
--------------------------------------------------------------------------------
/Legacy/Confetti/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'kotlin-android'
3 |
4 | def legacyCompileSdk = rootProject.ext["legacyCompileSdk"]
5 | def legacyMinSdk = rootProject.ext["legacyMinSdk"]
6 | def javaVersion = rootProject.ext["javaVersion"]
7 |
8 | android {
9 | namespace 'com.infomaniak.lib.confetti'
10 | compileSdk legacyCompileSdk
11 |
12 | defaultConfig {
13 | minSdkVersion legacyMinSdk
14 | targetSdkVersion legacyCompileSdk
15 | }
16 |
17 | compileOptions {
18 | sourceCompatibility javaVersion
19 | targetCompatibility javaVersion
20 | }
21 |
22 | kotlinOptions { jvmTarget = javaVersion }
23 |
24 | dependencies {
25 | implementation project(':Core:Legacy')
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Legacy/Confetti/src/main/java/com/infomaniak/lib/confetti/ConfettoGenerator.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2023-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.confetti
19 |
20 | import com.infomaniak.lib.confetti.confetto.Confetto
21 | import java.util.Random
22 |
23 | fun interface ConfettoGenerator {
24 | /**
25 | * Generate a random confetto to animate.
26 | *
27 | * @param random a [Random] that can be used to generate random confetto.
28 | * @return the randomly generated confetto.
29 | */
30 | fun generateConfetto(random: Random): Confetto
31 | }
32 |
--------------------------------------------------------------------------------
/Legacy/Confetti/src/main/java/com/infomaniak/lib/confetti/confetto/BitmapConfetto.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2023-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.confetti.confetto
19 |
20 | import android.graphics.Bitmap
21 | import android.graphics.Canvas
22 | import android.graphics.Matrix
23 | import android.graphics.Paint
24 |
25 | open class BitmapConfetto(private val bitmap: Bitmap) : Confetto() {
26 |
27 | private val bitmapCenterX: Float = bitmap.width / 2.0f
28 | private val bitmapCenterY: Float = bitmap.height / 2.0f
29 |
30 | override val width: Int get() = bitmap.width
31 |
32 | override val height: Int get() = bitmap.height
33 |
34 | override fun drawInternal(
35 | canvas: Canvas,
36 | matrix: Matrix,
37 | paint: Paint,
38 | x: Float,
39 | y: Float,
40 | rotation: Float,
41 | percentAnimated: Float,
42 | ) {
43 | matrix.preTranslate(x, y)
44 | matrix.preRotate(rotation, bitmapCenterX, bitmapCenterY)
45 | canvas.drawBitmap(bitmap, matrix, paint)
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Legacy/Confetti/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | 9999dp
20 | 6dp
21 | 100dp
22 | 20dp
23 | 50dp
24 | 100dp
25 | 200dp
26 | 275dp
27 | 2375dp
28 |
29 |
--------------------------------------------------------------------------------
/Legacy/Stores/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'androidx.navigation.safeargs.kotlin'
4 |
5 | def legacyCompileSdk = rootProject.ext["legacyCompileSdk"]
6 | def legacyMinSdk = rootProject.ext["legacyMinSdk"]
7 | def javaVersion = rootProject.ext["javaVersion"]
8 |
9 | android {
10 | namespace 'com.infomaniak.lib.stores'
11 | compileSdk legacyCompileSdk
12 |
13 | defaultConfig {
14 | minSdk legacyMinSdk
15 | targetSdk legacyCompileSdk
16 | }
17 |
18 | compileOptions {
19 | sourceCompatibility javaVersion
20 | targetCompatibility javaVersion
21 | }
22 |
23 | kotlinOptions { jvmTarget = javaVersion }
24 |
25 | buildFeatures { viewBinding true }
26 |
27 | flavorDimensions += 'distribution'
28 | productFlavors {
29 | standard { getIsDefault().set(true) }
30 | fdroid
31 | }
32 | }
33 |
34 | dependencies {
35 | implementation project(':Core:Legacy')
36 |
37 | // Version 1.1.5 has some issues so we have to use the alpha version for now
38 | api 'androidx.datastore:datastore-preferences:1.2.0-alpha02'
39 |
40 | implementation 'androidx.work:work-runtime-ktx:2.9.1' // Doesn't build when bumped to 2.10.0 (waiting for Api 35)
41 | implementation 'androidx.concurrent:concurrent-futures-ktx:1.2.0'
42 |
43 | def appReviewVersion = '2.0.2'
44 | standardImplementation "com.google.android.play:review:$appReviewVersion"
45 | standardImplementation "com.google.android.play:review-ktx:$appReviewVersion"
46 |
47 | def appUpdateVersion = "2.1.0"
48 | standardImplementation "com.google.android.play:app-update:$appUpdateVersion"
49 | standardImplementation "com.google.android.play:app-update-ktx:$appUpdateVersion"
50 | }
51 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/fdroid/java/com/infomaniak/lib/stores/AppUpdateScheduler.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.stores
19 |
20 | import android.content.Context
21 | import androidx.work.WorkManager
22 |
23 | class AppUpdateScheduler(
24 | appContext: Context,
25 | workManager: WorkManager = WorkManager.getInstance(appContext),
26 | ) : UpdateScheduler(appContext, workManager)
27 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/fdroid/java/com/infomaniak/lib/stores/StoreUtils.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2023-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.stores
19 |
20 | import com.infomaniak.lib.stores.updaterequired.data.models.AppVersion.Store
21 |
22 | object StoreUtils : StoresUtils {
23 |
24 | const val APP_UPDATE_TAG = "appUpdateFDroid"
25 | override val REQUIRED_UPDATE_STORE = Store.FDROID
26 | }
27 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/fdroid/java/com/infomaniak/lib/stores/reviewmanagers/InAppReviewManager.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.stores.reviewmanagers
19 |
20 | import androidx.fragment.app.FragmentActivity
21 | import com.infomaniak.lib.stores.BaseInAppReviewManager
22 |
23 | class InAppReviewManager(
24 | private val activity: FragmentActivity,
25 | private val reviewDialogTheme: Int,
26 | private val reviewDialogTitleResId: Int,
27 | private val feedbackUrlResId: Int,
28 | ) : BaseInAppReviewManager(activity)
29 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/fdroid/java/com/infomaniak/lib/stores/updatemanagers/WorkerUpdateManager.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.stores.updatemanagers
19 |
20 | import android.content.Context
21 |
22 | internal class WorkerUpdateManager(appContext: Context) {
23 |
24 | fun installDownloadedUpdate(onInstallFailure: (Exception) -> Unit, onInstallSuccess: () -> Unit) = Unit
25 | }
26 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
18 |
20 |
21 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/java/com/infomaniak/lib/stores/BaseInAppReviewManager.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.stores
19 |
20 | import androidx.fragment.app.FragmentActivity
21 | import androidx.lifecycle.DefaultLifecycleObserver
22 | import androidx.lifecycle.ViewModelProvider
23 |
24 | abstract class BaseInAppReviewManager(private val activity: FragmentActivity) : DefaultLifecycleObserver {
25 |
26 | protected val viewModel: StoresViewModel by lazy { ViewModelProvider(activity)[StoresViewModel::class.java] }
27 |
28 | open fun init(
29 | onDialogShown: (() -> Unit)? = null,
30 | onUserWantToReview: (() -> Unit)? = null,
31 | onUserWantToGiveFeedback: (() -> Unit)? = null,
32 | ) = Unit
33 | }
34 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/java/com/infomaniak/lib/stores/UpdateScheduler.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.stores
19 |
20 | import android.content.Context
21 | import androidx.work.WorkManager
22 |
23 | open class UpdateScheduler(
24 | appContext: Context,
25 | private val workManager: WorkManager = WorkManager.getInstance(appContext),
26 | ) {
27 |
28 | open fun scheduleWorkIfNeeded() = Unit
29 |
30 | open suspend fun cancelWorkIfNeeded() = Unit
31 | }
32 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/java/com/infomaniak/lib/stores/updaterequired/data/api/ApiRepositoryStores.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.stores.updaterequired.data.api
19 |
20 | import com.infomaniak.lib.core.api.ApiController
21 | import com.infomaniak.lib.core.api.ApiController.ApiMethod
22 | import com.infomaniak.lib.core.models.ApiResponse
23 | import com.infomaniak.lib.stores.updaterequired.data.models.AppVersion
24 | import okhttp3.OkHttpClient
25 |
26 | object ApiRepositoryStores {
27 |
28 | suspend fun getAppVersion(appName: String, okHttpClient: OkHttpClient): ApiResponse {
29 | return ApiController.callApi(ApiRoutesStores.appVersion(appName), ApiMethod.GET, okHttpClient = okHttpClient)
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/java/com/infomaniak/lib/stores/updaterequired/data/api/ApiRoutesStores.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.stores.updaterequired.data.api
19 |
20 | import com.infomaniak.lib.core.BuildConfig
21 | import com.infomaniak.lib.stores.StoreUtils
22 | import com.infomaniak.lib.stores.updaterequired.data.models.AppVersion.Platform
23 |
24 | object ApiRoutesStores {
25 |
26 | fun appVersion(appName: String): String {
27 | val store = StoreUtils.REQUIRED_UPDATE_STORE.apiValue
28 | val platform = Platform.ANDROID.apiValue
29 |
30 | val parameters = "?only=min_version,published_versions.tag&filter_versions[]=production"
31 |
32 | return "${BuildConfig.INFOMANIAK_API_V1}/app-information/versions/$store/$platform/$appName$parameters"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/java/com/infomaniak/lib/stores/updaterequired/data/models/AppPublishedVersion.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.stores.updaterequired.data.models
19 |
20 | import kotlinx.serialization.Serializable
21 |
22 | @Serializable
23 | data class AppPublishedVersion(var tag: String)
24 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/res/layout/alert_dialog_review.xml:
--------------------------------------------------------------------------------
1 |
18 |
27 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/res/navigation/update_required_navigation.xml:
--------------------------------------------------------------------------------
1 |
18 |
23 |
24 |
29 |
32 |
35 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/res/values-de/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | Kein Update verfügbar
20 | Installieren
21 | Ihre Version der Anwendung wird nicht mehr unterstützt.\nInstallieren Sie die neueste Version und profitieren Sie von den neuesten Verbesserungen und Neuerungen.
22 |
23 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/res/values-es/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | No hay actualizaciones disponibles
20 | Instalar
21 | Su versión de la aplicación ya no es compatible.\nInstale la última versión y aproveche las últimas mejoras y nuevas funciones.
22 |
23 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/res/values-fr/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | Aucune mise à jour disponible
20 | Installer
21 | Votre version de l’application n’est plus supportée.\nInstallez la dernière version et profitez des dernières améliorations et nouveautés.
22 |
23 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/res/values-it/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | Nessun aggiornamento disponibile
20 | Installa
21 | La versione dell’applicazione in uso non è più supportata.\nInstalla la versione più recente e approfitta degli ultimi miglioramenti e delle nuove funzionalità.
22 |
23 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | No available update
20 | Install
21 | Your application version is no longer supported.\nInstall the latest version and benefit from the latest enhancements and new features.
22 |
23 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Legacy/Stores/src/standard/java/com/infomaniak/lib/stores/StoreUtils.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2023-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.stores
19 |
20 | import androidx.fragment.app.FragmentActivity
21 | import com.google.android.play.core.install.model.AppUpdateType
22 | import com.google.android.play.core.review.ReviewManagerFactory
23 | import com.infomaniak.lib.stores.updaterequired.data.models.AppVersion.Store
24 |
25 | object StoreUtils : StoresUtils {
26 |
27 | const val APP_UPDATE_TAG = "inAppUpdate"
28 | const val DEFAULT_UPDATE_TYPE = AppUpdateType.FLEXIBLE
29 | override val REQUIRED_UPDATE_STORE = Store.PLAY_STORE
30 |
31 | //region In-App Review
32 | override fun FragmentActivity.launchInAppReview() {
33 | ReviewManagerFactory.create(this).apply {
34 | requestReviewFlow().addOnCompleteListener { request ->
35 | if (request.isSuccessful) launchReviewFlow(this@launchInAppReview, request.result)
36 | }
37 | }
38 | }
39 | //endregion
40 | }
41 |
--------------------------------------------------------------------------------
/Legacy/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
18 |
20 |
21 |
22 |
25 |
26 |
31 |
32 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/api/ApiRepositoryCore.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2022-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.api
19 |
20 | import com.infomaniak.lib.core.models.ApiResponse
21 | import com.infomaniak.lib.core.models.user.User
22 | import okhttp3.OkHttpClient
23 |
24 | abstract class ApiRepositoryCore {
25 |
26 | suspend fun getUserProfile(
27 | okHttpClient: OkHttpClient,
28 | withEmails: Boolean = false,
29 | withPhones: Boolean = false,
30 | withSecurity: Boolean = false,
31 | ): ApiResponse {
32 | var with = ""
33 | if (withEmails) with += "emails"
34 | if (withPhones) with += "phones"
35 | if (withSecurity) with += "security"
36 | if (with.isNotEmpty()) with = "?with=$with"
37 |
38 | val url = "${ApiRoutesCore.getUserProfile()}$with"
39 | return ApiController.callApi(url, ApiController.ApiMethod.GET, okHttpClient = okHttpClient)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/api/ApiRoutesCore.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2022-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.api
19 |
20 | import com.infomaniak.lib.core.BuildConfig.INFOMANIAK_API
21 |
22 | object ApiRoutesCore {
23 |
24 | fun getUserProfile(): String {
25 | return "${INFOMANIAK_API}profile?no_avatar_default=1"
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/api/InternalTranslatedErrorCode.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.api
19 |
20 | import androidx.annotation.StringRes
21 | import com.infomaniak.lib.core.R
22 | import com.infomaniak.lib.core.utils.ErrorCodeTranslated
23 |
24 | enum class InternalTranslatedErrorCode(
25 | override val code: String,
26 | @StringRes override val translateRes: Int,
27 | ) : ErrorCodeTranslated {
28 | NoConnection("no_connection", R.string.noConnection),
29 | ConnectionError("connection_error", R.string.connectionError),
30 | UnknownError("an_error_has_occurred", R.string.anErrorHasOccurred),
31 | UserAlreadyPresent("user_already_present", R.string.errorUserAlreadyPresent),
32 | }
33 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/auth/TokenInterceptorListener.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2022-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.auth
19 |
20 | import com.infomaniak.lib.login.ApiToken
21 |
22 | interface TokenInterceptorListener {
23 | suspend fun onRefreshTokenSuccess(apiToken: ApiToken)
24 | suspend fun onRefreshTokenError()
25 | suspend fun getApiToken(): ApiToken?
26 | fun getCurrentUserId(): Int?
27 | }
28 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/fdroidTools/FdroidRelease.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2023-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.fdroidTools
19 |
20 | import kotlinx.serialization.Serializable
21 |
22 | @Serializable
23 | data class FdroidRelease(
24 | val packageName: String,
25 | val suggestedVersionCode: Int,
26 | val packages: List,
27 | ) {
28 | @Serializable
29 | data class FdroidPackages(
30 | val versionName: String,
31 | val versionCode: Int,
32 | )
33 | }
34 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/githubTools/GitHubRelease.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2023-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.githubTools
19 |
20 | import kotlinx.serialization.SerialName
21 | import kotlinx.serialization.Serializable
22 |
23 | @Serializable
24 | data class GitHubRelease(
25 | @SerialName("tag_name")
26 | val tagName: String,
27 | val name: String,
28 | val draft: Boolean,
29 | val prerelease: Boolean,
30 | )
31 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/models/ApiError.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2022-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.models
19 |
20 | import com.google.gson.annotations.SerializedName
21 | import kotlinx.serialization.Contextual
22 | import kotlinx.serialization.SerialName
23 | import kotlinx.serialization.Serializable
24 | import kotlinx.serialization.json.JsonObject
25 | import com.google.gson.JsonObject as GsonObject
26 |
27 | @Serializable
28 | class ApiError(
29 | val code: String? = null,
30 | val description: String? = null,
31 | @Contextual
32 | @SerializedName("context")
33 | var contextGson: GsonObject? = null,
34 | @Contextual
35 | @SerialName("context")
36 | var contextJson: JsonObject? = null,
37 | val errors: Array? = null,
38 | @Contextual
39 | val exception: Exception? = null
40 | )
41 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/models/ApiResponseStatus.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2023-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.models
19 |
20 | import com.google.gson.annotations.SerializedName
21 | import kotlinx.serialization.SerialName
22 | import kotlinx.serialization.Serializable
23 |
24 | @Serializable
25 | enum class ApiResponseStatus {
26 |
27 | @SerialName("error")
28 | @SerializedName("error")
29 | ERROR,
30 |
31 | @SerialName("success")
32 | @SerializedName("success")
33 | SUCCESS,
34 |
35 | @SerialName("asynchronous")
36 | @SerializedName("asynchronous")
37 | ASYNCHRONOUS,
38 |
39 | @SerialName("redirect")
40 | @SerializedName("redirect")
41 | REDIRECT,
42 |
43 | @SerialName("unknown")
44 | @SerializedName("unknown")
45 | UNKNOWN;
46 | }
47 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/models/user/ContactMethod.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2022-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.models.user
19 |
20 | import com.google.gson.annotations.SerializedName
21 |
22 | abstract class ContactMethod(
23 | val id: Int = 0,
24 | @SerializedName("created_at")
25 | val createdAt: Long = 0,
26 | val reminder: Boolean = false,
27 | val checked: Boolean = false,
28 | val type: String = "",
29 | )
30 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/models/user/Email.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2022-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.models.user
19 |
20 | import android.os.Parcelable
21 | import kotlinx.parcelize.Parcelize
22 |
23 | @Parcelize
24 | data class Email(
25 | val email: String,
26 | ) : ContactMethod(), Parcelable
27 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/models/user/Phone.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2022-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.models.user
19 |
20 | import android.os.Parcelable
21 | import kotlinx.parcelize.Parcelize
22 |
23 | @Parcelize
24 | data class Phone(
25 | val phone: String,
26 | ) : ContactMethod(), Parcelable
27 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/models/user/preferences/Country.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2022-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.models.user.preferences
19 |
20 | import android.os.Parcelable
21 | import androidx.room.ColumnInfo
22 | import com.google.gson.annotations.SerializedName
23 | import kotlinx.parcelize.Parcelize
24 |
25 | @Parcelize
26 | data class Country(
27 | @SerializedName("short_name")
28 | @ColumnInfo(defaultValue = "")
29 | var shortName: String,
30 | @SerializedName("is_enabled")
31 | @ColumnInfo(defaultValue = "false")
32 | var isEnabled: Boolean,
33 | ) : PreferenceTemplate(), Parcelable
34 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/models/user/preferences/Language.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2022-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.models.user.preferences
19 |
20 | import android.os.Parcelable
21 | import androidx.room.ColumnInfo
22 | import com.google.gson.annotations.SerializedName
23 | import kotlinx.parcelize.Parcelize
24 |
25 | @Parcelize
26 | data class Language(
27 | @SerializedName("short_name")
28 | @ColumnInfo(defaultValue = "")
29 | var shortName: String,
30 | @ColumnInfo(defaultValue = "")
31 | var locale: String,
32 | @SerializedName("short_locale")
33 | @ColumnInfo(defaultValue = "")
34 | var shortLocale: String,
35 | ) : PreferenceTemplate(), Parcelable
36 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/models/user/preferences/OrganizationPreference.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2022-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.models.user.preferences
19 |
20 | import android.os.Parcelable
21 | import androidx.room.ColumnInfo
22 | import com.google.gson.annotations.SerializedName
23 | import kotlinx.parcelize.Parcelize
24 |
25 | @Parcelize
26 | data class OrganizationPreference(
27 | @SerializedName("current_account_id")
28 | @ColumnInfo(defaultValue = "0")
29 | var currentOrganizationId: Int,
30 | @SerializedName("last_login_at")
31 | @ColumnInfo(defaultValue = "0")
32 | var lastLoginAt: Long,
33 | ) : Parcelable
34 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/models/user/preferences/PreferenceTemplate.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2022-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.models.user.preferences
19 |
20 | import androidx.room.ColumnInfo
21 |
22 | abstract class PreferenceTemplate(
23 | @ColumnInfo(defaultValue = "0")
24 | var id: Int = 0,
25 | @ColumnInfo(defaultValue = "")
26 | var name: String = "",
27 | )
28 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/models/user/preferences/Preferences.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2022-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.models.user.preferences
19 |
20 | import android.os.Parcelable
21 | import androidx.room.Embedded
22 | import com.google.gson.annotations.SerializedName
23 | import com.infomaniak.lib.core.models.user.preferences.security.Security
24 | import kotlinx.parcelize.Parcelize
25 |
26 | @Parcelize
27 | data class Preferences(
28 | @Embedded(prefix = "security_")
29 | var security: Security?,
30 | @Embedded(prefix = "organizationPreference_")
31 | @SerializedName("account")
32 | var organizationPreference: OrganizationPreference,
33 | @Embedded(prefix = "language_")
34 | var language: Language,
35 | @Embedded(prefix = "country_")
36 | var country: Country,
37 | @Embedded(prefix = "timezone_")
38 | var timezone: TimeZone?,
39 | ) : Parcelable
40 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/models/user/preferences/TimeZone.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2022-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.models.user.preferences
19 |
20 | import android.os.Parcelable
21 | import androidx.room.ColumnInfo
22 | import kotlinx.parcelize.Parcelize
23 |
24 | @Parcelize
25 | data class TimeZone(
26 | @ColumnInfo(defaultValue = "")
27 | var gmt: String,
28 | ) : PreferenceTemplate(), Parcelable
29 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/models/user/preferences/security/AuthDevices.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2022-2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.models.user.preferences.security
19 |
20 | import android.os.Parcelable
21 | import com.google.gson.annotations.SerializedName
22 | import kotlinx.parcelize.Parcelize
23 |
24 | @Parcelize
25 | data class AuthDevices(
26 | var id: Int,
27 | var name: String,
28 | @SerializedName("last_connexion")
29 | var lastConnexion: Long,
30 | @SerializedName("user_agent")
31 | var userAgent: String,
32 | @SerializedName("user_ip")
33 | var userIp: String,
34 | var device: String,
35 | @SerializedName("created_at")
36 | var createdAt: Long,
37 | @SerializedName("updated_at")
38 | var updatedAt: Long,
39 | @SerializedName("deleted_at")
40 | var deletedAt: Long?,
41 | ) : Parcelable
42 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/utils/ApiTokenExt.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.lib.core.utils
19 |
20 | import com.infomaniak.lib.login.ApiToken
21 |
22 | object ApiTokenExt {
23 | val ApiToken.isInfinite get() = refreshToken == null
24 | }
25 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/views/LoaderConstant.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright 2016 Elye Project
4 | * Copyright (C) 2022-2024 Infomaniak Network SA
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package com.infomaniak.lib.core.views
19 |
20 | import android.graphics.Color
21 |
22 | internal object LoaderConstant {
23 | val COLOR_DEFAULT_GRADIENT = Color.rgb(245, 245, 245)
24 | const val MIN_WEIGHT = 0.0f
25 | const val MAX_WEIGHT = 1.0f
26 | const val CORNER_DEFAULT = 0
27 | const val USE_GRADIENT_DEFAULT = false
28 | }
29 |
--------------------------------------------------------------------------------
/Legacy/src/main/java/com/infomaniak/lib/core/views/LoaderView.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright 2016 Elye Project
4 | * Copyright (C) 2022-2024 Infomaniak Network SA
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package com.infomaniak.lib.core.views
19 |
20 | import android.graphics.Paint
21 |
22 | internal interface LoaderView {
23 | fun setRectColor(rectPaint: Paint)
24 | fun invalidate()
25 | fun valueSet(): Boolean
26 | }
27 |
--------------------------------------------------------------------------------
/Legacy/src/main/res/drawable-hdpi/splashscreen_branding_image_legacy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/drawable-hdpi/splashscreen_branding_image_legacy.png
--------------------------------------------------------------------------------
/Legacy/src/main/res/drawable-mdpi/splashscreen_branding_image_legacy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/drawable-mdpi/splashscreen_branding_image_legacy.png
--------------------------------------------------------------------------------
/Legacy/src/main/res/drawable-night-hdpi/splashscreen_branding_image_legacy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/drawable-night-hdpi/splashscreen_branding_image_legacy.png
--------------------------------------------------------------------------------
/Legacy/src/main/res/drawable-night-mdpi/splashscreen_branding_image_legacy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/drawable-night-mdpi/splashscreen_branding_image_legacy.png
--------------------------------------------------------------------------------
/Legacy/src/main/res/drawable-night-xhdpi/splashscreen_branding_image_legacy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/drawable-night-xhdpi/splashscreen_branding_image_legacy.png
--------------------------------------------------------------------------------
/Legacy/src/main/res/drawable-night-xxhdpi/splashscreen_branding_image_legacy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/drawable-night-xxhdpi/splashscreen_branding_image_legacy.png
--------------------------------------------------------------------------------
/Legacy/src/main/res/drawable-night-xxxhdpi/splashscreen_branding_image_legacy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/drawable-night-xxxhdpi/splashscreen_branding_image_legacy.png
--------------------------------------------------------------------------------
/Legacy/src/main/res/drawable-xhdpi/splashscreen_branding_image_legacy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/drawable-xhdpi/splashscreen_branding_image_legacy.png
--------------------------------------------------------------------------------
/Legacy/src/main/res/drawable-xxhdpi/splashscreen_branding_image_legacy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/drawable-xxhdpi/splashscreen_branding_image_legacy.png
--------------------------------------------------------------------------------
/Legacy/src/main/res/drawable-xxxhdpi/splashscreen_branding_image_legacy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/drawable-xxxhdpi/splashscreen_branding_image_legacy.png
--------------------------------------------------------------------------------
/Legacy/src/main/res/drawable/placeholder.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Legacy/src/main/res/font/suisseintl_bold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/font/suisseintl_bold.otf
--------------------------------------------------------------------------------
/Legacy/src/main/res/font/suisseintl_medium.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/font/suisseintl_medium.otf
--------------------------------------------------------------------------------
/Legacy/src/main/res/font/suisseintl_regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/font/suisseintl_regular.otf
--------------------------------------------------------------------------------
/Legacy/src/main/res/font/suisseintl_regular_italic.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/font/suisseintl_regular_italic.otf
--------------------------------------------------------------------------------
/Legacy/src/main/res/font/suisseintl_semibold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Legacy/src/main/res/font/suisseintl_semibold.otf
--------------------------------------------------------------------------------
/Legacy/src/main/res/layout/activity_webview.xml:
--------------------------------------------------------------------------------
1 |
18 |
22 |
23 |
27 |
28 |
--------------------------------------------------------------------------------
/Legacy/src/main/res/layout/item_loading.xml:
--------------------------------------------------------------------------------
1 |
18 |
21 |
--------------------------------------------------------------------------------
/Legacy/src/main/res/values-night/colors.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 | #9E9E9E
21 | @android:color/white
22 |
23 |
24 | #2D2E30
25 | #131415
26 | #242424
27 | #6F7071
28 | #222324
29 |
30 |
31 | #666666
32 | #777777
33 |
34 |
--------------------------------------------------------------------------------
/Legacy/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Legacy/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | 110dp
20 | 60dp
21 | 6dp
22 | 48dp
23 | 24dp
24 | 16dp
25 | 8dp
26 | 4dp
27 | 10dp
28 | 120dp
29 | 180dp
30 |
31 |
--------------------------------------------------------------------------------
/Matomo/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | }
5 |
6 | val coreCompileSdk: Int by rootProject.extra
7 | val coreMinSdk: Int by rootProject.extra
8 | val javaVersion: JavaVersion by rootProject.extra
9 |
10 | android {
11 | namespace = "com.infomaniak.core.matomo"
12 | compileSdk = coreCompileSdk
13 |
14 | defaultConfig {
15 | minSdk = coreMinSdk
16 |
17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18 | consumerProguardFiles("consumer-rules.pro")
19 |
20 | buildConfigField("String", "MATOMO_URL", "\"https://analytics.infomaniak.com/matomo.php\"")
21 | }
22 |
23 | buildTypes {
24 | release {
25 | isMinifyEnabled = false
26 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
27 | }
28 | }
29 |
30 | compileOptions {
31 | sourceCompatibility = javaVersion
32 | targetCompatibility = javaVersion
33 | }
34 |
35 | buildFeatures {
36 | buildConfig = true
37 | }
38 |
39 | kotlinOptions {
40 | jvmTarget = javaVersion.toString()
41 | }
42 | }
43 |
44 | dependencies {
45 | api(core.matomo)
46 | implementation(core.splitties.appctx)
47 | }
48 |
--------------------------------------------------------------------------------
/Matomo/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Matomo/consumer-rules.pro
--------------------------------------------------------------------------------
/Matomo/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MyKSuite/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/MyKSuite/consumer-rules.pro
--------------------------------------------------------------------------------
/MyKSuite/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.kts.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/java/com/infomaniak/core/myksuite/ui/components/MyKSuiteGradient.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.myksuite.ui.components
19 |
20 | import androidx.compose.foundation.BorderStroke
21 | import androidx.compose.ui.geometry.Offset
22 | import androidx.compose.ui.graphics.Brush
23 | import androidx.compose.ui.graphics.Color
24 | import androidx.compose.ui.unit.dp
25 |
26 | internal fun myKSuiteGradient() = BorderStroke(
27 | width = 1.dp,
28 | brush = Brush.linearGradient(
29 | 0.0f to Color(0xFF1DDDFD),
30 | 0.3f to Color(0xFF337CFF),
31 | 0.5f to Color(0xFFA055FC),
32 | 0.7f to Color(0xFFF34BBB),
33 | 1.0f to Color(0xFFFD8C3D),
34 | start = Offset.Zero,
35 | end = Offset(Float.POSITIVE_INFINITY, 0.0f),
36 | ),
37 | )
38 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/java/com/infomaniak/core/myksuite/ui/components/WeightOneSpacer.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.myksuite.ui.components
19 |
20 | import androidx.compose.foundation.layout.*
21 | import androidx.compose.runtime.Composable
22 | import androidx.compose.ui.Modifier
23 | import androidx.compose.ui.unit.Dp
24 |
25 | // TODO Add in CoreUi
26 | @Composable
27 | fun ColumnScope.WeightOneSpacer(minHeight: Dp) {
28 | Spacer(Modifier.height(minHeight))
29 | Spacer(Modifier.weight(1.0f))
30 | }
31 |
32 | @Composable
33 | fun RowScope.WeightOneSpacer(minWidth: Dp) {
34 | Spacer(Modifier.width(minWidth))
35 | Spacer(Modifier.weight(1.0f))
36 | }
37 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/java/com/infomaniak/core/myksuite/ui/data/MyKSuiteDataDao.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.myksuite.ui.data
19 |
20 | import androidx.room.Dao
21 | import androidx.room.Delete
22 | import androidx.room.Query
23 | import androidx.room.Upsert
24 |
25 | @Dao
26 | interface MyKSuiteDataDao {
27 | @Query("SELECT * FROM MyKSuiteData WHERE id = :id LIMIT 1")
28 | suspend fun findById(id: Int): MyKSuiteData?
29 |
30 | @Query("SELECT * FROM MyKSuiteData WHERE user_id = :userId LIMIT 1")
31 | suspend fun findByUserId(userId: Int): MyKSuiteData?
32 |
33 | @Upsert
34 | suspend fun upsert(data: MyKSuiteData)
35 |
36 | @Delete
37 | suspend fun delete(data: MyKSuiteData)
38 | }
39 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/java/com/infomaniak/core/myksuite/ui/data/kSuiteDrive.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.myksuite.ui.data
19 |
20 | import androidx.room.ColumnInfo
21 | import kotlinx.serialization.SerialName
22 | import kotlinx.serialization.Serializable
23 |
24 | @Serializable
25 | data class KSuiteDrive(
26 | val id: Int,
27 | val name: String,
28 | val size: Long,
29 | @SerialName("used_size")
30 | @ColumnInfo("used_size")
31 | val usedSize: Long,
32 | )
33 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/java/com/infomaniak/core/myksuite/ui/data/kSuiteMail.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.myksuite.ui.data
19 |
20 | import androidx.room.ColumnInfo
21 | import kotlinx.serialization.SerialName
22 | import kotlinx.serialization.Serializable
23 |
24 | @Serializable
25 | data class KSuiteMail(
26 | val id: Int,
27 | val email: String,
28 | @SerialName("daily_limit_sent")
29 | @ColumnInfo("daily_limit_sent")
30 | val dailyLimitSent: Int,
31 | @SerialName("storage_size_limit")
32 | @ColumnInfo("storage_size_limit")
33 | val storageSizeLimit: Long,
34 | @SerialName("used_size")
35 | @ColumnInfo("used_size")
36 | val usedSize: Long,
37 | @SerialName("mailbox_id")
38 | @ColumnInfo("mailbox_id")
39 | val mailboxId: Int,
40 | )
41 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/java/com/infomaniak/core/myksuite/ui/network/ApiRoutes.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.myksuite.ui.network
19 |
20 | object ApiRoutes {
21 |
22 | const val MANAGER_URL = "https://manager.infomaniak.com/v3/ng/home"
23 |
24 | private const val BASE_URL = "https://api.infomaniak.com"
25 |
26 | fun myKSuiteData() = "$BASE_URL/1/my_ksuite/current?with=drive,mail"
27 | }
28 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/java/com/infomaniak/core/myksuite/ui/screens/components/MyKSuiteButtonType.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.myksuite.ui.screens.components
19 |
20 | import androidx.compose.foundation.shape.RoundedCornerShape
21 | import androidx.compose.ui.graphics.Shape
22 | import androidx.compose.ui.unit.dp
23 | import com.infomaniak.core.myksuite.ui.theme.Dimens
24 |
25 | internal enum class MyKSuiteButtonType(val shape: Shape) {
26 | Mail(shape = RoundedCornerShape(Dimens.largeCornerRadius)),
27 | Drive(shape = RoundedCornerShape(10.dp)),
28 | }
29 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/java/com/infomaniak/core/myksuite/ui/theme/Dimens.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.myksuite.ui.theme
19 |
20 | import androidx.compose.ui.unit.dp
21 |
22 | object Dimens {
23 |
24 | /** 56 dp */
25 | val buttonHeight = 56.dp
26 | /** 16 dp */
27 | val smallIconSize = 16.dp
28 | /** 24 dp */
29 | val iconSize = 24.dp
30 | /** 32 dp */
31 | val avatarSize = 32.dp
32 | /** 8 dp */
33 | val smallCornerRadius = 8.dp
34 | /** 16 dp */
35 | val largeCornerRadius = 16.dp
36 | /** 5 dp */
37 | val cardElevation = 5.dp
38 | /** 40 dp */
39 | val textItemMinHeight = 40.dp
40 | }
41 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/java/com/infomaniak/core/myksuite/ui/theme/Margin.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.myksuite.ui.theme
19 |
20 | import androidx.compose.ui.unit.dp
21 |
22 | object Margin {
23 | /** 4dp */
24 | val Micro = 4.dp
25 | /** 8dp */
26 | val Mini = 8.dp
27 | /** 12dp */
28 | val Small = 12.dp
29 | /** 16dp */
30 | val Medium = 16.dp
31 | /** 24dp */
32 | val Large = 24.dp
33 | /** 32dp */
34 | val Huge = 32.dp
35 | /** 48dp */
36 | val Giant = 48.dp
37 | }
38 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/java/com/infomaniak/core/myksuite/ui/utils/MatomoMyKSuite.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.myksuite.ui.utils
19 |
20 | object MatomoMyKSuite {
21 |
22 | const val CATEGORY_MY_KSUITE = "myKSuite"
23 | const val CATEGORY_MY_KSUITE_UPGRADE_BOTTOMSHEET = "myKSuiteUpgradeBottomSheet"
24 |
25 | const val OPEN_DASHBOARD_NAME = "openDashboard"
26 | const val NOT_ENOUGH_STORAGE_UPGRADE_NAME = "notEnoughStorageUpgrade"
27 | }
28 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/java/com/infomaniak/core/myksuite/ui/views/MyKSuiteChipView.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.myksuite.ui.views
19 |
20 | import android.content.Context
21 | import android.util.AttributeSet
22 | import com.infomaniak.core.myksuite.ui.components.MyKSuiteTier
23 |
24 | class MyKSuiteChipView @JvmOverloads constructor(
25 | context: Context,
26 | attrs: AttributeSet? = null,
27 | defStyleAttr: Int = 0,
28 | ) : BaseMyKSuiteChipView(context, attrs, defStyleAttr, MyKSuiteTier.Free)
29 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/java/com/infomaniak/core/myksuite/ui/views/MyKSuitePlusChipView.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.myksuite.ui.views
19 |
20 | import android.content.Context
21 | import android.util.AttributeSet
22 | import com.infomaniak.core.myksuite.ui.components.MyKSuiteTier
23 |
24 | class MyKSuitePlusChipView @JvmOverloads constructor(
25 | context: Context,
26 | attrs: AttributeSet? = null,
27 | defStyleAttr: Int = 0,
28 | ) : BaseMyKSuiteChipView(context, attrs, defStyleAttr, tier = MyKSuiteTier.Plus)
29 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/res/drawable-night/illu_dashboard_background.xml:
--------------------------------------------------------------------------------
1 |
18 |
23 |
26 |
27 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/res/drawable/ic_chevron_down.xml:
--------------------------------------------------------------------------------
1 |
18 |
23 |
26 |
27 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/res/drawable/ic_chevron_up.xml:
--------------------------------------------------------------------------------
1 |
18 |
23 |
26 |
27 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/res/drawable/ic_cross_thick.xml:
--------------------------------------------------------------------------------
1 |
18 |
23 |
26 |
27 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/res/drawable/ic_envelope_bold.xml:
--------------------------------------------------------------------------------
1 |
18 |
23 |
27 |
28 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/res/drawable/illu_dashboard_background.xml:
--------------------------------------------------------------------------------
1 |
18 |
23 |
26 |
27 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/res/values-night/colors.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | #333333
20 |
21 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/MyKSuite/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | #F4F6FD
20 |
21 |
--------------------------------------------------------------------------------
/Network/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | }
5 |
6 | val coreCompileSdk: Int by rootProject.extra
7 | val coreMinSdk: Int by rootProject.extra
8 | val javaVersion: JavaVersion by rootProject.extra
9 |
10 | android {
11 | namespace = "com.infomaniak.core.network"
12 | compileSdk = coreCompileSdk
13 |
14 | defaultConfig {
15 | minSdk = coreMinSdk
16 |
17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18 | consumerProguardFiles("consumer-rules.pro")
19 | }
20 |
21 | buildTypes {
22 | release {
23 | isMinifyEnabled = false
24 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
25 | }
26 | }
27 | compileOptions {
28 | sourceCompatibility = javaVersion
29 | targetCompatibility = javaVersion
30 | }
31 | kotlinOptions {
32 | jvmTarget = javaVersion.toString()
33 | }
34 | }
35 |
36 | dependencies {
37 | implementation(project(":Core:Sentry"))
38 |
39 | implementation(core.androidx.core.ktx)
40 | }
41 |
--------------------------------------------------------------------------------
/Network/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Network/consumer-rules.pro
--------------------------------------------------------------------------------
/Network/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/Network/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Notifications/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | }
5 |
6 | val coreCompileSdk: Int by rootProject.extra
7 | val coreMinSdk: Int by rootProject.extra
8 | val javaVersion: JavaVersion by rootProject.extra
9 |
10 | android {
11 | namespace = "com.infomaniak.core.notifications"
12 | compileSdk = coreCompileSdk
13 |
14 | defaultConfig {
15 | minSdk = coreMinSdk
16 |
17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18 | consumerProguardFiles("consumer-rules.pro")
19 | }
20 |
21 | buildTypes {
22 | release {
23 | isMinifyEnabled = false
24 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
25 | }
26 | }
27 |
28 | compileOptions {
29 | sourceCompatibility = javaVersion
30 | targetCompatibility = javaVersion
31 | }
32 |
33 | kotlinOptions {
34 | jvmTarget = javaVersion.toString()
35 | }
36 | }
37 |
38 | dependencies {
39 | implementation(project(":Core"))
40 | implementation(core.androidx.core.ktx)
41 | }
42 |
--------------------------------------------------------------------------------
/Notifications/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Onboarding/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | alias(core.plugins.compose.compiler)
5 | }
6 |
7 | val coreCompileSdk: Int by rootProject.extra
8 | val coreMinSdk: Int by rootProject.extra
9 | val javaVersion: JavaVersion by rootProject.extra
10 |
11 | android {
12 | namespace = "com.infomaniak.core.onboarding"
13 | compileSdk = coreCompileSdk
14 |
15 | defaultConfig {
16 | minSdk = coreMinSdk
17 |
18 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
19 | consumerProguardFiles("consumer-rules.pro")
20 | }
21 |
22 | buildTypes {
23 | release {
24 | isMinifyEnabled = false
25 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
26 | }
27 | }
28 | compileOptions {
29 | sourceCompatibility = javaVersion
30 | targetCompatibility = javaVersion
31 | }
32 | buildFeatures {
33 | compose = true
34 | }
35 | composeOptions {
36 | kotlinCompilerExtensionVersion = "1.5.14"
37 | }
38 | kotlinOptions {
39 | jvmTarget = javaVersion.toString()
40 | }
41 | }
42 |
43 | dependencies {
44 | implementation(platform(core.compose.bom))
45 | implementation(core.androidx.core.ktx)
46 | implementation(core.compose.foundation)
47 | implementation(core.compose.material3)
48 | implementation(core.compose.runtime)
49 | implementation(core.compose.ui.tooling.preview)
50 |
51 | debugImplementation(core.compose.ui.tooling)
52 | }
53 |
--------------------------------------------------------------------------------
/Onboarding/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Onboarding/consumer-rules.pro
--------------------------------------------------------------------------------
/Onboarding/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/RecyclerView/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | }
5 |
6 | val coreCompileSdk: Int by rootProject.extra
7 | val coreMinSdk: Int by rootProject.extra
8 | val javaVersion: JavaVersion by rootProject.extra
9 |
10 | android {
11 | namespace = "com.infomaniak.core.recyclerview"
12 | compileSdk = coreCompileSdk
13 |
14 | defaultConfig {
15 | minSdk = coreMinSdk
16 |
17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18 | consumerProguardFiles("consumer-rules.pro")
19 | }
20 |
21 | buildTypes {
22 | release {
23 | isMinifyEnabled = false
24 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
25 | }
26 | }
27 |
28 | compileOptions {
29 | sourceCompatibility = javaVersion
30 | targetCompatibility = javaVersion
31 | }
32 |
33 | kotlinOptions {
34 | jvmTarget = javaVersion.toString()
35 | }
36 | }
37 |
38 | dependencies {
39 | api(core.kotlinx.coroutines.core)
40 | api(core.androidx.recyclerview)
41 | api(core.androidx.lifecycle.runtime.ktx)
42 |
43 | testImplementation(core.junit)
44 | androidTestImplementation(core.androidx.junit)
45 | }
46 |
--------------------------------------------------------------------------------
/RecyclerView/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/RecyclerView/consumer-rules.pro
--------------------------------------------------------------------------------
/RecyclerView/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/RecyclerView/src/main/kotlin/com/infomaniak/core/recyclerview/ResettableLazy.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.recyclerview
19 |
20 | import kotlin.reflect.KProperty
21 |
22 | internal class ResettableLazy(private val initializer: () -> T) {
23 |
24 | var value: T? = null
25 | private set
26 |
27 | operator fun getValue(
28 | @Suppress("unused") thisRef: Any?,
29 | @Suppress("unused") prop: KProperty<*>
30 | ): T {
31 | return value ?: initializer().apply { value = this }
32 | }
33 |
34 | fun reset() {
35 | value = null
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Sentry/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | }
5 |
6 | val coreCompileSdk: Int by rootProject.extra
7 | val coreMinSdk: Int by rootProject.extra
8 | val javaVersion: JavaVersion by rootProject.extra
9 |
10 | android {
11 | namespace = "com.infomaniak.core.sentry"
12 | compileSdk = coreCompileSdk
13 |
14 | defaultConfig {
15 | minSdk = coreMinSdk
16 |
17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18 | consumerProguardFiles("consumer-rules.pro")
19 | }
20 |
21 | buildTypes {
22 | release {
23 | isMinifyEnabled = false
24 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
25 | }
26 | }
27 | compileOptions {
28 | sourceCompatibility = javaVersion
29 | targetCompatibility = javaVersion
30 | }
31 | kotlinOptions {
32 | jvmTarget = javaVersion.toString()
33 | }
34 | }
35 |
36 | dependencies {
37 | api(core.sentry.android)
38 | }
39 |
--------------------------------------------------------------------------------
/Sentry/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Sentry/consumer-rules.pro
--------------------------------------------------------------------------------
/Sentry/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/Thumbnails/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | }
5 |
6 | val coreCompileSdk: Int by rootProject.extra
7 | val legacyMinSdk: Int by rootProject.extra
8 | val javaVersion: JavaVersion by rootProject.extra
9 |
10 | android {
11 | namespace = "com.infomaniak.core.thumbnails"
12 | compileSdk = coreCompileSdk
13 |
14 | defaultConfig {
15 | minSdk = legacyMinSdk
16 |
17 | consumerProguardFiles("consumer-rules.pro")
18 | }
19 |
20 | buildTypes {
21 | release {
22 | isMinifyEnabled = false
23 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
24 | }
25 | }
26 | compileOptions {
27 | sourceCompatibility = javaVersion
28 | targetCompatibility = javaVersion
29 | }
30 | kotlinOptions {
31 | jvmTarget = javaVersion.toString()
32 | }
33 | composeOptions {
34 | kotlinCompilerExtensionVersion = "1.5.14"
35 | }
36 | }
37 |
38 | dependencies {
39 | implementation(core.androidx.core.ktx)
40 | }
41 |
--------------------------------------------------------------------------------
/Thumbnails/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/Thumbnails/consumer-rules.pro
--------------------------------------------------------------------------------
/Thumbnails/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/UserAvatar/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | alias(core.plugins.compose.compiler)
5 | kotlin("plugin.parcelize")
6 | }
7 |
8 | val coreCompileSdk: Int by rootProject.extra
9 | val legacyMinSdk: Int by rootProject.extra
10 | val javaVersion: JavaVersion by rootProject.extra
11 |
12 | android {
13 | namespace = "com.infomaniak.core.useravatar"
14 | compileSdk = coreCompileSdk
15 |
16 | defaultConfig {
17 | minSdk = legacyMinSdk
18 |
19 | consumerProguardFiles("consumer-rules.pro")
20 | }
21 |
22 | buildTypes {
23 | release {
24 | isMinifyEnabled = false
25 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
26 | }
27 | }
28 | compileOptions {
29 | sourceCompatibility = javaVersion
30 | targetCompatibility = javaVersion
31 | }
32 | kotlinOptions {
33 | jvmTarget = javaVersion.toString()
34 | }
35 | }
36 |
37 | dependencies {
38 |
39 | implementation(core.androidx.core.ktx)
40 |
41 | // Compose
42 | implementation(core.coil.compose)
43 | implementation(core.coil.network.okhttp)
44 | implementation(platform(core.compose.bom))
45 | implementation(core.compose.runtime)
46 | implementation(core.compose.material3)
47 | implementation(core.compose.ui)
48 | debugImplementation(core.compose.ui.tooling)
49 | implementation(core.compose.ui.tooling.preview)
50 | }
51 |
--------------------------------------------------------------------------------
/UserAvatar/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/UserAvatar/consumer-rules.pro
--------------------------------------------------------------------------------
/UserAvatar/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/UserAvatar/src/main/java/com/infomaniak/core/useravatar/AvatarData.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.useravatar
19 |
20 | import android.os.Parcelable
21 | import androidx.annotation.ColorInt
22 | import kotlinx.parcelize.Parcelize
23 |
24 | @Parcelize
25 | data class AvatarData(
26 | val uri: String = "",
27 | val userInitials: String = "",
28 | @ColorInt val iconColor: Int? = null,
29 | @ColorInt val backgroundColor: Int? = null,
30 | ) : Parcelable
31 |
--------------------------------------------------------------------------------
/UserAvatar/src/main/java/com/infomaniak/core/useravatar/AvatarDisplayState.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.useravatar
19 |
20 | internal enum class AvatarDisplayState {
21 | Avatar, Initials, UnknownUser
22 | }
23 |
--------------------------------------------------------------------------------
/UserAvatar/src/main/java/com/infomaniak/core/useravatar/component/DefaultIconColor.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.useravatar.component
19 |
20 | import androidx.compose.foundation.isSystemInDarkTheme
21 | import androidx.compose.runtime.Composable
22 | import androidx.compose.ui.graphics.Color
23 |
24 | // TODO: Remove this file when using CoreUi
25 |
26 | private const val iconColorDark = 0xFF333333
27 |
28 | @Composable
29 | fun getDefaultIconColor() = if (isSystemInDarkTheme()) Color(iconColorDark) else Color.White
30 |
--------------------------------------------------------------------------------
/UserAvatar/src/main/java/com/infomaniak/core/useravatar/component/InitialsTextAvatar.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.useravatar.component
19 |
20 | import androidx.compose.foundation.layout.wrapContentSize
21 | import androidx.compose.material3.Text
22 | import androidx.compose.runtime.Composable
23 | import androidx.compose.ui.Alignment
24 | import androidx.compose.ui.Modifier
25 | import androidx.compose.ui.graphics.Color
26 | import androidx.compose.ui.text.style.TextAlign
27 | import com.infomaniak.core.useravatar.AvatarData
28 |
29 | @Composable
30 | internal fun InitialsTextAvatar(avatarData: AvatarData) = with(avatarData) {
31 | // TODO: Use BasicText with autosize when Mail and Drive will be targeting api >= 35
32 | Text(
33 | modifier = Modifier.wrapContentSize(align = Alignment.Center),
34 | text = userInitials,
35 | color = iconColor?.let(::Color) ?: getDefaultIconColor(),
36 | textAlign = TextAlign.Center,
37 | )
38 | }
39 |
--------------------------------------------------------------------------------
/UserAvatar/src/main/java/com/infomaniak/core/useravatar/component/UnknownUserIcon.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.useravatar.component
19 |
20 | import androidx.annotation.ColorInt
21 | import androidx.compose.foundation.layout.fillMaxSize
22 | import androidx.compose.material3.Icon
23 | import androidx.compose.runtime.Composable
24 | import androidx.compose.ui.Modifier
25 | import androidx.compose.ui.graphics.Color
26 | import androidx.compose.ui.graphics.vector.ImageVector
27 | import androidx.compose.ui.res.vectorResource
28 | import com.infomaniak.core.useravatar.R
29 |
30 | @Composable
31 | internal fun UnknownUserIcon(@ColorInt iconColorRes: Int?) {
32 | Icon(
33 | modifier = Modifier.fillMaxSize(),
34 | imageVector = ImageVector.vectorResource(R.drawable.ic_person),
35 | contentDescription = null,
36 | tint = iconColorRes?.let(::Color) ?: getDefaultIconColor()
37 | )
38 | }
39 |
--------------------------------------------------------------------------------
/UserAvatar/src/main/res/drawable-night/ic_person.xml:
--------------------------------------------------------------------------------
1 |
18 |
23 |
26 |
29 |
30 |
--------------------------------------------------------------------------------
/UserAvatar/src/main/res/drawable/ic_person.xml:
--------------------------------------------------------------------------------
1 |
18 |
23 |
26 |
29 |
30 |
--------------------------------------------------------------------------------
/WebView/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.library")
3 | alias(core.plugins.kotlin.android)
4 | alias(core.plugins.compose.compiler)
5 | kotlin("plugin.serialization")
6 | }
7 |
8 | val coreCompileSdk: Int by rootProject.extra
9 | val legacyMinSdk: Int by rootProject.extra
10 | val javaVersion: JavaVersion by rootProject.extra
11 |
12 | android {
13 | namespace = "com.infomaniak.core.webview"
14 | compileSdk = coreCompileSdk
15 |
16 | defaultConfig {
17 | minSdk = legacyMinSdk
18 |
19 | consumerProguardFiles("consumer-rules.pro")
20 | }
21 |
22 | buildTypes {
23 | release {
24 | isMinifyEnabled = false
25 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
26 | }
27 | }
28 |
29 | compileOptions {
30 | sourceCompatibility = javaVersion
31 | targetCompatibility = javaVersion
32 | }
33 |
34 | kotlinOptions {
35 | jvmTarget = javaVersion.toString()
36 | }
37 |
38 | buildFeatures {
39 | compose = true
40 | }
41 | }
42 |
43 | dependencies {
44 | implementation(core.activity.compose)
45 | implementation(core.compose.foundation)
46 | implementation(core.kotlinx.serialization.json)
47 | }
48 |
--------------------------------------------------------------------------------
/WebView/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/WebView/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
18 |
20 |
21 |
22 |
25 |
26 |
29 |
30 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Infomaniak/android-core/41422dfe1c53bb136d141f2dad8aec8b90d83da8/consumer-rules.pro
--------------------------------------------------------------------------------
/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/src/main/kotlin/com/infomaniak/core/CacheExpirationScope.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core
19 |
20 | @NotTestedNorUsed
21 | interface CacheExpirationScope {
22 | suspend fun dropUnusedElements(count: Int)
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/infomaniak/core/Lifecycle.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core
19 |
20 | import androidx.lifecycle.Lifecycle
21 | import kotlinx.coroutines.flow.distinctUntilChanged
22 | import kotlinx.coroutines.flow.map
23 |
24 | fun Lifecycle.isResumedFlow() = currentStateFlow.map {
25 | it.isAtLeast(Lifecycle.State.RESUMED)
26 | }.distinctUntilChanged()
27 |
28 | fun Lifecycle.isStartedFlow() = currentStateFlow.map {
29 | it.isAtLeast(Lifecycle.State.STARTED)
30 | }.distinctUntilChanged()
31 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/infomaniak/core/NotTestedNorUsed.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core
19 |
20 | /**
21 | * # WARNING
22 | *
23 | * APIs annotated with this are not tested, nor used yet.
24 | *
25 | * If you want to start using them, it is **your responsibility to add tests**,
26 | * and remove this annotation.
27 | */
28 | @RequiresOptIn(level = RequiresOptIn.Level.ERROR)
29 | @Retention(AnnotationRetention.BINARY)
30 | annotation class NotTestedNorUsed()
31 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/infomaniak/core/Result.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core
19 |
20 | import kotlinx.coroutines.CancellationException
21 |
22 | @Suppress("RedundantSuspendModifier")
23 | suspend inline fun Result.cancellable(): Result = onFailure {
24 | if (it is CancellationException) throw it
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/infomaniak/core/SendChannel.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core
19 |
20 | import kotlinx.coroutines.CancellationException
21 | import kotlinx.coroutines.channels.SendChannel
22 | import kotlinx.coroutines.currentCoroutineContext
23 | import kotlinx.coroutines.ensureActive
24 |
25 | /**
26 | * [SendChannel.send] can throw a [CancellationException] after the value was sent,
27 | * which might not be desirable if we want to factor-in whether the value was actually sent.
28 | *
29 | * That's why this atomic version exists.
30 | * It supports cancellation, but if the value is sent, it will return instead, even if it's
31 | * happening concurrently to cancellation.
32 | *
33 | * See [this issue](https://github.com/Kotlin/kotlinx.coroutines/issues/4414) for more details.
34 | */
35 | suspend fun SendChannel.sendAtomic(element: T) {
36 | trySelectAtomically(onCancellation = { null }) {
37 | onSend(element) {}
38 | } ?: currentCoroutineContext().ensureActive()
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/infomaniak/core/Uri.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core
19 |
20 | import android.net.Uri
21 | import splitties.init.appCtx
22 | import splitties.mainthread.checkNotMainThread
23 | import java.io.FileNotFoundException
24 |
25 | fun Uri.doesFileExist(): Boolean {
26 | checkNotMainThread()
27 | return try {
28 | appCtx.contentResolver.openInputStream(this).use {}
29 | true
30 | } catch (e: FileNotFoundException) {
31 | false
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/infomaniak/core/WakeLock.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core
19 |
20 | import android.os.PowerManager
21 | import splitties.systemservices.powerManager
22 |
23 | @Suppress("WakelockTimeout")
24 | inline fun withPartialWakeLock(
25 | appName: String,
26 | tagSuffix: String = "default",
27 | block: () -> R
28 | ): R {
29 | val wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "$appName:$tagSuffix")
30 | return try {
31 | wakeLock.acquire()
32 | block()
33 | } finally {
34 | wakeLock.release()
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/infomaniak/core/extensions/BundleExt.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.extensions
19 |
20 | import android.os.Build.VERSION.SDK_INT
21 | import android.os.Bundle
22 | import android.os.Parcelable
23 |
24 | inline fun Bundle.parcelableExtra(key: String): T? = when {
25 | SDK_INT >= 33 -> getParcelable(key, T::class.java)
26 | else -> @Suppress("DEPRECATION") getParcelable(key) as? T
27 | }
28 |
29 | inline fun Bundle.parcelableArrayListExtra(key: String): List? = when {
30 | SDK_INT >= 33 -> getParcelableArrayList(key, T::class.java)
31 | else -> @Suppress("DEPRECATION") getParcelableArrayList(key)
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/infomaniak/core/extensions/IntentExt.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.extensions
19 |
20 | import android.content.Intent
21 |
22 | fun Intent.clearStack() = apply { flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK }
23 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/infomaniak/core/extensions/PackageManagerExt.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.extensions
19 |
20 | import splitties.init.appCtx
21 | import kotlin.LazyThreadSafetyMode.NONE
22 |
23 | internal val appName: String by lazy(NONE) {
24 | packageManager.getApplicationLabel(applicationInfo).toString()
25 | }
26 |
27 | internal val appVersionName: String by lazy(NONE) {
28 | packageManager.getPackageInfo(appCtx.packageName, 0).versionName.toString()
29 | }
30 |
31 | private val packageManager = appCtx.packageManager
32 | private val applicationInfo by lazy(NONE) { appCtx.applicationInfo }
33 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/infomaniak/core/extensions/StringExt.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.extensions
19 |
20 | fun String.capitalizeFirstChar(): String = replaceFirstChar { char -> char.titlecase() }
21 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/infomaniak/core/utils/NumberUtils.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2025 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.utils
19 |
20 | import java.util.Locale
21 |
22 | fun percent(currentValue: Long, totalValue: Long): String {
23 | val percentage = (currentValue.toFloat() / totalValue.toFloat())
24 | return String.format(Locale.getDefault(), "%d", (percentage * 100.0f).toInt())
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/kotlin/com/infomaniak/core/utils/UserAgentUtils.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Infomaniak Core - Android
3 | * Copyright (C) 2024 Infomaniak Network SA
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package com.infomaniak.core.utils
19 |
20 | import android.os.Build
21 |
22 | fun buildUserAgent(
23 | appId: String,
24 | appVersionCode: Int,
25 | appVersionName: String,
26 | ): String {
27 | val androidVersion = "Android ${Build.VERSION.RELEASE}"
28 | val arch = System.getProperty("os.arch")
29 | return "$appId/$appVersionName-$appVersionCode (${Build.MODEL}; $androidVersion; $arch)"
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/src/main/res/values-de/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | Ein Fehler ist aufgetreten
20 | Abbrechen
21 | Schliessen
22 | Weiter
23 | Nein
24 | Wiederholen
25 | Speichern
26 | Ja
27 | Fehler beim Download
28 | Download nicht möglich: Unzureichender Speicherplatz
29 | Mögen Sie %s?
30 |
31 |
--------------------------------------------------------------------------------
/src/main/res/values-es/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | Se ha producido un error
20 | Cancelar
21 | Cerrar
22 | Siguiente
23 | No
24 | Reintentar
25 | Guardar
26 | Sí
27 | Error al descargar
28 | No se puede descargar: espacio insuficiente
29 | ¿Te gusta %s?
30 |
31 |
--------------------------------------------------------------------------------
/src/main/res/values-fr/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | Une erreur est survenue
20 | Annuler
21 | Fermer
22 | Suivant
23 | Non
24 | Réessayer
25 | Enregistrer
26 | Oui
27 | Erreur lors du téléchargement
28 | Téléchargement impossible : Espace insuffisant
29 | Vous aimez %s ?
30 |
31 |
--------------------------------------------------------------------------------
/src/main/res/values-it/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | Si è verificato un errore
20 | Annulla
21 | Chiudere
22 | Avanti
23 | No
24 | Riprova
25 | Salva
26 | Sì
27 | Errore durante il download
28 | Impossibile scaricare: spazio insufficiente
29 | Ti piace %s?
30 |
31 |
--------------------------------------------------------------------------------
/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | An error has occurred
20 | Cancel
21 | Close
22 | Next
23 | No
24 | Retry
25 | Save
26 | Yes
27 | Download error
28 | Cannot download : Insufficient space
29 | Do you like %s?
30 |
31 |
--------------------------------------------------------------------------------