package com.tencent.mm.plugin.appbrand.launching.precondition;

import android.content.Intent;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.launching.AppBrandLaunchProxyUI;
import com.tencent.mm.plugin.appbrand.ui.AppBrandXWebDownloadProxyUI;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ah;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.sdk.platformtools.g;
import com.tencent.mm.storage.ac.a;
import org.xwalk.core.XWalkEnvironment;

class a$2 implements Runnable {
    final /* synthetic */ a ijF;
    final /* synthetic */ Runnable ijG;

    a$2(a aVar, Runnable runnable) {
        this.ijF = aVar;
        this.ijG = runnable;
    }

    public final void run() {
        AppMethodBeat.i(132049);
        1 1 = new 1(this);
        AppBrandLaunchProxyUI appBrandLaunchProxyUI = (AppBrandLaunchProxyUI) this.ijF.getBaseContext();
        if (g.dnY()) {
            ab.i("MicroMsg.AppBrand.PreLaunchCheckForXWEB", "check xweb download, gp version, just return");
            1.aHx();
            AppMethodBeat.o(132049);
            return;
        }
        if (XWalkEnvironment.getInstalledNewstVersion(ah.getContext()) > 400) {
            ab.i("MicroMsg.AppBrand.PreLaunchCheckForXWEB", "have available version , no need check");
            1.onReady();
            AppMethodBeat.o(132049);
            return;
        }
        if (Math.abs(bo.anT() - com.tencent.mm.kernel.g.RP().Ry().a(a.xOA, 0)) < 7200) {
            ab.i("MicroMsg.AppBrand.PreLaunchCheckForXWEB", "check xweb download, not exceed interval, just return");
            1.aHx();
            AppMethodBeat.o(132049);
            return;
        }
        com.tencent.mm.kernel.g.RP().Ry().set(a.xOA, Long.valueOf(bo.anT()));
        long anU = bo.anU();
        ab.d("MicroMsg.AppBrand.PreLaunchCheckForXWEB", "check xweb download, cost = %d, xweb core ver = %d", new Object[]{Long.valueOf(bo.anU() - anU), Integer.valueOf(r2)});
        if (appBrandLaunchProxyUI == null || !appBrandLaunchProxyUI.aHa()) {
            1.aHx();
            AppMethodBeat.o(132049);
            return;
        }
        appBrandLaunchProxyUI.a(1, new Intent().setClass(appBrandLaunchProxyUI.getBaseContext(), AppBrandXWebDownloadProxyUI.class).putExtra("intent_extra_download_ignore_network_type", true), 1.requestCode);
        AppMethodBeat.o(132049);
    }
}
