mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-02-16 22:24:12 +00:00
Only allow setting PIN by master device
This commit is contained in:
parent
f4ed9a01b7
commit
80e15ad54e
@ -415,6 +415,9 @@ public class Manager implements Closeable {
|
||||
}
|
||||
|
||||
public void setRegistrationLockPin(Optional<String> pin) throws IOException, UnauthenticatedResponseException {
|
||||
if (!account.isMasterDevice()) {
|
||||
throw new RuntimeException("Only master device can set a PIN");
|
||||
}
|
||||
if (pin.isPresent()) {
|
||||
final MasterKey masterKey = account.getPinMasterKey() != null
|
||||
? account.getPinMasterKey()
|
||||
|
||||
@ -505,6 +505,10 @@ public class SignalAccount implements Closeable {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public boolean isMasterDevice() {
|
||||
return deviceId == SignalServiceAddress.DEFAULT_DEVICE_ID;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user