Skip to content

Commit

Permalink
Merge pull request #1602 from oxen-io/release/1.19.0
Browse files Browse the repository at this point in the history
Release/1.19.0
  • Loading branch information
ThomasSession authored Aug 9, 2024
2 parents e51c2cc + 4e50701 commit 77e8583
Show file tree
Hide file tree
Showing 460 changed files with 504,970 additions and 305,303 deletions.
31 changes: 21 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ configurations.all {
exclude module: "commons-logging"
}

def canonicalVersionCode = 376
def canonicalVersionName = "1.18.6"
def canonicalVersionCode = 379
def canonicalVersionName = "1.19.0"

def postFixSize = 10
def abiPostFix = ['armeabi-v7a' : 1,
Expand Down Expand Up @@ -263,15 +263,15 @@ 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'
}
if (project.hasProperty('huawei')) 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'
implementation 'org.conscrypt:conscrypt-android:2.5.2'
implementation 'org.signal:aesgcmprovider:0.0.3'
implementation 'org.webrtc:google-webrtc:1.0.32006'
implementation "me.leolin:ShortcutBadger:1.1.16"
Expand Down Expand Up @@ -322,6 +322,7 @@ dependencies {
implementation "com.google.protobuf:protobuf-java:$protobufVersion"
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion"
implementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
implementation "com.squareup.phrase:phrase:$phraseVersion"
implementation 'app.cash.copper:copper-flow:1.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
Expand Down Expand Up @@ -375,14 +376,24 @@ dependencies {


implementation 'com.github.bumptech.glide:compose:1.0.0-alpha.5'
implementation 'androidx.compose.ui:ui:1.5.2'
implementation 'androidx.compose.ui:ui-tooling:1.5.2'
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"

implementation "com.google.accompanist:accompanist-themeadapter-appcompat:0.33.1-alpha"
implementation "com.google.accompanist:accompanist-pager-indicators:0.33.1-alpha"
implementation "androidx.compose.runtime:runtime-livedata:1.5.2"
implementation "com.google.accompanist:accompanist-permissions:0.33.1-alpha"
implementation "com.google.accompanist:accompanist-drawablepainter:0.33.1-alpha"

implementation "androidx.camera:camera-camera2:1.3.2"
implementation "androidx.camera:camera-lifecycle:1.3.2"
implementation "androidx.camera:camera-view:1.3.2"

implementation 'androidx.compose.foundation:foundation-layout:1.5.2'
implementation 'androidx.compose.material:material:1.5.2'
implementation "com.google.mlkit:barcode-scanning:17.2.0"
}

static def getLastCommitTimestamp() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice
import com.adevinta.android.barista.interaction.PermissionGranter
import network.loki.messenger.util.InputBarButtonDrawableMatcher.Companion.inputButtonWithDrawable
import org.hamcrest.Matcher
Expand Down Expand Up @@ -49,9 +51,14 @@ class HomeActivityTests {

private val activityMonitor = Instrumentation.ActivityMonitor(ConversationActivityV2::class.java.name, null, false)

private val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())

private val context = InstrumentationRegistry.getInstrumentation().targetContext

@Before
fun setUp() {
InstrumentationRegistry.getInstrumentation().addMonitor(activityMonitor)

}

@After
Expand All @@ -72,25 +79,34 @@ class HomeActivityTests {
onView(isRoot()).perform(waitFor(500))
}

private fun objectFromDesc(id: Int) = device.findObject(By.desc(context.getString(id)))

private fun setupLoggedInState(hasViewedSeed: Boolean = false) {
// landing activity
onView(withId(R.id.registerButton)).perform(ViewActions.click())
// session ID - register activity
onView(withId(R.id.registerButton)).perform(ViewActions.click())
objectFromDesc(R.string.onboardingAccountCreate).click()

// display name selection
onView(withId(R.id.displayNameEditText)).perform(ViewActions.typeText("test-user123"))
onView(withId(R.id.registerButton)).perform(ViewActions.click())
objectFromDesc(R.string.displayNameEnter).click()
device.pressKeyCode(65)
device.pressKeyCode(66)
device.pressKeyCode(67)

// Continue with display name
objectFromDesc(R.string.continue_2).click()

// Continue with default push notification setting
objectFromDesc(R.string.continue_2).click()

// PN select
if (hasViewedSeed) {
// has viewed seed is set to false after register activity
TextSecurePreferences.setHasViewedSeed(InstrumentationRegistry.getInstrumentation().targetContext, true)
}
onView(withId(R.id.backgroundPollingOptionView)).perform(ViewActions.click())
onView(withId(R.id.registerButton)).perform(ViewActions.click())
// allow notification permission
PermissionGranter.allowPermissionsIfNeeded(Manifest.permission.POST_NOTIFICATIONS)
}


private fun goToMyChat() {
onView(withId(R.id.newConversationButton)).perform(ViewActions.click())
onView(withId(R.id.createPrivateChatButton)).perform(ViewActions.click())
Expand All @@ -111,8 +127,8 @@ class HomeActivityTests {
@Test
fun testLaunches_dismiss_seedView() {
setupLoggedInState()
onView(allOf(withId(R.id.button), isDescendantOfA(withId(R.id.seedReminderView)))).perform(ViewActions.click())
onView(withId(R.id.copyButton)).perform(ViewActions.click())
objectFromDesc(R.string.continue_2).click()
objectFromDesc(R.string.copy).click()
pressBack()
onView(withId(R.id.seedReminderView)).check(matches(not(isDisplayed())))
}
Expand All @@ -133,7 +149,7 @@ class HomeActivityTests {
fun testChat_withSelf() {
setupLoggedInState()
goToMyChat()
TextSecurePreferences.setLinkPreviewsEnabled(InstrumentationRegistry.getInstrumentation().targetContext, true)
TextSecurePreferences.setLinkPreviewsEnabled(context, true)
sendMessage("howdy")
sendMessage("test")
// tests url rewriter doesn't crash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class LibSessionTests {

private fun randomSeedBytes() = (0 until 16).map { Random.nextInt(UByte.MAX_VALUE.toInt()).toByte() }
private fun randomKeyPair() = KeyPairUtilities.generate(randomSeedBytes().toByteArray())
private fun randomSessionId() = randomKeyPair().x25519KeyPair.hexEncodedPublicKey
private fun randomAccountId() = randomKeyPair().x25519KeyPair.hexEncodedPublicKey

private var fakeHashI = 0
private val nextFakeHash: String
Expand Down Expand Up @@ -102,7 +102,7 @@ class LibSessionTests {
val storageSpy = spy(app.storage)
app.storage = storageSpy

val newContactId = randomSessionId()
val newContactId = randomAccountId()
val singleContact = Contact(
id = newContactId,
approved = true,
Expand All @@ -123,7 +123,7 @@ class LibSessionTests {
val storageSpy = spy(app.storage)
app.storage = storageSpy

val randomRecipient = randomSessionId()
val randomRecipient = randomAccountId()
val newContact = Contact(
id = randomRecipient,
approved = true,
Expand Down Expand Up @@ -158,7 +158,7 @@ class LibSessionTests {
app.storage = storageSpy

// Initial state
val randomRecipient = randomSessionId()
val randomRecipient = randomAccountId()
val currentContact = Contact(
id = randomRecipient,
approved = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,29 +136,29 @@ class SodiumUtilitiesTest {
}

@Test
fun sessionIdSuccess() {
val result = SodiumUtilities.sessionId("05$publicKey", "15$blindedPublicKey", serverPublicKey)
fun accountIdSuccess() {
val result = SodiumUtilities.accountId("05$publicKey", "15$blindedPublicKey", serverPublicKey)

assertTrue(result)
}

@Test
fun sessionIdFailureInvalidSessionId() {
val result = SodiumUtilities.sessionId("AB$publicKey", "15$blindedPublicKey", serverPublicKey)
fun accountIdFailureInvalidAccountId() {
val result = SodiumUtilities.accountId("AB$publicKey", "15$blindedPublicKey", serverPublicKey)

assertFalse(result)
}

@Test
fun sessionIdFailureInvalidBlindedId() {
val result = SodiumUtilities.sessionId("05$publicKey", "AB$blindedPublicKey", serverPublicKey)
fun accountIdFailureInvalidBlindedId() {
val result = SodiumUtilities.accountId("05$publicKey", "AB$blindedPublicKey", serverPublicKey)

assertFalse(result)
}

@Test
fun sessionIdFailureBlindingFactor() {
val result = SodiumUtilities.sessionId("05$publicKey", "15$blindedPublicKey", "Test")
fun accountIdFailureBlindingFactor() {
val result = SodiumUtilities.accountId("05$publicKey", "15$blindedPublicKey", "Test")

assertFalse(result)
}
Expand Down
14 changes: 8 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<uses-permission android:name="android.permission.RAISED_THREAD_PRIORITY" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" tools:node="remove"/>
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT"/>

<queries>
<intent>
Expand Down Expand Up @@ -99,25 +100,26 @@
android:value="false" />

<activity
android:name="org.thoughtcrime.securesms.onboarding.LandingActivity"
android:name="org.thoughtcrime.securesms.onboarding.landing.LandingActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.Session.DayNight.FlatActionBar" />
<activity
android:name="org.thoughtcrime.securesms.onboarding.RegisterActivity"
android:name="org.thoughtcrime.securesms.onboarding.loadaccount.LoadAccountActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.Session.DayNight.FlatActionBar" />
<activity
android:name="org.thoughtcrime.securesms.onboarding.LinkDeviceActivity"
android:name="org.thoughtcrime.securesms.onboarding.loading.LoadingActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.Session.DayNight.FlatActionBar" />
<activity
android:name="org.thoughtcrime.securesms.onboarding.DisplayNameActivity"
android:name="org.thoughtcrime.securesms.onboarding.pickname.PickDisplayNameActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.Session.DayNight.FlatActionBar" />
<activity
android:name="org.thoughtcrime.securesms.onboarding.PNModeActivity"
android:name="org.thoughtcrime.securesms.onboarding.messagenotifications.MessageNotificationsActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.Session.DayNight.FlatActionBar" />
<activity
Expand Down Expand Up @@ -152,7 +154,7 @@
android:label="@string/activity_edit_closed_group_title"
android:screenOrientation="portrait" />
<activity
android:name="org.thoughtcrime.securesms.onboarding.SeedActivity"
android:name="org.thoughtcrime.securesms.recoverypassword.RecoveryPasswordActivity"
android:screenOrientation="portrait" />
<activity
android:name="org.thoughtcrime.securesms.contacts.SelectContactsActivity"
Expand Down
Loading

0 comments on commit 77e8583

Please sign in to comment.