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

[Automated] Update translations from Crowdin #1674

Open
wants to merge 44 commits into
base: release/1.20.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
af89d5f
Merge pull request #1662 from oxen-io/release/1.20.0
ThomasSession Sep 11, 2024
59eed88
Updating the app to using Compose 1.7.1 via the latest BOM
ThomasSession Sep 11, 2024
d897a83
Tweaking debug menu
ThomasSession Sep 11, 2024
607dae2
Removing hardcoded reference to material3
ThomasSession Sep 11, 2024
f0c8ec8
Using the latest compose compiler
ThomasSession Sep 11, 2024
fdf8f41
Merge pull request #1663 from oxen-io/feature/compose-1.7.1
ThomasSession Sep 11, 2024
73b0088
Fix ItemButton padding for downstate
Sep 18, 2024
6ca34b2
Merge pull request #1670 from oxen-io/release/1.20.0
ThomasSession Sep 19, 2024
89a854e
Merge pull request #1672 from bemusementpark/ItemButton
ThomasSession Sep 19, 2024
1ff8ea0
SES-1714 - SES-1715
ThomasSession Sep 19, 2024
3dfbd08
Cleaned up ItemButton to work in both its variations
ThomasSession Sep 20, 2024
75c5a75
Merge pull request #1675 from oxen-io/fix/message-request-after-delete
ThomasSession Sep 20, 2024
b74d35e
Merge pull request #1679 from oxen-io/release/1.20.0
ThomasSession Sep 24, 2024
c956b20
Making sure we don't pass in a null recipient name
ThomasSession Sep 30, 2024
29c6e6b
Adding back long press fix
ThomasSession Oct 1, 2024
3d42a04
Fixing property name
ThomasSession Oct 2, 2024
b237faa
Fixing ANRs
ThomasSession Oct 4, 2024
8fec296
Fixing Crashes
ThomasSession Oct 4, 2024
390757f
Updating QA tags for dialogs as per the QA Team's instructions
ThomasSession Oct 4, 2024
d257a1a
Moving recovery password dialogs to compose for QA
ThomasSession Oct 4, 2024
a3abf94
Latest translations
ThomasSession Oct 4, 2024
c095427
Build process update
ThomasSession Oct 7, 2024
b595475
Using appropriate name
ThomasSession Oct 7, 2024
231360d
Merge pull request #1683 from oxen-io/release/1.20.1
ThomasSession Oct 7, 2024
ce968cc
Only force a contact to visible if the approval goes from 'not approv…
ThomasSession Oct 10, 2024
a324cd3
Merge pull request #1687 from oxen-io/fix/ses-2802
ThomasSession Oct 10, 2024
92f66b4
Fixing store crash by removing non required spannable
ThomasSession Oct 11, 2024
2945a92
Merge pull request #1688 from oxen-io/fix/download-dialog-string
ThomasSession Oct 11, 2024
9ffaed5
v1.20.2
ThomasSession Oct 11, 2024
bf61579
Making sure restored accounts do not display deleted messages
ThomasSession Oct 13, 2024
e068b71
Merge pull request #1690 from oxen-io/release/1.20.2
ThomasSession Oct 13, 2024
ed1bddd
Merge pull request #1691 from oxen-io/fix/ses-2804-message-reappearin…
ThomasSession Oct 13, 2024
ecfa5d3
Close cursor in retrieveConfigLastUpdateTimestamp (#1692)
SessionHero01 Oct 14, 2024
54ef260
Feature/standardised message deletion (#1685)
ThomasSession Oct 14, 2024
68750e6
Making sure deleted control messages leave nothing behind (#1693)
ThomasSession Oct 14, 2024
f6d50ac
Feature/strings nice to haves (#1686)
ThomasSession Oct 14, 2024
74939da
Fix/message deletion issues (#1696)
ThomasSession Oct 20, 2024
952bafa
Fix/conversation deletion issues (#1695)
ThomasSession Oct 20, 2024
4b01fce
Fix/message deletion issues (#1697)
ThomasSession Oct 21, 2024
4917548
Fix/empty conversations (#1698)
ThomasSession Oct 22, 2024
3e17ab2
Optimise and test IP2Country (#1684)
bemusementpark Oct 23, 2024
16cca2d
Getting the recipient from the VM (#1694)
ThomasSession Oct 23, 2024
8615c57
Making sure the avatars refresh when changed by other users
ThomasSession Oct 24, 2024
bb5dbdd
[Automated] Update translations from Crowdin
mpretty-cyro Dec 23, 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
78 changes: 60 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ configurations.forEach {
it.exclude module: "commons-logging"
}

def canonicalVersionCode = 382
def canonicalVersionName = "1.20.0"
def canonicalVersionCode = 384
def canonicalVersionName = "1.20.2"

def postFixSize = 10
def abiPostFix = ['armeabi-v7a' : 1,
Expand Down Expand Up @@ -56,7 +56,7 @@ android {

splits {
abi {
enable true
enable !project.hasProperty('huawei') // huawei builds do not need the split variants
reset()
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
universalApk true
Expand All @@ -68,7 +68,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion '1.5.14'
kotlinCompilerExtensionVersion '1.5.15'
}

defaultConfig {
Expand Down Expand Up @@ -105,6 +105,13 @@ android {
String sharedTestDir = 'src/sharedTest/java'
test.java.srcDirs += sharedTestDir
androidTest.java.srcDirs += sharedTestDir
main {
assets.srcDirs += "$buildDir/generated/binary"
}
test {
resources.srcDirs += "$buildDir/generated/binary"
resources.srcDirs += "$projectDir/src/main/assets"
}
}

buildTypes {
Expand All @@ -118,6 +125,25 @@ android {
}
}

signingConfigs {
play {
if (project.hasProperty('SESSION_STORE_FILE')) {
storeFile file(SESSION_STORE_FILE)
storePassword SESSION_STORE_PASSWORD
keyAlias SESSION_KEY_ALIAS
keyPassword SESSION_KEY_PASSWORD
}
}
huawei {
if (project.hasProperty('SESSION_HUAWEI_STORE_FILE')) {
storeFile file(SESSION_HUAWEI_STORE_FILE)
storePassword SESSION_HUAWEI_STORE_PASSWORD
keyAlias SESSION_HUAWEI_KEY_ALIAS
keyPassword SESSION_HUAWEI_KEY_PASSWORD
}
}
}

flavorDimensions "distribution"
productFlavors {
play {
Expand All @@ -129,6 +155,7 @@ android {
buildConfigField "org.session.libsession.utilities.Device", "DEVICE", "org.session.libsession.utilities.Device.ANDROID"
buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl"
buildConfigField 'String', 'PUSH_KEY_SUFFIX', '\"\"'
signingConfig signingConfigs.play
}

huawei {
Expand All @@ -138,6 +165,7 @@ android {
buildConfigField "org.session.libsession.utilities.Device", "DEVICE", "org.session.libsession.utilities.Device.HUAWEI"
buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl"
buildConfigField 'String', 'PUSH_KEY_SUFFIX', '\"_HUAWEI\"'
signingConfig signingConfigs.huawei
}

website {
Expand All @@ -150,13 +178,15 @@ android {
}
}

applicationVariants.forEach { variant ->
applicationVariants.configureEach { variant ->
variant.outputs.each { output ->
def abiName = output.getFilter("ABI") ?: 'universal'
def postFix = abiPostFix.get(abiName, 0)

def flavour = (variant.flavorName == 'huawei') ? "-huawei" : ""

if (postFix >= postFixSize) throw new AssertionError("postFix is too large")
output.outputFileName = output.outputFileName = "session-${variant.versionName}-${abiName}.apk"
output.outputFileName = output.outputFileName = "session-${variant.versionName}-${abiName}${flavour}.apk"
output.versionCodeOverride = canonicalVersionCode * postFixSize + postFix
}
}
Expand Down Expand Up @@ -219,6 +249,12 @@ android {
}
}

apply {
from("ipToCode.gradle.kts")
}

preBuild.dependsOn ipToCode

dependencies {
implementation project(':content-descriptions')

Expand All @@ -245,9 +281,9 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
implementation "androidx.paging:paging-runtime-ktx:$pagingVersion"
implementation 'androidx.activity:activity-ktx:1.5.1'
implementation 'androidx.activity:activity-compose:1.5.1'
implementation 'androidx.fragment:fragment-ktx:1.5.3'
implementation 'androidx.activity:activity-ktx:1.9.2'
implementation 'androidx.activity:activity-compose:1.9.2'
implementation 'androidx.fragment:fragment-ktx:1.8.4'
implementation "androidx.core:core-ktx:$coreVersion"
implementation "androidx.work:work-runtime-ktx:2.7.1"

Expand Down Expand Up @@ -353,15 +389,21 @@ dependencies {
testImplementation 'org.conscrypt:conscrypt-openjdk-uber:2.5.2' // For Robolectric
testImplementation 'app.cash.turbine:turbine:1.1.0'

implementation 'com.github.bumptech.glide:compose:1.0.0-alpha.5'
implementation "androidx.compose.ui:ui:$composeVersion"
implementation "androidx.compose.animation:animation:$composeVersion"
implementation "androidx.compose.ui:ui-tooling:$composeVersion"
implementation "androidx.compose.runtime:runtime-livedata:$composeVersion"
implementation "androidx.compose.foundation:foundation-layout:$composeVersion"
implementation "androidx.compose.material3:material3:1.2.1"
androidTestImplementation "androidx.compose.ui:ui-test-junit4-android:$composeVersion"
debugImplementation "androidx.compose.ui:ui-test-manifest:$composeVersion"
// compose
Dependency composeBom = platform('androidx.compose:compose-bom:2024.09.01')
implementation composeBom
testImplementation composeBom
androidTestImplementation composeBom

implementation "androidx.compose.ui:ui"
implementation "androidx.compose.animation:animation"
implementation "androidx.compose.ui:ui-tooling"
implementation "androidx.compose.runtime:runtime-livedata"
implementation "androidx.compose.foundation:foundation-layout"
implementation "androidx.compose.material3:material3"

androidTestImplementation "androidx.compose.ui:ui-test-junit4-android"
debugImplementation "androidx.compose.ui:ui-test-manifest"

implementation "com.google.accompanist:accompanist-themeadapter-appcompat:0.33.1-alpha"
implementation "com.google.accompanist:accompanist-permissions:0.36.0"
Expand Down
41 changes: 41 additions & 0 deletions app/ipToCode.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import java.io.File
import java.io.DataOutputStream
import java.io.FileOutputStream

task("ipToCode") {
val inputFile = File("${projectDir}/geolite2_country_blocks_ipv4.csv")

val outputDir = "${buildDir}/generated/binary"
val outputFile = File(outputDir, "geolite2_country_blocks_ipv4.bin").apply { parentFile.mkdirs() }

outputs.file(outputFile)

doLast {

// Ensure the input file exists
if (!inputFile.exists()) {
throw IllegalArgumentException("Input file does not exist: ${inputFile.absolutePath}")
}

// Create a DataOutputStream to write binary data
DataOutputStream(FileOutputStream(outputFile)).use { out ->
inputFile.useLines { lines ->
var prevCode = -1
lines.drop(1).forEach { line ->
runCatching {
val ints = line.split(".", "/", ",")
val code = ints[5].toInt().also { if (it == prevCode) return@forEach }
val ip = ints.take(4).fold(0) { acc, s -> acc shl 8 or s.toInt() }

out.writeInt(ip)
out.writeInt(code)

prevCode = code
}
}
}
}

println("Processed data written to: ${outputFile.absolutePath}")
}
}
4 changes: 2 additions & 2 deletions app/src/huawei/agconnect-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"channel_id":""
},
"edukit":{
"edu_url":"edukit.edu.cloud.huawei.com.cn",
"dh_url":"edukit.edu.cloud.huawei.com.cn"
"edu_url":"edukit.cloud.huawei.com.cn",
"dh_url":"edukit.cloud.huawei.com.cn"
},
"search":{
"url":"https://search-dre.cloud.huawei.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class HuaweiPushService: HmsMessageService() {

override fun onMessageReceived(message: RemoteMessage?) {
Log.d(TAG, "onMessageReceived")
message?.dataOfMap?.takeIf { it.isNotEmpty() }?.let(pushReceiver::onPush) ?:
pushReceiver.onPush(message?.data?.let(Base64::decode))
message?.dataOfMap?.takeIf { it.isNotEmpty() }?.let(pushReceiver::onPushDataReceived) ?:
pushReceiver.onPushDataReceived(message?.data?.let(Base64::decode))
}

override fun onNewToken(token: String?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class HuaweiTokenFetcher @Inject constructor(
override suspend fun fetch(): String? = HmsInstanceId.getInstance(context).run {
// https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/push-basic-capability#h2-1576218800370
// getToken may return an empty string, if so HuaweiPushService#onNewToken will be called.
withContext(Dispatchers.IO) { getToken(APP_ID, TOKEN_SCOPE) }
withContext(Dispatchers.IO) {
getToken(APP_ID, TOKEN_SCOPE)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,7 @@ private void initializeScreenshotSecurity(boolean isResume) {
if (!isResume) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
} else {
if (TextSecurePreferences.isScreenSecurityEnabled(this)) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
} else {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
}
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import org.session.libsession.utilities.recipients.RecipientModifiedListener;
import org.session.libsignal.utilities.Log;
import org.thoughtcrime.securesms.components.MediaView;
import org.thoughtcrime.securesms.components.dialogs.DeleteMediaPreviewDialog;
import org.thoughtcrime.securesms.database.MediaDatabase.MediaRecord;
import org.thoughtcrime.securesms.database.loaders.PagingMediaLoader;
import org.thoughtcrime.securesms.database.model.MmsMessageRecord;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ class SessionDialogBuilder(val context: Context) {

// Main title entry point
fun title(text: String?) {
text(text, R.style.TextAppearance_Session_Dialog_Title) { setPadding(dp20, 0, dp20, 0) }
text(
text = text,
qaTag = context.getString(R.string.AccessibilityId_modalTitle),
style = R.style.TextAppearance_Session_Dialog_Title) { setPadding(dp20, 0, dp20, 0) }
}

// Convenience assessor for title that takes a string resource
Expand All @@ -74,18 +77,24 @@ class SessionDialogBuilder(val context: Context) {
fun text(@StringRes id: Int, style: Int? = null) = text(context.getString(id), style)

fun text(text: CharSequence?, @StyleRes style: Int? = null) {
text(text, style) {
text(text = text, style = style) {
layoutParams = LinearLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT)
.apply { updateMargins(dp40, 0, dp40, 0) }
}
}

private fun text(text: CharSequence?, @StyleRes style: Int? = null, modify: TextView.() -> Unit) {
private fun text(
text: CharSequence?,
qaTag: String = context.getString(R.string.AccessibilityId_modalMessage),
@StyleRes style: Int? = null,
modify: TextView.() -> Unit
) {
text ?: return
TextView(context, null, 0, style ?: R.style.TextAppearance_Session_Dialog_Message)
.apply {
setText(text)
textAlignment = View.TEXT_ALIGNMENT_CENTER
contentDescription = qaTag
modify()
}.let(topView::addView)

Expand Down Expand Up @@ -166,7 +175,7 @@ class SessionDialogBuilder(val context: Context) {
textColor?.let{
setTextColor(it)
}
contentDescription = resources.getString(contentDescriptionRes)
contentDescription = resources.getString(text) // QA now wants the qa tag to mtch the button's text
layoutParams = LinearLayout.LayoutParams(WRAP_CONTENT, dp60, 1f)
setOnClickListener {
listener.invoke()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.google.protobuf.ByteString
import org.greenrobot.eventbus.EventBus
import org.session.libsession.database.MessageDataProvider
import org.session.libsession.messaging.MessagingModuleConfiguration
import org.session.libsession.messaging.messages.MarkAsDeletedMessage
import org.session.libsession.messaging.messages.control.UnsendRequest
import org.session.libsession.messaging.sending_receiving.attachments.Attachment
import org.session.libsession.messaging.sending_receiving.attachments.AttachmentId
Expand Down Expand Up @@ -144,6 +145,12 @@ class DatabaseAttachmentProvider(context: Context, helper: SQLCipherOpenHelper)
return smsDatabase.isOutgoingMessage(timestamp) || mmsDatabase.isOutgoingMessage(timestamp)
}

override fun isDeletedMessage(timestamp: Long): Boolean {
val smsDatabase = DatabaseComponent.get(context).smsDatabase()
val mmsDatabase = DatabaseComponent.get(context).mmsDatabase()
return smsDatabase.isDeletedMessage(timestamp) || mmsDatabase.isDeletedMessage(timestamp)
}

override fun handleSuccessfulAttachmentUpload(attachmentId: Long, attachmentStream: SignalServiceAttachmentStream, attachmentKey: ByteArray, uploadResult: UploadResult) {
val database = DatabaseComponent.get(context).attachmentDatabase()
val databaseAttachment = getDatabaseAttachment(attachmentId) ?: return
Expand Down Expand Up @@ -198,7 +205,6 @@ class DatabaseAttachmentProvider(context: Context, helper: SQLCipherOpenHelper)
}

override fun deleteMessages(messageIDs: List<Long>, threadId: Long, isSms: Boolean) {

val messagingDatabase: MessagingDatabase = if (isSms) DatabaseComponent.get(context).smsDatabase()
else DatabaseComponent.get(context).mmsDatabase()

Expand All @@ -215,18 +221,32 @@ class DatabaseAttachmentProvider(context: Context, helper: SQLCipherOpenHelper)
threadId?.let{ MessagingModuleConfiguration.shared.lastSentTimestampCache.delete(it, messages.map { it.timestamp }) }
}

override fun updateMessageAsDeleted(timestamp: Long, author: String): Long? {
override fun markMessageAsDeleted(timestamp: Long, author: String, displayedMessage: String) {
val database = DatabaseComponent.get(context).mmsSmsDatabase()
val address = Address.fromSerialized(author)
val message = database.getMessageFor(timestamp, address) ?: return null
val messagingDatabase: MessagingDatabase = if (message.isMms) DatabaseComponent.get(context).mmsDatabase()
else DatabaseComponent.get(context).smsDatabase()
messagingDatabase.markAsDeleted(message.id, message.isRead, message.hasMention)
if (message.isOutgoing) {
messagingDatabase.deleteMessage(message.id)
}
val message = database.getMessageFor(timestamp, address) ?: return Log.w("", "Failed to find message to mark as deleted")

markMessagesAsDeleted(
messages = listOf(MarkAsDeletedMessage(
messageId = message.id,
isOutgoing = message.isOutgoing
)),
isSms = !message.isMms,
displayedMessage = displayedMessage
)
}

override fun markMessagesAsDeleted(
messages: List<MarkAsDeletedMessage>,
isSms: Boolean,
displayedMessage: String
) {
val messagingDatabase: MessagingDatabase = if (isSms) DatabaseComponent.get(context).smsDatabase()
else DatabaseComponent.get(context).mmsDatabase()

return message.id
messages.forEach { message ->
messagingDatabase.markAsDeleted(message.messageId, message.isOutgoing, displayedMessage)
}
}

override fun getServerHashForMessage(messageID: Long, mms: Boolean): String? =
Expand Down
Loading