Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
package com.amazonaws.util;
import com.amazonaws.internal.config.HostRegexToRegionMapping;
import com.amazonaws.internal.config.InternalConfig;
import java.net.URI;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/* loaded from: classes.dex */
public abstract class AwsHostNameUtils {
public static final Pattern S3_ENDPOINT_PATTERN = Pattern.compile("^(?:.+\\.)?s3[.-]([a-z0-9-]+)$");
public static String parseRegionName(String str, String str2) {
if (str == null) {
throw new IllegalArgumentException("hostname cannot be null");
}
String parseRegionNameByInternalConfig = parseRegionNameByInternalConfig(str);
if (parseRegionNameByInternalConfig != null) {
return parseRegionNameByInternalConfig;
}
if (str.endsWith(".amazonaws.com")) {
return parseStandardRegionName(str.substring(0, str.length() - 14));
}
if (str.endsWith(".amazonaws.com.cn")) {
return parseStandardRegionName(str.substring(0, str.length() - 17));
}
if (str2 == null) {
return "us-east-1";
}
Matcher matcher = Pattern.compile("^(?:.+\\.)?" + Pattern.quote(str2) + "[.-]([a-z0-9-]+)\\.").matcher(str);
return matcher.find() ? matcher.group(1) : "us-east-1";
}
public static String parseStandardRegionName(String str) {
Matcher matcher = S3_ENDPOINT_PATTERN.matcher(str);
if (matcher.matches()) {
return matcher.group(1);
}
int lastIndexOf = str.lastIndexOf(46);
if (lastIndexOf == -1) {
return "us-east-1";
}
String substring = str.substring(lastIndexOf + 1);
if (substring.equals("vpce")) {
String[] split = str.split("\\.");
if (split.length < 2) {
return "us-east-1";
}
substring = split[split.length - 2];
}
return "us-gov".equals(substring) ? "us-gov-west-1" : substring;
}
public static String parseRegionNameByInternalConfig(String str) {
for (HostRegexToRegionMapping hostRegexToRegionMapping : InternalConfig.Factory.getInternalConfig().getHostRegexToRegionMappings()) {
if (str.matches(hostRegexToRegionMapping.getHostNameRegex())) {
return hostRegexToRegionMapping.getRegionName();
}
}
return null;
}
public static String parseServiceName(URI uri) {
String host = uri.getHost();
if (!host.endsWith(".amazonaws.com")) {
throw new IllegalArgumentException("Cannot parse a service name from an unrecognized endpoint (" + host + ").");
}
String substring = host.substring(0, host.indexOf(".amazonaws.com"));
return (substring.endsWith(".s3") || S3_ENDPOINT_PATTERN.matcher(substring).matches()) ? "s3" : substring.indexOf(46) == -1 ? substring : substring.substring(0, substring.indexOf(46));
}
}