WeChat.apk(点击下载) / GameVideoEditorProxyUI.java


package com.tencent.mm.plugin.game.media;

import a50.g;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.MenuItem;
import bw3.hb3;
import com.google.android.gms.common.util.GmsVersion;
import com.tencent.mm.R;
import com.tencent.mm.component.api.jumper.UICustomParam;
import com.tencent.mm.feature.sight.api.ISightJNIService;
import com.tencent.mm.modelcontrol.VideoTransPara;
import com.tencent.mm.plugin.game.api.GameShareOption;
import com.tencent.mm.plugin.game.commlib.c;
import com.tencent.mm.plugin.game.commlib.util.f;
import com.tencent.mm.plugin.mmsight.SightCaptureResult;
import com.tencent.mm.plugin.recordvideo.jumper.CaptureDataManager;
import com.tencent.mm.plugin.recordvideo.jumper.RecordConfigProvider;
import com.tencent.mm.plugin.webview.model.WebViewJSSDKFileItem;
import com.tencent.mm.plugin.webview.model.WebViewJSSDKVideoItem;
import com.tencent.mm.plugin.webview.model.k2;
import com.tencent.mm.plugin.webview.model.q1;
import com.tencent.mm.sdk.platformtools.Log;
import com.tencent.mm.sdk.platformtools.MMHandlerThread;
import com.tencent.mm.sdk.platformtools.Util;
import com.tencent.mm.storage.w1;
import com.tencent.mm.ui.MMBaseActivity;
import com.tencent.mm.ui.j5;
import com.tencent.mm.vfs.u1;
import com.tencent.thumbplayer.tmediacodec.util.MimeTypes;
import com.tencent.tmassistantsdk.downloadservice.DownloadHelper;
import com.tencent.xweb.util.FrequentLimiter;
import d60.z;
import h92.q0;
import i14.d0;
import i14.l0;
import i14.p0;
import i14.y0;
import ie1.h;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import l92.m3;
import l92.r1;
import ln.t;
import o00.q;
import org.json.JSONArray;
import org.json.JSONException;
import p64.n;
import v20.e;
import yz3.j;

@i14.a(19)
public class GameVideoEditorProxyUI extends MMBaseActivity {

    /* renamed from: w  reason: collision with root package name */
    public static final String f125713w = (f.b(f.a.f125105g) + "haowan/");

    /* renamed from: e  reason: collision with root package name */
    public Context f125714e;

    /* renamed from: f  reason: collision with root package name */
    public int f125715f;

    /* renamed from: g  reason: collision with root package name */
    public String f125716g;

    /* renamed from: h  reason: collision with root package name */
    public String f125717h;

    /* renamed from: i  reason: collision with root package name */
    public String f125718i;

    /* renamed from: j  reason: collision with root package name */
    public SparseArray<GameShareOption> f125719j;

    /* renamed from: n  reason: collision with root package name */
    public GameShareOption f125720n = null;

    /* renamed from: o  reason: collision with root package name */
    public n f125721o;

    /* renamed from: p  reason: collision with root package name */
    public com.tencent.mm.plugin.sight.base.a f125722p;

    /* renamed from: q  reason: collision with root package name */
    public String f125723q = "";

    /* renamed from: r  reason: collision with root package name */
    public String f125724r = "";

    /* renamed from: s  reason: collision with root package name */
    public boolean f125725s = true;

    /* renamed from: t  reason: collision with root package name */
    public boolean f125726t = false;

    /* renamed from: u  reason: collision with root package name */
    public int f125727u = 0;

    /* renamed from: v  reason: collision with root package name */
    public CaptureDataManager.b f125728v = new a();

    public class a extends CaptureDataManager.c {

        /* renamed from: com.tencent.mm.plugin.game.media.GameVideoEditorProxyUI$a$a  reason: collision with other inner class name */
        public class RunnableC1274a implements Runnable {

            /* renamed from: d  reason: collision with root package name */
            public final /* synthetic */ Context f125730d;

            /* renamed from: e  reason: collision with root package name */
            public final /* synthetic */ CaptureDataManager.CaptureVideoNormalModel f125731e;

            /* renamed from: f  reason: collision with root package name */
            public final /* synthetic */ Bundle f125732f;

            public RunnableC1274a(Context context, CaptureDataManager.CaptureVideoNormalModel captureVideoNormalModel, Bundle bundle) {
                this.f125730d = context;
                this.f125731e = captureVideoNormalModel;
                this.f125732f = bundle;
            }

            public void run() {
                int i15;
                GameShareOption gameShareOption;
                GameVideoEditorProxyUI gameVideoEditorProxyUI = GameVideoEditorProxyUI.this;
                Context context = this.f125730d;
                CaptureDataManager.CaptureVideoNormalModel captureVideoNormalModel = this.f125731e;
                Bundle bundle = this.f125732f;
                bundle.putInt("game_haowan_source_scene_id", gameVideoEditorProxyUI.f125727u);
                i92.a.f(captureVideoNormalModel, bundle);
                if (!captureVideoNormalModel.f139918d.booleanValue()) {
                    y0.makeText(gameVideoEditorProxyUI.f125714e, (int) R.string.fpy, 1).show();
                    Log.e("MicroMsg.Haowan.GameVideoEditorProxyUI", "video remux error");
                    return;
                }
                i92.a.h(gameVideoEditorProxyUI.f125723q, captureVideoNormalModel);
                i92.a.g(gameVideoEditorProxyUI.f125724r, captureVideoNormalModel);
                if (gameVideoEditorProxyUI.f125715f == 2) {
                    hb3 hb32 = new hb3();
                    hb32.f23570e = false;
                    hb32.f23569d = false;
                    String r15 = u1.r(captureVideoNormalModel.f139919e);
                    String str = captureVideoNormalModel.f139919e;
                    SightCaptureResult sightCaptureResult = new SightCaptureResult(true, str, captureVideoNormalModel.f139920f, r15, u1.q(str), (int) (captureVideoNormalModel.f139921g.longValue() / 1000), hb32);
                    if (captureVideoNormalModel.f139922h.booleanValue()) {
                        sightCaptureResult.f132972e = true;
                        i15 = 0;
                        sightCaptureResult.f132971d = false;
                        sightCaptureResult.f132980p = captureVideoNormalModel.f139920f;
                    } else {
                        i15 = 0;
                    }
                    int i16 = bundle.getInt("key_selected_item", i15);
                    Object[] objArr = new Object[1];
                    objArr[i15] = Integer.valueOf(i16);
                    Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "hy: generated video, selected item is %d", objArr);
                    SparseArray<GameShareOption> sparseArray = gameVideoEditorProxyUI.f125719j;
                    if (sparseArray == null) {
                        gameShareOption = null;
                    } else {
                        gameShareOption = sparseArray.get(i16);
                    }
                    Intent intent = new Intent();
                    if (gameShareOption != null && gameShareOption.f124478f) {
                        intent.putExtra("key_ext_url", gameVideoEditorProxyUI.Q7(null, i92.a.a(captureVideoNormalModel)));
                    }
                    intent.putExtra("key_req_result", sightCaptureResult);
                    intent.putExtra("key_selected_item", i16);
                    Activity activity = (Activity) context;
                    activity.setResult(-1, intent);
                    activity.finish();
                    return;
                }
                boolean booleanValue = ((Boolean) captureVideoNormalModel.a().b("KEY_VIDEO_IS_EDITED_BOOLEAN", Boolean.TRUE)).booleanValue();
                if (gameVideoEditorProxyUI.f125725s && booleanValue) {
                    i92.a.d(captureVideoNormalModel.f139919e);
                }
                String a15 = i92.a.a(captureVideoNormalModel);
                if (a15 == null) {
                    gameVideoEditorProxyUI.finish();
                    return;
                }
                Intent intent2 = new Intent();
                intent2.putExtra("key_video_info", a15);
                Activity activity2 = (Activity) context;
                activity2.setResult(-1, intent2);
                activity2.finish();
            }
        }

        public class b implements l0 {
            public b() {
            }

            @Override // i14.l0
            public void onCreateMMMenu(d0 d0Var) {
                d0Var.clear();
                for (int i15 = 0; i15 < GameVideoEditorProxyUI.this.f125719j.size(); i15++) {
                    GameShareOption valueAt = GameVideoEditorProxyUI.this.f125719j.valueAt(i15);
                    d0Var.f(valueAt.f124476d, valueAt.f124477e);
                }
            }
        }

        public class c implements p0 {

            /* renamed from: d  reason: collision with root package name */
            public final /* synthetic */ Bundle f125735d;

            /* renamed from: e  reason: collision with root package name */
            public final /* synthetic */ CaptureDataManager.a f125736e;

            public c(Bundle bundle, CaptureDataManager.a aVar) {
                this.f125735d = bundle;
                this.f125736e = aVar;
            }

            @Override // i14.p0
            public void onMMMenuItemSelected(MenuItem menuItem, int i15) {
                Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "hy: user selected: %d", Integer.valueOf(menuItem.getItemId()));
                GameShareOption gameShareOption = GameVideoEditorProxyUI.this.f125719j.get(menuItem.getItemId());
                if (gameShareOption != null) {
                    this.f125735d.putInt("key_selected_item", gameShareOption.f124476d);
                    this.f125736e.a();
                    return;
                }
                Log.e("MicroMsg.Haowan.GameVideoEditorProxyUI", "hy: non option!!");
            }
        }

        public a() {
        }

        @Override // com.tencent.mm.plugin.recordvideo.jumper.CaptureDataManager.b
        public void d2(Context context, CaptureDataManager.CaptureVideoNormalModel captureVideoNormalModel, Bundle bundle) {
            Bundle bundle2 = new Bundle();
            bundle2.putAll(bundle);
            e04.a.a(new RunnableC1274a(context, captureVideoNormalModel, bundle2));
        }

        @Override // com.tencent.mm.plugin.recordvideo.jumper.CaptureDataManager.b
        public boolean f1(Context context, Bundle bundle, CaptureDataManager.a aVar) {
            SparseArray<GameShareOption> sparseArray;
            bundle.putInt("key_video_from", GameVideoEditorProxyUI.this.f125715f);
            bundle.putString("key_raw_video_path", GameVideoEditorProxyUI.this.f125718i);
            bundle.putInt("key_raw_video_duration", GameVideoEditorProxyUI.this.f125722p.a());
            bundle.putInt("key_raw_video_size", (int) u1.l(GameVideoEditorProxyUI.this.f125718i));
            bundle.putInt("key_game_haowan_flag", 10);
            bundle.putInt("game_haowan_source_scene_id", GameVideoEditorProxyUI.this.f125727u);
            GameVideoEditorProxyUI gameVideoEditorProxyUI = GameVideoEditorProxyUI.this;
            if (gameVideoEditorProxyUI.f125715f == 2 && (sparseArray = gameVideoEditorProxyUI.f125719j) != null) {
                if (sparseArray.size() > 1) {
                    Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "hy: more than 1 share options and need to show actionsheet");
                    n nVar = GameVideoEditorProxyUI.this.f125721o;
                    if (nVar != null) {
                        nVar.p();
                    }
                    GameVideoEditorProxyUI.this.f125721o = new n(context, 1, false);
                    n nVar2 = GameVideoEditorProxyUI.this.f125721o;
                    nVar2.f281245i = new b();
                    nVar2.f281259q = new c(bundle, aVar);
                    nVar2.q();
                    return true;
                }
                GameShareOption gameShareOption = GameVideoEditorProxyUI.this.f125720n;
                if (gameShareOption != null) {
                    Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "hy: only 1 option. use default, dafault id is %d", Integer.valueOf(gameShareOption.f124476d));
                    bundle.putInt("key_selected_item", GameVideoEditorProxyUI.this.f125720n.f124476d);
                } else {
                    Log.w("MicroMsg.Haowan.GameVideoEditorProxyUI", "hy: no default option!");
                }
            }
            return false;
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:18:0x0050  */
    /* JADX WARNING: Removed duplicated region for block: B:23:0x006e A[SYNTHETIC, Splitter:B:23:0x006e] */
    public final String Q7(String str, String str2) {
        l92.u1 u1Var;
        String str3;
        String str4;
        if (c.e() != null) {
            u1Var = c.f125069a.GeneralJumpInfo;
        } else {
            c.q();
            u1Var = null;
        }
        if (u1Var != null && !Util.isNullOrNil(u1Var.f251726d)) {
            Iterator<m3> it = u1Var.f251726d.iterator();
            while (true) {
                if (!it.hasNext()) {
                    break;
                }
                m3 next = it.next();
                if (next.f251553d == 2 && !Util.isNullOrNil(next.f251555f)) {
                    str3 = next.f251555f;
                    break;
                }
            }
            StringBuffer stringBuffer = new StringBuffer();
            stringBuffer.append(str3);
            stringBuffer.append("?video_info=");
            if (str2 != null) {
                g gVar = new g();
                try {
                    gVar.put("videoUrl", str);
                    gVar.put("thumbUrl", getIntent().getStringExtra("thumb_url"));
                } catch (a50.f unused) {
                }
                str4 = gVar.toString();
            } else {
                try {
                    str4 = new JSONArray(str2).getJSONObject(0).toString();
                } catch (JSONException e15) {
                    Log.e("MicroMsg.Haowan.GameVideoEditorProxyUI", "json_err:%s", e15.getMessage());
                    str4 = "";
                }
            }
            stringBuffer.append(URLEncoder.encode(str4));
            stringBuffer.append("&from=");
            stringBuffer.append(this.f125715f);
            stringBuffer.append("&appid=");
            stringBuffer.append(this.f125717h);
            stringBuffer.append("&game_info=");
            stringBuffer.append(getIntent().getStringExtra("game_info"));
            Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "publish url:%s", stringBuffer.toString());
            return stringBuffer.toString();
        }
        str3 = "https://game.weixin.qq.com/cgi-bin/h5/static/appcenter/publish.html?ssid=5&scene=5";
        StringBuffer stringBuffer2 = new StringBuffer();
        stringBuffer2.append(str3);
        stringBuffer2.append("?video_info=");
        if (str2 != null) {
        }
        stringBuffer2.append(URLEncoder.encode(str4));
        stringBuffer2.append("&from=");
        stringBuffer2.append(this.f125715f);
        stringBuffer2.append("&appid=");
        stringBuffer2.append(this.f125717h);
        stringBuffer2.append("&game_info=");
        stringBuffer2.append(getIntent().getStringExtra("game_info"));
        Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "publish url:%s", stringBuffer2.toString());
        return stringBuffer2.toString();
    }

    public final VideoTransPara R7() {
        VideoTransPara videoTransPara;
        r1 r1Var;
        int i15 = this.f125715f;
        if (i15 == 3 || i15 == 5) {
            videoTransPara = ((q) j.c(q.class)).Ze(1);
        } else {
            videoTransPara = ((q) j.c(q.class)).Ze(0);
        }
        r1 r1Var2 = null;
        if (c.e() != null) {
            r1Var = c.f125069a.GameSight;
        } else {
            c.q();
            r1Var = null;
        }
        if (r1Var != null) {
            if (c.e() != null) {
                r1Var2 = c.f125069a.GameSight;
            } else {
                c.q();
            }
            videoTransPara.f78864d = (int) r1Var2.f251658e;
            videoTransPara.f78865e = (int) r1Var2.f251659f;
            videoTransPara.f78867g = (int) r1Var2.f251657d;
            videoTransPara.f78871n = (int) r1Var2.f251660g;
            videoTransPara.f78868h = (int) r1Var2.f251661h;
        }
        return videoTransPara;
    }

    /* JADX WARNING: Code restructure failed: missing block: B:11:0x0097, code lost:
        if (r3.f146160c >= r3.f146161d) goto L_0x0099;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:9:0x008e, code lost:
        if (r3.f146161d >= r3.f146160c) goto L_0x0099;
     */
    /* JADX WARNING: Removed duplicated region for block: B:15:0x009e  */
    /* JADX WARNING: Removed duplicated region for block: B:18:0x00bc  */
    /* JADX WARNING: Removed duplicated region for block: B:23:0x00e9  */
    /* JADX WARNING: Removed duplicated region for block: B:75:0x024b  */
    /* JADX WARNING: Removed duplicated region for block: B:76:0x024d  */
    /* JADX WARNING: Removed duplicated region for block: B:78:0x0290  */
    /* JADX WARNING: Removed duplicated region for block: B:88:? A[RETURN, SYNTHETIC] */
    public final void S7() {
        boolean z15;
        Intent a15;
        ArrayList<String> stringArrayList;
        getWindow().getDecorView().setSystemUiVisibility(-3);
        long currentTimeMillis = System.currentTimeMillis();
        StringBuilder sb5 = new StringBuilder();
        String str = f125713w;
        sb5.append(str);
        sb5.append("vsg_output_");
        sb5.append(currentTimeMillis);
        sb5.append(".mp4");
        this.f125723q = sb5.toString();
        String str2 = str + "vsg_thumb_" + currentTimeMillis + ".jpg";
        this.f125724r = str2;
        RecordConfigProvider c15 = RecordConfigProvider.c(this.f125718i, this.f125723q, str2);
        c15.f139932n = R7();
        c15.F = 5;
        UICustomParam.b bVar = new UICustomParam.b();
        boolean z16 = true;
        bVar.e(true);
        bVar.g(true);
        bVar.c(true);
        int mp4RotateVFS = ((ISightJNIService) j.c(ISightJNIService.class)).getMp4RotateVFS(this.f125718i);
        if (mp4RotateVFS == 0 || mp4RotateVFS == 180) {
            com.tencent.mm.plugin.sight.base.a aVar = this.f125722p;
        } else {
            if (mp4RotateVFS == 270 || mp4RotateVFS == 90) {
                com.tencent.mm.plugin.sight.base.a aVar2 = this.f125722p;
            }
            z15 = false;
            if (z15) {
                UICustomParam uICustomParam = bVar.f74045a;
                uICustomParam.f74029d = 0.6f;
                uICustomParam.f74030e = 0.6f;
                uICustomParam.f74031f = 0.5f;
                uICustomParam.f74032g = 0.5f;
            }
            int a16 = j5.a(this, 32);
            if (this.f125715f == 2) {
                if (this.f125725s) {
                    c15.f139944z = false;
                    c15.f139939u = Boolean.FALSE;
                    c15.J = FrequentLimiter.WEEK_MILLS;
                } else {
                    c15.f139944z = true;
                    c15.f139939u = Boolean.TRUE;
                }
                c15.f139941w = c15.f139932n.f78868h * 1000;
                bVar.i(R.drawable.af7, R.color.aaw, getString(R.string.fpx), a16);
            } else {
                c15.f139944z = true;
                c15.f139939u = Boolean.TRUE;
                c15.f139941w = GmsVersion.VERSION_PARMESAN;
                c15.f139925d = 2;
                Bundle bundleExtra = getIntent().getBundleExtra("ext_data");
                if (bundleExtra != null) {
                    String string = bundleExtra.getString("k_ext_wording");
                    VideoTransPara videoTransPara = (VideoTransPara) bundleExtra.getParcelable("k_preferred_trans_param");
                    if (videoTransPara != null) {
                        Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "hy: has given trasn params: %s", videoTransPara.toString());
                        c15.f139932n = videoTransPara;
                    }
                    if (!Util.isNullOrNil(string)) {
                        int color = getResources().getColor(R.color.aaw);
                        UICustomParam uICustomParam2 = bVar.f74045a;
                        uICustomParam2.f74038p = string;
                        uICustomParam2.f74039q = color;
                        uICustomParam2.f74040r = 17.0f;
                    }
                    ArrayList parcelableArrayList = bundleExtra.getParcelableArrayList("k_ext_share_options");
                    if (parcelableArrayList == null || parcelableArrayList.size() <= 0) {
                        bVar.i(0, 0, getString(R.string.f367610yg), a16);
                    } else {
                        this.f125720n = (GameShareOption) parcelableArrayList.get(0);
                        if (parcelableArrayList.size() == 1) {
                            bVar.i(0, 0, this.f125720n.f124477e, a16);
                        } else {
                            bVar.i(0, 0, getString(R.string.f367610yg), a16);
                        }
                        this.f125719j = new SparseArray<>();
                        Iterator it = parcelableArrayList.iterator();
                        while (it.hasNext()) {
                            GameShareOption gameShareOption = (GameShareOption) it.next();
                            this.f125719j.put(gameShareOption.f124476d, gameShareOption);
                        }
                    }
                    int i15 = bundleExtra.getInt("minDuration", -1);
                    if (i15 > 0) {
                        c15.f139942x = i15 * 1000;
                    }
                    int i16 = bundleExtra.getInt("maxDuration", -1);
                    if (i16 > 0) {
                        c15.f139941w = i16 * 1000;
                    }
                    Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "zbq:minRecordTimeMs:%d,maxRecordTimeMs:%d", Integer.valueOf(c15.f139942x), Integer.valueOf(c15.f139941w));
                } else {
                    bVar.i(0, 0, getString(R.string.f367610yg), a16);
                }
                bVar.h(true);
                if (!(bundleExtra.getInt("k_ext_editor_from", 0) != 1 || (stringArrayList = bundleExtra.getStringArrayList("k_ext_tool_bars")) == null || stringArrayList.size() == 0)) {
                    bVar.a(true);
                    bVar.d(true);
                    bVar.h(true);
                    bVar.f(true);
                    Iterator<String> it4 = stringArrayList.iterator();
                    while (it4.hasNext()) {
                        String next = it4.next();
                        if (next.equals("emoji")) {
                            bVar.a(false);
                        } else if (next.equals("music")) {
                            bVar.d(false);
                        } else if (next.equals(MimeTypes.BASE_TYPE_TEXT)) {
                            bVar.f(false);
                        } else if (next.equals("crop")) {
                            bVar.h(false);
                        }
                    }
                }
            }
            c15.f139933o = bVar.f74045a;
            CaptureDataManager.f139915c.f139916a = this.f125728v;
            zt2.a aVar3 = zt2.a.f355481a;
            Context context = this.f125714e;
            Activity activity = (Activity) context;
            a15 = aVar3.a(activity, "com.tencent.mm.plugin.recordvideo.activity.MMRecordUI", 2);
            if (a15 != null) {
                z16 = false;
            } else {
                a15.putExtra("KEY_PARAMS_CONFIG", c15);
                a15.putExtra("KEY_PARAMS_TO_WHERE", 2);
                a15.putExtra("KEY_PARAMS_EXIT_ANIM", -1);
                Log.i("MicroMsg.VideoCaptureJumper", "configProvider: %s", c15);
                k30.a aVar4 = new k30.a();
                ThreadLocal<k30.a> threadLocal = k30.c.f244265a;
                aVar4.c(121);
                aVar4.c(a15);
                j30.a.j(activity, aVar4.b(), "com/tencent/mm/plugin/recordvideo/jumper/VideoCaptureJumper", "jumpToEditViewForResult", "(Landroid/content/Context;IIILcom/tencent/mm/plugin/recordvideo/jumper/RecordConfigProvider;I)Z", "android/app/Activity", "startActivityForResult", "(Landroid/content/Intent;I)V");
                aVar3.b(context, R.anim.f357363e0, -1);
            }
            if (!z16) {
                com.tencent.mm.game.report.g.c(this, 87, 8763, 0, 1, this.f125727u, w20.a.a(this.f125715f, null));
                return;
            }
            return;
        }
        z15 = true;
        if (z15) {
        }
        int a162 = j5.a(this, 32);
        if (this.f125715f == 2) {
        }
        c15.f139933o = bVar.f74045a;
        CaptureDataManager.f139915c.f139916a = this.f125728v;
        zt2.a aVar32 = zt2.a.f355481a;
        Context context2 = this.f125714e;
        Activity activity2 = (Activity) context2;
        a15 = aVar32.a(activity2, "com.tencent.mm.plugin.recordvideo.activity.MMRecordUI", 2);
        if (a15 != null) {
        }
        if (!z16) {
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:38:0x014d  */
    /* JADX WARNING: Removed duplicated region for block: B:40:? A[RETURN, SYNTHETIC] */
    public void onActivityResult(int i15, int i16, Intent intent) {
        int i17;
        int i18;
        super.onActivityResult(i15, i16, intent);
        Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "requestCode:%d, resultCode:%d", Integer.valueOf(i15), Integer.valueOf(i16));
        int i19 = -1;
        if (i15 == 121) {
            if (i16 == -1) {
                if (intent != null && (this.f125715f == 3 || this.f125726t)) {
                    MMHandlerThread.postToMainThreadDelayed(new q0(this, null, intent.getStringExtra("key_video_info")), 0);
                    setResult(-1);
                    return;
                }
            } else if (i16 == 0 || i16 == 3000 || i16 == 3001) {
                com.tencent.mm.game.report.g.c(this, 87, 8763, 1, 2, this.f125727u, w20.a.a(this.f125715f, null));
            } else if (i16 == 888) {
                Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "video edit in background");
                String b15 = i92.a.b(intent.getStringExtra("key_thumb_path"), this.f125718i);
                String stringExtra = intent.getStringExtra("key_bg_mix_task_id");
                int videoMsToSec = Util.videoMsToSec((long) intent.getIntExtra("key_video_duration", 0));
                com.tencent.mm.plugin.sight.base.a aVar = this.f125722p;
                int i25 = aVar.f146160c;
                int i26 = aVar.f146161d;
                int i27 = aVar.f146171n;
                if (i27 == 90 || i27 == 270) {
                    i18 = i25;
                    i17 = i26;
                } else {
                    i17 = i25;
                    i18 = i26;
                }
                String i28 = k2.i("weixin://bgmixid/" + stringExtra, b15, videoMsToSec, i18, i17, 0);
                Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "videoInfo:%s", i28);
                intent.putExtra("key_video_info", i28);
                if (this.f125715f == 3 || this.f125726t) {
                    MMHandlerThread.postToMainThreadDelayed(new q0(this, null, intent.getStringExtra("key_video_info")), 0);
                    return;
                }
                setResult(i19, intent);
                finish();
                if (this.f125715f != 3) {
                    ((t) j.c(t.class)).bc0(this.f125716g, "", this.f125717h, 0, "");
                    return;
                }
                return;
            } else {
                Log.e("MicroMsg.Haowan.GameVideoEditorProxyUI", "video check error: [%d]", Integer.valueOf(i16));
                HashMap hashMap = new HashMap();
                hashMap.put("failid", Integer.valueOf(i16));
                com.tencent.mm.game.report.g.c(this.f125714e, 87, 8763, 2, 56, this.f125727u, w20.a.a(this.f125715f, hashMap));
                y0.makeText(this.f125714e, (int) R.string.f368654fq3, 1).show();
                if (this.f125715f == 3) {
                    setResult(i16, intent);
                    finish();
                    ((t) j.c(t.class)).bc0(this.f125716g, "Invalid video format", this.f125717h, -3, "Invalid video format");
                    return;
                }
            }
        }
        i19 = i16;
        setResult(i19, intent);
        finish();
        if (this.f125715f != 3) {
        }
    }

    @Override // com.tencent.mm.hellhoundlib.activities.HellActivity
    public void onCreate(Bundle bundle) {
        boolean z15;
        String str;
        super.onCreate(bundle);
        this.f125714e = this;
        this.f125715f = getIntent().getIntExtra("from", -1);
        this.f125716g = getIntent().getStringExtra("business_type");
        this.f125717h = getIntent().getStringExtra("appid");
        this.f125718i = getIntent().getStringExtra("video_path");
        Bundle bundleExtra = getIntent().getBundleExtra("ext_data");
        if (bundleExtra != null) {
            this.f125726t = bundleExtra.getBoolean("game_straight_to_publish", false);
        }
        this.f125727u = getIntent().getIntExtra("game_haowan_source_scene_id", 0);
        boolean equals = z.s().i().f(w1.a.O9, "1").equals("1");
        if (((e) j.c(e.class)).h8(h.c.f232113m1, 1) == 1) {
            z15 = true;
        } else {
            z15 = false;
        }
        Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "video bg mix, debugOpen:%b, xLabOpen:%b", Boolean.valueOf(equals), Boolean.valueOf(z15));
        if (!equals || !z15) {
            this.f125725s = false;
        } else {
            this.f125725s = true;
        }
        Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "video_path:%s", this.f125718i);
        this.f125722p = ((com.tencent.mm.feature.sight.api.f) j.c(com.tencent.mm.feature.sight.api.f.class)).fg0(this.f125718i);
        if (getIntent().getBooleanExtra("need_edit", false)) {
            if (this.f125722p == null) {
                Log.e("MicroMsg.Haowan.GameVideoEditorProxyUI", "video is error");
                finish();
            } else {
                S7();
            }
        } else if (Util.isNullOrNil(this.f125718i)) {
            MMHandlerThread.postToMainThreadDelayed(new q0(this, getIntent().getStringExtra("video_url"), null), 0);
        } else if (this.f125722p == null) {
            Log.e("MicroMsg.Haowan.GameVideoEditorProxyUI", "video is error");
            finish();
        } else {
            VideoTransPara R7 = R7();
            if (u1.l(this.f125718i) > DownloadHelper.SAVE_LENGTH || (R7 != null && R7.f78868h < this.f125722p.a())) {
                Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "videoLength(%d) > %d or videoDuration(%d) > paramDuration(%d), needEdit is invalid", Long.valueOf(u1.l(this.f125718i)), 104857600, Integer.valueOf(this.f125722p.a()), Integer.valueOf(R7.f78868h));
                S7();
            } else {
                String str2 = f125713w + "vsg_output_" + System.currentTimeMillis() + ".mp4";
                String str3 = this.f125718i;
                if (!str3.equals(str2)) {
                    u1.v(u1.s(str2));
                    u1.c(str3, str2);
                }
                this.f125718i = str2;
                WebViewJSSDKVideoItem c15 = i92.a.c(str2);
                if (c15 == null) {
                    str = null;
                } else {
                    String b15 = i92.a.b(null, str2);
                    WebViewJSSDKFileItem b16 = q1.f165761b.b(b15);
                    if (b16 != null) {
                        c15.f165429f = b16.f165430g;
                    }
                    c15.f165442v.putInt("mark_edit_flag", 0);
                    str = k2.i(c15.f165428e, b15, c15.f165446w, c15.f165437q, c15.f165436p, c15.f165435o);
                }
                if (str == null) {
                    finish();
                } else {
                    MMHandlerThread.postToMainThreadDelayed(new q0(this, null, str), 0);
                }
            }
        }
        Log.i("MicroMsg.Haowan.GameVideoEditorProxyUI", "onCreate");
    }

    @Override // com.tencent.mm.ui.MMBaseActivity, com.tencent.mm.hellhoundlib.activities.HellActivity
    public void onDestroy() {
        super.onDestroy();
    }
}