- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
34 lines
1.2 KiB
Java
34 lines
1.2 KiB
Java
package com.helpshift.util;
|
|
|
|
import com.helpshift.HelpshiftInstallException;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.regex.Pattern;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public abstract class SchemaUtil {
|
|
public static final Pattern platformPattern = Pattern.compile("^[\\p{L}\\p{N}-]+_platform_\\d{17}-[0-9a-z]{15}$");
|
|
|
|
public static boolean validatePlatformId(String str) {
|
|
return Utils.isNotEmpty(str) && platformPattern.matcher(str).matches();
|
|
}
|
|
|
|
public static boolean validateDomainName(String str) {
|
|
if (Utils.isEmpty(str)) {
|
|
return false;
|
|
}
|
|
List asList = Arrays.asList(str.trim().split("\\."));
|
|
return asList.size() >= 3 && !asList.contains("");
|
|
}
|
|
|
|
public static boolean validateInstallCredentials(String str, String str2) {
|
|
if (!validateDomainName(str)) {
|
|
throw new HelpshiftInstallException("The domain name used in the Helpshift.install() is not valid!");
|
|
}
|
|
if (validatePlatformId(str2)) {
|
|
return true;
|
|
}
|
|
throw new HelpshiftInstallException("The platform id used in the Helpshift.install() is not valid!");
|
|
}
|
|
}
|