2021-07-24 02:37:17 +00:00
|
|
|
package com.discord.views;
|
|
|
|
|
|
|
|
import android.widget.TextView;
|
|
|
|
import c.a.i.o0;
|
|
|
|
import com.discord.api.auth.OAuthScope;
|
|
|
|
import com.discord.utilities.views.SimpleRecyclerAdapter;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import kotlin.NoWhenBranchMatchedException;
|
|
|
|
/* compiled from: OAuthPermissionViews.kt */
|
|
|
|
public final class OAuthPermissionViews {
|
|
|
|
|
|
|
|
/* compiled from: OAuthPermissionViews.kt */
|
|
|
|
public static final class InvalidScopeException extends IllegalArgumentException {
|
|
|
|
private final String scope;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public InvalidScopeException(String str) {
|
|
|
|
super("invalid scope: " + str);
|
|
|
|
m.checkNotNullParameter(str, "scope");
|
|
|
|
this.scope = str;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String a() {
|
|
|
|
return this.scope;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: OAuthPermissionViews.kt */
|
|
|
|
public static final class a extends SimpleRecyclerAdapter.ViewHolder<OAuthScope> {
|
|
|
|
public final o0 a;
|
|
|
|
|
|
|
|
/* JADX WARNING: Illegal instructions before constructor call */
|
|
|
|
public a(o0 o0Var) {
|
|
|
|
super(r0);
|
|
|
|
m.checkNotNullParameter(o0Var, "binding");
|
|
|
|
TextView textView = o0Var.a;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.root");
|
|
|
|
this.a = o0Var;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
|
|
|
@Override // com.discord.utilities.views.SimpleRecyclerAdapter.ViewHolder
|
|
|
|
public void bind(OAuthScope oAuthScope) {
|
|
|
|
OAuthScope oAuthScope2 = oAuthScope;
|
|
|
|
m.checkNotNullParameter(oAuthScope2, "data");
|
|
|
|
TextView textView = this.a.a;
|
|
|
|
m.checkNotNullExpressionValue(textView, "binding.root");
|
|
|
|
OAuthPermissionViews.a(textView, oAuthScope2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final void a(TextView textView, OAuthScope oAuthScope) throws InvalidScopeException {
|
|
|
|
int i;
|
|
|
|
m.checkNotNullParameter(textView, "$this$setScopePermissionText");
|
|
|
|
m.checkNotNullParameter(oAuthScope, "scope");
|
|
|
|
if (m.areEqual(oAuthScope, OAuthScope.Identify.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893256;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Email.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893248;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Connections.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893246;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Guilds.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893252;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.GuildsJoin.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893254;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.GdmJoin.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893250;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Bot.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893243;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.WebhookIncoming.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893270;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Rpc.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893261;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RpcNotificationsRead.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893264;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RpcVoiceRead.INSTANCE)) {
|
2021-07-27 00:35:07 +00:00
|
|
|
i = 2131893266;
|
2021-07-28 07:39:21 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RpcVoiceWrite.INSTANCE)) {
|
|
|
|
i = 2131893267;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RpcActivitiesWrite.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893262;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.MessagesRead.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893257;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsBuildsUpload.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893233;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsBuildsRead.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893231;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsCommands.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893235;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsCommandsUpdate.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893237;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsStoreUpdate.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893241;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsEntitlements.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893239;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ActivitiesRead.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893227;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ActivitiesWrite.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893229;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RelationshipsRead.INSTANCE)) {
|
2021-07-28 07:39:21 +00:00
|
|
|
i = 2131893259;
|
2021-07-24 02:37:17 +00:00
|
|
|
} else if (oAuthScope instanceof OAuthScope.Invalid) {
|
|
|
|
throw new InvalidScopeException(((OAuthScope.Invalid) oAuthScope).b());
|
|
|
|
} else {
|
|
|
|
throw new NoWhenBranchMatchedException();
|
|
|
|
}
|
|
|
|
textView.setText(i);
|
|
|
|
}
|
|
|
|
}
|