diff --git a/app/build.gradle b/app/build.gradle index 9e0bd76e97..9192d48c56 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -136,6 +136,13 @@ android { buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl" } + huawei { + dimension "distribution" + ext.websiteUpdateUrl = "null" + buildConfigField "boolean", "PLAY_STORE_DISABLED", "true" + buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl" + } + website { dimension "distribution" ext.websiteUpdateUrl = "https://github.com/oxen-io/session-android/releases" @@ -203,6 +210,7 @@ dependencies { exclude group: 'com.google.firebase', module: 'firebase-analytics' exclude group: 'com.google.firebase', module: 'firebase-measurement-connector' } + huaweiImplementation 'com.huawei.hms:push:6.7.0.300' implementation 'com.google.android.exoplayer:exoplayer-core:2.9.1' implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.1' implementation 'org.conscrypt:conscrypt-android:2.0.0' diff --git a/app/src/huawei/kotlin/org/thoughtcrime/securesms/notifications/HuaweiPushManager.kt b/app/src/huawei/kotlin/org/thoughtcrime/securesms/notifications/HuaweiPushManager.kt new file mode 100644 index 0000000000..72a22ecfa4 --- /dev/null +++ b/app/src/huawei/kotlin/org/thoughtcrime/securesms/notifications/HuaweiPushManager.kt @@ -0,0 +1,9 @@ +package org.thoughtcrime.securesms.notifications + +import android.content.Context + +class HuaweiPushManager(val context: Context): PushManager { + override fun refresh(force: Boolean) { + + } +} diff --git a/app/src/huawei/kotlin/org/thoughtcrime/securesms/notifications/HuaweiPushModule.kt b/app/src/huawei/kotlin/org/thoughtcrime/securesms/notifications/HuaweiPushModule.kt new file mode 100644 index 0000000000..17c40ea826 --- /dev/null +++ b/app/src/huawei/kotlin/org/thoughtcrime/securesms/notifications/HuaweiPushModule.kt @@ -0,0 +1,27 @@ +package org.thoughtcrime.securesms.notifications + +import android.content.Context +import dagger.Binds +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.android.qualifiers.ApplicationContext +import dagger.hilt.components.SingletonComponent +import javax.inject.Singleton + +@Module +@InstallIn(SingletonComponent::class) +object HuaweiPushModule { + @Provides + @Singleton + fun provideFirebasePushManager( + @ApplicationContext context: Context, + ) = HuaweiPushManager(context) +} + +@Module +@InstallIn(SingletonComponent::class) +abstract class FirebaseBindingModule { + @Binds + abstract fun bindPushManager(firebasePushManager: HuaweiPushManager): PushManager +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 70da7183d8..8e344c5e14 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ buildscript { repositories { google() mavenCentral() + maven {url 'https://developer.huawei.com/repo/'} } dependencies { classpath "com.android.tools.build:gradle:$gradlePluginVersion" @@ -12,6 +13,7 @@ buildscript { classpath files('libs/gradle-witness.jar') classpath "com.squareup:javapoet:1.13.0" classpath "com.google.dagger:hilt-android-gradle-plugin:$daggerVersion" + classpath 'com.huawei.agconnect:agcp:1.6.0.300' } } @@ -55,6 +57,7 @@ allprojects { } jcenter() maven { url "https://jitpack.io" } + maven { url 'https://developer.huawei.com/repo/' } } project.ext { diff --git a/libsession/build.gradle b/libsession/build.gradle index 3cfb66cd32..5dc67f525f 100644 --- a/libsession/build.gradle +++ b/libsession/build.gradle @@ -2,6 +2,7 @@ plugins { id 'com.android.library' id 'kotlin-android' id 'kotlinx-serialization' + id 'com.huawei.agconnect' } android {