mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-09 05:38:33 +00:00
Log capabilities.
This commit is contained in:
parent
52747782a7
commit
2001fa86cf
@ -16,6 +16,7 @@ import org.thoughtcrime.securesms.logging.Log;
|
|||||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||||
import org.whispersystems.signalservice.api.SignalServiceAccountManager;
|
import org.whispersystems.signalservice.api.SignalServiceAccountManager;
|
||||||
import org.whispersystems.signalservice.api.crypto.UnidentifiedAccess;
|
import org.whispersystems.signalservice.api.crypto.UnidentifiedAccess;
|
||||||
|
import org.whispersystems.signalservice.api.profiles.SignalServiceProfile;
|
||||||
import org.whispersystems.signalservice.api.push.exceptions.NetworkFailureException;
|
import org.whispersystems.signalservice.api.push.exceptions.NetworkFailureException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -69,13 +70,18 @@ public class RefreshAttributesJob extends BaseJob {
|
|||||||
registrationLockV1 = TextSecurePreferences.getDeprecatedV1RegistrationLockPin(context);
|
registrationLockV1 = TextSecurePreferences.getDeprecatedV1RegistrationLockPin(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.i(TAG, "Calling setAccountAttributes() reglockV1? " + !TextUtils.isEmpty(registrationLockV1) + ", reglockV2? " + !TextUtils.isEmpty(registrationLockV2) + ", pin? " + kbsValues.hasPin());
|
SignalServiceProfile.Capabilities capabilities = AppCapabilities.getCapabilities(kbsValues.hasPin());
|
||||||
|
Log.i(TAG, "Calling setAccountAttributes() reglockV1? " + !TextUtils.isEmpty(registrationLockV1) + ", reglockV2? " + !TextUtils.isEmpty(registrationLockV2) + ", pin? " + kbsValues.hasPin() +
|
||||||
|
"\n Capabilities:" +
|
||||||
|
"\n Storage? " + capabilities.isStorage() +
|
||||||
|
"\n GV2? " + capabilities.isGv2() +
|
||||||
|
"\n UUID? " + capabilities.isUuid()) ;
|
||||||
|
|
||||||
SignalServiceAccountManager signalAccountManager = ApplicationDependencies.getSignalServiceAccountManager();
|
SignalServiceAccountManager signalAccountManager = ApplicationDependencies.getSignalServiceAccountManager();
|
||||||
signalAccountManager.setAccountAttributes(null, registrationId, fetchesMessages,
|
signalAccountManager.setAccountAttributes(null, registrationId, fetchesMessages,
|
||||||
registrationLockV1, registrationLockV2,
|
registrationLockV1, registrationLockV2,
|
||||||
unidentifiedAccessKey, universalUnidentifiedAccess,
|
unidentifiedAccessKey, universalUnidentifiedAccess,
|
||||||
AppCapabilities.getCapabilities(kbsValues.hasPin()));
|
capabilities);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
package org.thoughtcrime.securesms.logsubmit;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.AppCapabilities;
|
||||||
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||||
|
import org.whispersystems.signalservice.api.profiles.SignalServiceProfile;
|
||||||
|
|
||||||
|
public final class LogSectionCapabilities implements LogSection {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NonNull String getTitle() {
|
||||||
|
return "CAPABILITIES";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NonNull CharSequence getContent(@NonNull Context context) {
|
||||||
|
Recipient self = Recipient.self();
|
||||||
|
if (!self.isRegistered()) {
|
||||||
|
return "Unregistered";
|
||||||
|
} else {
|
||||||
|
SignalServiceProfile.Capabilities capabilities = AppCapabilities.getCapabilities(false);
|
||||||
|
|
||||||
|
return new StringBuilder().append("Local device UUID : ").append(capabilities.isUuid()).append("\n")
|
||||||
|
.append("Global UUID : ").append(self.getUuidCapability()).append("\n")
|
||||||
|
.append("Local device GV2 : ").append(capabilities.isGv2()).append("\n")
|
||||||
|
.append("Global GV2 : ").append(self.getGroupsV2Capability()).append("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -60,6 +60,7 @@ public class SubmitDebugLogRepository {
|
|||||||
}
|
}
|
||||||
add(new LogSectionPin());
|
add(new LogSectionPin());
|
||||||
add(new LogSectionThreads());
|
add(new LogSectionThreads());
|
||||||
|
add(new LogSectionCapabilities());
|
||||||
add(new LogSectionFeatureFlags());
|
add(new LogSectionFeatureFlags());
|
||||||
add(new LogSectionPermissions());
|
add(new LogSectionPermissions());
|
||||||
add(new LogSectionLogcat());
|
add(new LogSectionLogcat());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user