Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Commit b8f30da

Browse files
authored
Merge pull request #2460 from RocketChat/chore/release-3.5.2
[CHORE] Release app version 2077 (3.5.1)
2 parents 4e8bc44 + 11d6f01 commit b8f30da

File tree

12 files changed

+48
-56
lines changed

12 files changed

+48
-56
lines changed

.circleci/config.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
docker:
55
- image: circleci/android:api-29
66
environment:
7-
JAVA_TOOL_OPTIONS: -Xmx5024m
7+
GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
88
steps:
99
- checkout
1010
- run:
@@ -33,7 +33,7 @@ jobs:
3333
docker:
3434
- image: circleci/android:api-29
3535
environment:
36-
JAVA_TOOL_OPTIONS: -Xmx5024m
36+
GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
3737
steps:
3838
- checkout
3939
- run:
@@ -48,29 +48,29 @@ jobs:
4848
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}-{{ checksum "player/build.gradle" }}-{{ checksum "core/build.gradle" }}-{{ checksum "util/build.gradle" }}-{{ checksum "draw/build.gradle" }}-{{ checksum "emoji/build.gradle" }}-{{ checksum "suggestions/build.gradle" }}
4949
- run:
5050
name: Download Dependencies
51-
command: ./gradlew --no-daemon androidDependencies --quiet --console=plain
51+
command: ./gradlew androidDependencies
5252
- save_cache:
5353
paths:
5454
- ~/.gradle/caches
5555
- ~/.gradle/wrapper
5656
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}-{{ checksum "player/build.gradle" }}-{{ checksum "core/build.gradle" }}-{{ checksum "util/build.gradle" }}-{{ checksum "draw/build.gradle" }}-{{ checksum "emoji/build.gradle" }}-{{ checksum "suggestions/build.gradle" }}
5757
- run:
58-
name: Run Lint #, Checkstyles, PMD, Findbugs...
59-
command: ./gradlew --no-daemon lint
58+
name: Run Lint
59+
command: ./gradlew lint
6060
- run:
6161
name: Run Unit test
62-
command: ./gradlew --no-daemon test
62+
command: ./gradlew test
6363
- run:
6464
name: Compile Instrumentation test
65-
command: ./gradlew --no-daemon assembleAndroidTest
65+
command: ./gradlew assembleAndroidTest
6666
- store_artifacts:
6767
path: app/build/reports/
6868
destination: reports
69-
build-play-apk:
69+
build-aab:
7070
docker:
7171
- image: circleci/android:api-29
7272
environment:
73-
JAVA_TOOL_OPTIONS: -Xmx5024m
73+
GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
7474
steps:
7575
- checkout
7676
- run:
@@ -90,24 +90,23 @@ jobs:
9090
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}-{{ checksum "player/build.gradle" }}-{{ checksum "core/build.gradle" }}-{{ checksum "util/build.gradle" }}-{{ checksum "draw/build.gradle" }}-{{ checksum "emoji/build.gradle" }}-{{ checksum "suggestions/build.gradle" }}
9191
- run:
9292
name: Download Dependencies
93-
command: ./gradlew --no-daemon androidDependencies --quiet --console=plain
93+
command: ./gradlew androidDependencies
9494
- save_cache:
9595
paths:
9696
- ~/.gradle/caches
9797
- ~/.gradle/wrapper
9898
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}-{{ checksum "player/build.gradle" }}-{{ checksum "core/build.gradle" }}-{{ checksum "util/build.gradle" }}-{{ checksum "draw/build.gradle" }}-{{ checksum "emoji/build.gradle" }}-{{ checksum "suggestions/build.gradle" }}
9999
- run:
100-
name: Build APK
101-
command: |
102-
./gradlew --no-daemon assemblePlayRelease --info --console=plain --stacktrace
100+
name: Build AAB
101+
command: ./gradlew bundleRelease
103102
- store_artifacts:
104-
path: app/build/outputs/apk
105-
destination: apks
103+
path: app/build/outputs/bundle
104+
destination: bundle
106105
build-foss-apk:
107106
docker:
108107
- image: circleci/android:api-29
109108
environment:
110-
JAVA_TOOL_OPTIONS: -Xmx5024m
109+
GRADLE_OPTS: -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false
111110
steps:
112111
- checkout
113112
- run:
@@ -127,16 +126,15 @@ jobs:
127126
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}-{{ checksum "player/build.gradle" }}-{{ checksum "core/build.gradle" }}-{{ checksum "util/build.gradle" }}-{{ checksum "draw/build.gradle" }}-{{ checksum "emoji/build.gradle" }}-{{ checksum "suggestions/build.gradle" }}
128127
- run:
129128
name: Download Dependencies
130-
command: ./gradlew --no-daemon androidDependencies --quiet --console=plain
129+
command: ./gradlew androidDependencies
131130
- save_cache:
132131
paths:
133132
- ~/.gradle/caches
134133
- ~/.gradle/wrapper
135134
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}-{{ checksum "player/build.gradle" }}-{{ checksum "core/build.gradle" }}-{{ checksum "util/build.gradle" }}-{{ checksum "draw/build.gradle" }}-{{ checksum "emoji/build.gradle" }}-{{ checksum "suggestions/build.gradle" }}
136135
- run:
137136
name: Build APK
138-
command: |
139-
./gradlew --no-daemon assembleFossRelease --info --console=plain --stacktrace
137+
command: ./gradlew assembleFossRelease
140138
- store_artifacts:
141139
path: app/build/outputs/apk
142140
destination: apks
@@ -154,7 +152,7 @@ workflows:
154152
- develop
155153
- develop-2.x
156154
- master
157-
- build-play-apk:
155+
- build-aab:
158156
requires:
159157
- build-kotlin-sdk
160158
- build-foss-apk:

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ android {
1818
applicationId "chat.rocket.android"
1919
minSdkVersion versions.minSdk
2020
targetSdkVersion versions.targetSdk
21-
versionCode 2075
21+
versionCode 2077
2222
versionName "3.5.1"
2323
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2424
multiDexEnabled true

app/src/main/java/chat/rocket/android/chatinformation/ui/MessageInfoFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class MessageInfoFragment : Fragment(), MessageInfoView {
4545

4646
val bundle = arguments
4747
if (bundle != null) {
48-
messageId = bundle.getString(BUNDLE_MESSAGE_ID)
48+
messageId = bundle.getString(BUNDLE_MESSAGE_ID, "")
4949
} else {
5050
requireNotNull(bundle) { "no arguments supplied when the fragment was instantiated" }
5151
}

app/src/main/java/chat/rocket/android/chatroom/domain/UriInteractor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class UriInteractor @Inject constructor(private val context: Context) {
1515
/**
1616
* Returns the MimeType from the [Uri].
1717
*/
18-
fun getMimeType(uri: Uri): String = uri.getMimeType(context)
18+
fun getMimeType(uri: Uri): String = uri.getMimeType(context) ?: ".png"
1919

2020
/**
2121
* Returns the file size from the [Uri].

app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,9 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
639639

640640
override fun copyToClipboard(message: String) {
641641
ui {
642-
val clipboard = it.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
643-
clipboard.primaryClip = ClipData.newPlainText("", message)
642+
(it.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager).apply {
643+
setPrimaryClip(ClipData.newPlainText("", message))
644+
}
644645
}
645646
}
646647

app/src/main/java/chat/rocket/android/chatroom/ui/Dialog.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fun ChatRoomFragment.showFileAttachmentDialog(uri: Uri) {
2020
var bitmap: Bitmap? = null
2121

2222
activity?.let { context ->
23-
uri.getMimeType(context).let {
23+
uri.getMimeType(context)?.let {
2424
mimeType = it
2525
description.text.clear()
2626
when {

app/src/main/java/chat/rocket/android/main/ui/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class MainActivity : AppCompatActivity(), HasActivityInjector,
8989
val config = Configuration()
9090

9191
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
92-
config.locales = LocaleList(locale)
92+
config.setLocales(LocaleList(locale))
9393
} else {
9494
config.locale = locale
9595
}

app/src/main/java/chat/rocket/android/util/extensions/Intent.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import android.app.Activity
44
import android.content.Intent
55

66
fun Intent.isSupportedLink(activity: Activity): Boolean {
7-
return (action == Intent.ACTION_VIEW && data != null && (data.isDynamicLink(activity) ||
8-
data.isAuthenticationDeepLink(activity) ||
9-
data.isCustomSchemeRoomLink() ||
10-
data.isWebSchemeRoomLink()))
7+
return (action == Intent.ACTION_VIEW && data != null && (data?.isDynamicLink(activity) == true ||
8+
data?.isAuthenticationDeepLink(activity) == true ||
9+
data?.isCustomSchemeRoomLink() == true ||
10+
data?.isWebSchemeRoomLink() == true))
1111
}

app/src/main/java/chat/rocket/android/util/extensions/Uri.kt

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fun Uri.getFileSize(context: Context): Int {
5353
return fileSize?.toIntOrNull() ?: -1
5454
}
5555

56-
fun Uri.getMimeType(context: Context): String {
56+
fun Uri.getMimeType(context: Context): String? {
5757
return if (scheme == ContentResolver.SCHEME_CONTENT) {
5858
context.contentResolver?.getType(this) ?: ""
5959
} else {
@@ -121,7 +121,7 @@ fun Uri.getDeepLinkInfo(context: Context): DeepLinkInfo? {
121121
return when {
122122
isAuthenticationDeepLink(context) -> {
123123
val host = getQueryParameter("host")
124-
val url = if (host.startsWith("http")) host else "https://$host"
124+
val url = if (host?.startsWith("http") == true) host else "https://$host"
125125
val userId = getQueryParameter("userId")
126126
val token = getQueryParameter("token")
127127
try {
@@ -133,12 +133,12 @@ fun Uri.getDeepLinkInfo(context: Context): DeepLinkInfo? {
133133
}
134134
isCustomSchemeRoomLink() -> {
135135
val hostValue = getQueryParameter("host")
136-
val url = if (hostValue.startsWith("http")) hostValue else "https://$hostValue"
136+
val url = if (hostValue?.startsWith("http") == true) hostValue else "https://$hostValue"
137137
val rid = getQueryParameter("rid")
138138
val pathValue = getQueryParameter("path")
139-
val pathSplit = pathValue.split("/")
140-
val roomType = pathSplit[0]
141-
val roomName = pathSplit[1]
139+
val pathSplit = pathValue?.split("/")
140+
val roomType = pathSplit?.get(0)
141+
val roomName = pathSplit?.get(1)
142142
try {
143143
DeepLinkInfo(url, null, null, rid, roomType, roomName)
144144
} catch (ex: Exception) {
@@ -148,9 +148,9 @@ fun Uri.getDeepLinkInfo(context: Context): DeepLinkInfo? {
148148
}
149149
isWebSchemeRoomLink() -> {
150150
val url = "https://$host"
151-
val pathSplit = path.split("/")
152-
val roomType = pathSplit[1]
153-
val roomName = pathSplit[2]
151+
val pathSplit = path?.split("/")
152+
val roomType = pathSplit?.get(1)
153+
val roomName = pathSplit?.get(2)
154154
try {
155155
DeepLinkInfo(url, null, null, null, roomType, roomName)
156156
} catch (ex: Exception) {
@@ -163,7 +163,7 @@ fun Uri.getDeepLinkInfo(context: Context): DeepLinkInfo? {
163163
}
164164

165165
fun Uri.isDynamicLink(activity: Activity): Boolean {
166-
return (host != null && host.contains(activity.getString(R.string.dynamic_link_host_url)))
166+
return (host != null && host?.contains(activity.getString(R.string.dynamic_link_host_url)) == true)
167167
}
168168

169169
// Authentication deep link defined here: https://rocket.chat/docs/developer-guides/deeplink/#authentication
@@ -177,17 +177,11 @@ fun Uri.isAuthenticationDeepLink(context: Context): Boolean {
177177

178178
// Custom scheme room deep link defined here: https://rocket.chat/docs/developer-guides/deeplink/#channel--group--dm
179179
fun Uri.isCustomSchemeRoomLink(): Boolean {
180-
if (scheme.startsWith("rocketchat") &&
181-
host == "room")
182-
return true
183-
return false
180+
return (scheme?.startsWith("rocketchat")) == true && host == "room"
184181
}
185182

186183
// http(s) scheme deep link not yet documented. Ex: https://open.rocket.chat/direct/testuser1
187184
fun Uri.isWebSchemeRoomLink(): Boolean {
188-
val roomType = path.split("/")[1]
189-
if (scheme.startsWith("http") &&
190-
(roomType == "channel" || roomType == "group" || roomType == "direct"))
191-
return true
192-
return false
185+
val roomType = path?.split("/")?.get(1)
186+
return (scheme?.startsWith("http")) == true && (roomType == "channel" || roomType == "group" || roomType == "direct")
193187
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ buildscript {
1010
}
1111

1212
dependencies {
13-
classpath 'com.android.tools.build:gradle:3.4.2'
13+
classpath 'com.android.tools.build:gradle:3.5.0'
1414
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
1515
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}"
1616
classpath 'com.google.gms:google-services:4.3.0'

0 commit comments

Comments
 (0)