103 lines
3.9 KiB
Java
103 lines
3.9 KiB
Java
|
package o;
|
||
|
|
||
|
import com.airbnb.deeplinkdispatch.UrlTreeKt;
|
||
|
import com.isprint.e2eea.client.util.E2EEAException;
|
||
|
import java.util.regex.Pattern;
|
||
|
|
||
|
/* renamed from: o.SPr, reason: case insensitive filesystem */
|
||
|
/* loaded from: classes3.dex */
|
||
|
public final class C0946SPr {
|
||
|
boolean a;
|
||
|
boolean b;
|
||
|
int c;
|
||
|
boolean d;
|
||
|
Pattern e;
|
||
|
int f;
|
||
|
int g;
|
||
|
int h;
|
||
|
int i;
|
||
|
int j;
|
||
|
int k;
|
||
|
private int l;
|
||
|
private String m;
|
||
|
int n;
|
||
|
|
||
|
/* renamed from: o, reason: collision with root package name */
|
||
|
int f8361o;
|
||
|
|
||
|
public C0946SPr(String str) {
|
||
|
String a = Ymn.a(Ymn.b(str));
|
||
|
if (!a.startsWith(UrlTreeKt.componentParamPrefix) && !a.endsWith(UrlTreeKt.componentParamSuffix)) {
|
||
|
throw new E2EEAException.OtherError("Invalid password quality policy.");
|
||
|
}
|
||
|
String concat = a.substring(1).substring(0, a.length() - 2).concat(",");
|
||
|
int i = -1;
|
||
|
while (true) {
|
||
|
int i2 = i + 1;
|
||
|
int indexOf = concat.indexOf(",", i2);
|
||
|
if (indexOf != -1) {
|
||
|
String[] split = concat.substring(i2, indexOf).split(":");
|
||
|
if (split.length != 2) {
|
||
|
throw new E2EEAException.OtherError("Invalid Password Quality Policy, col=".concat(String.valueOf(i)));
|
||
|
}
|
||
|
String str2 = split[0];
|
||
|
String str3 = split[1];
|
||
|
this.j = 3;
|
||
|
this.c = 2;
|
||
|
if (a(str2, "passwordMaxLength")) {
|
||
|
this.f = Integer.valueOf(str3).intValue();
|
||
|
} else if (a(str2, "passwordMinLength")) {
|
||
|
this.k = Integer.valueOf(str3).intValue();
|
||
|
} else if (a(str2, "passwordMinNumeric")) {
|
||
|
this.f8361o = Integer.valueOf(str3).intValue();
|
||
|
} else if (a(str2, "passwordMinUpper")) {
|
||
|
this.n = Integer.valueOf(str3).intValue();
|
||
|
} else if (a(str2, "passwordMinLower")) {
|
||
|
this.h = Integer.valueOf(str3).intValue();
|
||
|
} else if (a(str2, "passwordConsecutiveCharacterLength")) {
|
||
|
this.l = Integer.valueOf(str3).intValue();
|
||
|
} else if (a(str2, "passwordFirstCharChecking")) {
|
||
|
this.j = Integer.valueOf(str3).intValue();
|
||
|
} else if (a(str2, "passwordMinAlphabet")) {
|
||
|
this.g = Integer.valueOf(str3).intValue();
|
||
|
} else if (a(str2, "passwordAllowSequenceChar")) {
|
||
|
this.d = Boolean.valueOf(str3).booleanValue();
|
||
|
} else if (a(str2, "passwordAllowSequenceAlpha")) {
|
||
|
this.a = Boolean.valueOf(str3).booleanValue();
|
||
|
} else if (a(str2, "passwordAllowSequenceNumeric")) {
|
||
|
this.b = Boolean.valueOf(str3).booleanValue();
|
||
|
} else if (a(str2, "passwordAllowSameAsUserId")) {
|
||
|
this.c = Integer.valueOf(str3).intValue();
|
||
|
} else if (a(str2, "maxSequenceChars")) {
|
||
|
this.i = Integer.valueOf(str3).intValue();
|
||
|
}
|
||
|
i = indexOf;
|
||
|
} else {
|
||
|
if (this.l <= 0) {
|
||
|
this.l = this.f;
|
||
|
}
|
||
|
StringBuilder sb = new StringBuilder("^.*(.)\\1{");
|
||
|
sb.append(this.l);
|
||
|
sb.append(",}.*$");
|
||
|
String obj = sb.toString();
|
||
|
this.m = obj;
|
||
|
this.e = Pattern.compile(obj);
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private static boolean a(String str, String str2) {
|
||
|
if (!str.trim().equals(str2)) {
|
||
|
String trim = str.trim();
|
||
|
StringBuilder sb = new StringBuilder("\"");
|
||
|
sb.append(str2);
|
||
|
sb.append("\"");
|
||
|
if (!trim.equals(sb.toString())) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
}
|