导航菜单

页面标题

页面副标题

klikUMKM v2.0.1 - h0.java 源代码

正在查看: klikUMKM v2.0.1 应用的 h0.java JAVA 源代码文件

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


package com.yx.credit.indonesia.ui.camera;

import android.graphics.Bitmap;
import android.util.Base64;
import android.util.Log;
import com.yx.credit.base.entity.NetResponse;
import com.yx.credit.indonesia.http.entity.IdentityOcr;
import java.io.ByteArrayOutputStream;
import java.util.Arrays;
import java.util.Map;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Ref;
import kotlin.jvm.internal.StringCompanionObject;
import kotlinx.coroutines.q0;
import qb.p0;

public final class h0 extends ub.i implements Function2 {
    final Bitmap $bitmap;
    final Function1<IdentityOcr, Unit> $function;
    Object L$0;
    int label;
    final i0 this$0;

    public static final class a extends ub.i implements Function2 {
        final Bitmap $bitmap;
        final Ref.ObjectRef<NetResponse<IdentityOcr>> $response;
        Object L$0;
        int label;
        final i0 this$0;

        public a(Ref.ObjectRef<NetResponse<IdentityOcr>> objectRef, i0 i0Var, Bitmap bitmap, tb.a aVar) {
            super(2, aVar);
            this.$response = objectRef;
            this.this$0 = i0Var;
            this.$bitmap = bitmap;
        }

        @Override
        public final tb.a create(Object obj, tb.a aVar) {
            return new a(this.$response, this.this$0, this.$bitmap, aVar);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Ref.ObjectRef<NetResponse<IdentityOcr>> objectRef;
            T t9;
            kotlin.coroutines.intrinsics.a aVar = kotlin.coroutines.intrinsics.a.COROUTINE_SUSPENDED;
            int i10 = this.label;
            if (i10 == 0) {
                pb.r.b(obj);
                Ref.ObjectRef<NetResponse<IdentityOcr>> objectRef2 = this.$response;
                com.yx.credit.base.net.g gVar = com.yx.credit.base.net.g.a;
                i0 i0Var = this.this$0;
                Bitmap bitmap = this.$bitmap;
                i0Var.getClass();
                Intrinsics.checkNotNullParameter(bitmap, "bitmap");
                Intrinsics.checkNotNullParameter(bitmap, "bitmap");
                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                int i11 = 100;
                bitmap.compress(Bitmap.CompressFormat.JPEG, 100, byteArrayOutputStream);
                while (byteArrayOutputStream.size() > 1024000) {
                    i11 = i11 >= 15 ? i11 - 5 : i11 - 1;
                    byteArrayOutputStream.reset();
                    bitmap.compress(Bitmap.CompressFormat.JPEG, i11, byteArrayOutputStream);
                }
                byteArrayOutputStream.size();
                Log.d("Logger", "get is debug value false");
                byte[] byteArray = byteArrayOutputStream.toByteArray();
                Intrinsics.checkNotNullExpressionValue(byteArray, "toByteArray(...)");
                String encodeToString = Base64.encodeToString(byteArray, 0);
                StringCompanionObject stringCompanionObject = StringCompanionObject.INSTANCE;
                String format = String.format("%s%s", Arrays.copyOf(new Object[]{"data:image/jpeg;base64,", encodeToString}, 2));
                Intrinsics.checkNotNullExpressionValue(format, "format(...)");
                Map b3 = p0.b(new Pair("imgBase64", format));
                this.L$0 = objectRef2;
                this.label = 1;
                Object a = gVar.a("https://api.klikumkm.co.id/api/indo/identity/ocr", b3, IdentityOcr.class, true, this);
                if (a == aVar) {
                    return aVar;
                }
                objectRef = objectRef2;
                t9 = a;
            } else {
                if (i10 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                objectRef = (Ref.ObjectRef) this.L$0;
                pb.r.b(obj);
                t9 = obj;
            }
            objectRef.element = t9;
            return Unit.a;
        }

        @Override
        public final Object invoke(kotlinx.coroutines.b0 b0Var, tb.a aVar) {
            return ((a) create(b0Var, aVar)).invokeSuspend(Unit.a);
        }
    }

    public h0(i0 i0Var, Bitmap bitmap, Function1<? super IdentityOcr, Unit> function1, tb.a aVar) {
        super(2, aVar);
        this.this$0 = i0Var;
        this.$bitmap = bitmap;
        this.$function = function1;
    }

    @Override
    public final tb.a create(Object obj, tb.a aVar) {
        return new h0(this.this$0, this.$bitmap, this.$function, aVar);
    }

    @Override
    public final Object invokeSuspend(Object obj) {
        Ref.ObjectRef objectRef;
        IdentityOcr identityOcr;
        kotlin.coroutines.intrinsics.a aVar = kotlin.coroutines.intrinsics.a.COROUTINE_SUSPENDED;
        int i10 = this.label;
        if (i10 == 0) {
            pb.r.b(obj);
            androidx.camera.core.impl.utils.b bVar = this.this$0.f7342b;
            if (bVar != null) {
                bVar.onChanged(Boolean.TRUE);
            }
            Ref.ObjectRef objectRef2 = new Ref.ObjectRef();
            mc.e eVar = q0.f9859c;
            a aVar2 = new a(objectRef2, this.this$0, this.$bitmap, null);
            this.L$0 = objectRef2;
            this.label = 1;
            if (kotlinx.coroutines.f0.t(eVar, aVar2, this) == aVar) {
                return aVar;
            }
            objectRef = objectRef2;
        } else {
            if (i10 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            objectRef = (Ref.ObjectRef) this.L$0;
            pb.r.b(obj);
        }
        if (((NetResponse) objectRef.element).isSuccess() && (identityOcr = (IdentityOcr) ((NetResponse) objectRef.element).getData()) != null) {
            this.$function.invoke(identityOcr);
        }
        androidx.camera.core.impl.utils.b bVar2 = this.this$0.f7342b;
        if (bVar2 != null) {
            bVar2.onChanged(Boolean.FALSE);
        }
        return Unit.a;
    }

    @Override
    public final Object invoke(kotlinx.coroutines.b0 b0Var, tb.a aVar) {
        return ((h0) create(b0Var, aVar)).invokeSuspend(Unit.a);
    }
}