导航菜单

页面标题

页面副标题

CallApp v2.226 - Principal.java 源代码

正在查看: CallApp v2.226 应用的 Principal.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.amazonaws.auth.policy;

import androidx.fragment.app.n;

public class Principal {

    public static final Principal f7074c;

    public final String f7075a;

    public final String f7076b;

    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) {
            if (str == null) {
                return null;
            }
            for (Services services : values()) {
                if (services.getServiceId().equalsIgnoreCase(str)) {
                    return services;
                }
            }
            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) {
            if (str == null) {
                return null;
            }
            for (WebIdentityProviders webIdentityProviders : values()) {
                if (webIdentityProviders.getWebIdentityProvider().equalsIgnoreCase(str)) {
                    return webIdentityProviders;
                }
            }
            return null;
        }

        public String getWebIdentityProvider() {
            return this.webIdentityProvider;
        }
    }

    static {
        new Principal("AWS", "*");
        new Principal("Service", "*");
        new Principal("Federated", "*");
        f7074c = new Principal("*", "*");
    }

    public Principal(Services services) {
        if (services == null) {
            throw new IllegalArgumentException("Null AWS service name specified");
        }
        this.f7075a = services.getServiceId();
        this.f7076b = "Service";
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || !(obj instanceof Principal)) {
            return false;
        }
        Principal principal = (Principal) obj;
        return this.f7076b.equals(principal.f7076b) && this.f7075a.equals(principal.f7075a);
    }

    public final int hashCode() {
        return this.f7075a.hashCode() + n.c(31, 31, this.f7076b);
    }

    public Principal(String str, String str2) {
        this.f7076b = str;
        this.f7075a = "AWS".equals(str) ? str2.replaceAll("-", "") : str2;
    }

    public Principal(String str) {
        if (str != null) {
            this.f7075a = str.replaceAll("-", "");
            this.f7076b = "AWS";
            return;
        }
        throw new IllegalArgumentException("Null AWS account ID specified");
    }

    public Principal(WebIdentityProviders webIdentityProviders) {
        if (webIdentityProviders != null) {
            this.f7075a = webIdentityProviders.getWebIdentityProvider();
            this.f7076b = "Federated";
            return;
        }
        throw new IllegalArgumentException("Null web identity provider specified");
    }
}