mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-17 15:33:30 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
859efab038 | ||
|
|
c09ae9a234 | ||
|
|
0d57005606 |
@@ -46,14 +46,14 @@ ktlint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def canonicalVersionCode = 1293
|
def canonicalVersionCode = 1293
|
||||||
def canonicalVersionName = "6.26.3"
|
def canonicalVersionName = "6.26.4"
|
||||||
|
|
||||||
def postFixSize = 100
|
def postFixSize = 100
|
||||||
def abiPostFix = ['universal' : 0,
|
def abiPostFix = ['universal' : 5,
|
||||||
'armeabi-v7a' : 1,
|
'armeabi-v7a' : 6,
|
||||||
'arm64-v8a' : 2,
|
'arm64-v8a' : 7,
|
||||||
'x86' : 3,
|
'x86' : 8,
|
||||||
'x86_64' : 4]
|
'x86_64' : 9]
|
||||||
|
|
||||||
def keystores = [ 'debug' : loadKeystoreProperties('keystore.debug.properties') ]
|
def keystores = [ 'debug' : loadKeystoreProperties('keystore.debug.properties') ]
|
||||||
|
|
||||||
|
|||||||
@@ -492,6 +492,8 @@ open class ContactSearchAdapter(
|
|||||||
if (isEnabled(model)) {
|
if (isEnabled(model)) {
|
||||||
itemView.setOnClickListener { onClick.onClicked(avatar, getData(model), isSelected(model)) }
|
itemView.setOnClickListener { onClick.onClicked(avatar, getData(model), isSelected(model)) }
|
||||||
bindLongPress(model)
|
bindLongPress(model)
|
||||||
|
} else {
|
||||||
|
itemView.setOnClickListener(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
bindCheckbox(model)
|
bindCheckbox(model)
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ data class BackupAuthCheckResponse @JsonCreator constructor(
|
|||||||
private fun String.toBasic(): String {
|
private fun String.toBasic(): String {
|
||||||
return "Basic ${encode(StandardCharsets.ISO_8859_1).base64()}"
|
return "Basic ${encode(StandardCharsets.ISO_8859_1).base64()}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun merge(other: BackupAuthCheckResponse): BackupAuthCheckResponse {
|
||||||
|
return BackupAuthCheckResponse(this.matches + other.matches)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -297,7 +297,8 @@ public class PushServiceSocket {
|
|||||||
|
|
||||||
private static final String REPORT_SPAM = "/v1/messages/report/%s/%s";
|
private static final String REPORT_SPAM = "/v1/messages/report/%s/%s";
|
||||||
|
|
||||||
private static final String BACKUP_AUTH_CHECK = "/v1/backup/auth/check";
|
private static final String BACKUP_AUTH_CHECK_V1 = "/v1/backup/auth/check";
|
||||||
|
private static final String BACKUP_AUTH_CHECK_V2 = "/v2/backup/auth/check";
|
||||||
|
|
||||||
private static final String CALL_LINK_CREATION_AUTH = "/v1/call-link/create-auth";
|
private static final String CALL_LINK_CREATION_AUTH = "/v1/call-link/create-auth";
|
||||||
private static final String SERVER_DELIVERED_TIMESTAMP_HEADER = "X-Signal-Timestamp";
|
private static final String SERVER_DELIVERED_TIMESTAMP_HEADER = "X-Signal-Timestamp";
|
||||||
@@ -973,17 +974,41 @@ public class PushServiceSocket {
|
|||||||
public Single<ServiceResponse<BackupAuthCheckResponse>> checkBackupAuthCredentials(@Nonnull BackupAuthCheckRequest request,
|
public Single<ServiceResponse<BackupAuthCheckResponse>> checkBackupAuthCredentials(@Nonnull BackupAuthCheckRequest request,
|
||||||
@Nonnull ResponseMapper<BackupAuthCheckResponse> responseMapper)
|
@Nonnull ResponseMapper<BackupAuthCheckResponse> responseMapper)
|
||||||
{
|
{
|
||||||
Single<ServiceResponse<BackupAuthCheckResponse>> requestSingle = Single.fromCallable(() -> {
|
return Single
|
||||||
try (Response response = getServiceConnection(BACKUP_AUTH_CHECK, "POST", jsonRequestBody(JsonUtil.toJson(request)), Collections.emptyMap(), Optional.empty(), false)) {
|
.zip(
|
||||||
|
createBackupAuthCheckSingle(BACKUP_AUTH_CHECK_V1, request, responseMapper),
|
||||||
|
createBackupAuthCheckSingle(BACKUP_AUTH_CHECK_V2, request, responseMapper),
|
||||||
|
(v1, v2) -> {
|
||||||
|
if (v1.getResult().isPresent() && v2.getResult().isPresent()) {
|
||||||
|
BackupAuthCheckResponse v1Result = v1.getResult().get();
|
||||||
|
BackupAuthCheckResponse v2Result = v2.getResult().get();
|
||||||
|
BackupAuthCheckResponse merged = v1Result.merge(v2Result);
|
||||||
|
|
||||||
|
return new ServiceResponse<>(v2.getStatus(), null, merged, null, null);
|
||||||
|
} else if (v1.getResult().isEmpty() && v2.getResult().isEmpty()) {
|
||||||
|
return v2;
|
||||||
|
} else if (v2.getResult().isEmpty()) {
|
||||||
|
return v1;
|
||||||
|
} else {
|
||||||
|
return v2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(Schedulers.io())
|
||||||
|
.onErrorReturn(ServiceResponse::forUnknownError);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Single<ServiceResponse<BackupAuthCheckResponse>> createBackupAuthCheckSingle(@Nonnull String path,
|
||||||
|
@Nonnull BackupAuthCheckRequest request,
|
||||||
|
@Nonnull ResponseMapper<BackupAuthCheckResponse> responseMapper)
|
||||||
|
{
|
||||||
|
return Single.fromCallable(() -> {
|
||||||
|
try (Response response = getServiceConnection(path, "POST", jsonRequestBody(JsonUtil.toJson(request)), Collections.emptyMap(), Optional.empty(), false)) {
|
||||||
String body = response.body() != null ? readBodyString(response.body()): "";
|
String body = response.body() != null ? readBodyString(response.body()): "";
|
||||||
return responseMapper.map(response.code(), body, response::header, false);
|
return responseMapper.map(response.code(), body, response::header, false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return requestSingle
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(Schedulers.io())
|
|
||||||
.onErrorReturn(ServiceResponse::forUnknownError);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user