APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:造梦次元
版本号:1.1.73
包名称:com.ideaflow.zmcy

MD5 校验值:290b0e4cd89c7a20355df0a13ec24559

反编译源代码说明

TurboSdk.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package com.ideaflow.zmcy.sdk;

import com.huawei.hms.push.constant.RemoteMessageConst;
import com.ideaflow.zmcy.App;
import com.ideaflow.zmcy.common.CommonApp;
import com.ideaflow.zmcy.entity.User;
import com.ideaflow.zmcy.mmkv.AppConfigMMKV;
import com.ideaflow.zmcy.mmkv.StatisticMMKV;
import com.ideaflow.zmcy.mmkv.UserConfigMMKV;
import com.ideaflow.zmcy.network.HttpKitKt;
import com.ideaflow.zmcy.statistic.AppLifecycleReporter;
import com.ideaflow.zmcy.statistic.StatisticDataHandler;
import com.ideaflow.zmcy.tools.BuildToolKitKt;
import com.jstudio.jkit.JsonKit;
import com.jstudio.jkit.LogKit;
import com.jstudio.jkit.SecurityKit;
import com.jstudio.jkit.TimeKit;
import com.umeng.analytics.pro.bm;
import java.util.HashMap;
import java.util.Locale;
import kotlin.Metadata;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import kotlinx.coroutines.Dispatchers;

@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0007\bÆ\u0002\u0018\u00002\u00020\u0001:\u0001\u0012B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0006\u0010\u000b\u001a\u00020\fJ\u0006\u0010\r\u001a\u00020\fJ$\u0010\u000e\u001a\u00020\f2\b\u0010\u000f\u001a\u0004\u0018\u00010\t2\n\b\u0002\u0010\u0010\u001a\u0004\u0018\u00010\tH\u0082@¢\u0006\u0002\u0010\u0011R\u001a\u0010\u0003\u001a\u00020\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0003\u0010\u0005\"\u0004\b\u0006\u0010\u0007R\u0016\u0010\b\u001a\n \n*\u0004\u0018\u00010\t0\tX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u0013"}, d2 = {"Lcom/ideaflow/zmcy/sdk/TurboSdk;", "", "()V", "isReadyForWakeupUpload", "", "()Z", "setReadyForWakeupUpload", "(Z)V", RemoteMessageConst.Notification.TAG, "", "kotlin.jvm.PlatformType", "config", "", "uploadDeviceInfo", "uploadTurboAttributionData", "oaid", "imei", "(Ljava/lang/String;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "AttributionReporter", "1.1.73-20240523_yybRelease"}, k = 1, mv = {1, 9, 0}, xi = 48)
public final class TurboSdk {
    private static boolean isReadyForWakeupUpload;
    public static final TurboSdk INSTANCE = new TurboSdk();
    private static String tag = "TurboSdk";

    public final boolean isReadyForWakeupUpload() {
        return isReadyForWakeupUpload;
    }

    public final void setReadyForWakeupUpload(boolean z) {
        isReadyForWakeupUpload = z;
    }

    private TurboSdk() {
    }

    public final void config() {
        ((App) CommonApp.INSTANCE.obtain()).runTask(Dispatchers.getDefault(), new TurboSdk$config$1(null));
    }

    public final void uploadDeviceInfo() {
        App.runTask$default((App) CommonApp.INSTANCE.obtain(), null, new TurboSdk$uploadDeviceInfo$1(null), 1, null);
    }

    public final Object uploadTurboAttributionData(String str, String str2, Continuation<? super Unit> continuation) {
        TurboSdk$uploadTurboAttributionData$1 turboSdk$uploadTurboAttributionData$1;
        int i;
        String str3;
        if (continuation instanceof TurboSdk$uploadTurboAttributionData$1) {
            turboSdk$uploadTurboAttributionData$1 = (TurboSdk$uploadTurboAttributionData$1) continuation;
            if ((turboSdk$uploadTurboAttributionData$1.label & Integer.MIN_VALUE) != 0) {
                turboSdk$uploadTurboAttributionData$1.label -= Integer.MIN_VALUE;
                Object obj = turboSdk$uploadTurboAttributionData$1.result;
                Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
                i = turboSdk$uploadTurboAttributionData$1.label;
                if (i != 0) {
                    ResultKt.throwOnFailure(obj);
                    HashMap hashMap = new HashMap();
                    User user = UserConfigMMKV.INSTANCE.getUser();
                    if (user != null) {
                        hashMap.put("user_id", user.getId());
                    }
                    String str4 = str;
                    if (str4 != null && str4.length() != 0) {
                        Intrinsics.checkNotNull(str);
                        String lowerCase = SecurityKit.toMD5$default(str, null, 1, null).toLowerCase(Locale.ROOT);
                        Intrinsics.checkNotNullExpressionValue(lowerCase, "toLowerCase(...)");
                        hashMap.put("oaid2", lowerCase);
                    } else {
                        String str5 = str2;
                        if (str5 != null && str5.length() != 0) {
                            Intrinsics.checkNotNull(str2);
                            String lowerCase2 = SecurityKit.toMD5$default(str2, null, 1, null).toLowerCase(Locale.ROOT);
                            Intrinsics.checkNotNullExpressionValue(lowerCase2, "toLowerCase(...)");
                            hashMap.put("imeiMD5", lowerCase2);
                        }
                    }
                    HashMap hashMap2 = hashMap;
                    String lowerCase3 = AppConfigMMKV.INSTANCE.getUniqueID().toLowerCase(Locale.ROOT);
                    Intrinsics.checkNotNullExpressionValue(lowerCase3, "toLowerCase(...)");
                    hashMap2.put("lifecycleid", lowerCase3);
                    hashMap2.put(bm.x, "Android");
                    hashMap2.put("pkg", BuildToolKitKt.getPkgString());
                    LogKit.Companion companion = LogKit.INSTANCE;
                    String tag2 = tag;
                    Intrinsics.checkNotNullExpressionValue(tag2, "tag");
                    companion.d(tag2, "launch params: " + JsonKit.parseToJson(hashMap));
                    if (BuildToolKitKt.isDebugBuild()) {
                        LogKit.Companion companion2 = LogKit.INSTANCE;
                        String tag3 = tag;
                        Intrinsics.checkNotNullExpressionValue(tag3, "tag");
                        companion2.e(tag3, "****** debug build, no need to upload turbo event statistic");
                        return Unit.INSTANCE;
                    }
                    byte[] compressJson = StatisticDataHandler.INSTANCE.compressJson(JsonKit.parseToJson(hashMap));
                    if (compressJson == null) {
                        return Unit.INSTANCE;
                    }
                    turboSdk$uploadTurboAttributionData$1.label = 1;
                    obj = HttpKitKt.postZipData("https://cystat.ideaflow.pro/push/zhitou_launch", compressJson, turboSdk$uploadTurboAttributionData$1);
                    if (obj == coroutine_suspended) {
                        return coroutine_suspended;
                    }
                } else {
                    if (i != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    ResultKt.throwOnFailure(obj);
                }
                str3 = (String) obj;
                if (str3 != null && StringsKt.contains$default((CharSequence) str3, (CharSequence) "success", false, 2, (Object) null)) {
                    LogKit.Companion companion3 = LogKit.INSTANCE;
                    String tag4 = tag;
                    Intrinsics.checkNotNullExpressionValue(tag4, "tag");
                    companion3.d(tag4, "****** upload turbo launch data success");
                }
                return Unit.INSTANCE;
            }
        }
        turboSdk$uploadTurboAttributionData$1 = new TurboSdk$uploadTurboAttributionData$1(this, continuation);
        Object obj2 = turboSdk$uploadTurboAttributionData$1.result;
        Object coroutine_suspended2 = IntrinsicsKt.getCOROUTINE_SUSPENDED();
        i = turboSdk$uploadTurboAttributionData$1.label;
        if (i != 0) {
        }
        str3 = (String) obj2;
        if (str3 != null) {
            LogKit.Companion companion32 = LogKit.INSTANCE;
            String tag42 = tag;
            Intrinsics.checkNotNullExpressionValue(tag42, "tag");
            companion32.d(tag42, "****** upload turbo launch data success");
        }
        return Unit.INSTANCE;
    }

    static Object uploadTurboAttributionData$default(TurboSdk turboSdk, String str, String str2, Continuation continuation, int i, Object obj) {
        if ((i & 2) != 0) {
            str2 = null;
        }
        return turboSdk.uploadTurboAttributionData(str, str2, continuation);
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u0003\u001a\u00020\u0004H\u0016J\b\u0010\u0005\u001a\u00020\u0004H\u0016¨\u0006\u0006"}, d2 = {"Lcom/ideaflow/zmcy/sdk/TurboSdk$AttributionReporter;", "Lcom/ideaflow/zmcy/statistic/AppLifecycleReporter;", "()V", "onSessionClosed", "", "onSessionStarted", "1.1.73-20240523_yybRelease"}, k = 1, mv = {1, 9, 0}, xi = 48)
    public static final class AttributionReporter implements AppLifecycleReporter {
        @Override
        public void onSessionStarted() {
            StatisticMMKV.INSTANCE.setBecomeActiveTime(System.currentTimeMillis());
            LogKit.Companion companion = LogKit.INSTANCE;
            String str = TurboSdk.tag;
            Intrinsics.checkNotNullExpressionValue(str, "access$getTag$p(...)");
            companion.d(str, "turbo: ready? " + TurboSdk.INSTANCE.isReadyForWakeupUpload() + ", activeAt:" + TimeKit.toPatternString(StatisticMMKV.INSTANCE.getBecomeActiveTime(), "HH:mm:ss") + ", inactiveAt:" + TimeKit.toPatternString(StatisticMMKV.INSTANCE.getBecomeInactiveTime(), "HH:mm:ss"));
            if (StatisticMMKV.INSTANCE.getBecomeActiveTime() - StatisticMMKV.INSTANCE.getBecomeInactiveTime() <= 30000 || !TurboSdk.INSTANCE.isReadyForWakeupUpload()) {
                return;
            }
            TurboSdk.INSTANCE.uploadDeviceInfo();
        }

        @Override
        public void onSessionClosed() {
            StatisticMMKV.INSTANCE.setBecomeInactiveTime(System.currentTimeMillis());
        }
    }
}