mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-27 00:03:22 +01:00
96 lines
3.2 KiB
Java
96 lines
3.2 KiB
Java
package org.apache.http.auth;
|
|
|
|
import com.amazon.alexa.ra.core.ui.markdown.parser.formatter.MarkdownConstants;
|
|
import defpackage.a$$ExternalSyntheticOutline0;
|
|
import java.io.Serializable;
|
|
import java.security.Principal;
|
|
import java.util.Locale;
|
|
import org.apache.http.annotation.Contract;
|
|
import org.apache.http.annotation.ThreadingBehavior;
|
|
import org.apache.http.util.Args;
|
|
import org.apache.http.util.LangUtils;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Contract(threading = ThreadingBehavior.IMMUTABLE)
|
|
/* loaded from: classes11.dex */
|
|
public class NTCredentials implements Credentials, Serializable {
|
|
private static final long serialVersionUID = -7385699315228907265L;
|
|
private final String password;
|
|
private final NTUserPrincipal principal;
|
|
private final String workstation;
|
|
|
|
@Deprecated
|
|
public NTCredentials(String str) {
|
|
Args.notNull(str, "Username:password string");
|
|
int indexOf = str.indexOf(58);
|
|
if (indexOf >= 0) {
|
|
String substring = str.substring(0, indexOf);
|
|
this.password = str.substring(indexOf + 1);
|
|
str = substring;
|
|
} else {
|
|
this.password = null;
|
|
}
|
|
int indexOf2 = str.indexOf(47);
|
|
if (indexOf2 >= 0) {
|
|
this.principal = new NTUserPrincipal(str.substring(0, indexOf2).toUpperCase(Locale.ROOT), str.substring(indexOf2 + 1));
|
|
} else {
|
|
this.principal = new NTUserPrincipal(null, str.substring(indexOf2 + 1));
|
|
}
|
|
this.workstation = null;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof NTCredentials)) {
|
|
return false;
|
|
}
|
|
NTCredentials nTCredentials = (NTCredentials) obj;
|
|
return LangUtils.equals(this.principal, nTCredentials.principal) && LangUtils.equals(this.workstation, nTCredentials.workstation);
|
|
}
|
|
|
|
public String getDomain() {
|
|
return this.principal.getDomain();
|
|
}
|
|
|
|
@Override // org.apache.http.auth.Credentials
|
|
public String getPassword() {
|
|
return this.password;
|
|
}
|
|
|
|
public String getUserName() {
|
|
return this.principal.getUsername();
|
|
}
|
|
|
|
@Override // org.apache.http.auth.Credentials
|
|
public Principal getUserPrincipal() {
|
|
return this.principal;
|
|
}
|
|
|
|
public String getWorkstation() {
|
|
return this.workstation;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return LangUtils.hashCode(LangUtils.hashCode(17, this.principal), this.workstation);
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder("[principal: ");
|
|
sb.append(this.principal);
|
|
sb.append("][workstation: ");
|
|
return a$$ExternalSyntheticOutline0.m(sb, this.workstation, MarkdownConstants.RIGHT_BRACKET);
|
|
}
|
|
|
|
public NTCredentials(String str, String str2, String str3, String str4) {
|
|
Args.notNull(str, "User name");
|
|
this.principal = new NTUserPrincipal(str4, str);
|
|
this.password = str2;
|
|
if (str3 != null) {
|
|
this.workstation = str3.toUpperCase(Locale.ROOT);
|
|
} else {
|
|
this.workstation = null;
|
|
}
|
|
}
|
|
}
|