Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 094fcd6

Browse files
committed
Merge branch 'release/0.8.23'
2 parents 59e927c + fe7c317 commit 094fcd6

File tree

169 files changed

+4903
-2417
lines changed

Some content is hidden

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

169 files changed

+4903
-2417
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<!-- Please read [CONTRIBUTING.md](https://github.com/vector-im/riot-android/CONTRIBUTING.md) before submitting your pull request -->
44

55
* [ ] Changes has been tested on an Android device or Android emulator with API 16
6+
* [ ] UI change has been tested on both light and dark themes
67
* [ ] Pull request is based on the develop branch
78
* [ ] Pull request updates [CHANGES.rst](https://github.com/vector-im/riot-android/blob/develop/CHANGES.rst)
89
* [ ] Pull request includes screenshots or videos if containing UI changes

CHANGES.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
Changes in Riot 0.8.23 (2019-02-21)
2+
===================================================
3+
4+
MatrixSdk:
5+
- Upgrade MatrixSdk to version 0.9.17.
6+
7+
Features:
8+
- key backup: Trust on Decrypt (#2921)
9+
- key backup: new recover method detected (#2926)
10+
11+
Improvements:
12+
- keys backup: Setup screen UX improvement
13+
- keys backup: Sign Out flow improvement
14+
- Improved button styles (states, ripple effect)
15+
- Show direct chat section in user details only for other users, not self
16+
- Sender name colors in rooms
17+
18+
Other changes:
19+
- Remove beta e2e warning (#2946)
20+
21+
Bugfix:
22+
- Fix warning "Attribute value must be constant" in VectorHomeActivity
23+
- Fix key backup banner doesn't go away after you have restored from backup. (#2943)
24+
- Fix issue with registration on some HomeServer (#2985)
25+
126
Changes in Riot 0.8.22 (2019-02-01)
227
===================================================
328

@@ -38,6 +63,7 @@ Bugfix:
3863
- Fix issues with Tombstone events (#2866 && #2867)
3964
- Fix crash on BugReportActivity if previous Activity is destroyed (#2876)
4065
- Key share request does not go away when user select "verify" (#2781)
66+
- Fix crash when entering the settings due to missing push rules (#2893)
4167

4268
Changes in Riot 0.8.21 (2019-01-02)
4369
===================================================

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Android support can be found in this [![Android Matrix room #riot-android:matrix
66

77
# Specific rules for Matrix Android projects
88

9+
## Android Studio settings
10+
11+
Please set the "hard wrap" setting of Android Studio to 160 chars, this is the setting we use internally to format the source code (Menu `Settings/Editor/Code Style` then `Hard wrap at`).
12+
913
## Compilation
1014

1115
Riot Android uses by default the Matrix Android SDK library (file `matrix-sdk.aar`).

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ buildscript {
2323

2424
// global properties used in sub modules
2525
ext {
26-
versionCodeProp = 82200
27-
versionNameProp = "0.8.22"
26+
versionCodeProp = 82300
27+
versionNameProp = "0.8.23"
2828
versionBuild = System.getenv("BUILD_NUMBER") as Integer ?: 0
2929
buildNumberProp = "${versionBuild}"
3030
}

tools/check/forbidden_strings_in_resources.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,7 @@ layout_constraintLeft_
7878

7979
### Use im.vector.preference.VectorPreference to support multiline of the title
8080
<Preference\n
81+
82+
### Will crash on API < 21. Use ?colorAccent instead
83+
\?android:colorAccent
84+
\?android:attr/colorAccent

vector/libs/matrix-sdk.aar

43.8 KB
Binary file not shown.

vector/src/main/AndroidManifest.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,18 @@
131131

132132
<!-- activities list starts here -->
133133
<activity
134-
android:name=".activity.LoginActivity"
135-
android:configChanges="orientation|screenSize"
136-
android:windowSoftInputMode="stateHidden|adjustResize">
134+
android:name=".activity.LauncherActivity"
135+
android:theme="@style/AppTheme.Launcher">
137136
<intent-filter>
138137
<action android:name="android.intent.action.MAIN" />
139138

140139
<category android:name="android.intent.category.LAUNCHER" />
141140
</intent-filter>
142141
</activity>
142+
<activity
143+
android:name=".activity.LoginActivity"
144+
android:configChanges="orientation|screenSize"
145+
android:windowSoftInputMode="stateHidden|adjustResize" />
143146
<activity
144147
android:name=".activity.FallbackAccountCreationActivity"
145148
android:configChanges="orientation|screenSize"
@@ -159,9 +162,6 @@
159162
<activity
160163
android:name=".activity.SplashActivity"
161164
android:configChanges="orientation|screenSize" />
162-
<activity
163-
android:name=".activity.signout.SignOutActivity"
164-
android:label="@string/title_activity_sign_out" />
165165
<activity
166166
android:name=".activity.LoggingOutActivity"
167167
android:configChanges="orientation|screenSize" />
@@ -415,7 +415,7 @@
415415
android:windowSoftInputMode="stateHidden|adjustResize" />
416416
<activity
417417
android:name=".activity.KeysBackupManageActivity"
418-
android:label="@string/title_activity_keys_backup_manage" />
418+
android:label="@string/encryption_message_recovery" />
419419

420420
<!-- FileProvider -->
421421
<provider

vector/src/main/java/im/vector/Matrix.java

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,18 @@
2323
import android.content.Intent;
2424
import android.content.pm.PackageInfo;
2525
import android.support.annotation.NonNull;
26+
import android.support.v7.app.AlertDialog;
2627
import android.text.TextUtils;
2728

29+
import org.jetbrains.annotations.NotNull;
2830
import org.matrix.androidsdk.HomeServerConnectionConfig;
2931
import org.matrix.androidsdk.MXDataHandler;
3032
import org.matrix.androidsdk.MXSession;
3133
import org.matrix.androidsdk.crypto.IncomingRoomKeyRequest;
3234
import org.matrix.androidsdk.crypto.IncomingRoomKeyRequestCancellation;
3335
import org.matrix.androidsdk.crypto.MXCrypto;
36+
import org.matrix.androidsdk.crypto.keysbackup.KeysBackup;
37+
import org.matrix.androidsdk.crypto.keysbackup.KeysBackupStateManager;
3438
import org.matrix.androidsdk.data.Room;
3539
import org.matrix.androidsdk.data.RoomState;
3640
import org.matrix.androidsdk.data.metrics.MetricsListener;
@@ -53,12 +57,15 @@
5357
import java.util.ArrayList;
5458
import java.util.Arrays;
5559
import java.util.Collection;
60+
import java.util.HashMap;
5661
import java.util.HashSet;
5762
import java.util.Iterator;
5863
import java.util.List;
64+
import java.util.Map;
5965
import java.util.Set;
6066

6167
import im.vector.activity.CommonActivityUtils;
68+
import im.vector.activity.KeysBackupManageActivity;
6269
import im.vector.activity.SplashActivity;
6370
import im.vector.analytics.MetricsListenerProxy;
6471
import im.vector.push.PushManager;
@@ -100,6 +107,8 @@ public class Matrix {
100107
// tell if the client should be logged out
101108
public boolean mHasBeenDisconnected = false;
102109

110+
public Map<String, KeysBackupStateManager.KeysBackupStateListener> keyBackupStateListeners = new HashMap<>();
111+
103112
// i.e the event has been read from another client
104113
private static final MXEventListener mLiveEventListener = new MXEventListener() {
105114
boolean mClearCacheRequired = false;
@@ -495,6 +504,12 @@ public void onSuccess(Void info) {
495504
mLoginStorage.removeCredentials(session.getHomeServerConfig());
496505

497506
session.getDataHandler().removeListener(mLiveEventListener);
507+
if (keyBackupStateListeners.get(session.getMyUserId()) != null) {
508+
if (session.getCrypto() != null) {
509+
session.getCrypto().getKeysBackup().removeListener(keyBackupStateListeners.get(session.getMyUserId()));
510+
}
511+
keyBackupStateListeners.remove(session.getMyUserId());
512+
}
498513

499514
VectorApp.removeSyncingSession(session);
500515

@@ -530,6 +545,12 @@ public synchronized void clearSession(final Context context,
530545
}
531546

532547
session.getDataHandler().removeListener(mLiveEventListener);
548+
if (keyBackupStateListeners.get(session.getMyUserId()) != null) {
549+
if (session.getCrypto() != null) {
550+
session.getCrypto().getKeysBackup().removeListener(keyBackupStateListeners.get(session.getMyUserId()));
551+
}
552+
keyBackupStateListeners.remove(session.getMyUserId());
553+
}
533554

534555
ApiCallback<Void> callback = new SimpleApiCallback<Void>() {
535556
@Override
@@ -719,13 +740,49 @@ public void onRoomKeyRequestCancellation(IncomingRoomKeyRequestCancellation requ
719740
KeyRequestHandler.getSharedInstance().handleKeyRequestCancellation(request);
720741
}
721742
});
743+
744+
registerKeyBackupStateListener(session);
722745
}
723746
}
724747
});
725748

749+
726750
return session;
727751
}
728752

753+
private void registerKeyBackupStateListener(MXSession session) {
754+
if (session.getCrypto() != null) {
755+
KeysBackup keysBackup = session.getCrypto().getKeysBackup();
756+
final String matrixID = session.getMyUserId();
757+
if (keyBackupStateListeners.get(matrixID) == null) {
758+
KeysBackupStateManager.KeysBackupStateListener keyBackupStateListener = new KeysBackupStateManager.KeysBackupStateListener() {
759+
@Override
760+
public void onStateChange(@NotNull KeysBackupStateManager.KeysBackupState newState) {
761+
if (KeysBackupStateManager.KeysBackupState.WrongBackUpVersion == newState) {
762+
//We should show the popup
763+
Activity activity = VectorApp.getCurrentActivity();
764+
//This is fake multi session :/ i should be able to have current session...
765+
if (activity != null) {
766+
new AlertDialog.Builder(activity)
767+
.setTitle(R.string.new_recovery_method_popup_title)
768+
.setMessage(R.string.new_recovery_method_popup_description)
769+
.setPositiveButton(R.string.open_settings, (dialog, which) -> {
770+
activity.startActivity(KeysBackupManageActivity.Companion.intent(activity, matrixID));
771+
})
772+
.setNegativeButton(R.string.new_recovery_method_popup_was_me, null)
773+
.show();
774+
}
775+
}
776+
}
777+
};
778+
keyBackupStateListeners.put(matrixID, keyBackupStateListener);
779+
}
780+
keysBackup.addListener(keyBackupStateListeners.get(matrixID));
781+
} else {
782+
Log.e(LOG_TAG, "## Failed to register keybackup state listener");
783+
}
784+
}
785+
729786
/**
730787
* Reload the matrix sessions.
731788
* The session caches are cleared before being reloaded.

vector/src/main/java/im/vector/PhoneNumberHandler.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@ public class PhoneNumberHandler implements TextWatcher, View.OnFocusChangeListen
6666
* *********************************************************************************************
6767
*/
6868

69-
public PhoneNumberHandler(@NonNull final Activity activity, @NonNull final EditText phoneNumberInput,
70-
@NonNull final EditText countryCodeInput, @DisplayMode final int displayMode,
69+
public PhoneNumberHandler(@NonNull final Activity activity,
70+
@NonNull final EditText phoneNumberInput,
71+
@NonNull final EditText countryCodeInput,
72+
@DisplayMode final int displayMode,
7173
final int requestCode) {
7274
mPhoneNumberInput = phoneNumberInput;
7375
mCountryCodeInput = countryCodeInput;

vector/src/main/java/im/vector/activity/AccountCreationCaptchaActivity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ public void run() {
184184
public void onReceivedHttpError(WebView view, WebResourceRequest request, WebResourceResponse errorResponse) {
185185
super.onReceivedHttpError(view, request, errorResponse);
186186

187+
if (request.getUrl().toString().endsWith("favicon.ico")) {
188+
// Ignore this error
189+
return;
190+
}
191+
187192
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
188193
onError(errorResponse.getReasonPhrase());
189194
} else {

vector/src/main/java/im/vector/activity/CommonActivityUtils.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -336,13 +336,12 @@ public static void logout(final Activity activity, final boolean goToLoginPage)
336336
// display a dummy activity until the logout is done
337337
Matrix.getInstance(context).getPushManager().clearPreferences();
338338

339+
Intent intent = new Intent(activity, LoggingOutActivity.class);
340+
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
341+
339342
if (null != activity) {
340-
// go to login page
341-
activity.startActivity(new Intent(activity, LoggingOutActivity.class));
342-
activity.finish();
343+
activity.startActivity(intent);
343344
} else {
344-
Intent intent = new Intent(context, LoggingOutActivity.class);
345-
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
346345
context.startActivity(intent);
347346
}
348347
}
@@ -365,13 +364,14 @@ public void onSuccess(Void info) {
365364

366365
if (goToLoginPage) {
367366
Activity activeActivity = VectorApp.getCurrentActivity();
367+
368+
// go to login page
369+
Intent intent = new Intent(activeActivity, LoginActivity.class);
370+
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
371+
368372
if (null != activeActivity) {
369-
// go to login page
370-
activeActivity.startActivity(new Intent(activeActivity, LoginActivity.class));
371-
activeActivity.finish();
373+
activeActivity.startActivity(intent);
372374
} else {
373-
Intent intent = new Intent(context, LoginActivity.class);
374-
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
375375
context.startActivity(intent);
376376
}
377377
}

vector/src/main/java/im/vector/activity/KeysBackupManageActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class KeysBackupManageActivity : SimpleFragmentActivity() {
3737
}
3838
}
3939

40-
override fun getTitleRes() = R.string.title_activity_keys_backup_manage
40+
override fun getTitleRes() = R.string.encryption_message_recovery
4141

4242

4343
private lateinit var viewModel: KeysBackupSettingsViewModel

0 commit comments

Comments
 (0)