Picsart v24.6版本的 MD5 值为:21a61631d94e54da68d2ad9268b8b9d9

以下内容为反编译后的 OAuthServiceImpl.java 源代码,内容仅作参考


package com.picsart.jedi.auth.thirdparty.impl;

import androidx.recyclerview.widget.RecyclerView;
import com.google.gson.Gson;
import com.picsart.jedi.auth.thirdparty.model.OauthRequest;
import com.picsart.jedi.auth.thirdparty.model.OauthResponse;
import java.util.UUID;
import kotlin.Result;
import kotlin.coroutines.intrinsics.CoroutineSingletons;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.b;
import kotlinx.coroutines.c;
import myobfuscated.b11.a;
import myobfuscated.ik2.i;
import okhttp3.h;
import org.jetbrains.annotations.NotNull;
public final class OAuthServiceImpl implements a {
    @NotNull
    public final myobfuscated.zg1.a a;
    @NotNull
    public final Gson b;
    @NotNull
    public final c c;

    public OAuthServiceImpl(@NotNull myobfuscated.zg1.a sharedPreferences, @NotNull Gson gson, @NotNull c dispatcher) {
        Intrinsics.checkNotNullParameter(sharedPreferences, "sharedPreferences");
        Intrinsics.checkNotNullParameter(gson, "gson");
        Intrinsics.checkNotNullParameter(dispatcher, "dispatcher");
        this.a = sharedPreferences;
        this.b = gson;
        this.c = dispatcher;
    }

    @Override
    public final Object a(@NotNull h hVar, @NotNull myobfuscated.mk2.c<? super Result<OauthResponse>> cVar) {
        OAuthServiceImpl$handleAuthCallBack$1 oAuthServiceImpl$handleAuthCallBack$1;
        int i;
        if (cVar instanceof OAuthServiceImpl$handleAuthCallBack$1) {
            oAuthServiceImpl$handleAuthCallBack$1 = (OAuthServiceImpl$handleAuthCallBack$1) cVar;
            int i2 = oAuthServiceImpl$handleAuthCallBack$1.label;
            if ((i2 & RecyclerView.UNDEFINED_DURATION) != 0) {
                oAuthServiceImpl$handleAuthCallBack$1.label = i2 - RecyclerView.UNDEFINED_DURATION;
                Object obj = oAuthServiceImpl$handleAuthCallBack$1.result;
                CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                i = oAuthServiceImpl$handleAuthCallBack$1.label;
                if (i != 0) {
                    i.b(obj);
                    OAuthServiceImpl$handleAuthCallBack$2 oAuthServiceImpl$handleAuthCallBack$2 = new OAuthServiceImpl$handleAuthCallBack$2(this, hVar, null);
                    oAuthServiceImpl$handleAuthCallBack$1.label = 1;
                    obj = b.f(this.c, oAuthServiceImpl$handleAuthCallBack$2, oAuthServiceImpl$handleAuthCallBack$1);
                    if (obj == coroutineSingletons) {
                        return coroutineSingletons;
                    }
                } else if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                } else {
                    i.b(obj);
                }
                return ((Result) obj).m295unboximpl();
            }
        }
        oAuthServiceImpl$handleAuthCallBack$1 = new OAuthServiceImpl$handleAuthCallBack$1(this, cVar);
        Object obj2 = oAuthServiceImpl$handleAuthCallBack$1.result;
        CoroutineSingletons coroutineSingletons2 = CoroutineSingletons.COROUTINE_SUSPENDED;
        i = oAuthServiceImpl$handleAuthCallBack$1.label;
        if (i != 0) {
        }
        return ((Result) obj2).m295unboximpl();
    }

    @Override
    public final Object b(@NotNull OauthRequest oauthRequest) {
        myobfuscated.zg1.a aVar = this.a;
        try {
            Result.a aVar2 = Result.Companion;
            String d = oauthRequest.d();
            if (d == null) {
                d = UUID.randomUUID().toString();
                Intrinsics.checkNotNullExpressionValue(d, "toString(...)");
            }
            aVar.a(this.b.toJson(oauthRequest), myobfuscated.uj2.a.REQUEST_KEY_EXTRA);
            aVar.a(d, "session_id");
            aVar.a("https://picsart.com/mini_app/auth/callback", "key.redirect.url");
            String e = oauthRequest.e();
            Intrinsics.checkNotNullParameter(e, "<this>");
            h.a aVar3 = new h.a();
            aVar3.e(null, e);
            h.a f = aVar3.b().f();
            f.a(oauthRequest.b(), d);
            f.a(oauthRequest.c(), "https://picsart.com/mini_app/auth/callback");
            return Result.m287constructorimpl(f.b());
        } catch (Throwable th) {
            Result.a aVar4 = Result.Companion;
            return Result.m287constructorimpl(i.a(th));
        }
    }

    public final boolean c(h hVar, String str) {
        String h = hVar.h(str);
        if (h != null) {
            myobfuscated.zg1.a aVar = this.a;
            Object b = aVar.b("", "session_id");
            aVar.c("session_id");
            String str2 = (String) b;
            return str2.length() > 0 && h.length() > 0 && Intrinsics.c(str2, h);
        }
        throw new IllegalArgumentException("uri is not valid");
    }
}