导航菜单

页面标题

页面副标题

Glean v1.1.34 - SensorAsyncTask$sendToCalibrate$1.java 源代码

正在查看: Glean v1.1.34 应用的 SensorAsyncTask$sendToCalibrate$1.java JAVA 源代码文件

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


package co.tryterra.terra.fsl;

import co.tryterra.terra.HTTPRequestClient;
import co.tryterra.terra.fsl.models.CalibratedData;
import co.tryterra.terra.fsl.models.CalibrationData;
import com.google.gson.Gson;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.ResultKt;
import kotlin.TuplesKt;
import kotlin.Unit;
import kotlin.collections.MapsKt;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.CoroutineScope;

@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\u008a@"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;"}, k = 3, mv = {1, 7, 1}, xi = 48)
@DebugMetadata(c = "co.tryterra.terra.fsl.SensorAsyncTask$sendToCalibrate$1", f = "SensorAsyncTask.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
final class SensorAsyncTask$sendToCalibrate$1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
    final Function1<CalibratedData, Unit> $completion;
    final CalibrationData $data;
    final String $devId;
    int label;
    final SensorAsyncTask this$0;

    SensorAsyncTask$sendToCalibrate$1(String str, SensorAsyncTask sensorAsyncTask, CalibrationData calibrationData, Function1<? super CalibratedData, Unit> function1, Continuation<? super SensorAsyncTask$sendToCalibrate$1> continuation) {
        super(2, continuation);
        this.$devId = str;
        this.this$0 = sensorAsyncTask;
        this.$data = calibrationData;
        this.$completion = function1;
    }

    public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
        return new SensorAsyncTask$sendToCalibrate$1(this.$devId, this.this$0, this.$data, this.$completion, continuation);
    }

    public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
        return create(coroutineScope, continuation).invokeSuspend(Unit.INSTANCE);
    }

    public final Object invokeSuspend(Object obj) {
        Gson gson;
        IntrinsicsKt.getCOROUTINE_SUSPENDED();
        if (this.label != 0) {
            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
        }
        ResultKt.throwOnFailure(obj);
        HTTPRequestClient.Builder withInput = new HTTPRequestClient.Builder().setUrl("https://api.tryterra.co/v2/calibrate").method("POST").setHeaders1(MapsKt.hashMapOf(new Pair[]{TuplesKt.to("dev-id", this.$devId)})).withInput(CalibratedData.class);
        SensorAsyncTask sensorAsyncTask = this.this$0;
        gson = sensorAsyncTask.gson;
        String json = gson.toJson(this.$data);
        Intrinsics.checkNotNullExpressionValue(json, "gson.toJson(data)");
        String encrypt$TerraAndroid_release = sensorAsyncTask.encrypt$TerraAndroid_release(json);
        if (encrypt$TerraAndroid_release == null) {
            encrypt$TerraAndroid_release = "Failed to Encrypt";
        }
        HTTPRequestClient build = withInput.withOutput(encrypt$TerraAndroid_release).build();
        final Function1<CalibratedData, Unit> function1 = this.$completion;
        build.getResponseFromRequest(new Function1<Object, Unit>() {
            {
                super(1);
            }

            public Object invoke(Object obj2) {
                m500invoke(obj2);
                return Unit.INSTANCE;
            }

            public final void m500invoke(Object obj2) {
                function1.invoke(obj2 instanceof CalibratedData ? (CalibratedData) obj2 : null);
            }
        });
        return Unit.INSTANCE;
    }
}