├── app ├── .idea │ ├── .name │ ├── copyright │ │ ├── profiles_settings.xml │ │ └── LGPLv3.xml │ └── vcs.xml ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── src │ ├── debug │ │ ├── ic_launcher-playstore.png │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ └── drawable │ │ │ └── ic_launcher_background.xml │ ├── main │ │ ├── ic_launcher-playstore.png │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── drawable-hdpi │ │ │ │ └── ic_stat_herdr.png │ │ │ ├── drawable-mdpi │ │ │ │ └── ic_stat_herdr.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_stat_herdr.png │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_stat_herdr.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── drawable │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ ├── ic_login_24dp.xml │ │ │ │ ├── ic_logout_24dp.xml │ │ │ │ ├── ic_settings_24px.xml │ │ │ │ ├── ic_activity_still_24px.xml │ │ │ │ ├── ic_add_black_18dp.xml │ │ │ │ ├── ic_launch_black_24dp.xml │ │ │ │ ├── ic_cancel_black_24dp.xml │ │ │ │ ├── ic_location_rec_24dp.xml │ │ │ │ ├── ic_yellow_folder_76dp.xml │ │ │ │ ├── ic_activity_walk_24px.xml │ │ │ │ ├── ic_activity_run_24px.xml │ │ │ │ └── ic_activity_bike_24px.xml │ │ │ ├── values │ │ │ │ ├── preloaded_fonts.xml │ │ │ │ ├── attrs.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── font │ │ │ │ └── roboto.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ └── java │ │ │ ├── com │ │ │ └── ludoscity │ │ │ │ └── herdr │ │ │ │ ├── common │ │ │ │ ├── data │ │ │ │ │ └── database │ │ │ │ │ │ └── SQLDriver.kt │ │ │ │ ├── Dispatcher.kt │ │ │ │ ├── Timer.kt │ │ │ │ └── di │ │ │ │ │ └── KoinAndroid.kt │ │ │ │ └── ui │ │ │ │ └── main │ │ │ │ └── HerdrApp.kt │ │ │ └── sample │ │ │ └── SampleAndroid.kt │ ├── iosMain │ │ └── kotlin │ │ │ ├── com │ │ │ └── ludoscity │ │ │ │ └── herdr │ │ │ │ └── common │ │ │ │ ├── data │ │ │ │ └── database │ │ │ │ │ └── SQLDriver.kt │ │ │ │ ├── ApplicationDispatcher.kt │ │ │ │ ├── PlatformIos.kt │ │ │ │ └── di │ │ │ │ └── KoinIOS.kt │ │ │ └── sample │ │ │ └── SampleIos.kt │ ├── commonMain │ │ ├── kotlin │ │ │ ├── com │ │ │ │ └── ludoscity │ │ │ │ │ └── herdr │ │ │ │ │ └── common │ │ │ │ │ ├── data │ │ │ │ │ ├── database │ │ │ │ │ │ ├── SQLDriver.kt │ │ │ │ │ │ └── dao │ │ │ │ │ │ │ ├── GeoTrackingDatapointDao.kt │ │ │ │ │ │ │ └── AnalTrackingDatapointDao.kt │ │ │ │ │ ├── network │ │ │ │ │ │ └── cozy │ │ │ │ │ │ │ ├── GeoTrackingUploadRequestBody.kt │ │ │ │ │ │ │ ├── TokenSuccessReply.kt │ │ │ │ │ │ │ ├── AnalTrackingUploadRequestBody.kt │ │ │ │ │ │ │ └── FileRelatedRequestReply.kt │ │ │ │ │ └── SecureDataStore.kt │ │ │ │ │ ├── domain │ │ │ │ │ ├── entity │ │ │ │ │ │ ├── UserCredentials.kt │ │ │ │ │ │ ├── RawDataCloudFolderConfiguration.kt │ │ │ │ │ │ └── AuthClientRegistration.kt │ │ │ │ │ └── usecase │ │ │ │ │ │ ├── login │ │ │ │ │ │ ├── ObserveLoggedInUseCaseInput.kt │ │ │ │ │ │ ├── SetupDirectoryUseCaseInput.kt │ │ │ │ │ │ ├── RegisterAuthClientUseCaseInput.kt │ │ │ │ │ │ ├── RetrieveAccessAndRefreshTokenUseCaseInput.kt │ │ │ │ │ │ ├── checkLoginStatusUseCaseAsync.kt │ │ │ │ │ │ ├── ObserveLoggedInUseCaseSync.kt │ │ │ │ │ │ ├── UnregisterAuthClientUseCaseAsync.kt │ │ │ │ │ │ ├── RefreshAccessAndRefreshTokenUseCaseAsync.kt │ │ │ │ │ │ ├── SetupDirectoryUseCaseAsync.kt │ │ │ │ │ │ ├── RegisterAuthClientUseCaseAsync.kt │ │ │ │ │ │ └── RetrieveAccessAndRefreshTokenUseCaseAsync.kt │ │ │ │ │ │ ├── geotracking │ │ │ │ │ │ ├── UpdateGeoTrackingUseCaseInput.kt │ │ │ │ │ │ ├── ObserveGeoTrackingUseCaseInput.kt │ │ │ │ │ │ ├── ObserveGeoTrackingUseCaseSync.kt │ │ │ │ │ │ ├── PurgeAllGeoTrackingDatapointUseCaseAsync.kt │ │ │ │ │ │ ├── UpdateGeoTrackingUseCaseSync.kt │ │ │ │ │ │ ├── UploadAllGeoTrackingDatapointUseCaseAsync.kt │ │ │ │ │ │ ├── UpdateUserLocGeoTrackingDatapointUseCaseSync.kt │ │ │ │ │ │ ├── SaveGeoTrackingDatapointUseCaseAsync.kt │ │ │ │ │ │ └── SaveGeoTrackingDatapointUseCaseInput.kt │ │ │ │ │ │ ├── analytics │ │ │ │ │ │ ├── UpdateLocationPermissionGrantedUseCaseInput.kt │ │ │ │ │ │ ├── PurgeAllAnalyticsDatapointUseCaseAsync.kt │ │ │ │ │ │ ├── UploadAllAnalyticsDatapointUseCaseAsync.kt │ │ │ │ │ │ ├── GetPermissionGrantedUseCaseSync.kt │ │ │ │ │ │ ├── SaveAnalyticsDatapointUseCaseAsync.kt │ │ │ │ │ │ ├── UpdatePermissionGrantedUseCaseSync.kt │ │ │ │ │ │ └── SaveAnalyticsDatapointUseCaseInput.kt │ │ │ │ │ │ ├── useractivity │ │ │ │ │ │ ├── UpdateUserActivityUseCaseInput.kt │ │ │ │ │ │ ├── ObserveUserActivityUseCaseInput.kt │ │ │ │ │ │ ├── RetrieveWillGeoTrackUserActivityUseCaseInput.kt │ │ │ │ │ │ ├── RetrieveLastUserActivityTimestampUseCaseInput.kt │ │ │ │ │ │ ├── ObserveGeoTrackUserActivityUseCaseInput.kt │ │ │ │ │ │ ├── UpdateWillGeoTrackUserActivityUseCaseInput.kt │ │ │ │ │ │ ├── UpdateUserActivityUseCaseSync.kt │ │ │ │ │ │ ├── ObserveUserActivityUseCaseSync.kt │ │ │ │ │ │ ├── RetrieveLastUserActivityTimestampUseCaseAsync.kt │ │ │ │ │ │ ├── RetrieveWillGeoTrackUserActivityUseCaseAsync.kt │ │ │ │ │ │ ├── ObserveGeoTrackUserActivityUseCaseSync.kt │ │ │ │ │ │ ├── UpdateWillGeoTrackUserActivityUseCaseAsync.kt │ │ │ │ │ │ └── RetrieveUserActivityUseCaseSync.kt │ │ │ │ │ │ └── base │ │ │ │ │ │ ├── BaseUseCaseSync.kt │ │ │ │ │ │ └── BaseUseCaseAsync.kt │ │ │ │ │ ├── utils │ │ │ │ │ └── CoroutineExt.kt │ │ │ │ │ ├── Timer.kt │ │ │ │ │ ├── Platform.kt │ │ │ │ │ ├── base │ │ │ │ │ └── Response.kt │ │ │ │ │ └── ui │ │ │ │ │ ├── drivelogin │ │ │ │ │ ├── UserCredentialsState.kt │ │ │ │ │ └── AuthClientRegistrationState.kt │ │ │ │ │ └── drivesetup │ │ │ │ │ └── DriveSetupViewModel.kt │ │ │ └── sample │ │ │ │ └── Sample.kt │ │ └── sqldelight │ │ │ └── com │ │ │ └── ludoscity │ │ │ └── herdr │ │ │ └── common │ │ │ └── data │ │ │ ├── GeoTrackingDatapoint.sq │ │ │ └── AnalTrackingDatapoint.sq │ ├── iosTest │ │ └── kotlin │ │ │ └── sample │ │ │ └── SampleTestsIOS.kt │ ├── test │ │ └── java │ │ │ └── sample │ │ │ └── SampleTestsAndroid.kt │ ├── commonTest │ │ └── kotlin │ │ │ └── sample │ │ │ └── SampleTests.kt │ └── iosX64Main │ │ └── kotlin │ │ └── com │ │ └── ludoscity │ │ └── herdr │ │ └── common │ │ └── data │ │ └── database │ │ └── getSqlDriver.kt ├── Info.plist ├── gradle.properties └── MultiPlatformLibrary.podspec ├── .github ├── FUNDING.yml ├── workflows │ └── android.yml └── PULL_REQUEST_TEMPLATE.md ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── iosApp ├── iosApp │ ├── fonts │ │ ├── Roboto-Bold.ttf │ │ ├── Roboto-Thin.ttf │ │ ├── Roboto-Black.ttf │ │ ├── Roboto-Italic.ttf │ │ ├── Roboto-Light.ttf │ │ ├── Roboto-Medium.ttf │ │ ├── Roboto-Regular.ttf │ │ ├── Roboto-BlackItalic.ttf │ │ ├── Roboto-BoldItalic.ttf │ │ ├── Roboto-LightItalic.ttf │ │ ├── Roboto-ThinItalic.ttf │ │ └── Roboto-MediumItalic.ttf │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── add_white_18pt.imageset │ │ │ ├── baseline_add_white_18pt_1x.png │ │ │ ├── baseline_add_white_18pt_2x.png │ │ │ ├── baseline_add_white_18pt_3x.png │ │ │ └── Contents.json │ │ ├── ic_folder.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_folder.svg │ │ │ ├── ic_folder-1.svg │ │ │ └── ic_folder-2.svg │ │ ├── ic_cozy_logo.imageset │ │ │ └── Contents.json │ │ ├── ic_activity_run.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_activity_run-1.svg │ │ │ ├── ic_activity_run-2.svg │ │ │ └── ic_activity_run.svg │ │ ├── ic_location_rec.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_location_rec.svg │ │ │ ├── ic_location_rec-1.svg │ │ │ └── ic_location_rec-2.svg │ │ ├── ic_activity_bike.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_activity_bike-1.svg │ │ │ ├── ic_activity_bike-2.svg │ │ │ └── ic_activity_bike.svg │ │ ├── ic_activity_still.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_activity_still-1.svg │ │ │ ├── ic_activity_still-2.svg │ │ │ └── ic_activity_still.svg │ │ ├── ic_activity_walk.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_activity_walk.svg │ │ │ ├── ic_activity_walk-1.svg │ │ │ └── ic_activity_walk-2.svg │ │ └── ic_activity_vehicle.imageset │ │ │ ├── Contents.json │ │ │ ├── ic_activity_vehicle-1.svg │ │ │ ├── ic_activity_vehicle-2.svg │ │ │ └── ic_activity_vehicle.svg │ ├── NavigationController.swift │ ├── SecureDataStoreImpl.swift │ ├── Koin.swift │ ├── Info.plist │ └── Base.lproj │ │ └── LaunchScreen.storyboard ├── iosApp.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── iosApp.xcodeproj │ └── project.xcworkspace │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── iosAppTests │ ├── Info.plist │ └── iosAppTests.swift ├── .gitignore └── Podfile ├── .idea ├── copyright │ ├── profiles_settings.xml │ └── LGPLv3.xml ├── codeStyles │ ├── codeStyleConfig.xml │ └── Project.xml ├── vcs.xml ├── kotlinc.xml ├── misc.xml └── gradle.xml ├── README.md ├── settings.gradle.kts └── gradle.properties /app/.idea/.name: -------------------------------------------------------------------------------- 1 | herdr -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [f8full] 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /iosApp/iosApp/fonts/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/fonts/Roboto-Bold.ttf -------------------------------------------------------------------------------- /iosApp/iosApp/fonts/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/fonts/Roboto-Thin.ttf -------------------------------------------------------------------------------- /app/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /iosApp/iosApp/fonts/Roboto-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/fonts/Roboto-Black.ttf -------------------------------------------------------------------------------- /iosApp/iosApp/fonts/Roboto-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/fonts/Roboto-Italic.ttf -------------------------------------------------------------------------------- /iosApp/iosApp/fonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/fonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /iosApp/iosApp/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/debug/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/debug/ic_launcher-playstore.png -------------------------------------------------------------------------------- /app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /iosApp/iosApp/fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /app/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /iosApp/iosApp/fonts/Roboto-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/fonts/Roboto-BlackItalic.ttf -------------------------------------------------------------------------------- /iosApp/iosApp/fonts/Roboto-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/fonts/Roboto-BoldItalic.ttf -------------------------------------------------------------------------------- /iosApp/iosApp/fonts/Roboto-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/fonts/Roboto-LightItalic.ttf -------------------------------------------------------------------------------- /iosApp/iosApp/fonts/Roboto-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/fonts/Roboto-ThinItalic.ttf -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/debug/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/debug/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /iosApp/iosApp/fonts/Roboto-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/fonts/Roboto-MediumItalic.ttf -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/debug/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_stat_herdr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/res/drawable-hdpi/ic_stat_herdr.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_stat_herdr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/res/drawable-mdpi/ic_stat_herdr.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_stat_herdr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/res/drawable-xhdpi/ic_stat_herdr.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_stat_herdr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/res/drawable-xxhdpi/ic_stat_herdr.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/debug/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/debug/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/debug/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/iosMain/kotlin/com/ludoscity/herdr/common/data/database/SQLDriver.kt: -------------------------------------------------------------------------------- 1 | package com.ludoscity.herdr.common.data.database 2 | 3 | actual class DbArgs( 4 | ) 5 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/add_white_18pt.imageset/baseline_add_white_18pt_1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/Assets.xcassets/add_white_18pt.imageset/baseline_add_white_18pt_1x.png -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/add_white_18pt.imageset/baseline_add_white_18pt_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/Assets.xcassets/add_white_18pt.imageset/baseline_add_white_18pt_2x.png -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/add_white_18pt.imageset/baseline_add_white_18pt_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nackko/herdr/HEAD/iosApp/iosApp/Assets.xcassets/add_white_18pt.imageset/baseline_add_white_18pt_3x.png -------------------------------------------------------------------------------- /app/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun May 10 12:43:20 EDT 2020 2 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip 3 | distributionBase=GRADLE_USER_HOME 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /iosApp/iosApp.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /iosApp/iosApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /iosApp/iosApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /iosApp/iosApp/NavigationController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NavigationController.swift 3 | // iosApp 4 | // 5 | // Created by f. on 2021-03-27. 6 | // 7 | 8 | import UIKit 9 | 10 | class NavigationController: UINavigationController { 11 | 12 | override func viewDidLoad() { 13 | super.viewDidLoad() 14 | 15 | //FIXME -- this is supposed to happen in the AppDelegate 16 | startKoin() 17 | 18 | // Do any additional setup after loading the view. 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_login_24dp.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_logout_24dp.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/ludoscity/herdr/common/data/database/SQLDriver.kt: -------------------------------------------------------------------------------- 1 | package com.ludoscity.herdr.common.data.database 2 | 3 | import android.content.Context 4 | import com.squareup.sqldelight.android.AndroidSqliteDriver 5 | import com.squareup.sqldelight.db.SqlDriver 6 | 7 | 8 | actual class DbArgs( 9 | var context: Context 10 | ) 11 | 12 | actual fun getSqlDriver(dbArgs: DbArgs): SqlDriver? { 13 | val driver: SqlDriver = AndroidSqliteDriver(HerdrDatabase.Schema, dbArgs.context, "herdr.db") 14 | return driver 15 | } -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_folder.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_folder.svg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "ic_folder-1.svg", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "ic_folder-2.svg", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_cozy_logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_cozy_logo.svg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "ic_cozy_logo-1.svg", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "ic_cozy_logo-2.svg", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/data/database/SQLDriver.kt: -------------------------------------------------------------------------------- 1 | package com.ludoscity.herdr.common.data.database 2 | 3 | import com.squareup.sqldelight.db.SqlDriver 4 | 5 | expect class DbArgs 6 | 7 | expect fun getSqlDriver(dbArgs: DbArgs): SqlDriver? 8 | 9 | object DatabaseCreator { 10 | fun getDataBase(dbArgs: DbArgs): HerdrDatabase? { 11 | val sqlDriver = getSqlDriver(dbArgs) 12 | return if (sqlDriver != null) { 13 | HerdrDatabase(sqlDriver) 14 | } else { 15 | null 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_run.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_activity_run.svg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "ic_activity_run-1.svg", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "ic_activity_run-2.svg", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_location_rec.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_location_rec.svg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "ic_location_rec-1.svg", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "ic_location_rec-2.svg", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_bike.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_activity_bike.svg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "ic_activity_bike-1.svg", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "ic_activity_bike-2.svg", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_still.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_activity_still.svg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "ic_activity_still-1.svg", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "ic_activity_still-2.svg", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_walk.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_activity_walk.svg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "ic_activity_walk-1.svg", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "ic_activity_walk-2.svg", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_vehicle.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "ic_activity_vehicle.svg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "ic_activity_vehicle-1.svg", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "ic_activity_vehicle-2.svg", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/add_white_18pt.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "baseline_add_white_18pt_1x.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "baseline_add_white_18pt_2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "baseline_add_white_18pt_3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/entity/UserCredentials.kt: -------------------------------------------------------------------------------- 1 | package com.ludoscity.herdr.common.domain.entity 2 | 3 | /** 4 | * Created by F8Full on 2019-06-17. This file is part of #findmybikes 5 | * 6 | */ 7 | /** 8 | * Data class that captures user information for logged in users retrieved from Repository 9 | * // If user credentials will be cached in local storage, it is recommended it be encrypted 10 | // @see https://developer.android.com/training/articles/keystore 11 | */ 12 | data class UserCredentials( 13 | val accessToken: String, 14 | val refreshToken: String//, 15 | //val idToken: String 16 | ) 17 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_folder.imageset/ic_folder.svg: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_folder.imageset/ic_folder-1.svg: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_folder.imageset/ic_folder-2.svg: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/entity/RawDataCloudFolderConfiguration.kt: -------------------------------------------------------------------------------- 1 | package com.ludoscity.herdr.common.domain.entity 2 | 3 | /** 4 | * Created by F8Full on 2019-06-17. This file is part of #findmybikes 5 | * 6 | */ 7 | /** 8 | * Data class that captures user information for logged in users retrieved from Repository 9 | * // If user credentials will be cached in local storage, it is recommended it be encrypted 10 | // @see https://developer.android.com/training/articles/keystore 11 | */ 12 | data class RawDataCloudFolderConfiguration( 13 | val id: String, 14 | val name: String, 15 | val path: String, 16 | val rootPath: String 17 | ) 18 | -------------------------------------------------------------------------------- /.github/workflows/android.yml: -------------------------------------------------------------------------------- 1 | name: Android CI 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | apk: 11 | name: Build APK 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: set up JDK 1.8 17 | uses: actions/setup-java@v1 18 | with: 19 | java-version: 1.8 20 | - name: Build debug apk with Gradle 21 | run: bash ./gradlew assembleDebug --stacktrace 22 | - name: Build release apk with Gradle 23 | run: bash ./gradlew assembleRelease 24 | - name: Persist apk 25 | uses: actions/upload-artifact@v2 26 | with: 27 | name: herdr-debug 28 | path: app/build/outputs/apk/debug/app-debug.apk 29 | -------------------------------------------------------------------------------- /app/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleVersion 18 | 1 19 | CFBundlePackageType 20 | FMWK 21 | 22 | -------------------------------------------------------------------------------- /iosApp/iosAppTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleVersion 18 | 1 19 | CFBundlePackageType 20 | BNDL 21 | 22 | -------------------------------------------------------------------------------- /iosApp/.gitignore: -------------------------------------------------------------------------------- 1 | # From https://github.com/github/gitignore/blob/master/Global/Xcode.gitignore 2 | # Xcode 3 | # 4 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 5 | 6 | ## User settings 7 | xcuserdata/ 8 | 9 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 10 | *.xcscmblueprint 11 | *.xccheckout 12 | 13 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 14 | build/ 15 | DerivedData/ 16 | *.moved-aside 17 | *.pbxuser 18 | !default.pbxuser 19 | *.mode1v3 20 | !default.mode1v3 21 | *.mode2v3 22 | !default.mode2v3 23 | *.perspectivev3 24 | !default.perspectivev3 25 | 26 | ## Gcc Patch 27 | /*.gcno 28 | 29 | ##Added from untracked list 30 | /iosApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata 31 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **Summary:** 2 | 3 | Summarize the changes in the pull request including how it relates to any issues (include the #number, or link them). 4 | 5 | **Expected behavior:** 6 | 7 | Explain and/or show screenshots for how you expect the pull request to work in your testing (in case other devices exhibit different behavior). 8 | 9 | 10 | Please make sure these boxes are checked before submitting your pull request - thanks! 11 | 12 | ~~- [ ] Run the unit tests with `gradle test` to make sure you didn't break anything~~ 13 | - [ ] Format the title like "Fix # - " (for example - "Fix #1111 - Check for null value before using field") 14 | - [ ] Linked all relevant issues 15 | - [ ] Include screenshot(s) showing how this pull request works and fixes the issue(s) 16 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_walk.imageset/ic_activity_walk.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_walk.imageset/ic_activity_walk-1.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_walk.imageset/ic_activity_walk-2.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # herdr 2 | Herdr is a privacy conscious multiplatform mobile data collector 3 | 4 | ## Run 5 | ### Android 6 | `./gradlew installDebug` 7 | or just open IDE and click Run 8 | 9 | ### iOS 10 | [CocoaPods](https://cocoapods.org/) required. 11 | 12 | ``` 13 | (cd iosApp && pod install) 14 | open iosApp/iosApp.xcworkspace 15 | ``` 16 | or manually: 17 | - do `pod install` in `iosApp` directory. 18 | - open `iosApp.xcworkspace` and click Run. 19 | 20 | #### Description 21 | 22 | [WIP]. To see screenshots of the app go to this [PR #5](https://github.com/f8full/herdr/pull/25) 23 | 24 | Herdr is an activity tracker (walk, run, bike, in vehicle) allowing you to automatically record your personal geolocation data in a cloud service. You can set it to activate geolocation recording only when certain activities are detected. 25 | 26 | For now, [Cozy Cloud](https://cozy.io) is the only supported cloud storage service. 27 | -------------------------------------------------------------------------------- /app/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020. f8full https://github.com/f8full 3 | # Herdr is a privacy conscious multiplatform mobile data collector 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | android.enableJetifier=true 20 | android.useAndroidX=true -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_location_rec.imageset/ic_location_rec.svg: -------------------------------------------------------------------------------- 1 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_location_rec.imageset/ic_location_rec-1.svg: -------------------------------------------------------------------------------- 1 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_location_rec.imageset/ic_location_rec-2.svg: -------------------------------------------------------------------------------- 1 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | include(":app") 19 | rootProject.name = "herdr" 20 | enableFeaturePreview("GRADLE_METADATA") -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_settings_24px.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_activity_still_24px.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/copyright/LGPLv3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /app/.idea/copyright/LGPLv3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /iosApp/iosAppTests/iosAppTests.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 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 | import XCTest 19 | import app 20 | 21 | class iosAppTests: XCTestCase { 22 | func testExample() { 23 | assert(Sample().checkMe() == 7) 24 | } 25 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020. f8full https://github.com/f8full 3 | # Herdr is a privacy conscious multiplatform mobile data collector 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | kotlin.code.style=official 20 | org.gradle.daemon=true 21 | org.gradle.jvmargs=-Xmx2560m 22 | 23 | kotlin.native.enableDependencyPropagation=false 24 | kotlin.mpp.enableGranularSourceSetsMetadata=true 25 | -------------------------------------------------------------------------------- /app/src/iosMain/kotlin/sample/SampleIos.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package sample 20 | 21 | actual class Sample { 22 | actual fun checkMe() = 7 23 | } 24 | 25 | actual object Platform { 26 | actual val name: String = "iOS" 27 | } -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 23 | 24 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_run.imageset/ic_activity_run-1.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_run.imageset/ic_activity_run-2.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_run.imageset/ic_activity_run.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /iosApp/iosApp/SecureDataStoreImpl.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SecureDataStore.swift 3 | // iosApp 4 | // 5 | // Created by Fabrice on 2020-04-16. 6 | // 7 | 8 | import Foundation 9 | import MultiPlatformLibrary 10 | import SecureDefaults 11 | 12 | class SecureDataStoreImpl: SecureDataStore { 13 | var secureDefaults: SecureDefaults 14 | override init() { 15 | secureDefaults = SecureDefaults.shared 16 | if !secureDefaults.isKeyCreated { 17 | secureDefaults.password = UUID().uuidString 18 | } 19 | } 20 | 21 | override func getString(key: String, callback: KotlinContinuation) { 22 | callback.resumeWith(result: secureDefaults.string(forKey: key)) 23 | } 24 | 25 | override func putString(key: String, data: String?, callback: KotlinContinuation) { 26 | secureDefaults.set(data, forKey: key) 27 | secureDefaults.synchronize() 28 | callback.resumeWith(result: Void()) 29 | } 30 | 31 | override func deleteKey(key: String, callback: KotlinContinuation) { 32 | putString(key: key, data: nil, callback: callback) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/utils/CoroutineExt.kt: -------------------------------------------------------------------------------- 1 | package com.ludoscity.herdr.common.utils 2 | 3 | import kotlinx.coroutines.* 4 | import kotlin.coroutines.CoroutineContext 5 | 6 | //Heavily inspired by 7 | //https://github.com/jarroyoesp/KotlinMultiPlatform/blob/master/app/src/main/java/com/jarroyo/sharedcode/utils/CoroutineExt.kt 8 | 9 | /** 10 | * Equivalent to [launch] but return [Unit] instead of [Job]. 11 | * 12 | * Mainly for usage when you want to lift [launch] to return. Example: 13 | * 14 | * ``` 15 | * override fun loadData() = launchSilent { 16 | * // code 17 | * } 18 | * ``` 19 | */ 20 | fun launchSilent( 21 | context: CoroutineContext = Dispatchers.Main, 22 | exceptionHandler: CoroutineExceptionHandler? = null, 23 | job: Job, 24 | start: CoroutineStart = CoroutineStart.DEFAULT, 25 | block: suspend CoroutineScope.() -> Unit 26 | ) { 27 | val coroutineScope = if (exceptionHandler != null) { 28 | CoroutineScope(context + job + exceptionHandler) 29 | } else { 30 | CoroutineScope(context + job) 31 | } 32 | coroutineScope.launch(context, start, block) 33 | } -------------------------------------------------------------------------------- /app/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020. f8full https://github.com/f8full 3 | # Herdr is a privacy conscious multiplatform mobile data collector 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | distributionBase=GRADLE_USER_HOME 20 | distributionPath=wrapper/dists 21 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip 22 | zipStoreBase=GRADLE_USER_HOME 23 | zipStorePath=wrapper/dists 24 | -------------------------------------------------------------------------------- /app/src/main/res/values/preloaded_fonts.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | @font/roboto 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/data/database/dao/GeoTrackingDatapointDao.kt: -------------------------------------------------------------------------------- 1 | package com.ludoscity.herdr.common.data.database.dao 2 | 3 | import com.ludoscity.herdr.common.data.GeoTrackingDatapoint 4 | import com.ludoscity.herdr.common.data.database.HerdrDatabase 5 | 6 | 7 | class GeoTrackingDatapointDao(database: HerdrDatabase) { 8 | 9 | private val db = database.geoTrackingDatapointQueries 10 | 11 | internal fun insert(item: GeoTrackingDatapoint) { 12 | db.insertOrReplace(item) 13 | } 14 | 15 | internal fun updateUploadCompleted(id: Long) { 16 | db.updateUploadCompleted(id) 17 | } 18 | 19 | internal fun delete(geoTrackingDatapoint: GeoTrackingDatapoint) { 20 | db.deleteById(geoTrackingDatapoint.id) 21 | } 22 | 23 | internal fun deleteUploadedAll() { 24 | db.deleteUploadedAll() 25 | } 26 | 27 | //TODO: check latest versions of KamMPKit to use Coroutine flow 28 | internal fun selectReadyForUploadAll(): List = db.selectReadyForUploadAll().executeAsList() 29 | 30 | internal fun select(): List = db.selectAll().executeAsList() 31 | } -------------------------------------------------------------------------------- /app/src/iosTest/kotlin/sample/SampleTestsIOS.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package sample 20 | 21 | import kotlin.test.Test 22 | import kotlin.test.assertTrue 23 | 24 | class SampleTestsIOS { 25 | @Test 26 | fun testHello() { 27 | assertTrue("iOS" in hello()) 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/data/database/dao/AnalTrackingDatapointDao.kt: -------------------------------------------------------------------------------- 1 | package com.ludoscity.herdr.common.data.database.dao 2 | 3 | import com.ludoscity.herdr.common.data.AnalTrackingDatapoint 4 | import com.ludoscity.herdr.common.data.database.HerdrDatabase 5 | 6 | 7 | class AnalTrackingDatapointDao(database: HerdrDatabase) { 8 | 9 | private val db = database.analTrackingDatapointQueries 10 | 11 | internal fun insert(item: AnalTrackingDatapoint) { 12 | db.insertOrReplace(item) 13 | } 14 | 15 | internal fun updateUploadCompleted(id: Long) { 16 | db.updateUploadCompleted(id) 17 | } 18 | 19 | internal fun delete(analTrackingDatapoint: AnalTrackingDatapoint) { 20 | db.deleteById(analTrackingDatapoint.id) 21 | } 22 | 23 | internal fun deleteUploadedAll() { 24 | db.deleteUploadedAll() 25 | } 26 | 27 | //TODO: check latest versions of KamMPKit to use Coroutine flow 28 | internal fun selectReadyForUploadAll(): List = db.selectReadyForUploadAll().executeAsList() 29 | 30 | internal fun select(): List = db.selectAll().executeAsList() 31 | } -------------------------------------------------------------------------------- /app/src/test/java/sample/SampleTestsAndroid.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package sample 20 | 21 | import kotlin.test.Test 22 | import kotlin.test.assertTrue 23 | 24 | class SampleTestsAndroid { 25 | @Test 26 | fun testHello() { 27 | assertTrue("Android" in hello()) 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/ludoscity/herdr/common/Dispatcher.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common 20 | 21 | import kotlinx.coroutines.Dispatchers 22 | import kotlin.coroutines.CoroutineContext 23 | 24 | internal actual val ApplicationDispatcher: CoroutineContext = Dispatchers.Default -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/Timer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common 20 | 21 | expect class Timer( 22 | periodMilliSeconds: Long, 23 | block: () -> Boolean 24 | ) { 25 | val periodMilliSeconds: Long 26 | 27 | fun start() 28 | fun stop() 29 | } -------------------------------------------------------------------------------- /iosApp/iosApp/Koin.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Koin.swift 3 | // iosApp 4 | // 5 | // Created by f. on 2021-03-21. 6 | // 7 | 8 | import Foundation 9 | 10 | import MultiPlatformLibrary 11 | 12 | func startKoin() { 13 | // You could just as easily define all these dependencies in Kotlin, but this helps demonstrate how you might pass platform-specific dependencies in a larger scale project where declaring them in Kotlin is more difficult, or where they're also used in iOS-specific code. 14 | 15 | //let userDefaults = UserDefaults(suiteName: "KAMPSTARTER_SETTINGS")! 16 | //let iosAppInfo = IosAppInfo() 17 | //let doOnStartup = { NSLog("Hello from iOS/Swift!") } 18 | let secureDataStore = SecureDataStoreImpl() 19 | 20 | //let koinApplication = KoinIOSKt.doInitKoinIos(userDefaults: userDefaults, appInfo: iosAppInfo, doOnStartup: doOnStartup) 21 | let koinApplication = KoinIOSKt.doInitKoinIos(dataStore: secureDataStore) 22 | _koin = koinApplication.koin 23 | } 24 | 25 | private var _koin: Koin_coreKoin? = nil 26 | var koin: Koin_coreKoin { 27 | return _koin! 28 | } 29 | 30 | //class IosAppInfo : AppInfo { 31 | // let appId: String = Bundle.main.bundleIdentifier! 32 | //} 33 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_still.imageset/ic_activity_still-1.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_still.imageset/ic_activity_still-2.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_still.imageset/ic_activity_still.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_bike.imageset/ic_activity_bike-1.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_bike.imageset/ic_activity_bike-2.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_bike.imageset/ic_activity_bike.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/commonMain/sqldelight/com/ludoscity/herdr/common/data/GeoTrackingDatapoint.sq: -------------------------------------------------------------------------------- 1 | 2 | CREATE TABLE geoTrackingDatapoint ( 3 | id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 4 | timestamp_epoch INTEGER NOT NULL, 5 | altitude REAL, 6 | accuracy_horizontal_meters REAL NOT NULL, 7 | accuracy_vertical_meters REAL, 8 | latitude REAL NOT NULL, 9 | longitude REAL NOT NULL, 10 | upload_completed INTEGER NOT NULL, 11 | timestamp TEXT NOT NULL 12 | ); 13 | 14 | 15 | insertOrReplace: 16 | INSERT OR REPLACE INTO geoTrackingDatapoint( 17 | timestamp_epoch, 18 | altitude, 19 | accuracy_horizontal_meters, 20 | accuracy_vertical_meters, 21 | latitude, 22 | longitude, 23 | upload_completed, 24 | timestamp 25 | ) VALUES ?; 26 | 27 | getById: 28 | SELECT * FROM geoTrackingDatapoint WHERE id = ?; 29 | 30 | selectAll: 31 | SELECT * FROM geoTrackingDatapoint; 32 | 33 | selectReadyForUploadAll: 34 | SELECT * FROM geoTrackingDatapoint WHERE upload_completed = 0; 35 | 36 | deleteById: 37 | DELETE FROM geoTrackingDatapoint WHERE id = ?; 38 | 39 | deleteUploadedAll: 40 | DELETE FROM geoTrackingDatapoint WHERE upload_completed != 0; 41 | 42 | updateUploadCompleted: 43 | UPDATE geoTrackingDatapoint SET upload_completed = 1 WHERE id = ?; -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/sample/Sample.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package sample 20 | 21 | expect class Sample() { 22 | fun checkMe(): Int 23 | } 24 | 25 | expect object Platform { 26 | val name: String 27 | } 28 | 29 | fun hello(): String = "Hello from ${Platform.name}" 30 | 31 | class Proxy { 32 | fun proxyHello() = hello() 33 | } 34 | 35 | fun main() { 36 | println(hello()) 37 | } -------------------------------------------------------------------------------- /app/src/commonTest/kotlin/sample/SampleTests.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package sample 20 | 21 | import kotlin.test.Test 22 | import kotlin.test.assertTrue 23 | 24 | class SampleTests { 25 | @Test 26 | fun testMe() { 27 | assertTrue(Sample().checkMe() > 0) 28 | } 29 | 30 | @Test 31 | fun testProxy() { 32 | assertTrue(Proxy().proxyHello().isNotEmpty()) 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/entity/AuthClientRegistration.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.entity 20 | 21 | data class AuthClientRegistration( 22 | val stackBaseUrl: String, 23 | val redirectUriCollection: List, 24 | val clientRegistrationToken: String, 25 | val clientId: String, 26 | val clientSecret: String 27 | ) -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_add_black_18dp.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/login/ObserveLoggedInUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.login 20 | 21 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 22 | 23 | class ObserveLoggedInUseCaseInput(val observer: (Boolean?) -> Unit) : 24 | BaseUseCaseInput { 25 | override fun validate(): Boolean { 26 | return true 27 | } 28 | } -------------------------------------------------------------------------------- /app/src/main/res/font/roboto.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | #2E92F5 22 | #004BA0 23 | #FFDD00 24 | 25 | #000000 26 | #FF5252 27 | #555555 28 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/geotracking/UpdateGeoTrackingUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.geotracking 20 | 21 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 22 | 23 | class UpdateGeoTrackingUseCaseInput(val newState: Boolean) : 24 | BaseUseCaseInput { 25 | override fun validate(): Boolean { 26 | return true 27 | } 28 | } -------------------------------------------------------------------------------- /app/src/iosX64Main/kotlin/com/ludoscity/herdr/common/data/database/getSqlDriver.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.data.database 20 | 21 | import com.squareup.sqldelight.db.SqlDriver 22 | import com.squareup.sqldelight.drivers.native.NativeSqliteDriver 23 | 24 | actual fun getSqlDriver(dbArgs: DbArgs): SqlDriver? { 25 | val driver: SqlDriver = NativeSqliteDriver(HerdrDatabase.Schema, "herdr.db") 26 | return driver 27 | } 28 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/geotracking/ObserveGeoTrackingUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.geotracking 20 | 21 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 22 | 23 | class ObserveGeoTrackingUseCaseInput(val observer: (Boolean) -> Unit) : 24 | BaseUseCaseInput { 25 | override fun validate(): Boolean { 26 | return true 27 | } 28 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/analytics/UpdateLocationPermissionGrantedUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.analytics 20 | 21 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 22 | 23 | class UpdateLocationPermissionGrantedUseCaseInput(val newState: Boolean) : 24 | BaseUseCaseInput { 25 | override fun validate(): Boolean { 26 | return true 27 | } 28 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/Platform.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common 20 | 21 | expect object Platform { 22 | val now: Long 23 | val nowString: String 24 | 25 | fun toISO8601UTC(timestampString: String): String 26 | fun hashBase64MD5(toHash: ByteArray): String 27 | val app_version: String 28 | val api_level: Long 29 | val device_model: String 30 | val language: String 31 | val country: String 32 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/login/SetupDirectoryUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.login 20 | 21 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 22 | 23 | class SetupDirectoryUseCaseInput(val name: String, val tags: List) : 24 | BaseUseCaseInput { 25 | override fun validate(): Boolean { 26 | return name.isNotEmpty() && name.isNotBlank() 27 | } 28 | } -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_vehicle.imageset/ic_activity_vehicle-1.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_vehicle.imageset/ic_activity_vehicle-2.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /iosApp/iosApp/Assets.xcassets/ic_activity_vehicle.imageset/ic_activity_vehicle.svg: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/commonMain/sqldelight/com/ludoscity/herdr/common/data/AnalTrackingDatapoint.sq: -------------------------------------------------------------------------------- 1 | 2 | CREATE TABLE analTrackingDatapoint ( 3 | id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 4 | timestamp_epoch INTEGER NOT NULL, 5 | app_version TEXT NOT NULL, 6 | api_level INTEGER NOT NULL, 7 | device_model TEXT NOT NULL, 8 | language TEXT NOT NULL, 9 | country TEXT NOT NULL, 10 | battery_charge_percentage INTEGER, 11 | description TEXT NOT NULL, 12 | upload_completed INTEGER NOT NULL, 13 | timestamp TEXT NOT NULL 14 | ); 15 | 16 | 17 | insertOrReplace: 18 | INSERT OR REPLACE INTO analTrackingDatapoint( 19 | timestamp_epoch, 20 | app_version, 21 | api_level, 22 | device_model, 23 | language, 24 | country, 25 | battery_charge_percentage, 26 | description, 27 | upload_completed, 28 | timestamp 29 | ) VALUES ?; 30 | 31 | getById: 32 | SELECT * FROM analTrackingDatapoint WHERE id = ?; 33 | 34 | selectAll: 35 | SELECT * FROM analTrackingDatapoint; 36 | 37 | selectReadyForUploadAll: 38 | SELECT * FROM analTrackingDatapoint WHERE upload_completed = 0; 39 | 40 | deleteById: 41 | DELETE FROM analTrackingDatapoint WHERE id = ?; 42 | 43 | deleteUploadedAll: 44 | DELETE FROM analTrackingDatapoint WHERE upload_completed != 0; 45 | 46 | updateUploadCompleted: 47 | UPDATE analTrackingDatapoint SET upload_completed = 1 WHERE id = ?; -------------------------------------------------------------------------------- /app/src/main/java/com/ludoscity/herdr/ui/main/HerdrApp.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.ui.main 20 | 21 | import android.app.Application 22 | import android.content.Context 23 | import com.ludoscity.herdr.common.di.initKoin 24 | import org.koin.dsl.module 25 | 26 | class HerdrApp : Application() { 27 | override fun onCreate() { 28 | super.onCreate() 29 | initKoin ( 30 | module { 31 | single { this@HerdrApp } 32 | } 33 | ) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/data/network/cozy/GeoTrackingUploadRequestBody.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.data.network.cozy 20 | 21 | import kotlinx.serialization.Serializable 22 | 23 | @Serializable 24 | data class GeoTrackingUploadRequestBody( 25 | val timestampEpoch: Long, 26 | val altitude: Double?, 27 | val accuracyHorizontalMeters: Double, 28 | val accuracyVerticalMeters: Double?, 29 | val latitude: Double, 30 | val longitude: Double, 31 | val timestamp: String 32 | ) -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launch_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/data/SecureDataStore.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.data 20 | 21 | expect class SecureDataStore() { 22 | suspend fun storeString(key: String, data: String) 23 | suspend fun retrieveString(key: String): String? 24 | suspend fun storeLong(key: String, data: Long) 25 | suspend fun retrieveLong(key: String): Long? 26 | suspend fun storeBoolean(key: String, data: Boolean) 27 | suspend fun retrieveBoolean(key: String): Boolean? 28 | suspend fun deleteKey(key: String) 29 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/useractivity/UpdateUserActivityUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.useractivity 20 | 21 | import com.ludoscity.herdr.common.data.repository.UserActivityTrackingRepository 22 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 23 | 24 | class UpdateUserActivityUseCaseInput(val newUserActivity: UserActivityTrackingRepository.UserActivity) : 25 | BaseUseCaseInput { 26 | override fun validate(): Boolean { 27 | return true 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/login/RegisterAuthClientUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.login 20 | 21 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 22 | 23 | class RegisterAuthClientUseCaseInput(val baseUrl: String, val fromCacheOnly: Boolean = false) : 24 | BaseUseCaseInput { 25 | override fun validate(): Boolean { 26 | return !(fromCacheOnly && baseUrl.isNotEmpty()) 27 | } 28 | 29 | constructor(fromCacheOnly: Boolean) : this("", fromCacheOnly) 30 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/useractivity/ObserveUserActivityUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.useractivity 20 | 21 | import com.ludoscity.herdr.common.data.repository.UserActivityTrackingRepository 22 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 23 | 24 | class ObserveUserActivityUseCaseInput(val observer: (UserActivityTrackingRepository.UserActivity?) -> Unit) : 25 | BaseUseCaseInput { 26 | override fun validate(): Boolean { 27 | return true 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/data/network/cozy/TokenSuccessReply.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.data.network.cozy 20 | 21 | import kotlinx.serialization.SerialName 22 | import kotlinx.serialization.Serializable 23 | 24 | @Serializable 25 | data class TokenSuccessReply( 26 | @SerialName("access_token") 27 | val accessToken: String, 28 | @SerialName("token_type") 29 | val tokenType: String, 30 | @SerialName("refresh_token") 31 | val refreshToken: String? = null, 32 | @SerialName("scope") 33 | val scope: String 34 | ) -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_cancel_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/data/network/cozy/AnalTrackingUploadRequestBody.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.data.network.cozy 20 | 21 | import kotlinx.serialization.Serializable 22 | 23 | @Serializable 24 | data class AnalTrackingUploadRequestBody( 25 | val timestampEpoch: Long, 26 | val appVersion: String, 27 | val apiLevel: Long, 28 | val deviceModel: String, 29 | val language: String, 30 | val country: String, 31 | val batteryChargePercentage: Long?, 32 | val description: String, 33 | val timestamp: String 34 | ) -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/useractivity/RetrieveWillGeoTrackUserActivityUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.useractivity 20 | 21 | import com.ludoscity.herdr.common.data.repository.UserActivityTrackingRepository 22 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 23 | 24 | class RetrieveWillGeoTrackUserActivityUseCaseInput(val act: UserActivityTrackingRepository.UserActivity) : 25 | BaseUseCaseInput { 26 | override fun validate(): Boolean { 27 | return true 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/useractivity/RetrieveLastUserActivityTimestampUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.useractivity 20 | 21 | import com.ludoscity.herdr.common.data.repository.UserActivityTrackingRepository 22 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 23 | 24 | class RetrieveLastUserActivityTimestampUseCaseInput(val act: UserActivityTrackingRepository.UserActivity) : 25 | BaseUseCaseInput { 26 | override fun validate(): Boolean { 27 | return true 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/login/RetrieveAccessAndRefreshTokenUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.login 20 | 21 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 22 | 23 | class RetrieveAccessAndRefreshTokenUseCaseInput(val authCode: String, val fromCacheOnly: Boolean = false) : 24 | BaseUseCaseInput { 25 | override fun validate(): Boolean { 26 | return !(fromCacheOnly && authCode.isNotEmpty()) 27 | } 28 | 29 | constructor(fromCacheOnly: Boolean) : this("", fromCacheOnly) 30 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_location_rec_24dp.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 24 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | herdr 21 | Create New Account 22 | open app 23 | Get Started 24 | Connection Setup 25 | Log in to Cozy Cloud 26 | Log In 27 | Cozy Cloud Setup 28 | Username Or Custom Domain 29 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/base/BaseUseCaseSync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.base 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | 23 | abstract class BaseUseCaseSync { 24 | 25 | protected var input: R? = null 26 | 27 | fun execute(input: R? = null): Response { 28 | this.input = input 29 | 30 | val validated = input?.validate() ?: true 31 | if (validated) return run() 32 | return Response.Error(IllegalArgumentException()) 33 | } 34 | 35 | abstract fun run(): Response 36 | } -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 29 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/useractivity/ObserveGeoTrackUserActivityUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.useractivity 20 | 21 | import com.ludoscity.herdr.common.data.repository.UserActivityTrackingRepository 22 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 23 | 24 | class ObserveGeoTrackUserActivityUseCaseInput( 25 | val userActivity: UserActivityTrackingRepository.UserActivity, 26 | val observer: (Boolean) -> Unit) : 27 | BaseUseCaseInput { 28 | override fun validate(): Boolean { 29 | return true 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/base/BaseUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.base 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | 23 | abstract class BaseUseCaseAsync { 24 | 25 | protected var input: R? = null 26 | 27 | suspend fun execute(input: R? = null): Response { 28 | this.input = input 29 | 30 | val validated = input?.validate() ?: true 31 | if (validated) return run() 32 | return Response.Error(IllegalArgumentException()) 33 | } 34 | 35 | abstract suspend fun run(): Response 36 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/useractivity/UpdateWillGeoTrackUserActivityUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.useractivity 20 | 21 | import com.ludoscity.herdr.common.data.repository.UserActivityTrackingRepository 22 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 23 | 24 | class UpdateWillGeoTrackUserActivityUseCaseInput(val act: UserActivityTrackingRepository.UserActivity, 25 | val newState: Boolean) : 26 | BaseUseCaseInput { 27 | override fun validate(): Boolean { 28 | return true 29 | } 30 | } -------------------------------------------------------------------------------- /app/src/iosMain/kotlin/com/ludoscity/herdr/common/ApplicationDispatcher.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common 20 | 21 | import kotlinx.coroutines.* 22 | import platform.darwin.* 23 | import kotlin.coroutines.CoroutineContext 24 | 25 | internal actual val ApplicationDispatcher: CoroutineContext = 26 | NsQueueDispatcher(dispatch_get_main_queue()) 27 | 28 | internal class NsQueueDispatcher( 29 | private val dispatchQueue: dispatch_queue_t 30 | ) : CoroutineDispatcher() { 31 | override fun dispatch(context: CoroutineContext, block: Runnable) { 32 | dispatch_async(dispatchQueue) { 33 | block.run() 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /iosApp/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://cdn.cocoapods.org/' 2 | 3 | # ignore all warnings from all pods 4 | inhibit_all_warnings! 5 | 6 | use_frameworks! 7 | platform :ios, '11.0' 8 | 9 | # workaround for https://github.com/CocoaPods/CocoaPods/issues/8073 10 | # need for correct invalidate of cache MultiPlatformLibrary.framework 11 | install! 'cocoapods', :disable_input_output_paths => true 12 | 13 | pre_install do |installer| 14 | # We represent a Kotlin/Native module to CocoaPods as a vendored framework. 15 | # CocoaPods needs access to such frameworks during installation process to obtain 16 | # their type (static or dynamic) and configure the Xcode project accordingly. 17 | # Build MultiPlatformLibrary framework to correct install Pod 18 | puts "prepare MultiPlatformLibrary.framework (require some time...)" 19 | `cd .. && ./gradlew :app:syncMultiPlatformLibraryDebugFrameworkIosX64` 20 | puts "preparing MultiPlatformLibrary.framework complete" 21 | end 22 | 23 | target 'iosApp' do 24 | pod 'AppAuth', '1.4.0' 25 | pod 'SecureDefaults', '1.0.0' 26 | pod 'MaterialComponents/Buttons' 27 | pod 'MaterialComponents/Buttons+Theming' 28 | pod 'MaterialComponents/Cards' 29 | pod 'MaterialComponents/Cards+Theming' 30 | pod 'MaterialComponents/schemes/Shape' 31 | # pod 'MaterialComponents/TextControls+OutlinedTextFields' 32 | pod 'MaterialComponents/TextFields' 33 | pod 'MultiPlatformLibrary', :path => '../app' 34 | pod 'MultiPlatformLibraryMvvm/Core', 35 | :git => 'https://github.com/icerockdev/moko-mvvm.git', :tag => 'release/0.9.1' 36 | end -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/base/Response.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.base 20 | 21 | sealed class Response { 22 | class Success(val data: T) : Response() 23 | data class Error( 24 | val exception: Throwable, 25 | val code: Int? = null, 26 | val error: Boolean? = null, 27 | val errorCollection: List? = null, 28 | val message: String? = null, 29 | val method: String? = null, 30 | val path: String? = null 31 | ) : Response() 32 | } 33 | 34 | data class ErrorElement( 35 | val message: String, 36 | val path: String 37 | ) -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/data/network/cozy/FileRelatedRequestReply.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.data.network.cozy 20 | 21 | import kotlinx.serialization.Serializable 22 | 23 | @Serializable 24 | data class CozyFileDescAttributesMetadata(val createdOn: String) 25 | 26 | @Serializable 27 | data class CozyFileDescAttributes( 28 | val name: String, 29 | val path: String, 30 | val cozyMetadata: CozyFileDescAttributesMetadata 31 | ) 32 | 33 | @Serializable 34 | data class CozyFileDesc(val id: String, val attributes: CozyFileDescAttributes) 35 | 36 | @Serializable 37 | data class CozyFileDescAnswerRoot(val data: CozyFileDesc) -------------------------------------------------------------------------------- /app/src/main/java/sample/SampleAndroid.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package sample 20 | 21 | import androidx.appcompat.app.AppCompatActivity 22 | import android.os.Bundle 23 | import android.widget.TextView 24 | import com.ludoscity.herdr.R 25 | 26 | actual class Sample { 27 | actual fun checkMe() = 44 28 | } 29 | 30 | actual object Platform { 31 | actual val name: String = "Android" 32 | } 33 | 34 | class MainActivity : AppCompatActivity() { 35 | 36 | override fun onCreate(savedInstanceState: Bundle?) { 37 | super.onCreate(savedInstanceState) 38 | Sample().checkMe() 39 | setContentView(R.layout.activity_main) 40 | findViewById(R.id.main_text).text = hello() 41 | } 42 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/login/checkLoginStatusUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.login 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.HeadlessRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 24 | import org.koin.core.KoinComponent 25 | import org.koin.core.inject 26 | 27 | class CheckLoginStatusUseCaseAsync : KoinComponent, 28 | BaseUseCaseAsync() { 29 | private val repo: HeadlessRepository by inject() 30 | override suspend fun run(): Response { 31 | return repo.checkLoginStatus() 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/login/ObserveLoggedInUseCaseSync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.login 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.LoginRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseSync 24 | import org.koin.core.KoinComponent 25 | import org.koin.core.inject 26 | 27 | class ObserveLoggedInUseCaseSync : KoinComponent, 28 | BaseUseCaseSync() { 29 | private val repo: LoginRepository by inject() 30 | override fun run(): Response { 31 | return repo.addLoggedInObserver(input!!.observer) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/analytics/PurgeAllAnalyticsDatapointUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | package com.ludoscity.herdr.common.domain.usecase.analytics 19 | 20 | import com.ludoscity.herdr.common.base.Response 21 | import com.ludoscity.herdr.common.data.repository.HeadlessRepository 22 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 23 | import org.koin.core.KoinComponent 24 | import org.koin.core.inject 25 | 26 | class PurgeAllAnalyticsDatapointUseCaseAsync : KoinComponent, 27 | BaseUseCaseAsync() { 28 | private val repo: HeadlessRepository by inject() 29 | override suspend fun run(): Response { 30 | return repo.purgeAllAnalTrackingDatapointAlreadyUploaded() 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/analytics/UploadAllAnalyticsDatapointUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | package com.ludoscity.herdr.common.domain.usecase.analytics 19 | 20 | import com.ludoscity.herdr.common.base.Response 21 | import com.ludoscity.herdr.common.data.repository.HeadlessRepository 22 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 23 | import org.koin.core.KoinComponent 24 | import org.koin.core.inject 25 | 26 | class UploadAllAnalyticsDatapointUseCaseAsync : KoinComponent, 27 | BaseUseCaseAsync() { 28 | private val repo: HeadlessRepository by inject() 29 | override suspend fun run(): Response { 30 | return repo.uploadAllAnalTrackingDatapointReadyForUpload() 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/ui/drivelogin/UserCredentialsState.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.ui.drivelogin 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.domain.entity.UserCredentials 23 | 24 | sealed class UserCredentialsState { 25 | abstract val response: Response? 26 | } 27 | 28 | data class SuccessUserCredentials(override val response: Response) : 29 | UserCredentialsState() 30 | 31 | data class InProgressUserCredentials(override val response: Response? = null) : 32 | UserCredentialsState() 33 | 34 | data class ErrorUserCredentials(override val response: Response) : 35 | UserCredentialsState() -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/geotracking/ObserveGeoTrackingUseCaseSync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.geotracking 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.GeoTrackingRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseSync 24 | import org.koin.core.KoinComponent 25 | import org.koin.core.inject 26 | 27 | class ObserveGeoTrackingUseCaseSync : KoinComponent, 28 | BaseUseCaseSync() { 29 | private val repo: GeoTrackingRepository by inject() 30 | override fun run(): Response { 31 | return repo.addGeoTrackingObserver(input!!.observer) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/geotracking/PurgeAllGeoTrackingDatapointUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | package com.ludoscity.herdr.common.domain.usecase.geotracking 19 | 20 | import com.ludoscity.herdr.common.base.Response 21 | import com.ludoscity.herdr.common.data.repository.HeadlessRepository 22 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 23 | import org.koin.core.KoinComponent 24 | import org.koin.core.inject 25 | 26 | class PurgeAllGeoTrackingDatapointUseCaseAsync : KoinComponent, 27 | BaseUseCaseAsync() { 28 | private val repo: HeadlessRepository by inject() 29 | override suspend fun run(): Response { 30 | return repo.purgeAllGeoTrackingDatapointAlreadyUploaded() 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/geotracking/UpdateGeoTrackingUseCaseSync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.geotracking 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.GeoTrackingRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseSync 24 | import org.koin.core.KoinComponent 25 | import org.koin.core.inject 26 | 27 | class UpdateGeoTrackingUseCaseSync : KoinComponent, 28 | BaseUseCaseSync() { 29 | private val repo: GeoTrackingRepository by inject() 30 | override fun run(): Response { 31 | 32 | return repo.updateGeoTracking(input!!.newState) 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/geotracking/UploadAllGeoTrackingDatapointUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | package com.ludoscity.herdr.common.domain.usecase.geotracking 19 | 20 | import com.ludoscity.herdr.common.base.Response 21 | import com.ludoscity.herdr.common.data.repository.HeadlessRepository 22 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 23 | import org.koin.core.KoinComponent 24 | import org.koin.core.inject 25 | 26 | class UploadAllGeoTrackingDatapointUseCaseAsync : KoinComponent, 27 | BaseUseCaseAsync() { 28 | private val repo: HeadlessRepository by inject() 29 | override suspend fun run(): Response { 30 | return repo.uploadAllGeoTrackingDatapointReadyForUpload() 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_yellow_folder_76dp.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 24 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/useractivity/UpdateUserActivityUseCaseSync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.useractivity 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.UserActivityTrackingRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseSync 24 | import org.koin.core.KoinComponent 25 | import org.koin.core.inject 26 | 27 | class UpdateUserActivityUseCaseSync : KoinComponent, 28 | BaseUseCaseSync() { 29 | private val repo: UserActivityTrackingRepository by inject() 30 | override fun run(): Response { 31 | return repo.onNewUserActivity(input!!.newUserActivity) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/ludoscity/herdr/common/Timer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common 20 | 21 | import android.os.Handler 22 | import android.os.Looper 23 | 24 | actual class Timer actual constructor( 25 | actual val periodMilliSeconds: Long, 26 | block: () -> Boolean 27 | ) { 28 | 29 | private val handler = Handler(Looper.getMainLooper()) 30 | private val runnable = object : Runnable { 31 | override fun run() { 32 | if (block()) { 33 | handler.postDelayed(this, periodMilliSeconds) 34 | } 35 | } 36 | } 37 | 38 | actual fun start() { 39 | handler.postDelayed(runnable, periodMilliSeconds) 40 | } 41 | 42 | actual fun stop() { 43 | handler.removeCallbacks(runnable) 44 | } 45 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/useractivity/ObserveUserActivityUseCaseSync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.useractivity 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.UserActivityTrackingRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseSync 24 | import org.koin.core.KoinComponent 25 | import org.koin.core.inject 26 | 27 | class ObserveUserActivityUseCaseSync : KoinComponent, 28 | BaseUseCaseSync() { 29 | private val repo: UserActivityTrackingRepository by inject() 30 | override fun run(): Response { 31 | return repo.addUserActivityObserver(input!!.observer) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/login/UnregisterAuthClientUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.login 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.LoginRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 24 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 25 | import org.koin.core.KoinComponent 26 | import org.koin.core.inject 27 | 28 | class UnregisterAuthClientUseCaseAsync() : KoinComponent, 29 | BaseUseCaseAsync() { 30 | private val repo: LoginRepository by inject() 31 | override suspend fun run(): Response { 32 | return repo.clearAuthClientRegistration() 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/analytics/GetPermissionGrantedUseCaseSync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.analytics 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.AnalTrackingRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseSync 24 | import dev.icerock.moko.mvvm.livedata.LiveData 25 | import org.koin.core.KoinComponent 26 | import org.koin.core.inject 27 | 28 | class GetPermissionGrantedUseCaseSync : KoinComponent, 29 | BaseUseCaseSync>() { 30 | private val repo: AnalTrackingRepository by inject() 31 | override fun run(): Response> { 32 | return Response.Success(repo.hasLocationPermission) 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/login/RefreshAccessAndRefreshTokenUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.login 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.LoginRepository 23 | import com.ludoscity.herdr.common.domain.entity.UserCredentials 24 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 25 | import org.koin.core.KoinComponent 26 | import org.koin.core.inject 27 | 28 | class RefreshAccessAndRefreshTokenUseCaseAsync() : KoinComponent, 29 | BaseUseCaseAsync() { 30 | private val repo: LoginRepository by inject() 31 | override suspend fun run(): Response { 32 | return repo.refreshAccessToken() 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/useractivity/RetrieveLastUserActivityTimestampUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.useractivity 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.HeadlessRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 24 | import org.koin.core.KoinComponent 25 | import org.koin.core.inject 26 | 27 | class RetrieveLastUserActivityTimestampUseCaseAsync : KoinComponent, 28 | BaseUseCaseAsync() { 29 | private val repo: HeadlessRepository by inject() 30 | override suspend fun run(): Response { 31 | return repo.retrieveLastUserActivityTimestamp(input!!.act) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/useractivity/RetrieveWillGeoTrackUserActivityUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.useractivity 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.HeadlessRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 24 | import org.koin.core.KoinComponent 25 | import org.koin.core.inject 26 | 27 | class RetrieveWillGeoTrackUserActivityUseCaseAsync : KoinComponent, 28 | BaseUseCaseAsync() { 29 | private val repo: HeadlessRepository by inject() 30 | override suspend fun run(): Response { 31 | return repo.retrieveWillGeoTrackUserActivity(input!!.act) 32 | } 33 | } -------------------------------------------------------------------------------- /iosApp/iosApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | herdr_ios 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/useractivity/ObserveGeoTrackUserActivityUseCaseSync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.useractivity 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.UserActivityTrackingRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseSync 24 | import org.koin.core.KoinComponent 25 | import org.koin.core.inject 26 | 27 | class ObserveGeoTrackUserActivityUseCaseSync : KoinComponent, 28 | BaseUseCaseSync() { 29 | private val repo: UserActivityTrackingRepository by inject() 30 | override fun run(): Response { 31 | return repo.addGeoTrackActivityObserver(input!!.userActivity, input!!.observer) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/ui/drivelogin/AuthClientRegistrationState.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.ui.drivelogin 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.domain.entity.AuthClientRegistration 23 | 24 | sealed class AuthClientRegistrationState { 25 | abstract val response: Response? 26 | } 27 | 28 | data class SuccessAuthClientRegistration(override val response: Response) : 29 | AuthClientRegistrationState() 30 | 31 | data class InProgressAuthClientRegistration(override val response: Response? = null) : 32 | AuthClientRegistrationState() 33 | 34 | data class ErrorAuthClientRegistration(override val response: Response) : 35 | AuthClientRegistrationState() -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/useractivity/UpdateWillGeoTrackUserActivityUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.useractivity 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.UserActivityTrackingRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 24 | import org.koin.core.KoinComponent 25 | import org.koin.core.inject 26 | 27 | class UpdateWillGeoTrackUserActivityUseCaseAsync : KoinComponent, 28 | BaseUseCaseAsync() { 29 | private val repo: UserActivityTrackingRepository by inject() 30 | override suspend fun run(): Response { 31 | 32 | return repo.onWillGeoTrackUserActivity(input!!.act, input!!.newState) 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_activity_walk_24px.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /iosApp/iosApp/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/login/SetupDirectoryUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | package com.ludoscity.herdr.common.domain.usecase.login 19 | 20 | import com.ludoscity.herdr.common.base.Response 21 | import com.ludoscity.herdr.common.data.repository.LoginRepository 22 | import com.ludoscity.herdr.common.domain.entity.RawDataCloudFolderConfiguration 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 24 | import org.koin.core.KoinComponent 25 | import org.koin.core.inject 26 | 27 | class SetupDirectoryUseCaseAsync : KoinComponent, 28 | BaseUseCaseAsync() { 29 | private val repo: LoginRepository by inject() 30 | override suspend fun run(): Response { 31 | return repo.setupDirectory(input!!.name, input!!.tags) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/login/RegisterAuthClientUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.login 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.LoginRepository 23 | import com.ludoscity.herdr.common.domain.entity.AuthClientRegistration 24 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 25 | import org.koin.core.KoinComponent 26 | import org.koin.core.inject 27 | 28 | class RegisterAuthClientUseCaseAsync : KoinComponent, 29 | BaseUseCaseAsync() { 30 | private val repo: LoginRepository by inject() 31 | override suspend fun run(): Response { 32 | return repo.getAuthClientRegistration(input!!.baseUrl, input!!.fromCacheOnly) 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/analytics/SaveAnalyticsDatapointUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | package com.ludoscity.herdr.common.domain.usecase.analytics 19 | 20 | import com.ludoscity.herdr.common.base.Response 21 | import com.ludoscity.herdr.common.data.AnalTrackingDatapoint 22 | import com.ludoscity.herdr.common.data.repository.AnalTrackingRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 24 | import org.koin.core.KoinComponent 25 | import org.koin.core.inject 26 | 27 | class SaveAnalyticsDatapointUseCaseAsync : KoinComponent, 28 | BaseUseCaseAsync>() { 29 | private val repo: AnalTrackingRepository by inject() 30 | override suspend fun run(): Response> { 31 | return repo.insertAnalTrackingDatapoint(input!!.toSave) 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/geotracking/UpdateUserLocGeoTrackingDatapointUseCaseSync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.geotracking 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.GeoTrackingDatapoint 23 | import com.ludoscity.herdr.common.data.repository.GeoTrackingRepository 24 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseSync 25 | import org.koin.core.KoinComponent 26 | import org.koin.core.inject 27 | 28 | class UpdateUserLocGeoTrackingDatapointUseCaseSync : KoinComponent, 29 | BaseUseCaseSync() { 30 | private val repo: GeoTrackingRepository by inject() 31 | override fun run(): Response { 32 | 33 | return repo.onNewUserLocation(input!!.toSave) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/login/RetrieveAccessAndRefreshTokenUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.login 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.LoginRepository 23 | import com.ludoscity.herdr.common.domain.entity.UserCredentials 24 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 25 | import org.koin.core.KoinComponent 26 | import org.koin.core.inject 27 | 28 | class RetrieveAccessAndRefreshTokenUseCaseAsync : KoinComponent, 29 | BaseUseCaseAsync() { 30 | private val repo: LoginRepository by inject() 31 | override suspend fun run(): Response { 32 | return repo.getUserCredentials(input!!.authCode, input!!.fromCacheOnly) 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/geotracking/SaveGeoTrackingDatapointUseCaseAsync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.geotracking 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.GeoTrackingDatapoint 23 | import com.ludoscity.herdr.common.data.repository.GeoTrackingRepository 24 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseAsync 25 | import org.koin.core.KoinComponent 26 | import org.koin.core.inject 27 | 28 | class SaveGeoTrackingDatapointUseCaseAsync : KoinComponent, 29 | BaseUseCaseAsync>() { 30 | private val repo: GeoTrackingRepository by inject() 31 | override suspend fun run(): Response> { 32 | return repo.insertGeoTrackingDatapoint(input!!.toSave) 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/analytics/UpdatePermissionGrantedUseCaseSync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.analytics 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.AnalTrackingRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseSync 24 | import org.koin.core.KoinComponent 25 | import org.koin.core.inject 26 | 27 | class UpdatePermissionGrantedUseCaseSync : KoinComponent, 28 | BaseUseCaseSync() { 29 | private val repo: AnalTrackingRepository by inject() 30 | override fun run(): Response { 31 | 32 | return if (input?.newState == true) { 33 | repo.onLocationPermissionAccepted() 34 | } else { 35 | repo.onLocationPermissionDenied() 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /app/src/iosMain/kotlin/com/ludoscity/herdr/common/PlatformIos.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common 20 | 21 | actual object Platform { 22 | actual val app_version: String = "iOS:" 23 | actual val api_level: Long 24 | get() = TODO("Not yet implemented") 25 | actual val device_model: String 26 | get() = TODO("Not yet implemented") 27 | actual val language: String 28 | get() = TODO("Not yet implemented") 29 | actual val country: String 30 | get() = TODO("Not yet implemented") 31 | actual val now: Long 32 | get() = TODO("Not yet implemented") 33 | actual val nowString: String 34 | get() = TODO("Not yet implemented") 35 | 36 | actual fun toISO8601UTC(timestampString: String): String { 37 | TODO("Not yet implemented") 38 | } 39 | 40 | actual fun hashBase64MD5(toHash: ByteArray): String { 41 | TODO("Not yet implemented") 42 | } 43 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/ui/drivesetup/DriveSetupViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.ui.drivesetup 20 | 21 | import dev.icerock.moko.mvvm.dispatcher.EventsDispatcher 22 | import dev.icerock.moko.mvvm.dispatcher.EventsDispatcherOwner 23 | import dev.icerock.moko.mvvm.viewmodel.ViewModel 24 | 25 | class DriveSetupViewModel(override val eventsDispatcher: EventsDispatcher) 26 | : ViewModel(), EventsDispatcherOwner { 27 | 28 | fun onLoginButtonPressed() { 29 | eventsDispatcher.dispatchEvent { routeToDriveLogin() } 30 | } 31 | 32 | fun onCreateAccountButtonPressed() { 33 | eventsDispatcher.dispatchEvent { routeToCreateAccount() } 34 | } 35 | 36 | interface DriveSetupFragmentEventListener { 37 | fun routeToDriveLogin() 38 | fun routeToCreateAccount() 39 | } 40 | } -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/useractivity/RetrieveUserActivityUseCaseSync.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.useractivity 20 | 21 | import com.ludoscity.herdr.common.base.Response 22 | import com.ludoscity.herdr.common.data.repository.UserActivityTrackingRepository 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseSync 24 | import org.koin.core.KoinComponent 25 | import org.koin.core.inject 26 | 27 | class RetrieveUserActivityUseCaseSync : KoinComponent, 28 | BaseUseCaseSync() { 29 | private val repo: UserActivityTrackingRepository by inject() 30 | override fun run(): Response { 31 | return Response.Success(repo.userActivity.value) // FIXME? 32 | // maybe at repo level we shall have no LiveData and models regularly pull from repo? 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_activity_run_24px.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/geotracking/SaveGeoTrackingDatapointUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.geotracking 20 | 21 | import com.ludoscity.herdr.common.Platform 22 | import com.ludoscity.herdr.common.data.GeoTrackingDatapoint 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 24 | 25 | class SaveGeoTrackingDatapointUseCaseInput(toSave: GeoTrackingDatapoint) : 26 | BaseUseCaseInput { 27 | 28 | val toSave:GeoTrackingDatapoint = GeoTrackingDatapoint( 29 | -1, 30 | Platform.now, 31 | toSave.altitude, 32 | toSave.accuracy_horizontal_meters, 33 | toSave.accuracy_vertical_meters, 34 | toSave.latitude, 35 | toSave.longitude, 36 | 0L, 37 | Platform.nowString 38 | ) 39 | 40 | override fun validate(): Boolean { 41 | return true 42 | } 43 | } -------------------------------------------------------------------------------- /app/MultiPlatformLibrary.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |spec| 2 | spec.name = 'MultiPlatformLibrary' 3 | spec.version = '0.1.0' 4 | spec.homepage = 'Link to a Kotlin/Native module homepage' 5 | spec.source = { :git => "Not Published", :tag => "Cocoapods/#{spec.name}/#{spec.version}" } 6 | spec.authors = 'IceRock Development' 7 | spec.license = '' 8 | spec.summary = 'Shared code between iOS and Android' 9 | 10 | spec.vendored_frameworks = "build/cocoapods/framework/#{spec.name}.framework" 11 | spec.libraries = "c++" 12 | spec.module_name = "#{spec.name}_umbrella" 13 | 14 | spec.ios.deployment_target = '11.0' 15 | 16 | spec.pod_target_xcconfig = { 17 | 'MPP_LIBRARY_NAME' => 'MultiPlatformLibrary', 18 | 'GRADLE_TASK[sdk=iphonesimulator*][config=*ebug]' => 'syncMultiPlatformLibraryDebugFrameworkIosX64', 19 | 'GRADLE_TASK[sdk=iphonesimulator*][config=*elease]' => 'syncMultiPlatformLibraryReleaseFrameworkIosX64', 20 | 'GRADLE_TASK[sdk=iphoneos*][config=*ebug]' => 'syncMultiPlatformLibraryDebugFrameworkIosArm64', 21 | 'GRADLE_TASK[sdk=iphoneos*][config=*elease]' => 'syncMultiPlatformLibraryReleaseFrameworkIosArm64' 22 | } 23 | 24 | spec.script_phases = [ 25 | { 26 | :name => 'Compile Kotlin/Native', 27 | :execution_position => :before_compile, 28 | :shell_path => '/bin/sh', 29 | :script => <<-SCRIPT 30 | MPP_PROJECT_ROOT="$SRCROOT/../../app" 31 | 32 | MPP_OUTPUT_DIR="$MPP_PROJECT_ROOT/build/cocoapods/framework" 33 | MPP_OUTPUT_NAME="$MPP_OUTPUT_DIR/#{spec.name}.framework" 34 | 35 | "$MPP_PROJECT_ROOT/../gradlew" -p "$MPP_PROJECT_ROOT" "$GRADLE_TASK" 36 | SCRIPT 37 | } 38 | ] 39 | end -------------------------------------------------------------------------------- /app/src/main/java/com/ludoscity/herdr/common/di/KoinAndroid.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.di 20 | 21 | import co.touchlab.kermit.Kermit 22 | import co.touchlab.kermit.LogcatLogger 23 | import com.ludoscity.herdr.BuildConfig 24 | import com.ludoscity.herdr.common.data.SecureDataStore 25 | import com.ludoscity.herdr.common.data.database.HerdrDatabase 26 | import com.squareup.sqldelight.android.AndroidSqliteDriver 27 | import com.squareup.sqldelight.db.SqlDriver 28 | import org.koin.core.module.Module 29 | import org.koin.dsl.module 30 | 31 | 32 | actual val platformModule: Module = module { 33 | single { 34 | AndroidSqliteDriver( 35 | HerdrDatabase.Schema, 36 | get(), 37 | BuildConfig.DATABASE_NAME 38 | ) 39 | } 40 | 41 | single { SecureDataStore(get()) } 42 | val baseKermit = Kermit(LogcatLogger()).withTag("KampKit") 43 | factory { (tag: String?) -> if (tag != null) baseKermit.withTag(tag) else baseKermit } 44 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 26 | 27 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/iosMain/kotlin/com/ludoscity/herdr/common/di/KoinIOS.kt: -------------------------------------------------------------------------------- 1 | package com.ludoscity.herdr.common.di 2 | 3 | import co.touchlab.kermit.Kermit 4 | import co.touchlab.kermit.NSLogLogger 5 | import com.ludoscity.herdr.common.data.SecureDataStore 6 | import com.ludoscity.herdr.common.data.database.DbArgs 7 | import com.ludoscity.herdr.common.data.database.HerdrDatabase 8 | import com.ludoscity.herdr.common.data.database.getSqlDriver 9 | import com.squareup.sqldelight.db.SqlDriver 10 | import kotlinx.cinterop.ObjCClass 11 | import kotlinx.cinterop.getOriginalKotlinClass 12 | import org.koin.core.Koin 13 | import org.koin.core.KoinApplication 14 | import org.koin.core.parameter.parametersOf 15 | import org.koin.core.qualifier.Qualifier 16 | import org.koin.dsl.module 17 | 18 | fun initKoinIos( 19 | dataStore: SecureDataStore 20 | ): KoinApplication = initKoin( 21 | module { 22 | single { dataStore } 23 | } 24 | ) 25 | 26 | actual val platformModule = module { 27 | //single { 28 | // val userDefaults = NSUserDefaults(suiteName = "KAMPSTARTER_SETTINGS") 29 | // AppleSettings(userDefaults) 30 | //} 31 | single { getSqlDriver(DbArgs())!! } 32 | 33 | val baseKermit = Kermit(NSLogLogger()).withTag("Herdr") 34 | factory { (tag: String?) -> if (tag != null) baseKermit.withTag(tag) else baseKermit } 35 | } 36 | 37 | fun Koin.get(objCClass: ObjCClass, qualifier: Qualifier?, parameter: Any): Any { 38 | val kClazz = getOriginalKotlinClass(objCClass)!! 39 | return get(kClazz, qualifier) { parametersOf(parameter) } 40 | } 41 | 42 | fun Koin.get(objCClass: ObjCClass, parameter: Any): Any { 43 | val kClazz = getOriginalKotlinClass(objCClass)!! 44 | return get(kClazz, null) { parametersOf(parameter) } 45 | } 46 | 47 | fun Koin.get(objCClass: ObjCClass, qualifier: Qualifier?): Any { 48 | val kClazz = getOriginalKotlinClass(objCClass)!! 49 | return get(kClazz, qualifier, null) 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_activity_bike_24px.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/commonMain/kotlin/com/ludoscity/herdr/common/domain/usecase/analytics/SaveAnalyticsDatapointUseCaseInput.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. f8full https://github.com/f8full 3 | * Herdr is a privacy conscious multiplatform mobile data collector 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser 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 Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | package com.ludoscity.herdr.common.domain.usecase.analytics 20 | 21 | import com.ludoscity.herdr.common.Platform 22 | import com.ludoscity.herdr.common.data.AnalTrackingDatapoint 23 | import com.ludoscity.herdr.common.domain.usecase.base.BaseUseCaseInput 24 | 25 | class SaveAnalyticsDatapointUseCaseInput( 26 | batteryChargePercentage: Long? = null, 27 | description: String 28 | 29 | ) : 30 | BaseUseCaseInput { 31 | val toSave: AnalTrackingDatapoint = AnalTrackingDatapoint( 32 | -1, 33 | Platform.now, 34 | Platform.app_version, 35 | Platform.api_level, 36 | Platform.device_model, 37 | Platform.language, 38 | Platform.country, 39 | batteryChargePercentage, 40 | description, 41 | 0L, 42 | Platform.nowString 43 | ) 44 | 45 | override fun validate(): Boolean { 46 | return true 47 | } 48 | } --------------------------------------------------------------------------------