mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Strongly type UUIDs as ACIs.
This commit is contained in:
@@ -22,7 +22,7 @@ public final class LogSectionCapabilities implements LogSection {
|
||||
return "Unregistered";
|
||||
}
|
||||
|
||||
if (TextSecurePreferences.getLocalNumber(context) == null || TextSecurePreferences.getLocalUuid(context) == null) {
|
||||
if (TextSecurePreferences.getLocalNumber(context) == null || TextSecurePreferences.getLocalAci(context) == null) {
|
||||
return "Self not yet available!";
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ final class LogSectionKeyPreferences implements LogSection {
|
||||
.append("Client Deprecated : ").append(SignalStore.misc().isClientDeprecated()).append("\n")
|
||||
.append("Push Registered : ").append(TextSecurePreferences.isPushRegistered(context)).append("\n")
|
||||
.append("Unauthorized Received: ").append(TextSecurePreferences.isUnauthorizedRecieved(context)).append("\n")
|
||||
.append("self.isRegistered() : ").append(TextSecurePreferences.getLocalUuid(context) == null ? "false" : Recipient.self().isRegistered()).append("\n")
|
||||
.append("self.isRegistered() : ").append(TextSecurePreferences.getLocalAci(context) == null ? "false" : Recipient.self().isRegistered()).append("\n")
|
||||
.append("Thread Trimming : ").append(getThreadTrimmingString()).append("\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ import com.google.android.gms.common.GoogleApiAvailability;
|
||||
|
||||
import org.thoughtcrime.securesms.BuildConfig;
|
||||
import org.thoughtcrime.securesms.emoji.EmojiFiles;
|
||||
import org.thoughtcrime.securesms.emoji.EmojiSource;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.util.AppSignatureUtil;
|
||||
@@ -27,12 +26,11 @@ import org.thoughtcrime.securesms.util.ServiceUtil;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.util.VersionTracker;
|
||||
import org.whispersystems.signalservice.api.push.ACI;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class LogSectionSystemInfo implements LogSection {
|
||||
@@ -64,7 +62,7 @@ public class LogSectionSystemInfo implements LogSection {
|
||||
builder.append("MemInfo : ").append(getMemoryInfo(context)).append("\n");
|
||||
builder.append("OS Host : ").append(Build.HOST).append("\n");
|
||||
builder.append("RecipientId : ").append(SignalStore.registrationValues().isRegistrationComplete() ? Recipient.self().getId() : "N/A").append("\n");
|
||||
builder.append("UUID : ").append(getCensoredUuid(context)).append("\n");
|
||||
builder.append("ACI : ").append(getCensoredAci(context)).append("\n");
|
||||
builder.append("Censored : ").append(CensorshipUtil.isCensored(context)).append("\n");
|
||||
builder.append("Play Services : ").append(getPlayServicesString(context)).append("\n");
|
||||
builder.append("FCM : ").append(!TextSecurePreferences.isFcmDisabled(context)).append("\n");
|
||||
@@ -166,12 +164,12 @@ public class LogSectionSystemInfo implements LogSection {
|
||||
}
|
||||
}
|
||||
|
||||
private static String getCensoredUuid(@NonNull Context context) {
|
||||
UUID uuid = TextSecurePreferences.getLocalUuid(context);
|
||||
private static String getCensoredAci(@NonNull Context context) {
|
||||
ACI aci = TextSecurePreferences.getLocalAci(context);
|
||||
|
||||
if (uuid != null) {
|
||||
String uuidString = uuid.toString();
|
||||
String lastTwo = uuidString.substring(uuidString.length() - 2);
|
||||
if (aci != null) {
|
||||
String aciString = aci.toString();
|
||||
String lastTwo = aciString.substring(aciString.length() - 2);
|
||||
|
||||
return "********-****-****-****-**********" + lastTwo;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user