52 lines
2.2 KiB
Java
52 lines
2.2 KiB
Java
|
package com.discord.widgets.auth;
|
||
|
|
||
|
import android.content.Intent;
|
||
|
import android.net.Uri;
|
||
|
import com.discord.app.AppActivity;
|
||
|
import com.discord.app.AppLog;
|
||
|
import com.discord.restapi.RestAPIParams;
|
||
|
import com.discord.utilities.logging.Logger;
|
||
|
import d0.z.d.m;
|
||
|
import d0.z.d.o;
|
||
|
import kotlin.Unit;
|
||
|
import kotlin.jvm.functions.Function1;
|
||
|
/* compiled from: WidgetOauth2Authorize.kt */
|
||
|
public final class WidgetOauth2Authorize$authorizeApplication$2 extends o implements Function1<RestAPIParams.OAuth2Authorize.ResponsePost, Unit> {
|
||
|
public final /* synthetic */ WidgetOauth2Authorize this$0;
|
||
|
|
||
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
||
|
public WidgetOauth2Authorize$authorizeApplication$2(WidgetOauth2Authorize widgetOauth2Authorize) {
|
||
|
super(1);
|
||
|
this.this$0 = widgetOauth2Authorize;
|
||
|
}
|
||
|
|
||
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
||
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
||
|
@Override // kotlin.jvm.functions.Function1
|
||
|
public /* bridge */ /* synthetic */ Unit invoke(RestAPIParams.OAuth2Authorize.ResponsePost responsePost) {
|
||
|
invoke(responsePost);
|
||
|
return Unit.a;
|
||
|
}
|
||
|
|
||
|
public final void invoke(RestAPIParams.OAuth2Authorize.ResponsePost responsePost) {
|
||
|
m.checkNotNullParameter(responsePost, "it");
|
||
|
Uri parse = Uri.parse(responsePost.getLocation());
|
||
|
AppLog appLog = AppLog.g;
|
||
|
Logger.d$default(appLog, "Redirect OAuth flow to: " + parse, null, 2, null);
|
||
|
Intent addFlags = new Intent("android.intent.action.VIEW", parse).addFlags(268435456);
|
||
|
m.checkNotNullExpressionValue(addFlags, "Intent(Intent.ACTION_VIE…t.FLAG_ACTIVITY_NEW_TASK)");
|
||
|
AppActivity appActivity = this.this$0.getAppActivity();
|
||
|
if (appActivity != null) {
|
||
|
appActivity.startActivity(addFlags);
|
||
|
}
|
||
|
AppActivity appActivity2 = this.this$0.getAppActivity();
|
||
|
if (appActivity2 != null) {
|
||
|
appActivity2.setResult(-1);
|
||
|
}
|
||
|
AppActivity appActivity3 = this.this$0.getAppActivity();
|
||
|
if (appActivity3 != null) {
|
||
|
appActivity3.onBackPressed();
|
||
|
}
|
||
|
}
|
||
|
}
|