Skip to content

Commit

Permalink
Merge pull request #164 from ProteGO-Safe/release/4.9.0
Browse files Browse the repository at this point in the history
Release/4.9.0
  • Loading branch information
pkleczko authored Jan 5, 2021
2 parents 9ea3b9e + d2ac577 commit d9ca926
Show file tree
Hide file tree
Showing 160 changed files with 3,300 additions and 491 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@ Dev: ./app/src/dev/google-services.json

## ChangeLog

4.9.0

Added information on COVID-19 statistics in Poland

Added information about the checks carried out by the application on meetings with people who reported to have got sick with COVID-19

Added history of application activity (information about performed checks, indicated threats, system notifications)

Added possibility of redirecting to a specific application screen by system notification

Added possibility to evaluate applications in the Google Play / Apple App Store

Added translations of the application into Russian, German and Turkish.

Updated UI

4.8.0

Possibility to share Temporary Exposure Keys with other countries
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ android {
applicationId "pl.gov.mc.protegosafe"
minSdkVersion 21
targetSdkVersion 29
versionCode 77
versionName "4.8.0"
versionCode 81
versionName "4.9.0"

setProperty("archivesBaseName", "protegosafe-${defaultConfig.versionName}-${defaultConfig.versionCode}")

Expand Down
28 changes: 28 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,26 @@

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:scheme="https"
android:host="safesafe.app" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:scheme="http"
android:host="safesafe.app" />
</intent-filter>
</activity>

<meta-data
Expand All @@ -57,6 +77,7 @@
android:permission="com.google.android.gms.nearby.exposurenotification.EXPOSURE_CALLBACK">
<intent-filter>
<action android:name="com.google.android.gms.exposurenotification.ACTION_EXPOSURE_STATE_UPDATED" />
<action android:name="com.google.android.gms.exposurenotification.ACTION_EXPOSURE_NOT_FOUND" />
</intent-filter>
</receiver>

Expand All @@ -66,6 +87,13 @@
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
</intent-filter>
</receiver>
<receiver
android:name=".receiver.UnsubscribeCovidStatsTopicBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name=".Consts.ACTION_UNSUBSCRIBE_COVID_STATS_TOPIC" />
</intent-filter>
</receiver>

</application>

Expand Down
21 changes: 19 additions & 2 deletions app/src/main/java/pl/gov/mc/protegosafe/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ import pl.gov.mc.protegosafe.data.db.realm.RealmDatabaseBuilder
import pl.gov.mc.protegosafe.data.di.dataModule
import pl.gov.mc.protegosafe.data.extension.copyTo
import pl.gov.mc.protegosafe.di.appModule
import pl.gov.mc.protegosafe.di.deviceModule
import pl.gov.mc.protegosafe.device.di.deviceModule
import pl.gov.mc.protegosafe.di.useCaseModule
import pl.gov.mc.protegosafe.di.viewModelModule
import pl.gov.mc.protegosafe.domain.repository.CertificatePinningRepository
import pl.gov.mc.protegosafe.domain.scheduler.ApplicationTaskScheduler
import pl.gov.mc.protegosafe.domain.usecase.PrepareMigrationIfRequiredUseCase
import pl.gov.mc.protegosafe.domain.usecase.RescheduleProvideDiagnosisKeysTaskUseCase
import pl.gov.mc.protegosafe.domain.usecase.SubscribeCovidStatusTopicUseCase
import timber.log.Timber

open class App : Application(), KoinComponent {
Expand All @@ -52,6 +54,7 @@ open class App : Application(), KoinComponent {
initializeFcm()
initializeStetho()
initializeThreeTenABP()
rescheduleProvideDiagnosisKeysTask()
scheduleRemoveOldExposuresTask()
scheduleUpdateDistrictsRestrictionsTask()
}
Expand All @@ -78,12 +81,16 @@ open class App : Application(), KoinComponent {
AndroidThreeTen.init(this)
}

private fun rescheduleProvideDiagnosisKeysTask() {
get<RescheduleProvideDiagnosisKeysTaskUseCase>().execute()
}

private fun scheduleRemoveOldExposuresTask() {
applicationTaskScheduler.scheduleRemoveOldExposuresTask()
}

private fun scheduleUpdateDistrictsRestrictionsTask() {
applicationTaskScheduler.scheduleUpdateDistrictsRestrictionsTask()
applicationTaskScheduler.scheduleUpdateDistrictsRestrictionsTask(false)
}

private fun initializeDatabase() {
Expand Down Expand Up @@ -154,6 +161,16 @@ open class App : Application(), KoinComponent {
)
}
}

get<SubscribeCovidStatusTopicUseCase>().execute()
.subscribe(
{
Timber.d("FCM COVID STATS topic subscribe success")
},
{
Timber.e(it)
}
).addTo(disposables)
}

private fun initializeStetho() {
Expand Down
39 changes: 39 additions & 0 deletions app/src/main/java/pl/gov/mc/protegosafe/AppRepositoryImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@ package pl.gov.mc.protegosafe
import android.annotation.SuppressLint
import android.content.Context
import android.content.SharedPreferences
import com.google.firebase.messaging.FirebaseMessaging
import io.reactivex.Completable
import io.reactivex.Single
import io.realm.Realm
import pl.gov.mc.protegosafe.data.db.AppLanguageDataStore
import pl.gov.mc.protegosafe.data.db.CovidStatsDataStore
import pl.gov.mc.protegosafe.data.db.WorkersIntervalDataStore
import pl.gov.mc.protegosafe.data.db.realm.RealmDatabaseBuilder
import pl.gov.mc.protegosafe.data.extension.toCompletable
import pl.gov.mc.protegosafe.domain.repository.AppRepository
import timber.log.Timber
import java.util.Locale

class AppRepositoryImpl(
private val appLanguageDataStore: AppLanguageDataStore,
private val sharedPreferences: SharedPreferences,
private val realmDatabaseBuilder: RealmDatabaseBuilder,
private val covidStatsDataStore: CovidStatsDataStore,
private val workersIntervalDataStore: WorkersIntervalDataStore,
private val context: Context
) : AppRepository {
Expand All @@ -37,6 +42,12 @@ class AppRepositoryImpl(
}
}

override fun getAppLanguage(): Single<String> {
return Single.fromCallable {
appLanguageDataStore.appLanguageISO
}
}

override fun getFontScale(): Single<Float> {
return Single.just(context.resources.configuration.fontScale)
}
Expand Down Expand Up @@ -75,4 +86,32 @@ class AppRepositoryImpl(
override fun setWorkersInterval(intervalInMinutes: Long) {
workersIntervalDataStore.timeIntervalInMinutes = intervalInMinutes
}

override fun setCovidStatsNotificationsAgreement(isAllowed: Boolean): Completable {
return Completable.fromAction {
covidStatsDataStore.covidStatsNotificationsAgreement = isAllowed
}
}

override fun areCovidStatsNotificationsAllowed(): Single<Boolean> {
return Single.fromCallable {
covidStatsDataStore.covidStatsNotificationsAgreement
}
}

override fun subscribeToCovidStatsNotificationsTopic(): Completable {
return pl.gov.mc.protegosafe.data.BuildConfig.COVID_STATS_TOPIC.let {
Timber.d("Subscribed to: $it")
FirebaseMessaging.getInstance().subscribeToTopic(it)
.toCompletable()
}
}

override fun unsubscribeFromCovidStatsNotificationsTopic(): Completable {
return pl.gov.mc.protegosafe.data.BuildConfig.COVID_STATS_TOPIC.let {
Timber.d("Unsubscribed from: $it")
FirebaseMessaging.getInstance().unsubscribeFromTopic(it)
.toCompletable()
}
}
}
3 changes: 2 additions & 1 deletion app/src/main/java/pl/gov/mc/protegosafe/Consts.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package pl.gov.mc.protegosafe

object Consts {
const val GENERAL_NOTIFICATION_CHANNEL_ID = "ProtegoSafe general"
const val GENERAL_NOTIFICATION_PUSH_ID = 18678
const val GENERAL_NOTIFICATION_EXTRA_DATA = "extra-notification-data"
const val EXPOSURE_STATE_UPDATED_EXTRA_TOKEN = "extra-exposure"
const val PWA_URL = "file:///android_asset/ui/index.html"
const val RELEASE_BUILD_TYPE = "release"
const val ACTION_UNSUBSCRIBE_COVID_STATS_TOPIC = "unsubscribe-covid-stats-topic"
const val COVID_STATS_NOTIIFICATION_EXTRA_ID = "covid-stats-notification-extra-id"
}
88 changes: 74 additions & 14 deletions app/src/main/java/pl/gov/mc/protegosafe/di/AppModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,51 @@ import pl.gov.mc.protegosafe.AppRepositoryImpl
import pl.gov.mc.protegosafe.domain.Notifier
import pl.gov.mc.protegosafe.domain.executor.PostExecutionThread
import pl.gov.mc.protegosafe.domain.repository.AppRepository
import pl.gov.mc.protegosafe.domain.usecase.AppReviewUseCase
import pl.gov.mc.protegosafe.domain.usecase.CancelExposureRiskUseCase
import pl.gov.mc.protegosafe.domain.usecase.ChangeServiceStatusUseCase
import pl.gov.mc.protegosafe.domain.usecase.PrepareMigrationIfRequiredUseCase
import pl.gov.mc.protegosafe.domain.usecase.CheckDeviceRootedUseCase
import pl.gov.mc.protegosafe.domain.usecase.ClearDataUseCase
import pl.gov.mc.protegosafe.domain.usecase.CloseAppUseCase
import pl.gov.mc.protegosafe.domain.usecase.ComposeAppLifecycleStateBrideDataUseCase
import pl.gov.mc.protegosafe.domain.usecase.DeleteActivitiesUseCase
import pl.gov.mc.protegosafe.domain.usecase.GetActivitiesResultUseCase
import pl.gov.mc.protegosafe.domain.usecase.SaveKeysCountToAnalyzeUseCase
import pl.gov.mc.protegosafe.domain.usecase.GetAnalyzeResultUseCase
import pl.gov.mc.protegosafe.domain.usecase.GetAppVersionNameUseCase
import pl.gov.mc.protegosafe.domain.usecase.GetCovidStatsNotificationStatusResultUseCase
import pl.gov.mc.protegosafe.domain.usecase.GetCovidStatsResultAndUpdateUseCase
import pl.gov.mc.protegosafe.domain.usecase.GetENStatsResultUseCase
import pl.gov.mc.protegosafe.domain.usecase.restrictions.UpdateDistrictsRestrictionsUseCase
import pl.gov.mc.protegosafe.domain.usecase.GetExposureInformationUseCase
import pl.gov.mc.protegosafe.domain.usecase.GetFontScaleUseCase
import pl.gov.mc.protegosafe.domain.usecase.GetLocaleUseCase
import pl.gov.mc.protegosafe.domain.usecase.GetMigrationUrlUseCase
import pl.gov.mc.protegosafe.domain.usecase.GetNotificationDataAndClearUseCase
import pl.gov.mc.protegosafe.domain.usecase.GetRouteDataAndClearUseCase
import pl.gov.mc.protegosafe.domain.usecase.GetServicesStatusUseCase
import pl.gov.mc.protegosafe.domain.usecase.covidtest.GetTestSubscriptionStatusUseCase
import pl.gov.mc.protegosafe.domain.usecase.GetSystemLanguageUseCase
import pl.gov.mc.protegosafe.domain.usecase.HandleNewUriUseCase
import pl.gov.mc.protegosafe.domain.usecase.OnGetBridgeDataUseCase
import pl.gov.mc.protegosafe.domain.usecase.OnPushNotificationUseCase
import pl.gov.mc.protegosafe.domain.usecase.ShowPushNotificationUseCase
import pl.gov.mc.protegosafe.domain.usecase.OnSetBridgeDataUseCase
import pl.gov.mc.protegosafe.domain.usecase.ProcessPendingActivityResultUseCase
import pl.gov.mc.protegosafe.domain.usecase.ProvideDiagnosisKeysUseCase
import pl.gov.mc.protegosafe.domain.usecase.SaveMatchedTokenUseCase
import pl.gov.mc.protegosafe.domain.usecase.SaveNotificationDataUseCase
import pl.gov.mc.protegosafe.domain.usecase.RescheduleProvideDiagnosisKeysTaskUseCase
import pl.gov.mc.protegosafe.domain.usecase.SaveExposureCheckActivityUseCase
import pl.gov.mc.protegosafe.domain.usecase.SaveExposureUseCase
import pl.gov.mc.protegosafe.domain.usecase.SaveRouteUseCase
import pl.gov.mc.protegosafe.domain.usecase.SaveRiskCheckActivityUseCase
import pl.gov.mc.protegosafe.domain.usecase.SaveTriageCompletedUseCase
import pl.gov.mc.protegosafe.domain.usecase.SetAppLanguageUseCase
import pl.gov.mc.protegosafe.domain.usecase.StartExposureNotificationUseCase
import pl.gov.mc.protegosafe.domain.usecase.StopExposureNotificationUseCase
import pl.gov.mc.protegosafe.domain.usecase.StorePendingActivityResultUseCase
import pl.gov.mc.protegosafe.domain.usecase.SubscribeCovidStatusTopicUseCase
import pl.gov.mc.protegosafe.domain.usecase.UpdateCovidStatsAndGetResultUseCase
import pl.gov.mc.protegosafe.domain.usecase.UpdateCovidStatsNotificationsStatusUseCase
import pl.gov.mc.protegosafe.domain.usecase.UpdateCovidStatsUseCase
import pl.gov.mc.protegosafe.domain.usecase.UploadTemporaryExposureKeysUseCase
import pl.gov.mc.protegosafe.domain.usecase.UploadTemporaryExposureKeysWithCachedPayloadUseCase
import pl.gov.mc.protegosafe.domain.usecase.covidtest.GetTestSubscriptionPinUseCase
Expand All @@ -60,7 +75,7 @@ val appModule = module {
factory<PostExecutionThread> { pl.gov.mc.protegosafe.executor.PostExecutionThread() }
factory { Realm.getDefaultInstance() }
single<AppUpdateManager> { AppUpdateManagerFactory.create(androidContext()) }
single<AppRepository> { AppRepositoryImpl(get(), get(), get(), get(), androidContext()) }
single<AppRepository> { AppRepositoryImpl(get(), get(), get(), get(), get(), androidContext()) }
}

val useCaseModule = module {
Expand All @@ -72,6 +87,23 @@ val useCaseModule = module {
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get()
)
}
factory {
OnSetBridgeDataUseCase(
get(),
get(),
get(),
Expand All @@ -83,10 +115,9 @@ val useCaseModule = module {
get()
)
}
factory { OnSetBridgeDataUseCase(get(), get(), get(), get(), get(), get(), get()) }
factory { OnPushNotificationUseCase(get(), get()) }
factory { SaveNotificationDataUseCase(get()) }
factory { GetNotificationDataAndClearUseCase(get()) }
factory { ShowPushNotificationUseCase(get(), get()) }
factory { SaveRouteUseCase(get(), get()) }
factory { GetRouteDataAndClearUseCase(get()) }
factory { StartExposureNotificationUseCase(get(), get(), get()) }
factory { StopExposureNotificationUseCase(get(), get(), get()) }
factory { GetServicesStatusUseCase(get()) }
Expand All @@ -109,11 +140,11 @@ val useCaseModule = module {
factory { UploadTemporaryExposureKeysWithCachedPayloadUseCase(get(), get(), get()) }
factory { SaveTriageCompletedUseCase(get(), get()) }
factory { ComposeAppLifecycleStateBrideDataUseCase(get()) }
factory { SaveMatchedTokenUseCase(get(), get()) }
factory { SaveExposureUseCase(get(), get()) }
factory { StorePendingActivityResultUseCase(get(), get()) }
factory { ProcessPendingActivityResultUseCase(get(), get()) }
factory { GetExposureInformationUseCase(get(), get()) }
factory { GetAnalyzeResultUseCase(get(), get(), get(), get(), get()) }
factory { GetAnalyzeResultUseCase(get(), get(), get(), get()) }
factory { CheckDeviceRootedUseCase(get(), get(), get(), get()) }
factory { PrepareMigrationIfRequiredUseCase(get(), get()) }
factory { GetMigrationUrlUseCase(get()) }
Expand All @@ -127,17 +158,46 @@ val useCaseModule = module {
factory { GetDistrictsRestrictionsResultUseCase(get(), get(), get()) }
factory { HandleDistrictActionUseCase(get(), get(), get()) }
factory { GetSubscribedDistrictsResultUseCase(get(), get(), get()) }
factory { NotifyDistrictsUpdatedUseCase(get(), get(), get()) }
factory { NotifyDistrictsUpdatedUseCase(get(), get(), get(), get()) }
factory { UploadTestSubscriptionPinUseCase(get(), get(), get(), get(), get(), get()) }
factory { GetTestSubscriptionStatusUseCase(get(), get(), get(), get()) }
factory { UpdateTestSubscriptionStatusUseCase(get(), get(), get()) }
factory { GetTestSubscriptionPinUseCase(get(), get(), get()) }
factory { CancelExposureRiskUseCase(get(), get(), get()) }
factory { AppReviewUseCase(get(), get()) }
factory { SaveKeysCountToAnalyzeUseCase(get(), get(), get(), get()) }
factory { SaveRiskCheckActivityUseCase(get(), get()) }
factory { SaveExposureCheckActivityUseCase(get(), get(), get()) }
factory { GetActivitiesResultUseCase(get(), get(), get()) }
factory { DeleteActivitiesUseCase(get(), get(), get()) }
factory { HandleNewUriUseCase(get(), get()) }
factory { UpdateCovidStatsUseCase(get(), get()) }
factory { GetCovidStatsResultAndUpdateUseCase(get(), get(), get()) }
factory { UpdateCovidStatsAndGetResultUseCase(get(), get(), get(), get()) }
factory { GetCovidStatsNotificationStatusResultUseCase(get(), get(), get()) }
factory { UpdateCovidStatsNotificationsStatusUseCase(get(), get(), get(), get()) }
factory { SubscribeCovidStatusTopicUseCase(get(), get()) }
factory { GetENStatsResultUseCase(get(), get(), get()) }
factory { RescheduleProvideDiagnosisKeysTaskUseCase(get(), get()) }
}

val viewModelModule = module {
viewModel { MainViewModel(get(), get(), get()) }
viewModel { MainViewModel(get(), get(), get(), get()) }
viewModel {
HomeViewModel(get(), get(), get(), get(), get(), get(), get(), get(), get(), get(), get())
HomeViewModel(
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get(),
get()
)
}
}
Loading

0 comments on commit d9ca926

Please sign in to comment.