Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ repositories {
google()
}

val nonFreeFlavors = setOf("prod", "internal", "staging", "beta", "dev")
val nonFreeFlavors = setOf("prod", "internal", "staging", "beta", "dev", "enterprise")
val fossFlavors = setOf("fdroid")
val internalFlavors = setOf("internal", "staging", "beta", "dev")
val allFlavors = nonFreeFlavors + fossFlavors
Expand Down Expand Up @@ -199,6 +199,8 @@ dependencies {
implementationWithCoverage(projects.features.meetings)
implementationWithCoverage(projects.features.sync)

enterpriseImplementation(projects.core.nomad)

// Anonymous Analytics
val flavors = getFlavorsSettings()
val isCustomBuild = isCustomizationEnabled()
Expand Down
17 changes: 17 additions & 0 deletions app/src/enterprise/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<application>
<provider
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
tools:node="merge">

<meta-data
android:name="com.wire.android.nomad.initializer.NomadInitializer"
android:value="androidx.startup"
tools:node="merge" />
</provider>
</application>

</manifest>
33 changes: 33 additions & 0 deletions app/src/enterprise/res/drawable/ic_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
~ Wire
~ Copyright (C) 2024 Wire Swiss GmbH
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see http://www.gnu.org/licenses/.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="512"
android:viewportHeight="512">
<path android:pathData="M0,0h512v512h-512z">
<aapt:attr name="android:fillColor">
<gradient android:endX="512" android:endY="512"
android:startX="106.5" android:startY="111.5" android:type="linear">
<item android:color="#FFFFFFFF" android:offset="0"/>
<item android:color="#FFDCE0E3" android:offset="1"/>
</gradient>
</aapt:attr>
</path>
</vector>
50 changes: 50 additions & 0 deletions app/src/enterprise/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!--
~ Wire
~ Copyright (C) 2024 Wire Swiss GmbH
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see http://www.gnu.org/licenses/.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="512"
android:viewportHeight="512">
<!-- ENTERPRISE text -->
<group
android:scaleX="0.6"
android:scaleY="0.6"
android:translateX="195"
android:translateY="133">
<!-- E, N, T, E, I, S, E (solid letters) -->
<path
android:fillColor="#000000"
android:pathData="M0,0 H17 V5 H5 V15.5 H14 V20.5 H5 V31 H17 V36 H0 Z M21,0 H26 V36 H21 Z M36,0 H41 V36 H36 Z M21,36 H26 L41,0 H36 Z M45,0 H62 V5 H56.5 V36 H50.5 V5 H45 Z M66,0 H83 V5 H71 V15.5 H80 V20.5 H71 V31 H83 V36 H66 Z M155,0 H160 V36 H155 Z M164,0 H181 V5 H169 V15.5 H181 V36 H164 V31 H176 V20.5 H164 Z M185,0 H202 V5 H190 V15.5 H199 V20.5 H190 V31 H202 V36 H185 Z" />
<!-- R, P, R (letters with holes) -->
<path
android:fillColor="#000000"
android:fillType="evenOdd"
android:pathData="M87,0 H106 V17 H99 L106,36 H101 L94,18 H92 V36 H87 Z M92,5 V12 H101 V5 Z M110,0 H128 V18 H115 V36 H110 Z M115,5 V13 H123 V5 Z M132,0 H151 V17 H144 L151,36 H146 L139,18 H137 V36 H132 Z M137,5 V12 H146 V5 Z" />
</group>
<!-- Wire logo -->
<group
android:scaleX="0.65"
android:scaleY="0.65"
android:translateX="89.6"
android:translateY="89.6">
<path
android:fillColor="#000000"
android:fillType="evenOdd"
android:pathData="M256.84,348.61C271.08,359.55 288.54,365.42 306.45,365.42C351.4,365.42 388.74,327.69 388.74,282.85V154.11H369.4V282.76L369.4,282.77V282.77C369.49,296.45 365.09,309.68 357.01,320.62C336.7,347.98 298.42,354.09 270.64,334.81C282.57,320.11 289.14,301.75 289.05,282.75L289.05,179.13C288.74,161.79 274.34,147.3 256.97,147.01C239.15,146.71 223.99,161.29 223.7,179.13L223.7,282.76L223.7,282.76C223.8,301.65 230.49,320.25 242.55,334.81C232.06,342.02 219.62,345.97 206.85,345.97C172.32,345.97 143.43,317.35 143.34,282.75V154.11H124V282.95C124,328.52 161.36,365.52 206.85,365.52C224.96,365.52 242.51,359.56 256.84,348.61ZM256.37,165.79C263.78,165.79 269.71,171.81 269.71,179.15V282.76C269.71,296.83 265.03,310.49 256.38,321.57C247.79,310.49 243.03,296.82 243.03,282.76V179.15C243.03,171.73 249.04,165.79 256.37,165.79Z" />
</group>
</vector>
23 changes: 23 additions & 0 deletions app/src/enterprise/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Wire
~ Copyright (C) 2024 Wire Swiss GmbH
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see http://www.gnu.org/licenses/.
-->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
23 changes: 23 additions & 0 deletions app/src/enterprise/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Wire
~ Copyright (C) 2024 Wire Swiss GmbH
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see http://www.gnu.org/licenses/.
-->
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/flavor/ProductFlavors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ sealed class ProductFlavors(

object Beta : ProductFlavors("beta", "Wire Beta")
object Internal : ProductFlavors("internal", "Wire Internal")
object Enterprise : ProductFlavors("enterprise", "Wire Enterprise")
object Production : ProductFlavors("prod", "Wire", shareduserId = "com.waz.userid")
object Fdroid : ProductFlavors(
buildName = "fdroid",
Expand All @@ -49,6 +50,7 @@ sealed class ProductFlavors(
Staging,
Beta,
Internal,
Enterprise,
Production,
Fdroid,
)
Expand Down
16 changes: 16 additions & 0 deletions core/nomad/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
plugins {
id(libs.plugins.wire.android.library.get().pluginId)
id(libs.plugins.wire.kover.get().pluginId)
id(libs.plugins.wire.hilt.get().pluginId)
alias(libs.plugins.compose.compiler)
}

dependencies {
implementation(projects.core.di)
implementation("com.wire.kalium:kalium-logic")
implementation("com.wire.kalium:kalium-nomaddevice")
implementation("com.wire.kalium:kalium-userstorage")
implementation("com.wire.kalium:kalium-hooks")
implementation(libs.androidx.startup)
implementation(libs.androidx.compose.runtime)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Wire
* Copyright (C) 2026 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/

package com.wire.android.nomad

import com.wire.kalium.logic.CoreLogic
import com.wire.kalium.nomaddevice.NomadRemoteBackupChangeLogHookNotifier
import com.wire.kalium.userstorage.di.PlatformUserStorageProvider
import dagger.Lazy

public object NomadHookRegistrar {
/**
* Registers Nomad's persisted-message hook into CoreLogic during app startup.
*/
public fun register(coreLogic: Lazy<CoreLogic>) {
coreLogic.get().registerPersistenceEventHook(
NomadRemoteBackupChangeLogHookNotifier(
userStorageProvider = PlatformUserStorageProvider()
)
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Wire
* Copyright (C) 2026 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/

package com.wire.android.nomad.di

import android.content.Context
import com.wire.android.di.KaliumCoreLogic
import com.wire.kalium.logic.CoreLogic
import dagger.Lazy
import dagger.hilt.EntryPoint
import dagger.hilt.InstallIn
import dagger.hilt.android.EntryPointAccessors
import dagger.hilt.components.SingletonComponent

@EntryPoint
@InstallIn(SingletonComponent::class)
interface NomadInitializerEntryPoint {

@KaliumCoreLogic
fun coreLogic(): Lazy<CoreLogic>

companion object {
fun resolve(context: Context): NomadInitializerEntryPoint {
val appContext = context.applicationContext ?: throw IllegalStateException()
return EntryPointAccessors.fromApplication(appContext, NomadInitializerEntryPoint::class.java)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Wire
* Copyright (C) 2026 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/

package com.wire.android.nomad.initializer

import android.content.Context
import androidx.startup.Initializer
import com.wire.android.nomad.NomadHookRegistrar
import com.wire.android.nomad.di.NomadInitializerEntryPoint

class NomadInitializer : Initializer<Unit> {

override fun create(context: Context) {
val entryPoint = NomadInitializerEntryPoint.resolve(context)
NomadHookRegistrar.register(coreLogic = entryPoint.coreLogic())
}

override fun dependencies(): List<Class<out Initializer<*>>> = emptyList()
}
15 changes: 13 additions & 2 deletions default.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"analytics_app_key": "8ffae535f1836ed5f58fd5c8a11c00eca07c5438",
"analytics_server_url": "https://wire.count.ly/",
"enable_new_registration": true,
"use_async_flush_logging": true,
"use_async_flush_logging": true
},
"internal": {
"application_id": "com.wire.internal",
Expand All @@ -86,7 +86,18 @@
"use_strict_mls_filter": false,
"use_async_flush_logging": true,
"conversation_feeder_enabled": true,
"db_invalidation_control_enabled": false,
"db_invalidation_control_enabled": false
},
"enterprise": {
"application_id": "com.wire.team",
"developer_features_enabled": false,
"logging_enabled": false,
"application_is_private_build": false,
"development_api_enabled": false,
"analytics_enabled": true,
"analytics_app_key": "4483f7a58ae3e70b3780319c4ccb5c88a037be49",
"analytics_server_url": "https://wire.count.ly/",
"enable_new_registration": true
},
"fdroid": {
"application_id": "com.wire",
Expand Down
3 changes: 3 additions & 0 deletions include_builds.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ includeBuild("kalium") {
substitute(module("com.wire.kalium:kalium-data")).using(project(":core:data"))
substitute(module("com.wire.kalium:kalium-common")).using(project(":core:common"))
substitute(module("com.wire.kalium:kalium-cells")).using(project(":domain:cells"))
substitute(module("com.wire.kalium:kalium-nomaddevice")).using(project(":domain:nomaddevice"))
substitute(module("com.wire.kalium:kalium-userstorage")).using(project(":domain:userstorage"))
substitute(module("com.wire.kalium:kalium-hooks")).using(project(":domain:messaging:hooks"))
// test modules
substitute(module("com.wire.kalium:kalium-mocks")).using(project(":test:mocks"))
substitute(module("com.wire.kalium:kalium-network")).using(project(":data:network"))
Expand Down
2 changes: 1 addition & 1 deletion kalium
Submodule kalium updated 41 files
+14 −13 data/persistence/src/commonMain/db_user/com/wire/kalium/persistence/RemotebackupChangeLog.sq
+23 −0 data/persistence/src/commonMain/db_user/migrations/128.sqm
+4 −2 data/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/backup/ChangeLogEntry.kt
+3 −2 data/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/backup/RemoteBackupChangeLogDAO.kt
+7 −3 data/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/backup/RemoteBackupChangeLogDAOImpl.kt
+66 −13 data/persistence/src/commonTest/kotlin/com/wire/kalium/persistence/dao/backup/RemoteBackupChangeLogDAOTest.kt
+32 −17 domain/messaging/hooks/src/commonMain/kotlin/com/wire/kalium/messaging/hooks/PersistMessageHook.kt
+7 −0 domain/nomaddevice/build.gradle.kts
+7 −6 domain/nomaddevice/src/commonMain/kotlin/com/wire/kalium/nomaddevice/NomadLogger.kt
+64 −0 domain/nomaddevice/src/commonMain/kotlin/com/wire/kalium/nomaddevice/NomadPersistenceEventHookNotifier.kt
+223 −0 domain/nomaddevice/src/commonMain/kotlin/com/wire/kalium/nomaddevice/NomadRemoteBackupChangeLogCallback.kt
+74 −0 domain/nomaddevice/src/commonMain/kotlin/com/wire/kalium/nomaddevice/NomadRemoteBackupChangeLogHookNotifier.kt
+41 −0 domain/nomaddevice/src/commonMain/kotlin/com/wire/kalium/nomaddevice/NomadRemoteBackupChangeLogRepository.kt
+517 −0 ...nomaddevice/src/commonTest/kotlin/com/wire/kalium/nomaddevice/NomadRemoteBackupChangeLogHookNotifierTest.kt
+1 −1 logic/src/androidMain/kotlin/com/wire/kalium/logic/CoreLogic.kt
+3 −3 logic/src/androidMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt
+3 −3 logic/src/androidMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt
+1 −1 logic/src/appleMain/kotlin/com/wire/kalium/logic/CoreLogic.kt
+3 −3 logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt
+3 −3 logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt
+11 −11 logic/src/commonMain/kotlin/com/wire/kalium/logic/CoreLogicCommon.kt
+3 −3 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/PersistMessageUseCase.kt
+12 −2 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/PersistReactionUseCase.kt
+21 −9 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt
+0 −58 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageHookRegistry.kt
+3 −3 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageScope.kt
+90 −0 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/PersistenceEventHookRegistry.kt
+10 −1 ...c/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/DeletedConversationEventHandler.kt
+7 −0 logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/handler/ClearConversationContentHandler.kt
+10 −3 logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/handler/DeleteMessageHandler.kt
+11 −0 logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/handler/ReceiptMessageHandler.kt
+3 −3 logic/src/commonTest/kotlin/com/wire/kalium/logic/data/message/PersistMessageUseCaseTest.kt
+77 −4 logic/src/commonTest/kotlin/com/wire/kalium/logic/data/message/PersistReactionUseCaseTest.kt
+44 −2 ...c/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/ClearConversationContentHandlerTest.kt
+80 −2 ...c/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/DeletedConversationEventHandlerTest.kt
+87 −2 ...src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/ReceiptMessageHandlerTest.kt
+81 −4 logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/handler/DeleteMessageHandlerTest.kt
+1 −1 logic/src/jvmMain/kotlin/com/wire/kalium/logic/CoreLogic.kt
+3 −3 logic/src/jvmMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt
+3 −3 logic/src/jvmMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt
+112 −0 tools/protobuf-codegen/src/main/proto/nomad_device_sync.proto
Loading