导航菜单

页面标题

页面副标题

Spermatid Pro v6.4.3 - TTDelegateActivity.java 源代码

正在查看: Spermatid Pro v6.4.3 应用的 TTDelegateActivity.java JAVA 源代码文件

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


package com.ss.android.downloadlib.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat$OnRequestPermissionsResultCallback;
import com.ss.android.download.api.config.d;
import com.ss.android.download.api.model.bh$bh;
import com.ss.android.download.api.model.bh$do;
import com.ss.android.downloadad.api.constant.AdBaseConstants;
import com.ss.android.downloadad.api.do.bh;
import com.ss.android.downloadad.api.p331do.Cdo;
import com.ss.android.downloadlib.addownload.bh.gu;
import com.ss.android.downloadlib.addownload.do.x;
import com.ss.android.downloadlib.addownload.f;
import com.ss.android.downloadlib.addownload.vs;
import com.ss.android.downloadlib.guide.install.do;
import com.ss.android.downloadlib.s.r;
import com.ss.android.downloadlib.s.yj;
import com.ss.android.downloadlib.td;
import com.ss.android.socialbase.appdownloader.p;
import com.ss.android.socialbase.downloader.downloader.Downloader;
import com.ss.android.socialbase.downloader.model.DownloadInfo;
import org.json.JSONObject;
import tv.danmaku.ijk.media.player.IjkMediaMeta;

public class TTDelegateActivity extends Activity implements ActivityCompat$OnRequestPermissionsResultCallback {

    private static do f2749o;
    private boolean bh;

    public Intent f1291do = null;
    private bh p;

    public static void bh(String str, Cdo cdo) {
        Intent p = p(cdo);
        p.addFlags(268435456);
        p.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 11);
        p.putExtra("package_name", str);
        if (vs.getContext() != null) {
            vs.getContext().startActivity(p);
        }
    }

    public static void m4822do(String str, String[] strArr) {
        Intent intent = new Intent(vs.getContext(), (Class<?>) TTDelegateActivity.class);
        intent.addFlags(268435456);
        intent.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 1);
        intent.putExtra("permission_id_key", str);
        intent.putExtra("permission_content_key", strArr);
        if (vs.getContext() != null) {
            vs.getContext().startActivity(intent);
        }
    }

    private static Intent p(@NonNull Cdo cdo) {
        return new Intent(vs.getContext(), (Class<?>) TTDelegateActivity.class);
    }

    @Override
    public void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        bh();
        this.f1291do = getIntent();
        vs.bh(this);
        m4823do();
    }

    @Override
    public void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        setIntent(intent);
        this.f1291do = intent;
        vs.bh(this);
        m4823do();
    }

    @Override
    public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        vs.x().do(this, i, strArr, iArr);
    }

    @Override
    public void onStop() {
        bh bhVar;
        super.onStop();
        if (!this.bh || (bhVar = this.p) == null) {
            return;
        }
        DownloadInfo downloadInfo = !TextUtils.isEmpty(bhVar.at()) ? td.do(vs.getContext()).do(this.p.at(), (String) null, true) : td.do(vs.getContext()).bh(this.p.do());
        if (downloadInfo == null || downloadInfo.getCurBytes() < downloadInfo.getTotalBytes() || isFinishing()) {
            return;
        }
        finish();
    }

    private void p() {
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.downloadlib.activity.TTDelegateActivity.p():void");
    }

    public static void bh(String str, long j, String str2) {
        Intent intent = new Intent(vs.getContext(), (Class<?>) TTDelegateActivity.class);
        intent.addFlags(268435456);
        intent.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 14);
        intent.putExtra("package_name", str);
        intent.putExtra("model_id", j);
        intent.putExtra("market_app_id", str2);
        if (vs.getContext() != null) {
            vs.getContext().startActivity(intent);
        }
    }

    public static void m4821do(String str, Cdo cdo) {
        Intent p = p(cdo);
        p.addFlags(268435456);
        p.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 2);
        p.putExtra(AdBaseConstants.MARKET_OPEN_INTENT_OPEN_URL, str);
        if (vs.getContext() != null) {
            vs.getContext().startActivity(p);
        }
    }

    public static void m4811do(Cdo cdo) {
        Intent p = p(cdo);
        p.addFlags(268435456);
        p.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 4);
        p.putExtra("model_id", cdo.bh());
        if (vs.getContext() != null) {
            vs.getContext().startActivity(p);
        }
    }

    public static void bh(@NonNull Cdo cdo) {
        m4812do(cdo, 5, "", "", "", "");
    }

    public static void bh(@NonNull Cdo cdo, String str, String str2, String str3) {
        m4812do(cdo, 7, str, str2, str3, "");
    }

    public static void bh(@NonNull Cdo cdo, String str, String str2, String str3, String str4) {
        m4812do(cdo, 20, str, str2, str3, str4);
    }

    private void bh() {
        Window window = getWindow();
        WindowManager.LayoutParams attributes = window.getAttributes();
        attributes.alpha = 0.0f;
        window.setAttributes(attributes);
    }

    public static void m4813do(Cdo cdo, do doVar) {
        Intent p = p(cdo);
        p.addFlags(268435456);
        p.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 9);
        f2749o = doVar;
        if (vs.getContext() != null) {
            vs.getContext().startActivity(p);
        }
    }

    private void bh(String str, String[] strArr) {
        if (!TextUtils.isEmpty(str) && strArr != null && strArr.length > 0) {
            1 r0 = new 1(this, str);
            if (Build.VERSION.SDK_INT >= 23) {
                try {
                    vs.x().do(this, strArr, r0);
                    return;
                } catch (Exception e2) {
                    vs.pk().mo4789do(e2, "requestPermission");
                }
            }
            r0.do();
            return;
        }
        p.m4940do((Activity) this);
    }

    public static void m4808do(long j) {
        Intent intent = new Intent(vs.getContext(), (Class<?>) TTDelegateActivity.class);
        intent.addFlags(268435456);
        intent.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 10);
        intent.putExtra("app_info_id", j);
        if (vs.getContext() != null) {
            vs.getContext().startActivity(intent);
        }
    }

    private void bh(String str) {
        Intent s2 = yj.s(this, str);
        if (s2 == null) {
            return;
        }
        try {
            s2.addFlags(268435456);
            s2.putExtra("start_only_for_android", true);
            startActivity(s2);
        } catch (Exception e2) {
            e2.printStackTrace();
        } finally {
            p.m4940do((Activity) this);
        }
    }

    public static void m4820do(String str, long j, String str2, @NonNull JSONObject jSONObject) {
        Intent intent = new Intent(vs.getContext(), (Class<?>) TTDelegateActivity.class);
        intent.addFlags(268435456);
        intent.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 12);
        intent.putExtra("package_name", str);
        intent.putExtra("model_id", j);
        intent.putExtra("param", str2);
        intent.putExtra("ext_json", jSONObject.toString());
        if (vs.getContext() != null) {
            vs.getContext().startActivity(intent);
        }
    }

    private void bh(long j) {
        bh o2 = gu.do().o(j);
        if (o2 == null) {
            com.ss.android.downloadlib.x.p.do().do("showOpenAppDialogInner nativeModel null");
            p.m4940do((Activity) this);
            return;
        }
        d p = vs.p();
        bh$do m4804do = new bh$do(this).m4804do("已安装完成");
        Object[] objArr = new Object[1];
        objArr[0] = TextUtils.isEmpty(o2.yb()) ? "刚刚下载的应用" : o2.yb();
        p.bh(m4804do.bh(String.format("%1$s已安装完成,是否立即打开?", objArr)).p("打开").o("取消").m4805do(false).m4802do(yj.o(this, o2.x())).m4803do((bh$bh) new 2(this, o2)).m4801do(2).m4806do());
        com.ss.android.downloadlib.o.do.do().bh("market_openapp_window_show", o2);
    }

    public static void m4819do(String str, long j, String str2) {
        Intent intent = new Intent(vs.getContext(), (Class<?>) TTDelegateActivity.class);
        intent.addFlags(268435456);
        intent.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 13);
        intent.putExtra("package_name", str);
        intent.putExtra("model_id", j);
        intent.putExtra("need_comment", str2);
        if (vs.getContext() != null) {
            vs.getContext().startActivity(intent);
        }
    }

    public static void m4818do(String str, long j) {
        Intent intent = new Intent(vs.getContext(), (Class<?>) TTDelegateActivity.class);
        intent.addFlags(268435456);
        intent.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 15);
        intent.putExtra("package_name", str);
        intent.putExtra("model_id", j);
        if (vs.getContext() != null) {
            vs.getContext().startActivity(intent);
        }
    }

    private void p(long j) {
        new com.ss.android.downloadlib.addownload.compliance.do(this, j).show();
    }

    public static void m4810do(Context context, String str, long j) {
        Intent intent = new Intent(context, (Class<?>) TTDelegateActivity.class);
        intent.addFlags(268435456);
        intent.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, 16);
        intent.putExtra("package_name", str);
        intent.putExtra("model_id", j);
        if (context != null) {
            context.startActivity(intent);
        }
    }

    public static void m4814do(@NonNull Cdo cdo, String str) {
        m4812do(cdo, 19, "", "", "", str);
    }

    public static void m4815do(@NonNull Cdo cdo, String str, String str2, String str3) {
        m4812do(cdo, 8, str, str2, str3, "");
    }

    public static void m4816do(@NonNull Cdo cdo, String str, String str2, String str3, String str4) {
        m4812do(cdo, 21, str, str2, str3, str4);
    }

    private static void m4812do(@NonNull Cdo cdo, int i, String str, String str2, String str3, String str4) {
        Intent p = p(cdo);
        p.addFlags(268435456);
        p.putExtra(IjkMediaMeta.IJKM_KEY_TYPE, i);
        if (!TextUtils.isEmpty(str2)) {
            p.putExtra("positive_button_text", str2);
        }
        if (!TextUtils.isEmpty(str3)) {
            p.putExtra("negative_button_text", str3);
        }
        if (!TextUtils.isEmpty(str4)) {
            p.putExtra("delete_button_text", str4);
        }
        if (!TextUtils.isEmpty(str)) {
            p.putExtra("message_text", str);
        }
        p.putExtra("model_id", cdo.bh());
        if (vs.getContext() != null) {
            vs.getContext().startActivity(p);
        }
    }

    public void m4823do() {
        Intent intent = this.f1291do;
        if (intent != null) {
            switch (intent.getIntExtra(IjkMediaMeta.IJKM_KEY_TYPE, 0)) {
                case 1:
                    bh(this.f1291do.getStringExtra("permission_id_key"), this.f1291do.getStringArrayExtra("permission_content_key"));
                    break;
                case 2:
                    m4817do(this.f1291do.getStringExtra(AdBaseConstants.MARKET_OPEN_INTENT_OPEN_URL));
                    break;
                case 3:
                case 6:
                case 17:
                case 18:
                default:
                    p.m4940do((Activity) this);
                    break;
                case 4:
                    bh(this.f1291do.getLongExtra("model_id", 0L));
                    break;
                case 5:
                    m4809do(this.f1291do.getLongExtra("model_id", 0L), "");
                    break;
                case 7:
                case 8:
                case 20:
                case 21:
                    p();
                    break;
                case 9:
                    do doVar = f2749o;
                    if (doVar != null) {
                        doVar.do();
                    }
                    p.m4940do((Activity) this);
                    break;
                case 10:
                    p(this.f1291do.getLongExtra("app_info_id", 0L));
                    break;
                case 11:
                    bh(this.f1291do.getStringExtra("package_name"));
                    break;
                case 12:
                    r.do(this, this.f1291do.getStringExtra("package_name"), this.f1291do.getLongExtra("model_id", 0L), this.f1291do.getStringExtra("param"), this.f1291do.getStringExtra("ext_json"));
                    p.m4940do((Activity) this);
                    break;
                case 13:
                    r.do(this, this.f1291do.getStringExtra("package_name"), this.f1291do.getLongExtra("model_id", 0L), this.f1291do.getStringExtra("need_comment"));
                    p.m4940do((Activity) this);
                    break;
                case 14:
                    r.bh(this, this.f1291do.getStringExtra("package_name"), this.f1291do.getLongExtra("model_id", 0L), this.f1291do.getStringExtra("market_app_id"));
                    p.m4940do((Activity) this);
                    break;
                case 15:
                    r.do(this, this.f1291do.getStringExtra("package_name"), this.f1291do.getLongExtra("model_id", 0L));
                    p.m4940do((Activity) this);
                    break;
                case 16:
                    r.bh(this, this.f1291do.getStringExtra("package_name"), this.f1291do.getLongExtra("model_id", 0L));
                    p.m4940do((Activity) this);
                    break;
                case 19:
                    m4809do(this.f1291do.getLongExtra("model_id", 0L), this.f1291do.getStringExtra("delete_button_text"));
                    break;
            }
            this.f1291do = null;
        }
    }

    private void m4809do(long j, String str) {
        if (f.do() == null) {
            return;
        }
        bh o2 = gu.do().o(j);
        if (o2 != null) {
            DownloadInfo downloadInfo = Downloader.getInstance(vs.getContext()).getDownloadInfo(o2.uw());
            JSONObject jSONObject = new JSONObject();
            try {
                jSONObject.putOpt("time_after_click", Long.valueOf(System.currentTimeMillis() - o2.ei()));
                jSONObject.putOpt("click_download_size", Long.valueOf(o2.l()));
                if (downloadInfo != null) {
                    jSONObject.putOpt("download_length", Long.valueOf(downloadInfo.getCurBytes()));
                    jSONObject.putOpt("download_percent", Long.valueOf(downloadInfo.getCurBytes() / downloadInfo.getTotalBytes()));
                    jSONObject.putOpt("download_apk_size", Long.valueOf(downloadInfo.getTotalBytes()));
                    jSONObject.putOpt("download_current_bytes", Integer.valueOf((int) (downloadInfo.getCurBytes() / 1048576)));
                    jSONObject.putOpt("download_total_bytes", Integer.valueOf((int) (downloadInfo.getTotalBytes() / 1048576)));
                }
            } catch (Exception e2) {
                e2.printStackTrace();
            }
            if (!TextUtils.isEmpty(str)) {
                com.ss.android.downloadlib.o.do.do().do("cancel_pause_reserve_wifi_dialog_show", jSONObject, o2);
            } else {
                com.ss.android.downloadlib.o.do.do().bh("pause_reserve_wifi_dialog_show", jSONObject, o2);
            }
        }
        x.do doVar = new x.do(this).do(false).do(f.do());
        if (!TextUtils.isEmpty(str)) {
            doVar.o(str).do(f.bh());
        }
        doVar.do().show();
        this.bh = true;
        this.p = o2;
    }

    private void m4817do(String str) {
        try {
            if (TextUtils.isEmpty(str)) {
                return;
            }
            Uri parse = Uri.parse(str);
            Intent intent = new Intent("android.intent.action.VIEW");
            intent.setData(parse);
            intent.putExtra(AdBaseConstants.MARKET_OPEN_INTENT_OPEN_URL, str);
            intent.addFlags(268435456);
            if (com.ss.android.socialbase.downloader.s.do.p().do("fix_app_link_flag")) {
                intent.addFlags(67108864);
            }
            intent.putExtra("start_only_for_android", true);
            startActivity(intent);
        } catch (Exception e2) {
            e2.printStackTrace();
        } finally {
            p.m4940do((Activity) this);
        }
    }
}