mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 11:26:01 +03:00
Log
This commit is contained in:
parent
f5bd215f36
commit
6d8000b957
48 changed files with 185 additions and 185 deletions
|
@ -134,7 +134,7 @@ internal class CryptoManager(
|
||||||
//private val mNetworkListener = object : IMXNetworkEventListener {
|
//private val mNetworkListener = object : IMXNetworkEventListener {
|
||||||
// override fun onNetworkConnectionUpdate(isConnected: Boolean) {
|
// override fun onNetworkConnectionUpdate(isConnected: Boolean) {
|
||||||
// if (isConnected && !isStarted()) {
|
// if (isConnected && !isStarted()) {
|
||||||
// Timber.d("Start MXCrypto because a network connection has been retrieved ")
|
// Timber.v("Start MXCrypto because a network connection has been retrieved ")
|
||||||
// start(false, null)
|
// start(false, null)
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
@ -257,13 +257,13 @@ internal class CryptoManager(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSuccess(data: KeysUploadResponse) {
|
override fun onSuccess(data: KeysUploadResponse) {
|
||||||
Timber.d("###########################################################")
|
Timber.v("###########################################################")
|
||||||
Timber.d("uploadDeviceKeys done for " + mCredentials.userId)
|
Timber.v("uploadDeviceKeys done for " + mCredentials.userId)
|
||||||
Timber.d(" - device id : " + mCredentials.deviceId)
|
Timber.v(" - device id : " + mCredentials.deviceId)
|
||||||
Timber.d(" - ed25519 : " + mOlmDevice.deviceEd25519Key)
|
Timber.v(" - ed25519 : " + mOlmDevice.deviceEd25519Key)
|
||||||
Timber.d(" - curve25519 : " + mOlmDevice.deviceCurve25519Key)
|
Timber.v(" - curve25519 : " + mOlmDevice.deviceCurve25519Key)
|
||||||
Timber.d(" - oneTimeKeys: " + mOneTimeKeysUploader.mLastPublishedOneTimeKeys)
|
Timber.v(" - oneTimeKeys: " + mOneTimeKeysUploader.mLastPublishedOneTimeKeys)
|
||||||
Timber.d("")
|
Timber.v("")
|
||||||
|
|
||||||
mOneTimeKeysUploader.maybeUploadOneTimeKeys(object : MatrixCallback<Unit> {
|
mOneTimeKeysUploader.maybeUploadOneTimeKeys(object : MatrixCallback<Unit> {
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
|
@ -502,7 +502,7 @@ internal class CryptoManager(
|
||||||
// e2e rooms with them, so there is room for optimisation here, but for now
|
// e2e rooms with them, so there is room for optimisation here, but for now
|
||||||
// we just invalidate everyone in the room.
|
// we just invalidate everyone in the room.
|
||||||
if (null == existingAlgorithm) {
|
if (null == existingAlgorithm) {
|
||||||
Timber.d("Enabling encryption in $roomId for the first time; invalidating device lists for all users therein")
|
Timber.v("Enabling encryption in $roomId for the first time; invalidating device lists for all users therein")
|
||||||
|
|
||||||
val userIds = ArrayList(membersId)
|
val userIds = ArrayList(membersId)
|
||||||
|
|
||||||
|
@ -578,7 +578,7 @@ internal class CryptoManager(
|
||||||
callback: MatrixCallback<MXEncryptEventContentResult>) {
|
callback: MatrixCallback<MXEncryptEventContentResult>) {
|
||||||
// wait that the crypto is really started
|
// wait that the crypto is really started
|
||||||
if (!isStarted()) {
|
if (!isStarted()) {
|
||||||
Timber.d("## encryptEventContent() : wait after e2e init")
|
Timber.v("## encryptEventContent() : wait after e2e init")
|
||||||
|
|
||||||
start(false, object : MatrixCallback<Unit> {
|
start(false, object : MatrixCallback<Unit> {
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
|
@ -626,11 +626,11 @@ internal class CryptoManager(
|
||||||
|
|
||||||
if (null != alg) {
|
if (null != alg) {
|
||||||
val t0 = System.currentTimeMillis()
|
val t0 = System.currentTimeMillis()
|
||||||
Timber.d("## encryptEventContent() starts")
|
Timber.v("## encryptEventContent() starts")
|
||||||
|
|
||||||
alg!!.encryptEventContent(eventContent, eventType, userIds, object : MatrixCallback<Content> {
|
alg!!.encryptEventContent(eventContent, eventType, userIds, object : MatrixCallback<Content> {
|
||||||
override fun onSuccess(data: Content) {
|
override fun onSuccess(data: Content) {
|
||||||
Timber.d("## encryptEventContent() : succeeds after " + (System.currentTimeMillis() - t0) + " ms")
|
Timber.v("## encryptEventContent() : succeeds after " + (System.currentTimeMillis() - t0) + " ms")
|
||||||
|
|
||||||
callback.onSuccess(MXEncryptEventContentResult(data, EventType.ENCRYPTED))
|
callback.onSuccess(MXEncryptEventContentResult(data, EventType.ENCRYPTED))
|
||||||
}
|
}
|
||||||
|
@ -890,7 +890,7 @@ internal class CryptoManager(
|
||||||
password: String,
|
password: String,
|
||||||
progressListener: ProgressListener?,
|
progressListener: ProgressListener?,
|
||||||
callback: MatrixCallback<ImportRoomKeysResult>) {
|
callback: MatrixCallback<ImportRoomKeysResult>) {
|
||||||
Timber.d("## importRoomKeys starts")
|
Timber.v("## importRoomKeys starts")
|
||||||
|
|
||||||
val t0 = System.currentTimeMillis()
|
val t0 = System.currentTimeMillis()
|
||||||
val roomKeys: String
|
val roomKeys: String
|
||||||
|
@ -906,7 +906,7 @@ internal class CryptoManager(
|
||||||
|
|
||||||
val t1 = System.currentTimeMillis()
|
val t1 = System.currentTimeMillis()
|
||||||
|
|
||||||
Timber.d("## importRoomKeys : decryptMegolmKeyFile done in " + (t1 - t0) + " ms")
|
Timber.v("## importRoomKeys : decryptMegolmKeyFile done in " + (t1 - t0) + " ms")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val list = MoshiProvider.providesMoshi()
|
val list = MoshiProvider.providesMoshi()
|
||||||
|
@ -921,7 +921,7 @@ internal class CryptoManager(
|
||||||
|
|
||||||
val t2 = System.currentTimeMillis()
|
val t2 = System.currentTimeMillis()
|
||||||
|
|
||||||
Timber.d("## importRoomKeys : JSON parsing " + (t2 - t1) + " ms")
|
Timber.v("## importRoomKeys : JSON parsing " + (t2 - t1) + " ms")
|
||||||
|
|
||||||
mMegolmSessionDataImporter.handle(importedSessions, true, progressListener, callback)
|
mMegolmSessionDataImporter.handle(importedSessions, true, progressListener, callback)
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,7 @@ internal class DeviceListManager(private val mCryptoStore: IMXCryptoStore,
|
||||||
|
|
||||||
for (userId in userIds) {
|
for (userId in userIds) {
|
||||||
if (!deviceTrackingStatuses.containsKey(userId) || TRACKING_STATUS_NOT_TRACKED == deviceTrackingStatuses[userId]) {
|
if (!deviceTrackingStatuses.containsKey(userId) || TRACKING_STATUS_NOT_TRACKED == deviceTrackingStatuses[userId]) {
|
||||||
Timber.d("## startTrackingDeviceList() : Now tracking device list for $userId")
|
Timber.v("## startTrackingDeviceList() : Now tracking device list for $userId")
|
||||||
deviceTrackingStatuses.put(userId, TRACKING_STATUS_PENDING_DOWNLOAD)
|
deviceTrackingStatuses.put(userId, TRACKING_STATUS_PENDING_DOWNLOAD)
|
||||||
isUpdated = true
|
isUpdated = true
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ internal class DeviceListManager(private val mCryptoStore: IMXCryptoStore,
|
||||||
|
|
||||||
for (userId in changed) {
|
for (userId in changed) {
|
||||||
if (deviceTrackingStatuses.containsKey(userId)) {
|
if (deviceTrackingStatuses.containsKey(userId)) {
|
||||||
Timber.d("## invalidateUserDeviceList() : Marking device list outdated for $userId")
|
Timber.v("## invalidateUserDeviceList() : Marking device list outdated for $userId")
|
||||||
deviceTrackingStatuses.put(userId, TRACKING_STATUS_PENDING_DOWNLOAD)
|
deviceTrackingStatuses.put(userId, TRACKING_STATUS_PENDING_DOWNLOAD)
|
||||||
isUpdated = true
|
isUpdated = true
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ internal class DeviceListManager(private val mCryptoStore: IMXCryptoStore,
|
||||||
|
|
||||||
for (userId in left) {
|
for (userId in left) {
|
||||||
if (deviceTrackingStatuses.containsKey(userId)) {
|
if (deviceTrackingStatuses.containsKey(userId)) {
|
||||||
Timber.d("## invalidateUserDeviceList() : No longer tracking device list for $userId")
|
Timber.v("## invalidateUserDeviceList() : No longer tracking device list for $userId")
|
||||||
deviceTrackingStatuses.put(userId, TRACKING_STATUS_NOT_TRACKED)
|
deviceTrackingStatuses.put(userId, TRACKING_STATUS_NOT_TRACKED)
|
||||||
isUpdated = true
|
isUpdated = true
|
||||||
}
|
}
|
||||||
|
@ -319,7 +319,7 @@ internal class DeviceListManager(private val mCryptoStore: IMXCryptoStore,
|
||||||
// we didn't get any new invalidations since this download started:
|
// we didn't get any new invalidations since this download started:
|
||||||
// this user's device list is now up to date.
|
// this user's device list is now up to date.
|
||||||
deviceTrackingStatuses.put(userId, TRACKING_STATUS_UP_TO_DATE)
|
deviceTrackingStatuses.put(userId, TRACKING_STATUS_UP_TO_DATE)
|
||||||
Timber.d("Device list for $userId now up to date")
|
Timber.v("Device list for $userId now up to date")
|
||||||
}
|
}
|
||||||
|
|
||||||
// And the response result
|
// And the response result
|
||||||
|
@ -359,7 +359,7 @@ internal class DeviceListManager(private val mCryptoStore: IMXCryptoStore,
|
||||||
* @param callback the asynchronous callback
|
* @param callback the asynchronous callback
|
||||||
*/
|
*/
|
||||||
fun downloadKeys(userIds: List<String>?, forceDownload: Boolean, callback: MatrixCallback<MXUsersDevicesMap<MXDeviceInfo>>?) {
|
fun downloadKeys(userIds: List<String>?, forceDownload: Boolean, callback: MatrixCallback<MXUsersDevicesMap<MXDeviceInfo>>?) {
|
||||||
Timber.d("## downloadKeys() : forceDownload $forceDownload : $userIds")
|
Timber.v("## downloadKeys() : forceDownload $forceDownload : $userIds")
|
||||||
|
|
||||||
// Map from userid -> deviceid -> DeviceInfo
|
// Map from userid -> deviceid -> DeviceInfo
|
||||||
val stored = MXUsersDevicesMap<MXDeviceInfo>()
|
val stored = MXUsersDevicesMap<MXDeviceInfo>()
|
||||||
|
@ -393,18 +393,18 @@ internal class DeviceListManager(private val mCryptoStore: IMXCryptoStore,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == downloadUsers.size) {
|
if (0 == downloadUsers.size) {
|
||||||
Timber.d("## downloadKeys() : no new user device")
|
Timber.v("## downloadKeys() : no new user device")
|
||||||
|
|
||||||
if (null != callback) {
|
if (null != callback) {
|
||||||
CryptoAsyncHelper.getUiHandler().post { callback.onSuccess(stored) }
|
CryptoAsyncHelper.getUiHandler().post { callback.onSuccess(stored) }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Timber.d("## downloadKeys() : starts")
|
Timber.v("## downloadKeys() : starts")
|
||||||
val t0 = System.currentTimeMillis()
|
val t0 = System.currentTimeMillis()
|
||||||
|
|
||||||
doKeyDownloadForUsers(downloadUsers, object : MatrixCallback<MXUsersDevicesMap<MXDeviceInfo>> {
|
doKeyDownloadForUsers(downloadUsers, object : MatrixCallback<MXUsersDevicesMap<MXDeviceInfo>> {
|
||||||
override fun onSuccess(data: MXUsersDevicesMap<MXDeviceInfo>) {
|
override fun onSuccess(data: MXUsersDevicesMap<MXDeviceInfo>) {
|
||||||
Timber.d("## downloadKeys() : doKeyDownloadForUsers succeeds after " + (System.currentTimeMillis() - t0) + " ms")
|
Timber.v("## downloadKeys() : doKeyDownloadForUsers succeeds after " + (System.currentTimeMillis() - t0) + " ms")
|
||||||
|
|
||||||
data.addEntriesFromMap(stored)
|
data.addEntriesFromMap(stored)
|
||||||
|
|
||||||
|
@ -428,7 +428,7 @@ internal class DeviceListManager(private val mCryptoStore: IMXCryptoStore,
|
||||||
* @param callback the asynchronous callback
|
* @param callback the asynchronous callback
|
||||||
*/
|
*/
|
||||||
private fun doKeyDownloadForUsers(downloadUsers: MutableList<String>, callback: MatrixCallback<MXUsersDevicesMap<MXDeviceInfo>>?) {
|
private fun doKeyDownloadForUsers(downloadUsers: MutableList<String>, callback: MatrixCallback<MXUsersDevicesMap<MXDeviceInfo>>?) {
|
||||||
Timber.d("## doKeyDownloadForUsers() : doKeyDownloadForUsers $downloadUsers")
|
Timber.v("## doKeyDownloadForUsers() : doKeyDownloadForUsers $downloadUsers")
|
||||||
|
|
||||||
// get the user ids which did not already trigger a keys download
|
// get the user ids which did not already trigger a keys download
|
||||||
val filteredUsers = addDownloadKeysPromise(downloadUsers, callback)
|
val filteredUsers = addDownloadKeysPromise(downloadUsers, callback)
|
||||||
|
@ -460,7 +460,7 @@ internal class DeviceListManager(private val mCryptoStore: IMXCryptoStore,
|
||||||
.dispatchTo(object : MatrixCallback<KeysQueryResponse> {
|
.dispatchTo(object : MatrixCallback<KeysQueryResponse> {
|
||||||
override fun onSuccess(data: KeysQueryResponse) {
|
override fun onSuccess(data: KeysQueryResponse) {
|
||||||
CryptoAsyncHelper.getEncryptBackgroundHandler().post {
|
CryptoAsyncHelper.getEncryptBackgroundHandler().post {
|
||||||
Timber.d("## doKeyDownloadForUsers() : Got keys for " + filteredUsers.size + " users")
|
Timber.v("## doKeyDownloadForUsers() : Got keys for " + filteredUsers.size + " users")
|
||||||
val userIdsList = ArrayList(filteredUsers)
|
val userIdsList = ArrayList(filteredUsers)
|
||||||
|
|
||||||
for (userId in userIdsList) {
|
for (userId in userIdsList) {
|
||||||
|
@ -472,7 +472,7 @@ internal class DeviceListManager(private val mCryptoStore: IMXCryptoStore,
|
||||||
} else {
|
} else {
|
||||||
val devices = data.deviceKeys!![userId]
|
val devices = data.deviceKeys!![userId]
|
||||||
|
|
||||||
Timber.d("## doKeyDownloadForUsers() : Got keys for $userId : $devices")
|
Timber.v("## doKeyDownloadForUsers() : Got keys for $userId : $devices")
|
||||||
|
|
||||||
if (null != devices) {
|
if (null != devices) {
|
||||||
val mutableDevices = HashMap(devices)
|
val mutableDevices = HashMap(devices)
|
||||||
|
@ -690,7 +690,7 @@ internal class DeviceListManager(private val mCryptoStore: IMXCryptoStore,
|
||||||
|
|
||||||
doKeyDownloadForUsers(users, object : MatrixCallback<MXUsersDevicesMap<MXDeviceInfo>> {
|
doKeyDownloadForUsers(users, object : MatrixCallback<MXUsersDevicesMap<MXDeviceInfo>> {
|
||||||
override fun onSuccess(data: MXUsersDevicesMap<MXDeviceInfo>) {
|
override fun onSuccess(data: MXUsersDevicesMap<MXDeviceInfo>) {
|
||||||
CryptoAsyncHelper.getEncryptBackgroundHandler().post { Timber.d("## refreshOutdatedDeviceLists() : done") }
|
CryptoAsyncHelper.getEncryptBackgroundHandler().post { Timber.v("## refreshOutdatedDeviceLists() : done") }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailure(failure: Throwable) {
|
override fun onFailure(failure: Throwable) {
|
||||||
|
|
|
@ -86,7 +86,7 @@ internal class IncomingRoomKeyRequestManager(
|
||||||
val roomId = body!!.roomId
|
val roomId = body!!.roomId
|
||||||
val alg = body.algorithm
|
val alg = body.algorithm
|
||||||
|
|
||||||
Timber.d("m.room_key_request from " + userId + ":" + deviceId + " for " + roomId + " / " + body.sessionId + " id " + request.mRequestId)
|
Timber.v("m.room_key_request from " + userId + ":" + deviceId + " for " + roomId + " / " + body.sessionId + " id " + request.mRequestId)
|
||||||
|
|
||||||
if (!TextUtils.equals(mCredentials.userId, userId)) {
|
if (!TextUtils.equals(mCredentials.userId, userId)) {
|
||||||
// TODO: determine if we sent this device the keys already: in
|
// TODO: determine if we sent this device the keys already: in
|
||||||
|
@ -114,7 +114,7 @@ internal class IncomingRoomKeyRequestManager(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TextUtils.equals(deviceId, mCredentials.deviceId) && TextUtils.equals(mCredentials.userId, userId)) {
|
if (TextUtils.equals(deviceId, mCredentials.deviceId) && TextUtils.equals(mCredentials.userId, userId)) {
|
||||||
Timber.d("## processReceivedRoomKeyRequests() : oneself device - ignored")
|
Timber.v("## processReceivedRoomKeyRequests() : oneself device - ignored")
|
||||||
mCryptoStore.deleteIncomingRoomKeyRequest(request)
|
mCryptoStore.deleteIncomingRoomKeyRequest(request)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -131,14 +131,14 @@ internal class IncomingRoomKeyRequestManager(
|
||||||
|
|
||||||
if (null != device) {
|
if (null != device) {
|
||||||
if (device.isVerified) {
|
if (device.isVerified) {
|
||||||
Timber.d("## processReceivedRoomKeyRequests() : device is already verified: sharing keys")
|
Timber.v("## processReceivedRoomKeyRequests() : device is already verified: sharing keys")
|
||||||
mCryptoStore.deleteIncomingRoomKeyRequest(request)
|
mCryptoStore.deleteIncomingRoomKeyRequest(request)
|
||||||
request.mShare!!.run()
|
request.mShare!!.run()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device.isBlocked) {
|
if (device.isBlocked) {
|
||||||
Timber.d("## processReceivedRoomKeyRequests() : device is blocked -> ignored")
|
Timber.v("## processReceivedRoomKeyRequests() : device is blocked -> ignored")
|
||||||
mCryptoStore.deleteIncomingRoomKeyRequest(request)
|
mCryptoStore.deleteIncomingRoomKeyRequest(request)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ internal class IncomingRoomKeyRequestManager(
|
||||||
|
|
||||||
if (null != receivedRoomKeyRequestCancellations) {
|
if (null != receivedRoomKeyRequestCancellations) {
|
||||||
for (request in receivedRoomKeyRequestCancellations!!) {
|
for (request in receivedRoomKeyRequestCancellations!!) {
|
||||||
Timber.d("## ## processReceivedRoomKeyRequests() : m.room_key_request cancellation for " + request.mUserId
|
Timber.v("## ## processReceivedRoomKeyRequests() : m.room_key_request cancellation for " + request.mUserId
|
||||||
+ ":" + request.mDeviceId + " id " + request.mRequestId)
|
+ ":" + request.mDeviceId + " id " + request.mRequestId)
|
||||||
|
|
||||||
// we should probably only notify the app of cancellations we told it
|
// we should probably only notify the app of cancellations we told it
|
||||||
|
|
|
@ -117,7 +117,7 @@ object MXEncryptedAttachments {
|
||||||
|
|
||||||
outStream.close()
|
outStream.close()
|
||||||
|
|
||||||
Timber.d("Encrypt in " + (System.currentTimeMillis() - t0) + " ms")
|
Timber.v("Encrypt in " + (System.currentTimeMillis() - t0) + " ms")
|
||||||
return result
|
return result
|
||||||
} catch (oom: OutOfMemoryError) {
|
} catch (oom: OutOfMemoryError) {
|
||||||
Timber.e(oom, "## encryptAttachment failed " + oom.message)
|
Timber.e(oom, "## encryptAttachment failed " + oom.message)
|
||||||
|
@ -214,7 +214,7 @@ object MXEncryptedAttachments {
|
||||||
val decryptedStream = ByteArrayInputStream(outStream.toByteArray())
|
val decryptedStream = ByteArrayInputStream(outStream.toByteArray())
|
||||||
outStream.close()
|
outStream.close()
|
||||||
|
|
||||||
Timber.d("Decrypt in " + (System.currentTimeMillis() - t0) + " ms")
|
Timber.v("Decrypt in " + (System.currentTimeMillis() - t0) + " ms")
|
||||||
|
|
||||||
return decryptedStream
|
return decryptedStream
|
||||||
} catch (oom: OutOfMemoryError) {
|
} catch (oom: OutOfMemoryError) {
|
||||||
|
|
|
@ -354,7 +354,7 @@ object MXMegolmExportEncryption {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timber.d("## deriveKeys() : " + iterations + " in " + (System.currentTimeMillis() - t0) + " ms")
|
Timber.v("## deriveKeys() : " + iterations + " in " + (System.currentTimeMillis() - t0) + " ms")
|
||||||
|
|
||||||
return key
|
return key
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ internal class MXOlmDevice(
|
||||||
mOlmAccount = mStore.getAccount()
|
mOlmAccount = mStore.getAccount()
|
||||||
|
|
||||||
if (null == mOlmAccount) {
|
if (null == mOlmAccount) {
|
||||||
Timber.d("MXOlmDevice : create a new olm account")
|
Timber.v("MXOlmDevice : create a new olm account")
|
||||||
// Else, create it
|
// Else, create it
|
||||||
try {
|
try {
|
||||||
mOlmAccount = OlmAccount()
|
mOlmAccount = OlmAccount()
|
||||||
|
@ -97,7 +97,7 @@ internal class MXOlmDevice(
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Timber.d("MXOlmDevice : use an existing account")
|
Timber.v("MXOlmDevice : use an existing account")
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -198,7 +198,7 @@ internal class MXOlmDevice(
|
||||||
* @return the session id for the outbound session.
|
* @return the session id for the outbound session.
|
||||||
*/
|
*/
|
||||||
fun createOutboundSession(theirIdentityKey: String, theirOneTimeKey: String): String? {
|
fun createOutboundSession(theirIdentityKey: String, theirOneTimeKey: String): String? {
|
||||||
Timber.d("## createOutboundSession() ; theirIdentityKey $theirIdentityKey theirOneTimeKey $theirOneTimeKey")
|
Timber.v("## createOutboundSession() ; theirIdentityKey $theirIdentityKey theirOneTimeKey $theirOneTimeKey")
|
||||||
var olmSession: OlmSession? = null
|
var olmSession: OlmSession? = null
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -216,7 +216,7 @@ internal class MXOlmDevice(
|
||||||
|
|
||||||
val sessionIdentifier = olmSession.sessionIdentifier()
|
val sessionIdentifier = olmSession.sessionIdentifier()
|
||||||
|
|
||||||
Timber.d("## createOutboundSession() ; olmSession.sessionIdentifier: $sessionIdentifier")
|
Timber.v("## createOutboundSession() ; olmSession.sessionIdentifier: $sessionIdentifier")
|
||||||
return sessionIdentifier
|
return sessionIdentifier
|
||||||
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
@ -238,7 +238,7 @@ internal class MXOlmDevice(
|
||||||
*/
|
*/
|
||||||
fun createInboundSession(theirDeviceIdentityKey: String, messageType: Int, ciphertext: String): Map<String, String>? {
|
fun createInboundSession(theirDeviceIdentityKey: String, messageType: Int, ciphertext: String): Map<String, String>? {
|
||||||
|
|
||||||
Timber.d("## createInboundSession() : theirIdentityKey: $theirDeviceIdentityKey")
|
Timber.v("## createInboundSession() : theirIdentityKey: $theirDeviceIdentityKey")
|
||||||
|
|
||||||
var olmSession: OlmSession? = null
|
var olmSession: OlmSession? = null
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ internal class MXOlmDevice(
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
Timber.d("## createInboundSession() : sessionId: " + olmSession.sessionIdentifier())
|
Timber.v("## createInboundSession() : sessionId: " + olmSession.sessionIdentifier())
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mOlmAccount!!.removeOneTimeKeys(olmSession)
|
mOlmAccount!!.removeOneTimeKeys(olmSession)
|
||||||
|
@ -260,10 +260,10 @@ internal class MXOlmDevice(
|
||||||
Timber.e(e, "## createInboundSession() : removeOneTimeKeys failed")
|
Timber.e(e, "## createInboundSession() : removeOneTimeKeys failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
Timber.d("## createInboundSession() : ciphertext: $ciphertext")
|
Timber.v("## createInboundSession() : ciphertext: $ciphertext")
|
||||||
try {
|
try {
|
||||||
val sha256 = mOlmUtility!!.sha256(URLEncoder.encode(ciphertext, "utf-8"))
|
val sha256 = mOlmUtility!!.sha256(URLEncoder.encode(ciphertext, "utf-8"))
|
||||||
Timber.d("## createInboundSession() :ciphertext: SHA256:" + sha256)
|
Timber.v("## createInboundSession() :ciphertext: SHA256:" + sha256)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Timber.e(e, "## createInboundSession() :ciphertext: cannot encode ciphertext")
|
Timber.e(e, "## createInboundSession() :ciphertext: cannot encode ciphertext")
|
||||||
}
|
}
|
||||||
|
@ -343,8 +343,8 @@ internal class MXOlmDevice(
|
||||||
|
|
||||||
if (mxOlmSession != null) {
|
if (mxOlmSession != null) {
|
||||||
try {
|
try {
|
||||||
Timber.d("## encryptMessage() : olmSession.sessionIdentifier: $sessionId")
|
Timber.v("## encryptMessage() : olmSession.sessionIdentifier: $sessionId")
|
||||||
//Timber.d("## encryptMessage() : payloadString: " + payloadString);
|
//Timber.v("## encryptMessage() : payloadString: " + payloadString);
|
||||||
|
|
||||||
olmMessage = mxOlmSession.olmSession.encryptMessage(payloadString)
|
olmMessage = mxOlmSession.olmSession.encryptMessage(payloadString)
|
||||||
mStore.storeSession(mxOlmSession, theirDeviceIdentityKey)
|
mStore.storeSession(mxOlmSession, theirDeviceIdentityKey)
|
||||||
|
|
|
@ -146,7 +146,7 @@ internal class OneTimeKeysUploader(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
Timber.d("## maybeUploadOneTimeKeys() : succeeded")
|
Timber.v("## maybeUploadOneTimeKeys() : succeeded")
|
||||||
uploadKeysDone(null)
|
uploadKeysDone(null)
|
||||||
|
|
||||||
callback?.onSuccess(Unit)
|
callback?.onSuccess(Unit)
|
||||||
|
|
|
@ -121,12 +121,12 @@ internal class OutgoingRoomKeyRequestManager(
|
||||||
?: // no request was made for this key
|
?: // no request was made for this key
|
||||||
return
|
return
|
||||||
|
|
||||||
Timber.d("cancelRoomKeyRequest: requestId: " + req.mRequestId + " state: " + req.mState + " andResend: " + andResend)
|
Timber.v("cancelRoomKeyRequest: requestId: " + req.mRequestId + " state: " + req.mState + " andResend: " + andResend)
|
||||||
|
|
||||||
if (req.mState === OutgoingRoomKeyRequest.RequestState.CANCELLATION_PENDING || req.mState === OutgoingRoomKeyRequest.RequestState.CANCELLATION_PENDING_AND_WILL_RESEND) {
|
if (req.mState === OutgoingRoomKeyRequest.RequestState.CANCELLATION_PENDING || req.mState === OutgoingRoomKeyRequest.RequestState.CANCELLATION_PENDING_AND_WILL_RESEND) {
|
||||||
// nothing to do here
|
// nothing to do here
|
||||||
} else if (req.mState === OutgoingRoomKeyRequest.RequestState.UNSENT || req.mState === OutgoingRoomKeyRequest.RequestState.FAILED) {
|
} else if (req.mState === OutgoingRoomKeyRequest.RequestState.UNSENT || req.mState === OutgoingRoomKeyRequest.RequestState.FAILED) {
|
||||||
Timber.d("## cancelRoomKeyRequest() : deleting unnecessary room key request for $requestBody")
|
Timber.v("## cancelRoomKeyRequest() : deleting unnecessary room key request for $requestBody")
|
||||||
mCryptoStore.deleteOutgoingRoomKeyRequest(req.mRequestId)
|
mCryptoStore.deleteOutgoingRoomKeyRequest(req.mRequestId)
|
||||||
} else if (req.mState === OutgoingRoomKeyRequest.RequestState.SENT) {
|
} else if (req.mState === OutgoingRoomKeyRequest.RequestState.SENT) {
|
||||||
if (andResend) {
|
if (andResend) {
|
||||||
|
@ -151,7 +151,7 @@ internal class OutgoingRoomKeyRequestManager(
|
||||||
|
|
||||||
Handler().postDelayed(Runnable {
|
Handler().postDelayed(Runnable {
|
||||||
if (mSendOutgoingRoomKeyRequestsRunning) {
|
if (mSendOutgoingRoomKeyRequestsRunning) {
|
||||||
Timber.d("## startTimer() : RoomKeyRequestSend already in progress!")
|
Timber.v("## startTimer() : RoomKeyRequestSend already in progress!")
|
||||||
return@Runnable
|
return@Runnable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ internal class OutgoingRoomKeyRequestManager(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Timber.d("## sendOutgoingRoomKeyRequests() : Looking for queued outgoing room key requests")
|
Timber.v("## sendOutgoingRoomKeyRequests() : Looking for queued outgoing room key requests")
|
||||||
val outgoingRoomKeyRequest = mCryptoStore.getOutgoingRoomKeyRequestByState(
|
val outgoingRoomKeyRequest = mCryptoStore.getOutgoingRoomKeyRequestByState(
|
||||||
HashSet<OutgoingRoomKeyRequest.RequestState>(Arrays.asList<OutgoingRoomKeyRequest.RequestState>(OutgoingRoomKeyRequest.RequestState.UNSENT,
|
HashSet<OutgoingRoomKeyRequest.RequestState>(Arrays.asList<OutgoingRoomKeyRequest.RequestState>(OutgoingRoomKeyRequest.RequestState.UNSENT,
|
||||||
OutgoingRoomKeyRequest.RequestState.CANCELLATION_PENDING,
|
OutgoingRoomKeyRequest.RequestState.CANCELLATION_PENDING,
|
||||||
|
@ -194,7 +194,7 @@ internal class OutgoingRoomKeyRequestManager(
|
||||||
* @param request the request
|
* @param request the request
|
||||||
*/
|
*/
|
||||||
private fun sendOutgoingRoomKeyRequest(request: OutgoingRoomKeyRequest) {
|
private fun sendOutgoingRoomKeyRequest(request: OutgoingRoomKeyRequest) {
|
||||||
Timber.d("## sendOutgoingRoomKeyRequest() : Requesting keys " + request.mRequestBody
|
Timber.v("## sendOutgoingRoomKeyRequest() : Requesting keys " + request.mRequestBody
|
||||||
+ " from " + request.mRecipients + " id " + request.mRequestId)
|
+ " from " + request.mRecipients + " id " + request.mRequestId)
|
||||||
|
|
||||||
val requestMessage = RoomKeyShareRequest()
|
val requestMessage = RoomKeyShareRequest()
|
||||||
|
@ -205,7 +205,7 @@ internal class OutgoingRoomKeyRequestManager(
|
||||||
sendMessageToDevices(requestMessage, request.mRecipients, request.mRequestId, object : MatrixCallback<Unit> {
|
sendMessageToDevices(requestMessage, request.mRecipients, request.mRequestId, object : MatrixCallback<Unit> {
|
||||||
private fun onDone(state: OutgoingRoomKeyRequest.RequestState) {
|
private fun onDone(state: OutgoingRoomKeyRequest.RequestState) {
|
||||||
if (request.mState !== OutgoingRoomKeyRequest.RequestState.UNSENT) {
|
if (request.mState !== OutgoingRoomKeyRequest.RequestState.UNSENT) {
|
||||||
Timber.d("## sendOutgoingRoomKeyRequest() : Cannot update room key request from UNSENT as it was already updated to " + request.mState)
|
Timber.v("## sendOutgoingRoomKeyRequest() : Cannot update room key request from UNSENT as it was already updated to " + request.mState)
|
||||||
} else {
|
} else {
|
||||||
request.mState = state
|
request.mState = state
|
||||||
mCryptoStore.updateOutgoingRoomKeyRequest(request)
|
mCryptoStore.updateOutgoingRoomKeyRequest(request)
|
||||||
|
@ -216,7 +216,7 @@ internal class OutgoingRoomKeyRequestManager(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
Timber.d("## sendOutgoingRoomKeyRequest succeed")
|
Timber.v("## sendOutgoingRoomKeyRequest succeed")
|
||||||
onDone(OutgoingRoomKeyRequest.RequestState.SENT)
|
onDone(OutgoingRoomKeyRequest.RequestState.SENT)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ internal class OutgoingRoomKeyRequestManager(
|
||||||
* @param request the request
|
* @param request the request
|
||||||
*/
|
*/
|
||||||
private fun sendOutgoingRoomKeyRequestCancellation(request: OutgoingRoomKeyRequest) {
|
private fun sendOutgoingRoomKeyRequestCancellation(request: OutgoingRoomKeyRequest) {
|
||||||
Timber.d("## sendOutgoingRoomKeyRequestCancellation() : Sending cancellation for key request for " + request.mRequestBody
|
Timber.v("## sendOutgoingRoomKeyRequestCancellation() : Sending cancellation for key request for " + request.mRequestBody
|
||||||
+ " to " + request.mRecipients
|
+ " to " + request.mRecipients
|
||||||
+ " cancellation id " + request.mCancellationTxnId)
|
+ " cancellation id " + request.mCancellationTxnId)
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ internal class OutgoingRoomKeyRequestManager(
|
||||||
|
|
||||||
|
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
Timber.d("## sendOutgoingRoomKeyRequestCancellation() : done")
|
Timber.v("## sendOutgoingRoomKeyRequestCancellation() : done")
|
||||||
val resend = request.mState === OutgoingRoomKeyRequest.RequestState.CANCELLATION_PENDING_AND_WILL_RESEND
|
val resend = request.mState === OutgoingRoomKeyRequest.RequestState.CANCELLATION_PENDING_AND_WILL_RESEND
|
||||||
|
|
||||||
onDone()
|
onDone()
|
||||||
|
|
|
@ -79,14 +79,14 @@ internal class EnsureOlmSessionsForDevicesAction(private val mOlmDevice: MXOlmDe
|
||||||
//
|
//
|
||||||
// That should eventually resolve itself, but it's poor form.
|
// That should eventually resolve itself, but it's poor form.
|
||||||
|
|
||||||
Timber.d("## claimOneTimeKeysForUsersDevices() : $usersDevicesToClaim")
|
Timber.v("## claimOneTimeKeysForUsersDevices() : $usersDevicesToClaim")
|
||||||
|
|
||||||
mClaimOneTimeKeysForUsersDeviceTask
|
mClaimOneTimeKeysForUsersDeviceTask
|
||||||
.configureWith(ClaimOneTimeKeysForUsersDeviceTask.Params(usersDevicesToClaim))
|
.configureWith(ClaimOneTimeKeysForUsersDeviceTask.Params(usersDevicesToClaim))
|
||||||
.dispatchTo(object : MatrixCallback<MXUsersDevicesMap<MXKey>> {
|
.dispatchTo(object : MatrixCallback<MXUsersDevicesMap<MXKey>> {
|
||||||
override fun onSuccess(data: MXUsersDevicesMap<MXKey>) {
|
override fun onSuccess(data: MXUsersDevicesMap<MXKey>) {
|
||||||
try {
|
try {
|
||||||
Timber.d("## claimOneTimeKeysForUsersDevices() : keysClaimResponse.oneTimeKeys: $data")
|
Timber.v("## claimOneTimeKeysForUsersDevices() : keysClaimResponse.oneTimeKeys: $data")
|
||||||
|
|
||||||
for (userId in userIds) {
|
for (userId in userIds) {
|
||||||
val deviceInfos = devicesByUser[userId]
|
val deviceInfos = devicesByUser[userId]
|
||||||
|
@ -113,7 +113,7 @@ internal class EnsureOlmSessionsForDevicesAction(private val mOlmDevice: MXOlmDe
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null == oneTimeKey) {
|
if (null == oneTimeKey) {
|
||||||
Timber.d("## ensureOlmSessionsForDevices() : No one-time keys " + oneTimeKeyAlgorithm
|
Timber.v("## ensureOlmSessionsForDevices() : No one-time keys " + oneTimeKeyAlgorithm
|
||||||
+ " for device " + userId + " : " + deviceId)
|
+ " for device " + userId + " : " + deviceId)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ internal class EnsureOlmSessionsForDevicesAction(private val mOlmDevice: MXOlmDe
|
||||||
sessionId = mOlmDevice.createOutboundSession(deviceInfo.identityKey()!!, oneTimeKey.value)
|
sessionId = mOlmDevice.createOutboundSession(deviceInfo.identityKey()!!, oneTimeKey.value)
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(sessionId)) {
|
if (!TextUtils.isEmpty(sessionId)) {
|
||||||
Timber.d("## verifyKeyAndStartSession() : Started new sessionid " + sessionId
|
Timber.v("## verifyKeyAndStartSession() : Started new sessionid " + sessionId
|
||||||
+ " for device " + deviceInfo + "(theirOneTimeKey: " + oneTimeKey.value + ")")
|
+ " for device " + deviceInfo + "(theirOneTimeKey: " + oneTimeKey.value + ")")
|
||||||
} else {
|
} else {
|
||||||
// Possibly a bad key
|
// Possibly a bad key
|
||||||
|
|
|
@ -39,7 +39,7 @@ internal class EnsureOlmSessionsForUsersAction(private val mOlmDevice: MXOlmDevi
|
||||||
* @param callback the asynchronous callback
|
* @param callback the asynchronous callback
|
||||||
*/
|
*/
|
||||||
fun handle(users: List<String>, callback: MatrixCallback<MXUsersDevicesMap<MXOlmSessionResult>>) {
|
fun handle(users: List<String>, callback: MatrixCallback<MXUsersDevicesMap<MXOlmSessionResult>>) {
|
||||||
Timber.d("## ensureOlmSessionsForUsers() : ensureOlmSessionsForUsers $users")
|
Timber.v("## ensureOlmSessionsForUsers() : ensureOlmSessionsForUsers $users")
|
||||||
|
|
||||||
val devicesByUser = HashMap<String /* userId */, MutableList<MXDeviceInfo>>()
|
val devicesByUser = HashMap<String /* userId */, MutableList<MXDeviceInfo>>()
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ internal class MegolmSessionDataImporter(private val mOlmDevice: MXOlmDevice,
|
||||||
if (null != decrypting) {
|
if (null != decrypting) {
|
||||||
try {
|
try {
|
||||||
val sessionId = megolmSessionData.sessionId
|
val sessionId = megolmSessionData.sessionId
|
||||||
Timber.d("## importRoomKeys retrieve mSenderKey " + megolmSessionData.senderKey + " sessionId " + sessionId)
|
Timber.v("## importRoomKeys retrieve mSenderKey " + megolmSessionData.senderKey + " sessionId " + sessionId)
|
||||||
|
|
||||||
totalNumbersOfImportedKeys++
|
totalNumbersOfImportedKeys++
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ internal class MegolmSessionDataImporter(private val mOlmDevice: MXOlmDevice,
|
||||||
|
|
||||||
val t1 = System.currentTimeMillis()
|
val t1 = System.currentTimeMillis()
|
||||||
|
|
||||||
Timber.d("## importMegolmSessionsData : sessions import " + (t1 - t0) + " ms (" + megolmSessionsData.size + " sessions)")
|
Timber.v("## importMegolmSessionsData : sessions import " + (t1 - t0) + " ms (" + megolmSessionsData.size + " sessions)")
|
||||||
|
|
||||||
val finalTotalNumbersOfImportedKeys = totalNumbersOfImportedKeys
|
val finalTotalNumbersOfImportedKeys = totalNumbersOfImportedKeys
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ internal class MessageEncrypter(private val mCredentials: Credentials,
|
||||||
val sessionId = mOlmDevice.getSessionId(deviceKey)
|
val sessionId = mOlmDevice.getSessionId(deviceKey)
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(sessionId)) {
|
if (!TextUtils.isEmpty(sessionId)) {
|
||||||
Timber.d("Using sessionid $sessionId for device $deviceKey")
|
Timber.v("Using sessionid $sessionId for device $deviceKey")
|
||||||
val deviceInfo = deviceInfoParticipantKey[deviceKey]
|
val deviceInfo = deviceInfoParticipantKey[deviceKey]
|
||||||
|
|
||||||
payloadJson["recipient"] = deviceInfo!!.userId
|
payloadJson["recipient"] = deviceInfo!!.userId
|
||||||
|
|
|
@ -183,7 +183,7 @@ internal class MXMegolmDecryption(private val mCredentials: Credentials,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mPendingEvents[k]!![timelineId]!!.indexOf(event) < 0) {
|
if (mPendingEvents[k]!![timelineId]!!.indexOf(event) < 0) {
|
||||||
Timber.d("## addEventToPendingList() : add Event " + event.eventId + " in room id " + event.roomId)
|
Timber.v("## addEventToPendingList() : add Event " + event.eventId + " in room id " + event.roomId)
|
||||||
mPendingEvents[k]!![timelineId]!!.add(event)
|
mPendingEvents[k]!![timelineId]!!.add(event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ internal class MXMegolmDecryption(private val mCredentials: Credentials,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.type == EventType.FORWARDED_ROOM_KEY) {
|
if (event.type == EventType.FORWARDED_ROOM_KEY) {
|
||||||
Timber.d("## onRoomKeyEvent(), forward adding key : roomId " + roomKeyContent.roomId + " sessionId " + roomKeyContent.sessionId
|
Timber.v("## onRoomKeyEvent(), forward adding key : roomId " + roomKeyContent.roomId + " sessionId " + roomKeyContent.sessionId
|
||||||
+ " sessionKey " + roomKeyContent.sessionKey) // from " + event);
|
+ " sessionKey " + roomKeyContent.sessionKey) // from " + event);
|
||||||
val forwardedRoomKeyContent = event.content.toModel<ForwardedRoomKeyContent>()!!
|
val forwardedRoomKeyContent = event.content.toModel<ForwardedRoomKeyContent>()!!
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ internal class MXMegolmDecryption(private val mCredentials: Credentials,
|
||||||
|
|
||||||
keysClaimed["ed25519"] = forwardedRoomKeyContent.senderClaimedEd25519Key!!
|
keysClaimed["ed25519"] = forwardedRoomKeyContent.senderClaimedEd25519Key!!
|
||||||
} else {
|
} else {
|
||||||
Timber.d("## onRoomKeyEvent(), Adding key : roomId " + roomKeyContent.roomId + " sessionId " + roomKeyContent.sessionId
|
Timber.v("## onRoomKeyEvent(), Adding key : roomId " + roomKeyContent.roomId + " sessionId " + roomKeyContent.sessionId
|
||||||
+ " sessionKey " + roomKeyContent.sessionKey) // from " + event);
|
+ " sessionKey " + roomKeyContent.sessionKey) // from " + event);
|
||||||
|
|
||||||
if (null == senderKey) {
|
if (null == senderKey) {
|
||||||
|
@ -300,7 +300,7 @@ internal class MXMegolmDecryption(private val mCredentials: Credentials,
|
||||||
TODO()
|
TODO()
|
||||||
//mSession!!.onEventDecrypted(event)
|
//mSession!!.onEventDecrypted(event)
|
||||||
}
|
}
|
||||||
Timber.d("## onNewSession() : successful re-decryption of " + event.eventId)
|
Timber.v("## onNewSession() : successful re-decryption of " + event.eventId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@ internal class MXMegolmDecryption(private val mCredentials: Credentials,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Timber.d("## shareKeysWithDevice() : sharing keys for session " + body!!.senderKey + "|" + body.sessionId
|
Timber.v("## shareKeysWithDevice() : sharing keys for session " + body!!.senderKey + "|" + body.sessionId
|
||||||
+ " with device " + userId + ":" + deviceId)
|
+ " with device " + userId + ":" + deviceId)
|
||||||
|
|
||||||
val inboundGroupSession = mOlmDevice.getInboundGroupSession(body.sessionId, body.senderKey, body.roomId)
|
val inboundGroupSession = mOlmDevice.getInboundGroupSession(body.sessionId, body.senderKey, body.roomId)
|
||||||
|
@ -357,11 +357,11 @@ internal class MXMegolmDecryption(private val mCredentials: Credentials,
|
||||||
val sendToDeviceMap = MXUsersDevicesMap<Any>()
|
val sendToDeviceMap = MXUsersDevicesMap<Any>()
|
||||||
sendToDeviceMap.setObject(encodedPayload, userId, deviceId)
|
sendToDeviceMap.setObject(encodedPayload, userId, deviceId)
|
||||||
|
|
||||||
Timber.d("## shareKeysWithDevice() : sending to $userId:$deviceId")
|
Timber.v("## shareKeysWithDevice() : sending to $userId:$deviceId")
|
||||||
mSendToDeviceTask.configureWith(SendToDeviceTask.Params(EventType.ENCRYPTED, sendToDeviceMap))
|
mSendToDeviceTask.configureWith(SendToDeviceTask.Params(EventType.ENCRYPTED, sendToDeviceMap))
|
||||||
.dispatchTo(object : MatrixCallback<Unit> {
|
.dispatchTo(object : MatrixCallback<Unit> {
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
Timber.d("## shareKeysWithDevice() : sent to $userId:$deviceId")
|
Timber.v("## shareKeysWithDevice() : sent to $userId:$deviceId")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailure(failure: Throwable) {
|
override fun onFailure(failure: Throwable) {
|
||||||
|
|
|
@ -112,7 +112,7 @@ internal class MXMegolmEncryption(
|
||||||
}
|
}
|
||||||
|
|
||||||
val t0 = System.currentTimeMillis()
|
val t0 = System.currentTimeMillis()
|
||||||
Timber.d("## encryptEventContent () starts")
|
Timber.v("## encryptEventContent () starts")
|
||||||
|
|
||||||
getDevicesInRoom(userIds, object : MatrixCallback<MXUsersDevicesMap<MXDeviceInfo>> {
|
getDevicesInRoom(userIds, object : MatrixCallback<MXUsersDevicesMap<MXDeviceInfo>> {
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ internal class MXMegolmEncryption(
|
||||||
override fun onSuccess(devicesInRoom: MXUsersDevicesMap<MXDeviceInfo>) {
|
override fun onSuccess(devicesInRoom: MXUsersDevicesMap<MXDeviceInfo>) {
|
||||||
ensureOutboundSession(devicesInRoom, object : MatrixCallback<MXOutboundSessionInfo> {
|
ensureOutboundSession(devicesInRoom, object : MatrixCallback<MXOutboundSessionInfo> {
|
||||||
override fun onSuccess(data: MXOutboundSessionInfo) {
|
override fun onSuccess(data: MXOutboundSessionInfo) {
|
||||||
Timber.d("## encryptEventContent () processPendingEncryptions after " + (System.currentTimeMillis() - t0) + "ms")
|
Timber.v("## encryptEventContent () processPendingEncryptions after " + (System.currentTimeMillis() - t0) + "ms")
|
||||||
processPendingEncryptions(data)
|
processPendingEncryptions(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ internal class MXMegolmEncryption(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mShareOperationIsProgress) {
|
if (mShareOperationIsProgress) {
|
||||||
Timber.d("## ensureOutboundSessionInRoom() : already in progress")
|
Timber.v("## ensureOutboundSessionInRoom() : already in progress")
|
||||||
// Key share already in progress
|
// Key share already in progress
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ internal class MXMegolmEncryption(
|
||||||
callback: MatrixCallback<Unit>?) {
|
callback: MatrixCallback<Unit>?) {
|
||||||
// nothing to send, the task is done
|
// nothing to send, the task is done
|
||||||
if (0 == devicesByUsers.size) {
|
if (0 == devicesByUsers.size) {
|
||||||
Timber.d("## shareKey() : nothing more to do")
|
Timber.v("## shareKey() : nothing more to do")
|
||||||
|
|
||||||
if (null != callback) {
|
if (null != callback) {
|
||||||
CryptoAsyncHelper.getUiHandler().post { callback.onSuccess(Unit) }
|
CryptoAsyncHelper.getUiHandler().post { callback.onSuccess(Unit) }
|
||||||
|
@ -273,7 +273,7 @@ internal class MXMegolmEncryption(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timber.d("## shareKey() ; userId $userIds")
|
Timber.v("## shareKey() ; userId $userIds")
|
||||||
shareUserDevicesKey(session, subMap, object : MatrixCallback<Unit> {
|
shareUserDevicesKey(session, subMap, object : MatrixCallback<Unit> {
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
for (userId in userIds) {
|
for (userId in userIds) {
|
||||||
|
@ -314,11 +314,11 @@ internal class MXMegolmEncryption(
|
||||||
payload["content"] = submap
|
payload["content"] = submap
|
||||||
|
|
||||||
val t0 = System.currentTimeMillis()
|
val t0 = System.currentTimeMillis()
|
||||||
Timber.d("## shareUserDevicesKey() : starts")
|
Timber.v("## shareUserDevicesKey() : starts")
|
||||||
|
|
||||||
mEnsureOlmSessionsForDevicesAction.handle(devicesByUser, object : MatrixCallback<MXUsersDevicesMap<MXOlmSessionResult>> {
|
mEnsureOlmSessionsForDevicesAction.handle(devicesByUser, object : MatrixCallback<MXUsersDevicesMap<MXOlmSessionResult>> {
|
||||||
override fun onSuccess(data: MXUsersDevicesMap<MXOlmSessionResult>) {
|
override fun onSuccess(data: MXUsersDevicesMap<MXOlmSessionResult>) {
|
||||||
Timber.d("## shareUserDevicesKey() : ensureOlmSessionsForDevices succeeds after "
|
Timber.v("## shareUserDevicesKey() : ensureOlmSessionsForDevices succeeds after "
|
||||||
+ (System.currentTimeMillis() - t0) + " ms")
|
+ (System.currentTimeMillis() - t0) + " ms")
|
||||||
val contentMap = MXUsersDevicesMap<Any>()
|
val contentMap = MXUsersDevicesMap<Any>()
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ internal class MXMegolmEncryption(
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
Timber.d("## shareUserDevicesKey() : Sharing keys with device $userId:$deviceID")
|
Timber.v("## shareUserDevicesKey() : Sharing keys with device $userId:$deviceID")
|
||||||
//noinspection ArraysAsListWithZeroOrOneArgument,ArraysAsListWithZeroOrOneArgument
|
//noinspection ArraysAsListWithZeroOrOneArgument,ArraysAsListWithZeroOrOneArgument
|
||||||
contentMap.setObject(mMessageEncrypter.encryptMessage(payload, Arrays.asList(sessionResult.mDevice)), userId, deviceID)
|
contentMap.setObject(mMessageEncrypter.encryptMessage(payload, Arrays.asList(sessionResult.mDevice)), userId, deviceID)
|
||||||
haveTargets = true
|
haveTargets = true
|
||||||
|
@ -356,12 +356,12 @@ internal class MXMegolmEncryption(
|
||||||
|
|
||||||
if (haveTargets) {
|
if (haveTargets) {
|
||||||
val t0 = System.currentTimeMillis()
|
val t0 = System.currentTimeMillis()
|
||||||
Timber.d("## shareUserDevicesKey() : has target")
|
Timber.v("## shareUserDevicesKey() : has target")
|
||||||
|
|
||||||
mSendToDeviceTask.configureWith(SendToDeviceTask.Params(EventType.ENCRYPTED, contentMap))
|
mSendToDeviceTask.configureWith(SendToDeviceTask.Params(EventType.ENCRYPTED, contentMap))
|
||||||
.dispatchTo(object : MatrixCallback<Unit> {
|
.dispatchTo(object : MatrixCallback<Unit> {
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
Timber.d("## shareUserDevicesKey() : sendToDevice succeeds after "
|
Timber.v("## shareUserDevicesKey() : sendToDevice succeeds after "
|
||||||
+ (System.currentTimeMillis() - t0) + " ms")
|
+ (System.currentTimeMillis() - t0) + " ms")
|
||||||
|
|
||||||
// Add the devices we have shared with to session.sharedWithDevices.
|
// Add the devices we have shared with to session.sharedWithDevices.
|
||||||
|
@ -390,7 +390,7 @@ internal class MXMegolmEncryption(
|
||||||
})
|
})
|
||||||
.executeBy(mTaskExecutor)
|
.executeBy(mTaskExecutor)
|
||||||
} else {
|
} else {
|
||||||
Timber.d("## shareUserDevicesKey() : no need to sharekey")
|
Timber.v("## shareUserDevicesKey() : no need to sharekey")
|
||||||
|
|
||||||
if (null != callback) {
|
if (null != callback) {
|
||||||
CryptoAsyncHelper.getUiHandler().post { callback.onSuccess(Unit) }
|
CryptoAsyncHelper.getUiHandler().post { callback.onSuccess(Unit) }
|
||||||
|
|
|
@ -39,7 +39,7 @@ internal class MXOutboundSessionInfo(
|
||||||
val sessionLifetime = System.currentTimeMillis() - mCreationTime
|
val sessionLifetime = System.currentTimeMillis() - mCreationTime
|
||||||
|
|
||||||
if (mUseCount >= rotationPeriodMsgs || sessionLifetime >= rotationPeriodMs) {
|
if (mUseCount >= rotationPeriodMsgs || sessionLifetime >= rotationPeriodMs) {
|
||||||
Timber.d("## needsRotation() : Rotating megolm session after " + mUseCount + ", " + sessionLifetime + "ms")
|
Timber.v("## needsRotation() : Rotating megolm session after " + mUseCount + ", " + sessionLifetime + "ms")
|
||||||
needsRotation = true
|
needsRotation = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ internal class MXOutboundSessionInfo(
|
||||||
|
|
||||||
for (userId in userIds) {
|
for (userId in userIds) {
|
||||||
if (null == devicesInRoom.getUserDeviceIds(userId)) {
|
if (null == devicesInRoom.getUserDeviceIds(userId)) {
|
||||||
Timber.d("## sharedWithTooManyDevices() : Starting new session because we shared with $userId")
|
Timber.v("## sharedWithTooManyDevices() : Starting new session because we shared with $userId")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ internal class MXOutboundSessionInfo(
|
||||||
|
|
||||||
for (deviceId in deviceIds!!) {
|
for (deviceId in deviceIds!!) {
|
||||||
if (null == devicesInRoom.getObject(deviceId, userId)) {
|
if (null == devicesInRoom.getObject(deviceId, userId)) {
|
||||||
Timber.d("## sharedWithTooManyDevices() : Starting new session because we shared with $userId:$deviceId")
|
Timber.v("## sharedWithTooManyDevices() : Starting new session because we shared with $userId:$deviceId")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,7 +184,7 @@ internal class MXOlmDecryption(
|
||||||
val payload = mOlmDevice.decryptMessage(messageBody, messageType, sessionId, theirDeviceIdentityKey)
|
val payload = mOlmDevice.decryptMessage(messageBody, messageType, sessionId, theirDeviceIdentityKey)
|
||||||
|
|
||||||
if (null != payload) {
|
if (null != payload) {
|
||||||
Timber.d("## decryptMessage() : Decrypted Olm message from $theirDeviceIdentityKey with session $sessionId")
|
Timber.v("## decryptMessage() : Decrypted Olm message from $theirDeviceIdentityKey with session $sessionId")
|
||||||
return payload
|
return payload
|
||||||
} else {
|
} else {
|
||||||
val foundSession = mOlmDevice.matchesSession(theirDeviceIdentityKey, sessionId, messageType, messageBody)
|
val foundSession = mOlmDevice.matchesSession(theirDeviceIdentityKey, sessionId, messageType, messageBody)
|
||||||
|
@ -220,7 +220,7 @@ internal class MXOlmDecryption(
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
Timber.d("## decryptMessage() : Created new inbound Olm session get id " + res["session_id"] + " with " + theirDeviceIdentityKey)
|
Timber.v("## decryptMessage() : Created new inbound Olm session get id " + res["session_id"] + " with " + theirDeviceIdentityKey)
|
||||||
|
|
||||||
return res["payload"]
|
return res["payload"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -334,7 +334,7 @@ internal class KeysBackup(
|
||||||
override fun onProgress(progress: Int, total: Int) {
|
override fun onProgress(progress: Int, total: Int) {
|
||||||
// Reset previous listeners if any
|
// Reset previous listeners if any
|
||||||
resetBackupAllGroupSessionsListeners()
|
resetBackupAllGroupSessionsListeners()
|
||||||
Timber.d("backupAllGroupSessions: backupProgress: $progress/$total")
|
Timber.v("backupAllGroupSessions: backupProgress: $progress/$total")
|
||||||
try {
|
try {
|
||||||
progressListener?.onProgress(progress, total)
|
progressListener?.onProgress(progress, total)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
@ -342,7 +342,7 @@ internal class KeysBackup(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (progress == total) {
|
if (progress == total) {
|
||||||
Timber.d("backupAllGroupSessions: complete")
|
Timber.v("backupAllGroupSessions: complete")
|
||||||
callback?.onSuccess(Unit)
|
callback?.onSuccess(Unit)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -417,13 +417,13 @@ internal class KeysBackup(
|
||||||
|| authData == null
|
|| authData == null
|
||||||
|| authData.publicKey.isEmpty()
|
|| authData.publicKey.isEmpty()
|
||||||
|| authData.signatures.isNullOrEmpty()) {
|
|| authData.signatures.isNullOrEmpty()) {
|
||||||
Timber.d("getKeysBackupTrust: Key backup is absent or missing required data")
|
Timber.v("getKeysBackupTrust: Key backup is absent or missing required data")
|
||||||
return keysBackupVersionTrust
|
return keysBackupVersionTrust
|
||||||
}
|
}
|
||||||
|
|
||||||
val mySigs: Map<String, *> = authData.signatures!![myUserId] as Map<String, *>
|
val mySigs: Map<String, *> = authData.signatures!![myUserId] as Map<String, *>
|
||||||
if (mySigs.isEmpty()) {
|
if (mySigs.isEmpty()) {
|
||||||
Timber.d("getKeysBackupTrust: Ignoring key backup because it lacks any signatures from this user")
|
Timber.v("getKeysBackupTrust: Ignoring key backup because it lacks any signatures from this user")
|
||||||
return keysBackupVersionTrust
|
return keysBackupVersionTrust
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,13 +442,13 @@ internal class KeysBackup(
|
||||||
var isSignatureValid = false
|
var isSignatureValid = false
|
||||||
|
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
Timber.d("getKeysBackupTrust: Signature from unknown device $deviceId")
|
Timber.v("getKeysBackupTrust: Signature from unknown device $deviceId")
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
mOlmDevice.verifySignature(device.fingerprint()!!, authData.signalableJSONDictionary(), mySigs[keyId] as String)
|
mOlmDevice.verifySignature(device.fingerprint()!!, authData.signalableJSONDictionary(), mySigs[keyId] as String)
|
||||||
isSignatureValid = true
|
isSignatureValid = true
|
||||||
} catch (e: OlmException) {
|
} catch (e: OlmException) {
|
||||||
Timber.d("getKeysBackupTrust: Bad signature from device " + device.deviceId + " " + e.localizedMessage)
|
Timber.v("getKeysBackupTrust: Bad signature from device " + device.deviceId + " " + e.localizedMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSignatureValid && device.isVerified) {
|
if (isSignatureValid && device.isVerified) {
|
||||||
|
@ -478,7 +478,7 @@ internal class KeysBackup(
|
||||||
override fun trustKeysBackupVersion(keysBackupVersion: KeysVersionResult,
|
override fun trustKeysBackupVersion(keysBackupVersion: KeysVersionResult,
|
||||||
trust: Boolean,
|
trust: Boolean,
|
||||||
callback: MatrixCallback<Unit>) {
|
callback: MatrixCallback<Unit>) {
|
||||||
Timber.d("trustKeyBackupVersion: $trust, version ${keysBackupVersion.version}")
|
Timber.v("trustKeyBackupVersion: $trust, version ${keysBackupVersion.version}")
|
||||||
|
|
||||||
CryptoAsyncHelper.getDecryptBackgroundHandler().post {
|
CryptoAsyncHelper.getDecryptBackgroundHandler().post {
|
||||||
val myUserId = mCredentials.userId
|
val myUserId = mCredentials.userId
|
||||||
|
@ -572,7 +572,7 @@ internal class KeysBackup(
|
||||||
override fun trustKeysBackupVersionWithRecoveryKey(keysBackupVersion: KeysVersionResult,
|
override fun trustKeysBackupVersionWithRecoveryKey(keysBackupVersion: KeysVersionResult,
|
||||||
recoveryKey: String,
|
recoveryKey: String,
|
||||||
callback: MatrixCallback<Unit>) {
|
callback: MatrixCallback<Unit>) {
|
||||||
Timber.d("trustKeysBackupVersionWithRecoveryKey: version ${keysBackupVersion.version}")
|
Timber.v("trustKeysBackupVersionWithRecoveryKey: version ${keysBackupVersion.version}")
|
||||||
|
|
||||||
CryptoAsyncHelper.getDecryptBackgroundHandler().post {
|
CryptoAsyncHelper.getDecryptBackgroundHandler().post {
|
||||||
if (!isValidRecoveryKeyForKeysBackupVersion(recoveryKey, keysBackupVersion)) {
|
if (!isValidRecoveryKeyForKeysBackupVersion(recoveryKey, keysBackupVersion)) {
|
||||||
|
@ -598,7 +598,7 @@ internal class KeysBackup(
|
||||||
override fun trustKeysBackupVersionWithPassphrase(keysBackupVersion: KeysVersionResult,
|
override fun trustKeysBackupVersionWithPassphrase(keysBackupVersion: KeysVersionResult,
|
||||||
password: String,
|
password: String,
|
||||||
callback: MatrixCallback<Unit>) {
|
callback: MatrixCallback<Unit>) {
|
||||||
Timber.d("trustKeysBackupVersionWithPassphrase: version ${keysBackupVersion.version}")
|
Timber.v("trustKeysBackupVersionWithPassphrase: version ${keysBackupVersion.version}")
|
||||||
|
|
||||||
CryptoAsyncHelper.getDecryptBackgroundHandler().post {
|
CryptoAsyncHelper.getDecryptBackgroundHandler().post {
|
||||||
val recoveryKey = recoveryKeyFromPassword(password, keysBackupVersion, null)
|
val recoveryKey = recoveryKeyFromPassword(password, keysBackupVersion, null)
|
||||||
|
@ -686,7 +686,7 @@ internal class KeysBackup(
|
||||||
sessionId: String?,
|
sessionId: String?,
|
||||||
stepProgressListener: StepProgressListener?,
|
stepProgressListener: StepProgressListener?,
|
||||||
callback: MatrixCallback<ImportRoomKeysResult>) {
|
callback: MatrixCallback<ImportRoomKeysResult>) {
|
||||||
Timber.d("restoreKeysWithRecoveryKey: From backup version: ${keysVersionResult.version}")
|
Timber.v("restoreKeysWithRecoveryKey: From backup version: ${keysVersionResult.version}")
|
||||||
|
|
||||||
CryptoAsyncHelper.getDecryptBackgroundHandler().post(Runnable {
|
CryptoAsyncHelper.getDecryptBackgroundHandler().post(Runnable {
|
||||||
// Check if the recovery is valid before going any further
|
// Check if the recovery is valid before going any further
|
||||||
|
@ -728,13 +728,13 @@ internal class KeysBackup(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Timber.d("restoreKeysWithRecoveryKey: Decrypted " + sessionsData.size + " keys out of "
|
Timber.v("restoreKeysWithRecoveryKey: Decrypted " + sessionsData.size + " keys out of "
|
||||||
+ sessionsFromHsCount + " from the backup store on the homeserver")
|
+ sessionsFromHsCount + " from the backup store on the homeserver")
|
||||||
|
|
||||||
// Do not trigger a backup for them if they come from the backup version we are using
|
// Do not trigger a backup for them if they come from the backup version we are using
|
||||||
val backUp = keysVersionResult.version != mKeysBackupVersion?.version
|
val backUp = keysVersionResult.version != mKeysBackupVersion?.version
|
||||||
if (backUp) {
|
if (backUp) {
|
||||||
Timber.d("restoreKeysWithRecoveryKey: Those keys will be backed up to backup version: " + mKeysBackupVersion?.version)
|
Timber.v("restoreKeysWithRecoveryKey: Those keys will be backed up to backup version: " + mKeysBackupVersion?.version)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Import them into the crypto store
|
// Import them into the crypto store
|
||||||
|
@ -788,7 +788,7 @@ internal class KeysBackup(
|
||||||
sessionId: String?,
|
sessionId: String?,
|
||||||
stepProgressListener: StepProgressListener?,
|
stepProgressListener: StepProgressListener?,
|
||||||
callback: MatrixCallback<ImportRoomKeysResult>) {
|
callback: MatrixCallback<ImportRoomKeysResult>) {
|
||||||
Timber.d("[MXKeyBackup] restoreKeyBackup with password: From backup version: ${keysBackupVersion.version}")
|
Timber.v("[MXKeyBackup] restoreKeyBackup with password: From backup version: ${keysBackupVersion.version}")
|
||||||
|
|
||||||
CryptoAsyncHelper.getDecryptBackgroundHandler().post {
|
CryptoAsyncHelper.getDecryptBackgroundHandler().post {
|
||||||
val progressListener = if (stepProgressListener != null) {
|
val progressListener = if (stepProgressListener != null) {
|
||||||
|
@ -807,7 +807,7 @@ internal class KeysBackup(
|
||||||
|
|
||||||
if (recoveryKey == null) {
|
if (recoveryKey == null) {
|
||||||
mUIHandler.post {
|
mUIHandler.post {
|
||||||
Timber.d("backupKeys: Invalid configuration")
|
Timber.v("backupKeys: Invalid configuration")
|
||||||
callback.onFailure(IllegalStateException("Invalid configuration"))
|
callback.onFailure(IllegalStateException("Invalid configuration"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -918,7 +918,7 @@ internal class KeysBackup(
|
||||||
mUIHandler.postDelayed({ backupKeys() }, delayInMs)
|
mUIHandler.postDelayed({ backupKeys() }, delayInMs)
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
Timber.d("maybeBackupKeys: Skip it because state: $state")
|
Timber.v("maybeBackupKeys: Skip it because state: $state")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1062,12 +1062,12 @@ internal class KeysBackup(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkAndStartWithKeysBackupVersion(keyBackupVersion: KeysVersionResult?) {
|
private fun checkAndStartWithKeysBackupVersion(keyBackupVersion: KeysVersionResult?) {
|
||||||
Timber.d("checkAndStartWithKeyBackupVersion: ${keyBackupVersion?.version}")
|
Timber.v("checkAndStartWithKeyBackupVersion: ${keyBackupVersion?.version}")
|
||||||
|
|
||||||
mKeysBackupVersion = keyBackupVersion
|
mKeysBackupVersion = keyBackupVersion
|
||||||
|
|
||||||
if (keyBackupVersion == null) {
|
if (keyBackupVersion == null) {
|
||||||
Timber.d("checkAndStartWithKeysBackupVersion: Found no key backup version on the homeserver")
|
Timber.v("checkAndStartWithKeysBackupVersion: Found no key backup version on the homeserver")
|
||||||
resetKeysBackupData()
|
resetKeysBackupData()
|
||||||
mKeysBackupStateManager.state = KeysBackupState.Disabled
|
mKeysBackupStateManager.state = KeysBackupState.Disabled
|
||||||
} else {
|
} else {
|
||||||
|
@ -1077,19 +1077,19 @@ internal class KeysBackup(
|
||||||
val versionInStore = mCryptoStore.getKeyBackupVersion()
|
val versionInStore = mCryptoStore.getKeyBackupVersion()
|
||||||
|
|
||||||
if (data.usable) {
|
if (data.usable) {
|
||||||
Timber.d("checkAndStartWithKeysBackupVersion: Found usable key backup. version: " + keyBackupVersion.version)
|
Timber.v("checkAndStartWithKeysBackupVersion: Found usable key backup. version: " + keyBackupVersion.version)
|
||||||
// Check the version we used at the previous app run
|
// Check the version we used at the previous app run
|
||||||
if (versionInStore != null && versionInStore != keyBackupVersion.version) {
|
if (versionInStore != null && versionInStore != keyBackupVersion.version) {
|
||||||
Timber.d(" -> clean the previously used version $versionInStore")
|
Timber.v(" -> clean the previously used version $versionInStore")
|
||||||
resetKeysBackupData()
|
resetKeysBackupData()
|
||||||
}
|
}
|
||||||
|
|
||||||
Timber.d(" -> enabling key backups")
|
Timber.v(" -> enabling key backups")
|
||||||
enableKeysBackup(keyBackupVersion)
|
enableKeysBackup(keyBackupVersion)
|
||||||
} else {
|
} else {
|
||||||
Timber.d("checkAndStartWithKeysBackupVersion: No usable key backup. version: " + keyBackupVersion.version)
|
Timber.v("checkAndStartWithKeysBackupVersion: No usable key backup. version: " + keyBackupVersion.version)
|
||||||
if (versionInStore != null) {
|
if (versionInStore != null) {
|
||||||
Timber.d(" -> disabling key backup")
|
Timber.v(" -> disabling key backup")
|
||||||
resetKeysBackupData()
|
resetKeysBackupData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1273,11 +1273,11 @@ internal class KeysBackup(
|
||||||
*/
|
*/
|
||||||
@UiThread
|
@UiThread
|
||||||
private fun backupKeys() {
|
private fun backupKeys() {
|
||||||
Timber.d("backupKeys")
|
Timber.v("backupKeys")
|
||||||
|
|
||||||
// Sanity check, as this method can be called after a delay, the state may have change during the delay
|
// Sanity check, as this method can be called after a delay, the state may have change during the delay
|
||||||
if (!isEnabled || mBackupKey == null || mKeysBackupVersion == null) {
|
if (!isEnabled || mBackupKey == null || mKeysBackupVersion == null) {
|
||||||
Timber.d("backupKeys: Invalid configuration")
|
Timber.v("backupKeys: Invalid configuration")
|
||||||
backupAllGroupSessionsCallback?.onFailure(IllegalStateException("Invalid configuration"))
|
backupAllGroupSessionsCallback?.onFailure(IllegalStateException("Invalid configuration"))
|
||||||
resetBackupAllGroupSessionsListeners()
|
resetBackupAllGroupSessionsListeners()
|
||||||
|
|
||||||
|
@ -1286,14 +1286,14 @@ internal class KeysBackup(
|
||||||
|
|
||||||
if (state === KeysBackupState.BackingUp) {
|
if (state === KeysBackupState.BackingUp) {
|
||||||
// Do nothing if we are already backing up
|
// Do nothing if we are already backing up
|
||||||
Timber.d("backupKeys: Invalid state: $state")
|
Timber.v("backupKeys: Invalid state: $state")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a chunk of keys to backup
|
// Get a chunk of keys to backup
|
||||||
val sessions = mCryptoStore.inboundGroupSessionsToBackup(KEY_BACKUP_SEND_KEYS_MAX_COUNT)
|
val sessions = mCryptoStore.inboundGroupSessionsToBackup(KEY_BACKUP_SEND_KEYS_MAX_COUNT)
|
||||||
|
|
||||||
Timber.d("backupKeys: 1 - " + sessions.size + " sessions to back up")
|
Timber.v("backupKeys: 1 - " + sessions.size + " sessions to back up")
|
||||||
|
|
||||||
if (sessions.isEmpty()) {
|
if (sessions.isEmpty()) {
|
||||||
// Backup is up to date
|
// Backup is up to date
|
||||||
|
@ -1307,7 +1307,7 @@ internal class KeysBackup(
|
||||||
mKeysBackupStateManager.state = KeysBackupState.BackingUp
|
mKeysBackupStateManager.state = KeysBackupState.BackingUp
|
||||||
|
|
||||||
CryptoAsyncHelper.getEncryptBackgroundHandler().post {
|
CryptoAsyncHelper.getEncryptBackgroundHandler().post {
|
||||||
Timber.d("backupKeys: 2 - Encrypting keys")
|
Timber.v("backupKeys: 2 - Encrypting keys")
|
||||||
|
|
||||||
// Gather data to send to the homeserver
|
// Gather data to send to the homeserver
|
||||||
// roomId -> sessionId -> MXKeyBackupData
|
// roomId -> sessionId -> MXKeyBackupData
|
||||||
|
@ -1329,7 +1329,7 @@ internal class KeysBackup(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timber.d("backupKeys: 4 - Sending request")
|
Timber.v("backupKeys: 4 - Sending request")
|
||||||
|
|
||||||
// Make the request
|
// Make the request
|
||||||
mStoreSessionDataTask
|
mStoreSessionDataTask
|
||||||
|
@ -1337,19 +1337,19 @@ internal class KeysBackup(
|
||||||
.dispatchTo(object : MatrixCallback<BackupKeysResult> {
|
.dispatchTo(object : MatrixCallback<BackupKeysResult> {
|
||||||
override fun onSuccess(data: BackupKeysResult) {
|
override fun onSuccess(data: BackupKeysResult) {
|
||||||
mUIHandler.post {
|
mUIHandler.post {
|
||||||
Timber.d("backupKeys: 5a - Request complete")
|
Timber.v("backupKeys: 5a - Request complete")
|
||||||
|
|
||||||
// Mark keys as backed up
|
// Mark keys as backed up
|
||||||
mCryptoStore.markBackupDoneForInboundGroupSessions(sessions)
|
mCryptoStore.markBackupDoneForInboundGroupSessions(sessions)
|
||||||
|
|
||||||
if (sessions.size < KEY_BACKUP_SEND_KEYS_MAX_COUNT) {
|
if (sessions.size < KEY_BACKUP_SEND_KEYS_MAX_COUNT) {
|
||||||
Timber.d("backupKeys: All keys have been backed up")
|
Timber.v("backupKeys: All keys have been backed up")
|
||||||
onServerDataRetrieved(data.count, data.hash)
|
onServerDataRetrieved(data.count, data.hash)
|
||||||
|
|
||||||
// Note: Changing state will trigger the call to backupAllGroupSessionsCallback.onSuccess()
|
// Note: Changing state will trigger the call to backupAllGroupSessionsCallback.onSuccess()
|
||||||
mKeysBackupStateManager.state = KeysBackupState.ReadyToBackUp
|
mKeysBackupStateManager.state = KeysBackupState.ReadyToBackUp
|
||||||
} else {
|
} else {
|
||||||
Timber.d("backupKeys: Continue to back up keys")
|
Timber.v("backupKeys: Continue to back up keys")
|
||||||
mKeysBackupStateManager.state = KeysBackupState.WillBackUp
|
mKeysBackupStateManager.state = KeysBackupState.WillBackUp
|
||||||
|
|
||||||
backupKeys()
|
backupKeys()
|
||||||
|
|
|
@ -133,7 +133,7 @@ private fun deriveKey(password: String,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timber.d("KeysBackupPassword", "## deriveKeys() : " + iterations + " in " + (System.currentTimeMillis() - t0) + " ms")
|
Timber.v("KeysBackupPassword", "## deriveKeys() : " + iterations + " in " + (System.currentTimeMillis() - t0) + " ms")
|
||||||
|
|
||||||
return dk
|
return dk
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ internal class KeysBackupStateManager(private val uiHandler: Handler) {
|
||||||
// Backup state
|
// Backup state
|
||||||
var state = KeysBackupState.Unknown
|
var state = KeysBackupState.Unknown
|
||||||
set(newState) {
|
set(newState) {
|
||||||
Timber.d("KeysBackup", "setState: $field -> $newState")
|
Timber.v("KeysBackup", "setState: $field -> $newState")
|
||||||
|
|
||||||
field = newState
|
field = newState
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,6 @@ internal object RealmCryptoStoreMigration : RealmMigration {
|
||||||
const val CRYPTO_STORE_SCHEMA_VERSION = 0L
|
const val CRYPTO_STORE_SCHEMA_VERSION = 0L
|
||||||
|
|
||||||
override fun migrate(realm: DynamicRealm, oldVersion: Long, newVersion: Long) {
|
override fun migrate(realm: DynamicRealm, oldVersion: Long, newVersion: Long) {
|
||||||
Timber.d("Migrating Realm Crypto from $oldVersion to $newVersion")
|
Timber.v("Migrating Realm Crypto from $oldVersion to $newVersion")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,17 +164,17 @@ internal class DefaultSasVerificationService(private val mCredentials: Credentia
|
||||||
otherUserId!!,
|
otherUserId!!,
|
||||||
startReq,
|
startReq,
|
||||||
success = {
|
success = {
|
||||||
Timber.d("## SAS onStartRequestReceived ${startReq.transactionID!!}")
|
Timber.v("## SAS onStartRequestReceived ${startReq.transactionID!!}")
|
||||||
val tid = startReq.transactionID!!
|
val tid = startReq.transactionID!!
|
||||||
val existing = getExistingTransaction(otherUserId, tid)
|
val existing = getExistingTransaction(otherUserId, tid)
|
||||||
val existingTxs = getExistingTransactionsForUser(otherUserId)
|
val existingTxs = getExistingTransactionsForUser(otherUserId)
|
||||||
if (existing != null) {
|
if (existing != null) {
|
||||||
//should cancel both!
|
//should cancel both!
|
||||||
Timber.d("## SAS onStartRequestReceived - Request exist with same if ${startReq.transactionID!!}")
|
Timber.v("## SAS onStartRequestReceived - Request exist with same if ${startReq.transactionID!!}")
|
||||||
existing.cancel(CancelCode.UnexpectedMessage)
|
existing.cancel(CancelCode.UnexpectedMessage)
|
||||||
cancelTransaction(tid, otherUserId, startReq.fromDevice!!, CancelCode.UnexpectedMessage)
|
cancelTransaction(tid, otherUserId, startReq.fromDevice!!, CancelCode.UnexpectedMessage)
|
||||||
} else if (existingTxs?.isEmpty() == false) {
|
} else if (existingTxs?.isEmpty() == false) {
|
||||||
Timber.d("## SAS onStartRequestReceived - There is already a transaction with this user ${startReq.transactionID!!}")
|
Timber.v("## SAS onStartRequestReceived - There is already a transaction with this user ${startReq.transactionID!!}")
|
||||||
//Multiple keyshares between two devices: any two devices may only have at most one key verification in flight at a time.
|
//Multiple keyshares between two devices: any two devices may only have at most one key verification in flight at a time.
|
||||||
existingTxs.forEach {
|
existingTxs.forEach {
|
||||||
it.cancel(CancelCode.UnexpectedMessage)
|
it.cancel(CancelCode.UnexpectedMessage)
|
||||||
|
@ -183,7 +183,7 @@ internal class DefaultSasVerificationService(private val mCredentials: Credentia
|
||||||
} else {
|
} else {
|
||||||
//Ok we can create
|
//Ok we can create
|
||||||
if (KeyVerificationStart.VERIF_METHOD_SAS == startReq.method) {
|
if (KeyVerificationStart.VERIF_METHOD_SAS == startReq.method) {
|
||||||
Timber.d("## SAS onStartRequestReceived - request accepted ${startReq.transactionID!!}")
|
Timber.v("## SAS onStartRequestReceived - request accepted ${startReq.transactionID!!}")
|
||||||
val tx = IncomingSASVerificationTransaction(
|
val tx = IncomingSASVerificationTransaction(
|
||||||
this,
|
this,
|
||||||
setDeviceVerificationAction,
|
setDeviceVerificationAction,
|
||||||
|
@ -232,7 +232,7 @@ internal class DefaultSasVerificationService(private val mCredentials: Credentia
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onCancelReceived(event: Event) {
|
private fun onCancelReceived(event: Event) {
|
||||||
Timber.d("## SAS onCancelReceived")
|
Timber.v("## SAS onCancelReceived")
|
||||||
val cancelReq = event.content.toModel<KeyVerificationCancel>()!!
|
val cancelReq = event.content.toModel<KeyVerificationCancel>()!!
|
||||||
|
|
||||||
if (!cancelReq.isValid()) {
|
if (!cancelReq.isValid()) {
|
||||||
|
@ -242,7 +242,7 @@ internal class DefaultSasVerificationService(private val mCredentials: Credentia
|
||||||
}
|
}
|
||||||
val otherUserId = event.sender!!
|
val otherUserId = event.sender!!
|
||||||
|
|
||||||
Timber.d("## SAS onCancelReceived otherUser:$otherUserId reason:${cancelReq.reason}")
|
Timber.v("## SAS onCancelReceived otherUser:$otherUserId reason:${cancelReq.reason}")
|
||||||
val existing = getExistingTransaction(otherUserId, cancelReq.transactionID!!)
|
val existing = getExistingTransaction(otherUserId, cancelReq.transactionID!!)
|
||||||
if (existing == null) {
|
if (existing == null) {
|
||||||
Timber.e("## Received invalid cancel request")
|
Timber.e("## Received invalid cancel request")
|
||||||
|
@ -415,7 +415,7 @@ internal class DefaultSasVerificationService(private val mCredentials: Credentia
|
||||||
mSendToDeviceTask.configureWith(SendToDeviceTask.Params(EventType.KEY_VERIFICATION_CANCEL, contentMap, transactionId))
|
mSendToDeviceTask.configureWith(SendToDeviceTask.Params(EventType.KEY_VERIFICATION_CANCEL, contentMap, transactionId))
|
||||||
.dispatchTo(object : MatrixCallback<Unit> {
|
.dispatchTo(object : MatrixCallback<Unit> {
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
Timber.d("## SAS verification [$transactionId] canceled for reason ${code.value}")
|
Timber.v("## SAS verification [$transactionId] canceled for reason ${code.value}")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailure(failure: Throwable) {
|
override fun onFailure(failure: Throwable) {
|
||||||
|
|
|
@ -80,7 +80,7 @@ internal class IncomingSASVerificationTransaction(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onVerificationStart(startReq: KeyVerificationStart) {
|
override fun onVerificationStart(startReq: KeyVerificationStart) {
|
||||||
Timber.d("## SAS received verification request from state $state")
|
Timber.v("## SAS received verification request from state $state")
|
||||||
if (state != SasVerificationTxState.None) {
|
if (state != SasVerificationTxState.None) {
|
||||||
Timber.e("## received verification request from invalid state")
|
Timber.e("## received verification request from invalid state")
|
||||||
//should I cancel??
|
//should I cancel??
|
||||||
|
@ -148,7 +148,7 @@ internal class IncomingSASVerificationTransaction(
|
||||||
|
|
||||||
private fun doAccept(accept: KeyVerificationAccept) {
|
private fun doAccept(accept: KeyVerificationAccept) {
|
||||||
this.accepted = accept
|
this.accepted = accept
|
||||||
Timber.d("## SAS accept request id:$transactionId")
|
Timber.v("## SAS accept request id:$transactionId")
|
||||||
|
|
||||||
//The hash commitment is the hash (using the selected hash algorithm) of the unpadded base64 representation of QB,
|
//The hash commitment is the hash (using the selected hash algorithm) of the unpadded base64 representation of QB,
|
||||||
// concatenated with the canonical JSON representation of the content of the m.key.verification.start message
|
// concatenated with the canonical JSON representation of the content of the m.key.verification.start message
|
||||||
|
@ -166,12 +166,12 @@ internal class IncomingSASVerificationTransaction(
|
||||||
|
|
||||||
|
|
||||||
override fun onVerificationAccept(accept: KeyVerificationAccept) {
|
override fun onVerificationAccept(accept: KeyVerificationAccept) {
|
||||||
Timber.d("## SAS invalid message for incoming request id:$transactionId")
|
Timber.v("## SAS invalid message for incoming request id:$transactionId")
|
||||||
cancel(CancelCode.UnexpectedMessage)
|
cancel(CancelCode.UnexpectedMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onKeyVerificationKey(userId: String, vKey: KeyVerificationKey) {
|
override fun onKeyVerificationKey(userId: String, vKey: KeyVerificationKey) {
|
||||||
Timber.d("## SAS received key for request id:$transactionId")
|
Timber.v("## SAS received key for request id:$transactionId")
|
||||||
if (state != SasVerificationTxState.SendingAccept && state != SasVerificationTxState.Accepted) {
|
if (state != SasVerificationTxState.SendingAccept && state != SasVerificationTxState.Accepted) {
|
||||||
Timber.e("## received key from invalid state $state")
|
Timber.e("## received key from invalid state $state")
|
||||||
cancel(CancelCode.UnexpectedMessage)
|
cancel(CancelCode.UnexpectedMessage)
|
||||||
|
@ -222,7 +222,7 @@ internal class IncomingSASVerificationTransaction(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onKeyVerificationMac(vKey: KeyVerificationMac) {
|
override fun onKeyVerificationMac(vKey: KeyVerificationMac) {
|
||||||
Timber.d("## SAS received mac for request id:$transactionId")
|
Timber.v("## SAS received mac for request id:$transactionId")
|
||||||
//Check for state?
|
//Check for state?
|
||||||
if (state != SasVerificationTxState.SendingKey
|
if (state != SasVerificationTxState.SendingKey
|
||||||
&& state != SasVerificationTxState.KeySent
|
&& state != SasVerificationTxState.KeySent
|
||||||
|
|
|
@ -117,7 +117,7 @@ internal class OutgoingSASVerificationRequest(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onVerificationAccept(accept: KeyVerificationAccept) {
|
override fun onVerificationAccept(accept: KeyVerificationAccept) {
|
||||||
Timber.d("## onVerificationAccept id:$transactionId")
|
Timber.v("## onVerificationAccept id:$transactionId")
|
||||||
if (state != SasVerificationTxState.Started) {
|
if (state != SasVerificationTxState.Started) {
|
||||||
Timber.e("## received accept request from invalid state $state")
|
Timber.e("## received accept request from invalid state $state")
|
||||||
cancel(CancelCode.UnexpectedMessage)
|
cancel(CancelCode.UnexpectedMessage)
|
||||||
|
@ -154,7 +154,7 @@ internal class OutgoingSASVerificationRequest(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onKeyVerificationKey(userId: String, vKey: KeyVerificationKey) {
|
override fun onKeyVerificationKey(userId: String, vKey: KeyVerificationKey) {
|
||||||
Timber.d("## onKeyVerificationKey id:$transactionId")
|
Timber.v("## onKeyVerificationKey id:$transactionId")
|
||||||
if (state != SasVerificationTxState.SendingKey && state != SasVerificationTxState.KeySent) {
|
if (state != SasVerificationTxState.SendingKey && state != SasVerificationTxState.KeySent) {
|
||||||
Timber.e("## received key from invalid state $state")
|
Timber.e("## received key from invalid state $state")
|
||||||
cancel(CancelCode.UnexpectedMessage)
|
cancel(CancelCode.UnexpectedMessage)
|
||||||
|
@ -196,7 +196,7 @@ internal class OutgoingSASVerificationRequest(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onKeyVerificationMac(vKey: KeyVerificationMac) {
|
override fun onKeyVerificationMac(vKey: KeyVerificationMac) {
|
||||||
Timber.d("## onKeyVerificationMac id:$transactionId")
|
Timber.v("## onKeyVerificationMac id:$transactionId")
|
||||||
if (state != SasVerificationTxState.OnKeyReceived
|
if (state != SasVerificationTxState.OnKeyReceived
|
||||||
&& state != SasVerificationTxState.ShortCodeReady
|
&& state != SasVerificationTxState.ShortCodeReady
|
||||||
&& state != SasVerificationTxState.ShortCodeAccepted
|
&& state != SasVerificationTxState.ShortCodeAccepted
|
||||||
|
|
|
@ -125,7 +125,7 @@ internal abstract class SASVerificationTransaction(
|
||||||
* both short codes do match
|
* both short codes do match
|
||||||
*/
|
*/
|
||||||
override fun userHasVerifiedShortCode() {
|
override fun userHasVerifiedShortCode() {
|
||||||
Timber.d("## SAS short code verified by user for id:$transactionId")
|
Timber.v("## SAS short code verified by user for id:$transactionId")
|
||||||
if (state != SasVerificationTxState.ShortCodeReady) {
|
if (state != SasVerificationTxState.ShortCodeReady) {
|
||||||
//ignore and cancel?
|
//ignore and cancel?
|
||||||
Timber.e("## Accepted short code from invalid state $state")
|
Timber.e("## Accepted short code from invalid state $state")
|
||||||
|
@ -199,7 +199,7 @@ internal abstract class SASVerificationTransaction(
|
||||||
abstract fun onKeyVerificationMac(vKey: KeyVerificationMac)
|
abstract fun onKeyVerificationMac(vKey: KeyVerificationMac)
|
||||||
|
|
||||||
protected fun verifyMacs() {
|
protected fun verifyMacs() {
|
||||||
Timber.d("## SAS verifying macs for id:$transactionId")
|
Timber.v("## SAS verifying macs for id:$transactionId")
|
||||||
state = SasVerificationTxState.Verifying
|
state = SasVerificationTxState.Verifying
|
||||||
|
|
||||||
//Keys have been downloaded earlier in process
|
//Keys have been downloaded earlier in process
|
||||||
|
@ -277,7 +277,7 @@ internal abstract class SASVerificationTransaction(
|
||||||
mSendToDeviceTask.configureWith(SendToDeviceTask.Params(type, contentMap, transactionId))
|
mSendToDeviceTask.configureWith(SendToDeviceTask.Params(type, contentMap, transactionId))
|
||||||
.dispatchTo(object : MatrixCallback<Unit> {
|
.dispatchTo(object : MatrixCallback<Unit> {
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
Timber.d("## SAS verification [$transactionId] toDevice type '$type' success.")
|
Timber.v("## SAS verification [$transactionId] toDevice type '$type' success.")
|
||||||
CryptoAsyncHelper.getDecryptBackgroundHandler().post {
|
CryptoAsyncHelper.getDecryptBackgroundHandler().post {
|
||||||
if (onDone != null) {
|
if (onDone != null) {
|
||||||
onDone()
|
onDone()
|
||||||
|
|
|
@ -119,7 +119,7 @@ internal class SyncThread(private val syncTask: SyncTask,
|
||||||
if (failure is Failure.NetworkConnection
|
if (failure is Failure.NetworkConnection
|
||||||
&& failure.cause is SocketTimeoutException) {
|
&& failure.cause is SocketTimeoutException) {
|
||||||
// Timeout are not critical
|
// Timeout are not critical
|
||||||
Timber.d("Timeout")
|
Timber.v("Timeout")
|
||||||
} else {
|
} else {
|
||||||
Timber.e(failure)
|
Timber.e(failure)
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,14 +42,14 @@ internal class BackgroundDetectionObserver : LifecycleObserver {
|
||||||
|
|
||||||
@OnLifecycleEvent(Lifecycle.Event.ON_START)
|
@OnLifecycleEvent(Lifecycle.Event.ON_START)
|
||||||
fun onMoveToForeground() {
|
fun onMoveToForeground() {
|
||||||
Timber.d("App returning to foreground…")
|
Timber.v("App returning to foreground…")
|
||||||
isIsBackground = false
|
isIsBackground = false
|
||||||
listeners.forEach { it.onMoveToForeground() }
|
listeners.forEach { it.onMoveToForeground() }
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnLifecycleEvent(Lifecycle.Event.ON_STOP)
|
@OnLifecycleEvent(Lifecycle.Event.ON_STOP)
|
||||||
fun onMoveToBackground() {
|
fun onMoveToBackground() {
|
||||||
Timber.d("App going to background…")
|
Timber.v("App going to background…")
|
||||||
isIsBackground = true
|
isIsBackground = true
|
||||||
listeners.forEach { it.onMoveToBackground() }
|
listeners.forEach { it.onMoveToBackground() }
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ import timber.log.Timber
|
||||||
class DebugReceiver : BroadcastReceiver() {
|
class DebugReceiver : BroadcastReceiver() {
|
||||||
|
|
||||||
override fun onReceive(context: Context, intent: Intent) {
|
override fun onReceive(context: Context, intent: Intent) {
|
||||||
Timber.d("Received debug action: ${intent.action}")
|
Timber.v("Received debug action: ${intent.action}")
|
||||||
|
|
||||||
intent.action?.let {
|
intent.action?.let {
|
||||||
when {
|
when {
|
||||||
|
@ -44,11 +44,11 @@ class DebugReceiver : BroadcastReceiver() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun logPrefs(name: String, sharedPreferences: SharedPreferences?) {
|
private fun logPrefs(name: String, sharedPreferences: SharedPreferences?) {
|
||||||
Timber.d("SharedPreferences $name:")
|
Timber.v("SharedPreferences $name:")
|
||||||
|
|
||||||
sharedPreferences?.let { prefs ->
|
sharedPreferences?.let { prefs ->
|
||||||
prefs.all.keys.forEach { key ->
|
prefs.all.keys.forEach { key ->
|
||||||
Timber.d("$key : ${prefs.all[key]}")
|
Timber.v("$key : ${prefs.all[key]}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class OnApplicationUpgradeReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
Timber.d("## onReceive() : Application has been upgraded, restart event stream service.");
|
Timber.v("## onReceive() : Application has been upgraded, restart event stream service.");
|
||||||
|
|
||||||
// Start Event stream
|
// Start Event stream
|
||||||
// TODO EventStreamServiceX.Companion.onApplicationUpgrade(context);
|
// TODO EventStreamServiceX.Companion.onApplicationUpgrade(context);
|
||||||
|
|
|
@ -94,7 +94,7 @@ class VectorFirebaseMessagingService : FirebaseMessagingService() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDeletedMessages() {
|
override fun onDeletedMessages() {
|
||||||
Timber.d("## onDeletedMessages()")
|
Timber.v("## onDeletedMessages()")
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -138,7 +138,7 @@ abstract class VectorBaseActivity : BaseMvRxActivity() {
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
|
||||||
Timber.d("onResume Activity ${this.javaClass.simpleName}")
|
Timber.v("onResume Activity ${this.javaClass.simpleName}")
|
||||||
|
|
||||||
if (this !is BugReportActivity) {
|
if (this !is BugReportActivity) {
|
||||||
rageShake?.start()
|
rageShake?.start()
|
||||||
|
|
|
@ -62,7 +62,7 @@ abstract class VectorBaseFragment : BaseMvRxFragment(), OnBackPressed {
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
|
||||||
Timber.d("onResume Fragment ${this.javaClass.simpleName}")
|
Timber.v("onResume Fragment ${this.javaClass.simpleName}")
|
||||||
}
|
}
|
||||||
|
|
||||||
@CallSuper
|
@CallSuper
|
||||||
|
|
|
@ -36,7 +36,7 @@ abstract class VectorPreferenceFragment : PreferenceFragmentCompat() {
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
|
||||||
Timber.d("onResume Fragment ${this.javaClass.simpleName}")
|
Timber.v("onResume Fragment ${this.javaClass.simpleName}")
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ==========================================================================================
|
/* ==========================================================================================
|
||||||
|
|
|
@ -70,20 +70,20 @@ class CallService : VectorService() {
|
||||||
* @param callId the callId
|
* @param callId the callId
|
||||||
*/
|
*/
|
||||||
private fun displayIncomingCallNotification(intent: Intent) {
|
private fun displayIncomingCallNotification(intent: Intent) {
|
||||||
Timber.d("displayIncomingCallNotification")
|
Timber.v("displayIncomingCallNotification")
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
/*
|
/*
|
||||||
|
|
||||||
// the incoming call in progress is already displayed
|
// the incoming call in progress is already displayed
|
||||||
if (!TextUtils.isEmpty(mIncomingCallId)) {
|
if (!TextUtils.isEmpty(mIncomingCallId)) {
|
||||||
Timber.d("displayIncomingCallNotification : the incoming call in progress is already displayed")
|
Timber.v("displayIncomingCallNotification : the incoming call in progress is already displayed")
|
||||||
} else if (!TextUtils.isEmpty(mCallIdInProgress)) {
|
} else if (!TextUtils.isEmpty(mCallIdInProgress)) {
|
||||||
Timber.d("displayIncomingCallNotification : a 'call in progress' notification is displayed")
|
Timber.v("displayIncomingCallNotification : a 'call in progress' notification is displayed")
|
||||||
} else if (null == CallsManager.getSharedInstance().activeCall) {
|
} else if (null == CallsManager.getSharedInstance().activeCall) {
|
||||||
val callId = intent.getStringExtra(EXTRA_CALL_ID)
|
val callId = intent.getStringExtra(EXTRA_CALL_ID)
|
||||||
|
|
||||||
Timber.d("displayIncomingCallNotification : display the dedicated notification")
|
Timber.v("displayIncomingCallNotification : display the dedicated notification")
|
||||||
val notification = NotificationUtils.buildIncomingCallNotification(
|
val notification = NotificationUtils.buildIncomingCallNotification(
|
||||||
this,
|
this,
|
||||||
intent.getBooleanExtra(EXTRA_IS_VIDEO, false),
|
intent.getBooleanExtra(EXTRA_IS_VIDEO, false),
|
||||||
|
|
|
@ -469,7 +469,7 @@ class EventStreamServiceX : VectorService() {
|
||||||
// But it could be triggered because of multi accounts management.
|
// But it could be triggered because of multi accounts management.
|
||||||
// The dedicated account is removing but some pushes are still received.
|
// The dedicated account is removing but some pushes are still received.
|
||||||
if (null == session || !session.isAlive) {
|
if (null == session || !session.isAlive) {
|
||||||
Timber.d("prepareCallNotification : don't bing - no session")
|
Timber.v("prepareCallNotification : don't bing - no session")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,10 +83,10 @@ class KeysBackupBanner @JvmOverloads constructor(
|
||||||
*/
|
*/
|
||||||
fun render(newState: State, force: Boolean = false) {
|
fun render(newState: State, force: Boolean = false) {
|
||||||
if (newState == state && !force) {
|
if (newState == state && !force) {
|
||||||
Timber.d("State unchanged")
|
Timber.v("State unchanged")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
Timber.d("Rendering $newState")
|
Timber.v("Rendering $newState")
|
||||||
|
|
||||||
state = newState
|
state = newState
|
||||||
|
|
||||||
|
|
|
@ -164,9 +164,9 @@ fun openCamera(activity: Activity, titlePrefix: String, requestCode: Int): Strin
|
||||||
|
|
||||||
if (dummyUri != null) {
|
if (dummyUri != null) {
|
||||||
captureIntent.putExtra(MediaStore.EXTRA_OUTPUT, dummyUri)
|
captureIntent.putExtra(MediaStore.EXTRA_OUTPUT, dummyUri)
|
||||||
Timber.d("trying to take a photo on " + dummyUri.toString())
|
Timber.v("trying to take a photo on " + dummyUri.toString())
|
||||||
} else {
|
} else {
|
||||||
Timber.d("trying to take a photo with no predefined uri")
|
Timber.v("trying to take a photo with no predefined uri")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store the dummy URI which will be set to a placeholder location. When all is lost on Samsung devices,
|
// Store the dummy URI which will be set to a placeholder location. When all is lost on Samsung devices,
|
||||||
|
|
|
@ -59,9 +59,9 @@ fun lsFiles(context: Context) {
|
||||||
|
|
||||||
private fun logAction(file: File): Boolean {
|
private fun logAction(file: File): Boolean {
|
||||||
if (file.isDirectory) {
|
if (file.isDirectory) {
|
||||||
Timber.d(file.toString())
|
Timber.v(file.toString())
|
||||||
} else {
|
} else {
|
||||||
Timber.d(file.toString() + " " + file.length() + " bytes")
|
Timber.v(file.toString() + " " + file.length() + " bytes")
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,10 +78,10 @@ fun logPermissionStatuses(context: Context) {
|
||||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||||
Manifest.permission.READ_CONTACTS)
|
Manifest.permission.READ_CONTACTS)
|
||||||
|
|
||||||
Timber.d("## logPermissionStatuses() : log the permissions status used by the app")
|
Timber.v("## logPermissionStatuses() : log the permissions status used by the app")
|
||||||
|
|
||||||
for (permission in permissions) {
|
for (permission in permissions) {
|
||||||
Timber.d(("Status of [$permission] : " +
|
Timber.v(("Status of [$permission] : " +
|
||||||
if (PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(context, permission))
|
if (PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(context, permission))
|
||||||
"PERMISSION_GRANTED"
|
"PERMISSION_GRANTED"
|
||||||
else
|
else
|
||||||
|
@ -244,7 +244,7 @@ private fun checkPermissions(permissionsToBeGrantedBitMap: Int,
|
||||||
}
|
}
|
||||||
explanationMessage += activity.getString(R.string.permissions_rationale_msg_contacts)
|
explanationMessage += activity.getString(R.string.permissions_rationale_msg_contacts)
|
||||||
}
|
}
|
||||||
else -> Timber.d("## checkPermissions(): already denied permission not supported")
|
else -> Timber.v("## checkPermissions(): already denied permission not supported")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ object BadgeProxy {
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the badge counter
|
// update the badge counter
|
||||||
Timber.d("## updateBadgeCount(): badge update count=$unreadRoomsCount")
|
Timber.v("## updateBadgeCount(): badge update count=$unreadRoomsCount")
|
||||||
updateBadgeCount(aContext, unreadRoomsCount)
|
updateBadgeCount(aContext, unreadRoomsCount)
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -32,7 +32,7 @@ object CommandParser {
|
||||||
if (!textMessage.startsWith("/")) {
|
if (!textMessage.startsWith("/")) {
|
||||||
return ParsedCommand.ErrorNotACommand
|
return ParsedCommand.ErrorNotACommand
|
||||||
} else {
|
} else {
|
||||||
Timber.d("parseSplashCommand")
|
Timber.v("parseSplashCommand")
|
||||||
|
|
||||||
// "/" only
|
// "/" only
|
||||||
if (textMessage.length == 1) {
|
if (textMessage.length == 1) {
|
||||||
|
|
|
@ -105,7 +105,7 @@ class KeysBackupRestoreFromKeyViewModel : ViewModel() {
|
||||||
object : MatrixCallback<Unit> {
|
object : MatrixCallback<Unit> {
|
||||||
|
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
Timber.d("##### trustKeysBackupVersion onSuccess")
|
Timber.v("##### trustKeysBackupVersion onSuccess")
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -112,7 +112,7 @@ class KeysBackupRestoreFromPassphraseViewModel : ViewModel() {
|
||||||
object : MatrixCallback<Unit> {
|
object : MatrixCallback<Unit> {
|
||||||
|
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
Timber.d("##### trustKeysBackupVersion onSuccess")
|
Timber.v("##### trustKeysBackupVersion onSuccess")
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -36,7 +36,7 @@ class NotificationBroadcastReceiver : BroadcastReceiver(), KoinComponent {
|
||||||
override fun onReceive(context: Context?, intent: Intent?) {
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
if (intent == null || context == null) return
|
if (intent == null || context == null) return
|
||||||
|
|
||||||
Timber.d("ReplyNotificationBroadcastReceiver received : $intent")
|
Timber.v("ReplyNotificationBroadcastReceiver received : $intent")
|
||||||
|
|
||||||
when (intent.action) {
|
when (intent.action) {
|
||||||
NotificationUtils.SMART_REPLY_ACTION ->
|
NotificationUtils.SMART_REPLY_ACTION ->
|
||||||
|
@ -102,7 +102,7 @@ class NotificationBroadcastReceiver : BroadcastReceiver(), KoinComponent {
|
||||||
room.storeOutgoingEvent(event)
|
room.storeOutgoingEvent(event)
|
||||||
room.sendEvent(event, object : MatrixCallback<Void?> {
|
room.sendEvent(event, object : MatrixCallback<Void?> {
|
||||||
override fun onSuccess(info: Void?) {
|
override fun onSuccess(info: Void?) {
|
||||||
Timber.d("Send message : onSuccess ")
|
Timber.v("Send message : onSuccess ")
|
||||||
val notifiableMessageEvent = NotifiableMessageEvent(
|
val notifiableMessageEvent = NotifiableMessageEvent(
|
||||||
event.eventId,
|
event.eventId,
|
||||||
false,
|
false,
|
||||||
|
@ -120,12 +120,12 @@ class NotificationBroadcastReceiver : BroadcastReceiver(), KoinComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onNetworkError(e: Exception) {
|
override fun onNetworkError(e: Exception) {
|
||||||
Timber.d("Send message : onNetworkError " + e.message, e)
|
Timber.v("Send message : onNetworkError " + e.message, e)
|
||||||
onSmartReplyFailed(e.localizedMessage)
|
onSmartReplyFailed(e.localizedMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onMatrixError(e: MatrixError) {
|
override fun onMatrixError(e: MatrixError) {
|
||||||
Timber.d("Send message : onMatrixError " + e.message)
|
Timber.v("Send message : onMatrixError " + e.message)
|
||||||
if (e is MXCryptoError) {
|
if (e is MXCryptoError) {
|
||||||
Toast.makeText(context, e.detailedErrorDescription, Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, e.detailedErrorDescription, Toast.LENGTH_SHORT).show()
|
||||||
onSmartReplyFailed(e.detailedErrorDescription)
|
onSmartReplyFailed(e.detailedErrorDescription)
|
||||||
|
|
|
@ -89,7 +89,7 @@ class NotificationDrawerManager(val context: Context) {
|
||||||
//If we support multi session, event list should be per userId
|
//If we support multi session, event list should be per userId
|
||||||
//Currently only manage single session
|
//Currently only manage single session
|
||||||
if (BuildConfig.LOW_PRIVACY_LOG_ENABLE) {
|
if (BuildConfig.LOW_PRIVACY_LOG_ENABLE) {
|
||||||
Timber.d("%%%%%%%% onNotifiableEventReceived $notifiableEvent")
|
Timber.v("%%%%%%%% onNotifiableEventReceived $notifiableEvent")
|
||||||
}
|
}
|
||||||
synchronized(eventList) {
|
synchronized(eventList) {
|
||||||
val existing = eventList.firstOrNull { it.eventId == notifiableEvent.eventId }
|
val existing = eventList.firstOrNull { it.eventId == notifiableEvent.eventId }
|
||||||
|
@ -128,7 +128,7 @@ class NotificationDrawerManager(val context: Context) {
|
||||||
|
|
||||||
/** Clear all known message events for this room and refresh the notification drawer */
|
/** Clear all known message events for this room and refresh the notification drawer */
|
||||||
fun clearMessageEventOfRoom(roomId: String?) {
|
fun clearMessageEventOfRoom(roomId: String?) {
|
||||||
Timber.d("clearMessageEventOfRoom $roomId")
|
Timber.v("clearMessageEventOfRoom $roomId")
|
||||||
|
|
||||||
if (roomId != null) {
|
if (roomId != null) {
|
||||||
eventList.removeAll { e ->
|
eventList.removeAll { e ->
|
||||||
|
@ -190,7 +190,7 @@ class NotificationDrawerManager(val context: Context) {
|
||||||
|
|
||||||
synchronized(eventList) {
|
synchronized(eventList) {
|
||||||
|
|
||||||
Timber.d("%%%%%%%% REFRESH NOTIFICATION DRAWER ")
|
Timber.v("%%%%%%%% REFRESH NOTIFICATION DRAWER ")
|
||||||
//TMP code
|
//TMP code
|
||||||
var hasNewEvent = false
|
var hasNewEvent = false
|
||||||
var summaryIsNoisy = false
|
var summaryIsNoisy = false
|
||||||
|
@ -224,7 +224,7 @@ class NotificationDrawerManager(val context: Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Timber.d("%%%%%%%% REFRESH NOTIFICATION DRAWER ${roomIdToEventMap.size} room groups")
|
Timber.v("%%%%%%%% REFRESH NOTIFICATION DRAWER ${roomIdToEventMap.size} room groups")
|
||||||
|
|
||||||
var globalLastMessageTimestamp = 0L
|
var globalLastMessageTimestamp = 0L
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ class NotificationDrawerManager(val context: Context) {
|
||||||
|
|
||||||
if (events.isEmpty()) {
|
if (events.isEmpty()) {
|
||||||
//Just clear this notification
|
//Just clear this notification
|
||||||
Timber.d("%%%%%%%% REFRESH NOTIFICATION DRAWER $roomId has no more events")
|
Timber.v("%%%%%%%% REFRESH NOTIFICATION DRAWER $roomId has no more events")
|
||||||
NotificationUtils.cancelNotificationMessage(context, roomId, ROOM_MESSAGES_NOTIFICATION_ID)
|
NotificationUtils.cancelNotificationMessage(context, roomId, ROOM_MESSAGES_NOTIFICATION_ID)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -292,13 +292,13 @@ class NotificationDrawerManager(val context: Context) {
|
||||||
summaryInboxStyle.addLine(summaryLine)
|
summaryInboxStyle.addLine(summaryLine)
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
//String not found or bad format
|
//String not found or bad format
|
||||||
Timber.d("%%%%%%%% REFRESH NOTIFICATION DRAWER failed to resolve string")
|
Timber.v("%%%%%%%% REFRESH NOTIFICATION DRAWER failed to resolve string")
|
||||||
summaryInboxStyle.addLine(roomName)
|
summaryInboxStyle.addLine(roomName)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstTime || roomGroup.hasNewEvent) {
|
if (firstTime || roomGroup.hasNewEvent) {
|
||||||
//Should update displayed notification
|
//Should update displayed notification
|
||||||
Timber.d("%%%%%%%% REFRESH NOTIFICATION DRAWER $roomId need refresh")
|
Timber.v("%%%%%%%% REFRESH NOTIFICATION DRAWER $roomId need refresh")
|
||||||
val lastMessageTimestamp = events.last().timestamp
|
val lastMessageTimestamp = events.last().timestamp
|
||||||
|
|
||||||
if (globalLastMessageTimestamp < lastMessageTimestamp) {
|
if (globalLastMessageTimestamp < lastMessageTimestamp) {
|
||||||
|
@ -314,7 +314,7 @@ class NotificationDrawerManager(val context: Context) {
|
||||||
hasNewEvent = true
|
hasNewEvent = true
|
||||||
summaryIsNoisy = summaryIsNoisy || roomGroup.shouldBing
|
summaryIsNoisy = summaryIsNoisy || roomGroup.shouldBing
|
||||||
} else {
|
} else {
|
||||||
Timber.d("%%%%%%%% REFRESH NOTIFICATION DRAWER $roomId is up to date")
|
Timber.v("%%%%%%%% REFRESH NOTIFICATION DRAWER $roomId is up to date")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ class OutdatedEventDetector(val context: Context) {
|
||||||
if (session.isAlive) {
|
if (session.isAlive) {
|
||||||
session.dataHandler.getRoom(roomID)?.let { room ->
|
session.dataHandler.getRoom(roomID)?.let { room ->
|
||||||
if (room.isEventRead(eventID)) {
|
if (room.isEventRead(eventID)) {
|
||||||
Timber.d("Notifiable Event $eventID is read, and should be removed")
|
Timber.v("Notifiable Event $eventID is read, and should be removed")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -296,7 +296,7 @@ object BugReporter {
|
||||||
mBugReportCall!!.cancel()
|
mBugReportCall!!.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
Timber.d("## onWrite() : $percentage%")
|
Timber.v("## onWrite() : $percentage%")
|
||||||
publishProgress(percentage)
|
publishProgress(percentage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -638,7 +638,7 @@ object BugReporter {
|
||||||
* @return the gzipped file
|
* @return the gzipped file
|
||||||
*/
|
*/
|
||||||
private fun compressFile(fin: File): File? {
|
private fun compressFile(fin: File): File? {
|
||||||
Timber.d("## compressFile() : compress " + fin.name)
|
Timber.v("## compressFile() : compress " + fin.name)
|
||||||
|
|
||||||
val dstFile = File(fin.parent, fin.name + ".gz")
|
val dstFile = File(fin.parent, fin.name + ".gz")
|
||||||
|
|
||||||
|
@ -665,7 +665,7 @@ object BugReporter {
|
||||||
gos.close()
|
gos.close()
|
||||||
inputStream.close()
|
inputStream.close()
|
||||||
|
|
||||||
Timber.d("## compressFile() : " + fin.length() + " compressed to " + dstFile.length() + " bytes")
|
Timber.v("## compressFile() : " + fin.length() + " compressed to " + dstFile.length() + " bytes")
|
||||||
return dstFile
|
return dstFile
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Timber.e(e, "## compressFile() failed " + e.message)
|
Timber.e(e, "## compressFile() failed " + e.message)
|
||||||
|
|
|
@ -410,7 +410,7 @@ public class PreferencesManager {
|
||||||
uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
Timber.d("## getNotificationRingTone() returns " + uri);
|
Timber.v("## getNotificationRingTone() returns " + uri);
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1159,7 +1159,7 @@ class VectorSettingsPreferencesFragment : VectorPreferenceFragment(), SharedPref
|
||||||
val matrixInstance = Matrix.getInstance(context)
|
val matrixInstance = Matrix.getInstance(context)
|
||||||
val pushManager = matrixInstance.pushManager
|
val pushManager = matrixInstance.pushManager
|
||||||
|
|
||||||
Timber.d("onPushRuleClick $preferenceKey : set to $newValue")
|
Timber.v("onPushRuleClick $preferenceKey : set to $newValue")
|
||||||
|
|
||||||
when (preferenceKey) {
|
when (preferenceKey) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue