Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge/1.19.0 #1607

Merged
merged 23 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b544961
Merge pull request #1504 from oxen-io/release-1.18.4
bemusementpark May 31, 2024
7f90a98
Release/1.18.5 (#1535)
ThomasSession Jul 9, 2024
e6762a1
Revert "Release/1.18.5 (#1535)"
ThomasSession Jul 9, 2024
cfd30bd
Merge pull request #1537 from oxen-io/revert-1535-release/1.18.5
ThomasSession Jul 9, 2024
84c5ebe
Merge pull request #1539 from oxen-io/release/1.18.5
ThomasSession Jul 9, 2024
bbb625d
Merge pull request #1562 from oxen-io/release/1.18.5
ThomasSession Jul 23, 2024
e51c2cc
Merge pull request #1565 from oxen-io/release/1.18.6
ThomasSession Jul 24, 2024
96dded0
Making sure the username is saved when creating an account
ThomasSession Aug 6, 2024
514c19e
Relying on the home config sync
ThomasSession Aug 6, 2024
71f9548
comments
ThomasSession Aug 6, 2024
b6c58f4
Merge pull request #1600 from oxen-io/fix/username-saved
ThomasSession Aug 6, 2024
2b8d2d4
Making sure we do not have AD_ID in the app
ThomasSession Aug 7, 2024
2c4b8bf
Do not check errors if profileAvatar is null
ThomasSession Aug 7, 2024
76a74f7
Upgraded firebase from v18.0.0 to v24.0.0
alansley Aug 7, 2024
bbac093
Unchecked code
ThomasSession Aug 7, 2024
fe1fe2e
Merge branch 'fix/removing-ad-id' of https://github.com/oxen-io/sessi…
ThomasSession Aug 7, 2024
a742620
Not needed anymre
ThomasSession Aug 7, 2024
9cc760c
Merge pull request #1605 from oxen-io/fix/removing-ad-id
ThomasSession Aug 7, 2024
b089677
Merge branch 'master' into release/1.19.0
ThomasSession Aug 7, 2024
80216e9
Removing the snodes version patch
ThomasSession Jul 31, 2024
4e741e6
Adding back the fullscreen intent permission
ThomasSession Jul 23, 2024
4e50701
version code bump
ThomasSession Aug 7, 2024
f865f9f
Merge branch 'dev' into merge/1.19.0
ThomasSession Aug 8, 2024
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
5 changes: 2 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ configurations.all {
exclude module: "commons-logging"
}

def canonicalVersionCode = 377
def canonicalVersionCode = 379
def canonicalVersionName = "1.19.0"

def postFixSize = 10
Expand Down Expand Up @@ -261,7 +261,7 @@ dependencies {
implementation 'androidx.fragment:fragment-ktx:1.5.3'
implementation "androidx.core:core-ktx:$coreVersion"
implementation "androidx.work:work-runtime-ktx:2.7.1"
playImplementation ("com.google.firebase:firebase-messaging:18.0.0") {
playImplementation ("com.google.firebase:firebase-messaging:24.0.0") {
exclude group: 'com.google.firebase', module: 'firebase-core'
exclude group: 'com.google.firebase', module: 'firebase-analytics'
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
Expand Down Expand Up @@ -388,7 +388,6 @@ dependencies {
implementation "androidx.camera:camera-lifecycle:1.3.2"
implementation "androidx.camera:camera-view:1.3.2"

implementation 'com.google.firebase:firebase-core:21.1.1'
implementation "com.google.mlkit:barcode-scanning:17.2.0"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,9 @@ class HomeActivity : PassphraseRequiredActionBarActivity(),

updateLegacyConfigView()

// TODO: remove this after enough updates that we can rely on ConfigBase.isNewConfigEnabled to always return true
// This will only run if we aren't using new configs, as they are schedule to sync when there are changes applied
if (textSecurePreferences.getConfigurationMessageSynced()) {
lifecycleScope.launch(Dispatchers.IO) {
ConfigurationMessageUtilities.syncConfigurationIfNeeded(this@HomeActivity)
}
// Sync config changes if there are any
lifecycleScope.launch(Dispatchers.IO) {
ConfigurationMessageUtilities.syncConfigurationIfNeeded(this@HomeActivity)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package org.thoughtcrime.securesms.messagerequests

import android.content.Context
import android.content.res.ColorStateList
import android.database.Cursor
import android.os.Build
import android.text.SpannableString
import android.text.style.ForegroundColorSpan
import android.view.ContextThemeWrapper
import android.view.ViewGroup
import android.widget.PopupMenu
import androidx.core.graphics.drawable.DrawableCompat
import androidx.recyclerview.widget.RecyclerView
import network.loki.messenger.R
import org.session.libsession.utilities.ThemeUtil
Expand Down Expand Up @@ -63,10 +64,17 @@ class MessageRequestsAdapter(
val s = SpannableString(item.title)
val danger = ThemeUtil.getThemedColor(context, R.attr.danger)
s.setSpan(ForegroundColorSpan(danger), 0, s.length, 0)
item.iconTintList = ColorStateList.valueOf(danger)
item.icon?.let {
DrawableCompat.setTint(
it,
danger
)
}
item.title = s
}
popupMenu.setForceShowIcon(true)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
popupMenu.setForceShowIcon(true)
}
popupMenu.show()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.session.libsignal.utilities.KeyHelper
import org.session.libsignal.utilities.hexEncodedPublicKey
import org.thoughtcrime.securesms.crypto.KeyPairUtilities
import org.thoughtcrime.securesms.dependencies.ConfigFactory
import org.thoughtcrime.securesms.util.ConfigurationMessageUtilities
import org.thoughtcrime.securesms.util.VersionDataFetcher
import javax.inject.Inject
import javax.inject.Singleton
Expand All @@ -24,7 +25,6 @@ class CreateAccountManager @Inject constructor(

fun createAccount(displayName: String) {
prefs.setProfileName(displayName)
configFactory.user?.setName(displayName)

// This is here to resolve a case where the app restarts before a user completes onboarding
// which can result in an invalid database state
Expand All @@ -37,13 +37,16 @@ class CreateAccountManager @Inject constructor(
val x25519KeyPair = keyPairGenerationResult.x25519KeyPair

KeyPairUtilities.store(application, seed, ed25519KeyPair, x25519KeyPair)
configFactory.keyPairChanged()
val userHexEncodedPublicKey = x25519KeyPair.hexEncodedPublicKey
val registrationID = KeyHelper.generateRegistrationId(false)
prefs.setLocalRegistrationId(registrationID)
prefs.setLocalNumber(userHexEncodedPublicKey)
prefs.setRestorationTime(0)

// we'll rely on the config syncing in the homeActivity resume
configFactory.keyPairChanged()
configFactory.user?.setName(displayName)

versionDataFetcher.startTimedVersionCheck()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ internal class PickDisplayNameViewModel(
viewModelScope.launch(Dispatchers.IO) {
if (loadFailed) {
prefs.setProfileName(displayName)
// we'll rely on the config syncing in the homeActivity resume
configFactory.user?.setName(displayName)

_events.emit(Event.LoadAccountComplete)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package org.thoughtcrime.securesms.notifications

import com.google.android.gms.tasks.Tasks
import com.google.firebase.iid.FirebaseInstanceId
import com.google.firebase.messaging.FirebaseMessaging

import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.isActive
import kotlinx.coroutines.tasks.await
import kotlinx.coroutines.withContext
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class FirebaseTokenFetcher @Inject constructor(): TokenFetcher {
val TAG = "FirebaseTF"

override suspend fun fetch() = withContext(Dispatchers.IO) {
FirebaseInstanceId.getInstance().instanceId
.also(Tasks::await)
.takeIf { isActive } // don't 'complete' task if we were canceled
?.run { result?.token ?: throw exception!! }
FirebaseMessaging.getInstance().token.await().takeIf { isActive } ?: throw Exception("Firebase token is null")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class RetrieveProfileAvatarJob(private val profileAvatar: String?, val recipient

override suspend fun execute(dispatcherName: String) {
val delegate = delegate ?: return Log.w(TAG, "RetrieveProfileAvatarJob has no delegate method to work with!")
if (profileAvatar in errorUrls) return delegate.handleJobFailed(this, dispatcherName, Exception("Profile URL 404'd this app instance"))
if (profileAvatar != null && profileAvatar in errorUrls) return delegate.handleJobFailed(this, dispatcherName, Exception("Profile URL 404'd this app instance"))
val context = MessagingModuleConfiguration.shared.context
val storage = MessagingModuleConfiguration.shared.storage
val recipient = Recipient.from(context, recipientAddress, true)
Expand Down