Skip to content

Commit a90fdbc

Browse files
greyson-signalAbandonedCart
authored andcommitted
Bump version to 7.29.0
Fix derivation of RRP in RefreshAttributesJob. Fix incorrect RRP bugs and reglock state with reregistering. Update translations and other static files. Bump version to 7.28.1 Fix large message size calculation to use bytes. Update translations and other static files. Bump version to 7.28.2 Fix bug with ellipsizing on media messages. Bump version to 7.28.3 Translate missing recipients into unknown recipients. Bump version to 7.28.4 Treat all groups updates as directionless for backupv2. Remove Mockito dependency from project. Resolves signalapp#13838 Fix gv1 updates in backupv2. Fix empty profile names during backupv2 export. Move from AssertJ to AssertK. Resolves signalapp#13841 Fix dangling call ringers. Isolated tests for RecurringInAppPaymentRepository. Add verification metadata for windows. Don't show linked device bottom sheets if you've seen them before. Add internal UI for importing backup with different credentials. Improve internal backup import UI tool. Implement initial support for IAP data. Upgrade to AGP 8.7.2 Upgrade to AGP 8.7.3 Isolated tests for OneTimeInAppPaymentRepository. Move some things to lib.versions.toml Add AAPT metadata for witness verification. Use more plugin aliases. Upgrade to kotlin 2.1.0 Update a bunch of libraries. Update compileSdk to 35. Add .kotlin to gitignore. Update more libraries. Ensure that the V262 database migration runs. Update our base themes to avoid crashing MaterialAlertDialog. Revert "Improve table display in Spinner." This reverts commit df96b05. Fix cutoff string in help section. Fix typo in sql query. Add trigger definitions to logs. Capitalize log section title. Fix small gap in call menu. Update string translation comments. Fix leaked refreshActiveSubscription disposable. Fix ability to share text stories. Fixes signalapp#13855 Resolves signalapp#13879 Initialize database error handler with application instance. Fix text overflow length calculation. Fix overflow handling in condensed mode. Ensure filter is not retriggered when formatting. Fixes signalapp#13876 Fix proximity sensor for voice notes. Ensure new manifest is saved after rotation. Inline and enable the SSRE2 config. Exclude unregistered group members from invalid collisions check. Fixes signalapp#13866 Stop in-chat notification sounds if notifications are disabled. Fix bug showing null string on empty search. Fixes signalapp#13854 Resolves signalapp#13878 Revert "Update our base themes to avoid crashing MaterialAlertDialog." This reverts commit 446c7d6. Add missing required material3 dialog theme attribute. Disable the SSRE2 capability for now. Fix benchmark build. Add loading state to toggle switch and enforce when changing call link admin settings. Update translations and other static files. Update baseline profile. Co-Authored-By: Greyson Parrelli <[email protected]>
1 parent 43eba96 commit a90fdbc

File tree

252 files changed

+18290
-12783
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+18290
-12783
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ dev.keystore
3131
maps.key
3232
/local/
3333
kls_database.db
34+
.kotlin

.idea/codeStyles/Project.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle.kts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ import java.util.Date
77
import java.util.Properties
88

99
plugins {
10-
id("com.android.application")
11-
id("kotlin-android")
10+
alias(libs.plugins.android.application)
11+
alias(libs.plugins.jetbrains.kotlin.android)
12+
alias(libs.plugins.ktlint)
13+
alias(libs.plugins.compose.compiler)
1214
id("androidx.navigation.safeargs")
13-
id("org.jlleitschuh.gradle.ktlint")
14-
id("org.jetbrains.kotlin.android")
15-
id("app.cash.exhaustive")
1615
id("kotlin-parcelize")
1716
id("com.squareup.wire")
1817
id("translations")
@@ -21,8 +20,8 @@ plugins {
2120

2221
apply(from = "static-ips.gradle.kts")
2322

24-
val canonicalVersionCode = 1492
25-
val canonicalVersionName = "7.28.0"
23+
val canonicalVersionCode = 1497
24+
val canonicalVersionName = "7.29.0"
2625
val currentHotfixVersion = 0
2726
val maxHotfixVersions = 100
2827

@@ -590,9 +589,7 @@ dependencies {
590589
}
591590

592591
testImplementation(testLibs.junit.junit)
593-
testImplementation(testLibs.assertj.core)
594-
testImplementation(testLibs.mockito.core)
595-
testImplementation(testLibs.mockito.kotlin)
592+
testImplementation(testLibs.assertk)
596593
testImplementation(testLibs.androidx.test.core)
597594
testImplementation(testLibs.robolectric.robolectric) {
598595
exclude(group = "com.google.protobuf", module = "protobuf-java")

app/proguard/proguard-automation.pro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
-dontwarn com.android.support.test.**
66
-dontwarn sun.reflect.**
77
-dontwarn sun.misc.**
8-
-dontwarn org.assertj.**
8+
-dontwarn assertk.**
99
-dontwarn org.hamcrest.**
10-
-dontwarn org.mockito.**
1110
-dontwarn com.squareup.**
1211

13-
-dontobfuscate
12+
-dontobfuscate

app/src/androidTest/java/org/thoughtcrime/securesms/backup/v2/ArchiveImportExportTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ class ArchiveImportExportTests {
296296
length = importData.size.toLong(),
297297
inputStreamFactory = { ByteArrayInputStream(importData) },
298298
selfData = BackupRepository.SelfData(SELF_ACI, SELF_PNI, SELF_E164, ProfileKey(SELF_PROFILE_KEY)),
299-
plaintext = true
299+
backupKey = null
300300
)
301301
}
302302

app/src/androidTest/java/org/thoughtcrime/securesms/components/settings/app/subscription/donate/CheckoutFlowActivityTest__RecurringDonations.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,12 @@ class CheckoutFlowActivityTest__RecurringDonations {
108108
currency = currency,
109109
type = InAppPaymentSubscriberRecord.Type.DONATION,
110110
requiresCancel = false,
111-
paymentMethodType = InAppPaymentData.PaymentMethodType.CARD
111+
paymentMethodType = InAppPaymentData.PaymentMethodType.CARD,
112+
iapSubscriptionId = null
112113
)
113114

114115
InAppPaymentsRepository.setSubscriber(subscriber)
115-
SignalStore.inAppPayments.setSubscriberCurrency(currency, subscriber.type)
116+
SignalStore.inAppPayments.setRecurringDonationCurrency(currency)
116117

117118
InstrumentationApplicationDependencyProvider.addMockWebRequestHandlers(
118119
Get("/v1/subscription/${subscriber.subscriberId.serialize()}") {
@@ -149,11 +150,12 @@ class CheckoutFlowActivityTest__RecurringDonations {
149150
currency = currency,
150151
type = InAppPaymentSubscriberRecord.Type.DONATION,
151152
requiresCancel = false,
152-
paymentMethodType = InAppPaymentData.PaymentMethodType.CARD
153+
paymentMethodType = InAppPaymentData.PaymentMethodType.CARD,
154+
iapSubscriptionId = null
153155
)
154156

155157
InAppPaymentsRepository.setSubscriber(subscriber)
156-
SignalStore.inAppPayments.setSubscriberCurrency(currency, subscriber.type)
158+
SignalStore.inAppPayments.setRecurringDonationCurrency(currency)
157159

158160
InstrumentationApplicationDependencyProvider.addMockWebRequestHandlers(
159161
Get("/v1/subscription/${subscriber.subscriberId.serialize()}") {
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
package org.thoughtcrime.securesms.database
2+
3+
import android.database.sqlite.SQLiteConstraintException
4+
import org.junit.Assert.fail
5+
import org.junit.Before
6+
import org.junit.Rule
7+
import org.junit.Test
8+
import org.signal.core.util.count
9+
import org.signal.core.util.deleteAll
10+
import org.signal.core.util.readToSingleInt
11+
import org.thoughtcrime.securesms.components.settings.app.subscription.InAppPaymentsRepository
12+
import org.thoughtcrime.securesms.database.model.InAppPaymentSubscriberRecord
13+
import org.thoughtcrime.securesms.database.model.databaseprotos.InAppPaymentData
14+
import org.thoughtcrime.securesms.testing.SignalActivityRule
15+
import org.thoughtcrime.securesms.testing.assertIs
16+
import org.whispersystems.signalservice.api.storage.IAPSubscriptionId
17+
import org.whispersystems.signalservice.api.subscriptions.SubscriberId
18+
import java.util.Currency
19+
20+
class InAppPaymentSubscriberTableTest {
21+
@get:Rule
22+
val harness = SignalActivityRule()
23+
24+
@Before
25+
fun setUp() {
26+
SignalDatabase.inAppPaymentSubscribers.writableDatabase.deleteAll(InAppPaymentTable.TABLE_NAME)
27+
}
28+
29+
@Test(expected = SQLiteConstraintException::class)
30+
fun givenASubscriberWithCurrencyAndIAPData_whenITryToInsert_thenIExpectException() {
31+
val subscriber = InAppPaymentSubscriberRecord(
32+
subscriberId = SubscriberId.generate(),
33+
currency = Currency.getInstance("USD"),
34+
type = InAppPaymentSubscriberRecord.Type.DONATION,
35+
requiresCancel = false,
36+
paymentMethodType = InAppPaymentData.PaymentMethodType.CARD,
37+
iapSubscriptionId = IAPSubscriptionId.GooglePlayBillingPurchaseToken("testToken")
38+
)
39+
40+
SignalDatabase.inAppPaymentSubscribers.insertOrReplace(subscriber)
41+
42+
fail("Expected a thrown exception.")
43+
}
44+
45+
@Test(expected = SQLiteConstraintException::class)
46+
fun givenADonorSubscriberWithGoogleIAPData_whenITryToInsert_thenIExpectException() {
47+
val subscriber = InAppPaymentSubscriberRecord(
48+
subscriberId = SubscriberId.generate(),
49+
currency = null,
50+
type = InAppPaymentSubscriberRecord.Type.DONATION,
51+
requiresCancel = false,
52+
paymentMethodType = InAppPaymentData.PaymentMethodType.CARD,
53+
iapSubscriptionId = IAPSubscriptionId.GooglePlayBillingPurchaseToken("testToken")
54+
)
55+
56+
SignalDatabase.inAppPaymentSubscribers.insertOrReplace(subscriber)
57+
58+
fail("Expected a thrown exception.")
59+
}
60+
61+
@Test(expected = SQLiteConstraintException::class)
62+
fun givenADonorSubscriberWithAppleIAPData_whenITryToInsert_thenIExpectException() {
63+
val subscriber = InAppPaymentSubscriberRecord(
64+
subscriberId = SubscriberId.generate(),
65+
currency = null,
66+
type = InAppPaymentSubscriberRecord.Type.DONATION,
67+
requiresCancel = false,
68+
paymentMethodType = InAppPaymentData.PaymentMethodType.CARD,
69+
iapSubscriptionId = IAPSubscriptionId.AppleIAPOriginalTransactionId(1000L)
70+
)
71+
72+
SignalDatabase.inAppPaymentSubscribers.insertOrReplace(subscriber)
73+
74+
fail("Expected a thrown exception.")
75+
}
76+
77+
@Test(expected = SQLiteConstraintException::class)
78+
fun givenADonorSubscriberWithoutCurrency_whenITryToInsert_thenIExpectException() {
79+
val subscriber = InAppPaymentSubscriberRecord(
80+
subscriberId = SubscriberId.generate(),
81+
currency = null,
82+
type = InAppPaymentSubscriberRecord.Type.DONATION,
83+
requiresCancel = false,
84+
paymentMethodType = InAppPaymentData.PaymentMethodType.CARD,
85+
iapSubscriptionId = null
86+
)
87+
88+
SignalDatabase.inAppPaymentSubscribers.insertOrReplace(subscriber)
89+
90+
fail("Expected a thrown exception.")
91+
}
92+
93+
@Test
94+
fun givenADonorSubscriberWithCurrency_whenITryToInsert_thenIExpectSuccess() {
95+
val subscriber = InAppPaymentSubscriberRecord(
96+
subscriberId = SubscriberId.generate(),
97+
currency = Currency.getInstance("USD"),
98+
type = InAppPaymentSubscriberRecord.Type.DONATION,
99+
requiresCancel = false,
100+
paymentMethodType = InAppPaymentData.PaymentMethodType.CARD,
101+
iapSubscriptionId = null
102+
)
103+
104+
SignalDatabase.inAppPaymentSubscribers.insertOrReplace(subscriber)
105+
}
106+
107+
@Test(expected = SQLiteConstraintException::class)
108+
fun givenABackupSubscriberWithCurrency_whenITryToInsert_thenIExpectException() {
109+
val subscriber = InAppPaymentSubscriberRecord(
110+
subscriberId = SubscriberId.generate(),
111+
currency = Currency.getInstance("USD"),
112+
type = InAppPaymentSubscriberRecord.Type.BACKUP,
113+
requiresCancel = false,
114+
paymentMethodType = InAppPaymentData.PaymentMethodType.GOOGLE_PLAY_BILLING,
115+
iapSubscriptionId = null
116+
)
117+
118+
SignalDatabase.inAppPaymentSubscribers.insertOrReplace(subscriber)
119+
120+
fail("Expected a thrown exception.")
121+
}
122+
123+
@Test(expected = SQLiteConstraintException::class)
124+
fun givenABackupSubscriberWithoutIAPData_whenITryToInsert_thenIExpectException() {
125+
val subscriber = InAppPaymentSubscriberRecord(
126+
subscriberId = SubscriberId.generate(),
127+
currency = null,
128+
type = InAppPaymentSubscriberRecord.Type.BACKUP,
129+
requiresCancel = false,
130+
paymentMethodType = InAppPaymentData.PaymentMethodType.GOOGLE_PLAY_BILLING,
131+
iapSubscriptionId = null
132+
)
133+
134+
SignalDatabase.inAppPaymentSubscribers.insertOrReplace(subscriber)
135+
}
136+
137+
@Test
138+
fun givenABackupSubscriberWithGoogleIAPData_whenITryToInsert_thenIExpectSuccess() {
139+
val subscriber = InAppPaymentSubscriberRecord(
140+
subscriberId = SubscriberId.generate(),
141+
currency = null,
142+
type = InAppPaymentSubscriberRecord.Type.BACKUP,
143+
requiresCancel = false,
144+
paymentMethodType = InAppPaymentData.PaymentMethodType.GOOGLE_PLAY_BILLING,
145+
iapSubscriptionId = IAPSubscriptionId.GooglePlayBillingPurchaseToken("testToken")
146+
)
147+
148+
SignalDatabase.inAppPaymentSubscribers.insertOrReplace(subscriber)
149+
}
150+
151+
@Test
152+
fun givenABackupSubscriberWithAppleIAPData_whenITryToInsert_thenIExpectSuccess() {
153+
val subscriber = InAppPaymentSubscriberRecord(
154+
subscriberId = SubscriberId.generate(),
155+
currency = null,
156+
type = InAppPaymentSubscriberRecord.Type.BACKUP,
157+
requiresCancel = false,
158+
paymentMethodType = InAppPaymentData.PaymentMethodType.GOOGLE_PLAY_BILLING,
159+
iapSubscriptionId = IAPSubscriptionId.AppleIAPOriginalTransactionId(1000L)
160+
)
161+
162+
SignalDatabase.inAppPaymentSubscribers.insertOrReplace(subscriber)
163+
}
164+
165+
@Test
166+
fun givenABackupSubscriberWithAppleIAPData_whenITryToInsertAGoogleSubscriber_thenIExpectSuccess() {
167+
val appleSubscriber = InAppPaymentSubscriberRecord(
168+
subscriberId = SubscriberId.generate(),
169+
currency = null,
170+
type = InAppPaymentSubscriberRecord.Type.BACKUP,
171+
requiresCancel = false,
172+
paymentMethodType = InAppPaymentData.PaymentMethodType.GOOGLE_PLAY_BILLING,
173+
iapSubscriptionId = IAPSubscriptionId.AppleIAPOriginalTransactionId(1000L)
174+
)
175+
176+
SignalDatabase.inAppPaymentSubscribers.insertOrReplace(appleSubscriber)
177+
178+
val googleSubscriber = InAppPaymentSubscriberRecord(
179+
subscriberId = SubscriberId.generate(),
180+
currency = null,
181+
type = InAppPaymentSubscriberRecord.Type.BACKUP,
182+
requiresCancel = false,
183+
paymentMethodType = InAppPaymentData.PaymentMethodType.GOOGLE_PLAY_BILLING,
184+
iapSubscriptionId = IAPSubscriptionId.GooglePlayBillingPurchaseToken("testToken")
185+
)
186+
187+
SignalDatabase.inAppPaymentSubscribers.insertOrReplace(googleSubscriber)
188+
189+
val subscriberCount = SignalDatabase.inAppPaymentSubscribers.readableDatabase.count()
190+
.from(InAppPaymentSubscriberTable.TABLE_NAME)
191+
.run()
192+
.readToSingleInt()
193+
194+
subscriberCount assertIs 1
195+
196+
val subscriber = InAppPaymentsRepository.requireSubscriber(InAppPaymentSubscriberRecord.Type.BACKUP)
197+
subscriber.iapSubscriptionId?.originalTransactionId assertIs null
198+
subscriber.iapSubscriptionId?.purchaseToken assertIs "testToken"
199+
subscriber.subscriberId assertIs googleSubscriber.subscriberId
200+
}
201+
}

app/src/androidTest/java/org/thoughtcrime/securesms/database/helpers/migration/FixInAppCurrencyIfAbleTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ class FixInAppCurrencyIfAbleTest {
104104
currency = Currency.getInstance(currencyCode),
105105
type = InAppPaymentSubscriberRecord.Type.DONATION,
106106
requiresCancel = false,
107-
paymentMethodType = InAppPaymentData.PaymentMethodType.PAYPAL
107+
paymentMethodType = InAppPaymentData.PaymentMethodType.PAYPAL,
108+
iapSubscriptionId = null
108109
)
109110

110111
SignalDatabase.inAppPaymentSubscribers.insertOrReplace(record)

app/src/androidTest/java/org/thoughtcrime/securesms/dependencies/InstrumentationApplicationDependencyProvider.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import okhttp3.mockwebserver.MockWebServer
1414
import okhttp3.mockwebserver.RecordedRequest
1515
import okio.ByteString
1616
import org.signal.core.util.Base64
17+
import org.signal.core.util.billing.BillingApi
1718
import org.signal.core.util.logging.Log
1819
import org.thoughtcrime.securesms.BuildConfig
1920
import org.thoughtcrime.securesms.push.SignalServiceNetworkAccess
@@ -49,6 +50,7 @@ class InstrumentationApplicationDependencyProvider(val application: Application,
4950
private val serviceNetworkAccessMock: SignalServiceNetworkAccess
5051
private val recipientCache: LiveRecipientCache
5152
private var signalServiceMessageSender: SignalServiceMessageSender? = null
53+
private var billingApi: BillingApi = mockk()
5254

5355
init {
5456
runSync {
@@ -108,6 +110,8 @@ class InstrumentationApplicationDependencyProvider(val application: Application,
108110
recipientCache = LiveRecipientCache(application) { r -> r.run() }
109111
}
110112

113+
override fun provideBillingApi(): BillingApi = billingApi
114+
111115
override fun provideSignalServiceNetworkAccess(): SignalServiceNetworkAccess {
112116
return serviceNetworkAccessMock
113117
}

0 commit comments

Comments
 (0)