TopTV v3.0.1版本的 MD5 值为:0fc1b9ce94885bc92edd11a6ee3e5932
以下内容为反编译后的 Principal.java 源代码,内容仅作参考
package com.amazonaws.auth.policy;
import me.zhanghai.android.materialprogressbar.BuildConfig;
public class Principal {
private final String id;
private final String provider;
public static final Principal AllUsers = new Principal("AWS", "*");
public static final Principal AllServices = new Principal("Service", "*");
public static final Principal AllWebProviders = new Principal("Federated", "*");
public static final Principal All = new Principal("*", "*");
public enum Services {
AWSDataPipeline("datapipeline.amazonaws.com"),
AmazonElasticTranscoder("elastictranscoder.amazonaws.com"),
AmazonEC2("ec2.amazonaws.com"),
AWSOpsWorks("opsworks.amazonaws.com"),
AWSCloudHSM("cloudhsm.amazonaws.com"),
AllServices("*");
private String serviceId;
Services(String str) {
this.serviceId = str;
}
public static Services fromString(String str) {
Services[] values;
if (str != null) {
for (Services services : values()) {
if (services.getServiceId().equalsIgnoreCase(str)) {
return services;
}
}
return null;
}
return null;
}
public String getServiceId() {
return this.serviceId;
}
}
public enum WebIdentityProviders {
Facebook("graph.facebook.com"),
Google("accounts.google.com"),
Amazon("www.amazon.com"),
AllProviders("*");
private String webIdentityProvider;
WebIdentityProviders(String str) {
this.webIdentityProvider = str;
}
public static WebIdentityProviders fromString(String str) {
WebIdentityProviders[] values;
if (str != null) {
for (WebIdentityProviders webIdentityProviders : values()) {
if (webIdentityProviders.getWebIdentityProvider().equalsIgnoreCase(str)) {
return webIdentityProviders;
}
}
return null;
}
return null;
}
public String getWebIdentityProvider() {
return this.webIdentityProvider;
}
}
public Principal(Services services) {
if (services == null) {
throw new IllegalArgumentException("Null AWS service name specified");
}
this.id = services.getServiceId();
this.provider = "Service";
}
public Principal(WebIdentityProviders webIdentityProviders) {
if (webIdentityProviders == null) {
throw new IllegalArgumentException("Null web identity provider specified");
}
this.id = webIdentityProviders.getWebIdentityProvider();
this.provider = "Federated";
}
public Principal(String str) {
if (str == null) {
throw new IllegalArgumentException("Null AWS account ID specified");
}
this.id = str.replaceAll("-", BuildConfig.FLAVOR);
this.provider = "AWS";
}
public Principal(String str, String str2) {
this.provider = str;
this.id = "AWS".equals(str) ? str2.replaceAll("-", BuildConfig.FLAVOR) : str2;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj != null && (obj instanceof Principal)) {
Principal principal = (Principal) obj;
return getProvider().equals(principal.getProvider()) && getId().equals(principal.getId());
}
return false;
}
public String getId() {
return this.id;
}
public String getProvider() {
return this.provider;
}
public int hashCode() {
return ((this.provider.hashCode() + 31) * 31) + this.id.hashCode();
}
}