package com.ss.android.ugc.effectmanager.effect.task.task.oldtask;

import X.0HH;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.effectmanager.EffectConfiguration;
import com.ss.android.ugc.effectmanager.common.EffectConstants;
import com.ss.android.ugc.effectmanager.common.EffectRequest;
import com.ss.android.ugc.effectmanager.common.cachemanager.ICache;
import com.ss.android.ugc.effectmanager.common.listener.IJsonConverter;
import com.ss.android.ugc.effectmanager.common.listener.IMonitorService;
import com.ss.android.ugc.effectmanager.common.logger.EPLog;
import com.ss.android.ugc.effectmanager.common.task.ExceptionResult;
import com.ss.android.ugc.effectmanager.common.task.NormalTask;
import com.ss.android.ugc.effectmanager.common.utils.EffectCacheKeyGenerator;
import com.ss.android.ugc.effectmanager.common.utils.EffectRequestUtil;
import com.ss.android.ugc.effectmanager.common.utils.EventJsonBuilder;
import com.ss.android.ugc.effectmanager.common.utils.NetworkUtils;
import com.ss.android.ugc.effectmanager.context.EffectContext;
import com.ss.android.ugc.effectmanager.effect.model.CategoryPageModel;
import com.ss.android.ugc.effectmanager.effect.model.net.CategoryEffectListResponse;
import com.ss.android.ugc.effectmanager.effect.task.result.FetchCategoryEffectTaskResult;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.UnknownHostException;
import java.util.HashMap;
import org.json.JSONException;
import org.json.JSONObject;

public class FetchCategoryEffectTask extends NormalTask {
    public String category;
    public int count;
    public int cursor;
    public EffectConfiguration mConfiguration;
    public int mCurCnt = this.mConfiguration.getRetryCount();
    public EffectContext mEffectContext;
    public ICache mFileCache;
    public IJsonConverter mJsonConverter = this.mConfiguration.getJsonConverter();
    public String mRemoteIp;
    public String mRequestedUrl;
    public String mSelectedHost;
    public IMonitorService monitorService = this.mConfiguration.getMonitorService();
    public String panel;
    public int requestStrategy = this.mConfiguration.getRequestStrategy();
    public long size;
    public int sortingPosition;
    public String version;

    static {
        Covode.recordClassIndex(125506);
    }

    private EffectRequest buildEffectListRequest() {
        String str;
        HashMap<String, String> addCommonParams = EffectRequestUtil.INSTANCE.addCommonParams(this.mConfiguration);
        if (!TextUtils.isEmpty(this.panel)) {
            addCommonParams.put("panel", this.panel);
        }
        addCommonParams.put("category", this.category);
        addCommonParams.put("cursor", String.valueOf(this.cursor));
        addCommonParams.put("count", String.valueOf(this.count));
        addCommonParams.put("sorting_position", String.valueOf(this.sortingPosition));
        addCommonParams.put("version", String.valueOf(this.version));
        String testStatus = this.mConfiguration.getTestStatus();
        if (!TextUtils.isEmpty(testStatus)) {
            addCommonParams.put("test_status", testStatus);
        }
        this.mSelectedHost = this.mEffectContext.getBestHostUrl();
        StringBuilder sb = new StringBuilder();
        sb.append(this.mSelectedHost);
        sb.append(this.mConfiguration.getApiAdress());
        if (this.requestStrategy == 2) {
            str = "/category/effects/v2";
        } else {
            str = "/category/effects";
        }
        sb.append(str);
        String buildRequestUrl = NetworkUtils.buildRequestUrl(addCommonParams, sb.toString());
        this.mRequestedUrl = buildRequestUrl;
        try {
            this.mRemoteIp = InetAddress.getByName(new URL(buildRequestUrl).getHost()).getHostAddress();
        } catch (UnknownHostException e) {
            0HH.LIZ(e);
        } catch (MalformedURLException e2) {
            0HH.LIZ(e2);
        }
        return new EffectRequest("GET", buildRequestUrl);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:27:0x017d, code lost:
        r1 = e;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:34:0x0188, code lost:
        onFail(new com.ss.android.ugc.effectmanager.common.task.ExceptionResult(r1));
     */
    /* JADX WARNING: Code restructure failed: missing block: B:35:0x0191, code lost:
        com.ss.android.ugc.effectmanager.common.utils.CloseUtil.close(r3);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:42:0x01a2, code lost:
        r0 = th;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:43:0x01a4, code lost:
        com.ss.android.ugc.effectmanager.common.utils.CloseUtil.close(r3);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:44:0x01a7, code lost:
        return;
     */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Removed duplicated region for block: B:34:0x0188 A[Catch:{ all -> 0x01a8 }, EDGE_INSN: B:50:0x0188->B:34:0x0188 ?: BREAK  
    EDGE_INSN: B:51:0x0188->B:34:0x0188 ?: BREAK  ] */
    /* JADX WARNING: Removed duplicated region for block: B:35:0x0191  */
    /* JADX WARNING: Removed duplicated region for block: B:42:0x01a2 A[ExcHandler: all (th java.lang.Throwable), Splitter:B:9:0x002f] */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public void execute() {
        /*
            r18 = this;
            r4 = r18
            long r14 = java.lang.System.currentTimeMillis()
            com.ss.android.ugc.effectmanager.common.EffectRequest r5 = r18.buildEffectListRequest()
        L_0x000a:
            int r1 = r4.mCurCnt
            int r0 = r1 + -1
            r4.mCurCnt = r0
            if (r1 == 0) goto L_0x01ad
            r3 = 0
            boolean r0 = r18.isCanceled()     // Catch:{ Exception -> 0x017f }
            if (r0 == 0) goto L_0x0025
            com.ss.android.ugc.effectmanager.common.task.ExceptionResult r1 = new com.ss.android.ugc.effectmanager.common.task.ExceptionResult     // Catch:{ Exception -> 0x017f }
            r0 = 10001(0x2711, float:1.4014E-41)
            r1.<init>((int) r0)     // Catch:{ Exception -> 0x017f }
            r4.onFail(r1)     // Catch:{ Exception -> 0x017f }
            goto L_0x0196
        L_0x0025:
            com.ss.android.ugc.effectmanager.EffectConfiguration r0 = r4.mConfiguration     // Catch:{ Exception -> 0x017f }
            com.ss.android.ugc.effectmanager.common.network.EffectNetWorkerWrapper r0 = r0.getEffectNetWorker()     // Catch:{ Exception -> 0x017f }
            java.io.InputStream r3 = r0.execute(r5)     // Catch:{ Exception -> 0x017f }
            long r16 = java.lang.System.currentTimeMillis()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.EffectConfiguration r0 = r4.mConfiguration     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.common.network.EffectNetWorkerWrapper r2 = r0.getEffectNetWorker()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.common.listener.IJsonConverter r1 = r4.mJsonConverter     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.lang.Class<com.ss.android.ugc.effectmanager.effect.model.net.CategoryEffectListResponse> r0 = com.ss.android.ugc.effectmanager.effect.model.net.CategoryEffectListResponse.class
            com.ss.android.ugc.effectmanager.common.model.BaseNetResponse r2 = r2.parse(r5, r3, r1, r0)     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.effect.model.net.CategoryEffectListResponse r2 = (com.ss.android.ugc.effectmanager.effect.model.net.CategoryEffectListResponse) r2     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            long r12 = java.lang.System.currentTimeMillis()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            boolean r0 = r2.checkValue()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            if (r0 != 0) goto L_0x0061
            int r0 = r4.mCurCnt     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            if (r0 != 0) goto L_0x005d
            com.ss.android.ugc.effectmanager.common.task.ExceptionResult r1 = new com.ss.android.ugc.effectmanager.common.task.ExceptionResult     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            r0 = 10002(0x2712, float:1.4016E-41)
            r1.<init>((int) r0)     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            r4.onFail(r1)     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            goto L_0x019a
        L_0x005d:
            com.ss.android.ugc.effectmanager.common.utils.CloseUtil.close(r3)
            goto L_0x000a
        L_0x0061:
            com.ss.android.ugc.effectmanager.effect.model.CategoryPageModel r6 = r2.getData()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.EffectConfiguration r0 = r4.mConfiguration     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.io.File r0 = r0.getEffectDir()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.lang.String r8 = r0.getAbsolutePath()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.lang.String r7 = r4.panel     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.lang.String r1 = r2.getRecId()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.effect.model.CategoryEffectModel r0 = r6.getCategoryEffects()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.util.List r0 = r0.getEffects()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.common.utils.EffectUtils.setEffectField(r8, r7, r1, r0)     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.EffectConfiguration r0 = r4.mConfiguration     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.io.File r0 = r0.getEffectDir()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.lang.String r8 = r0.getAbsolutePath()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.lang.String r7 = r4.panel     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.lang.String r1 = r2.getRecId()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.effect.model.CategoryEffectModel r0 = r6.getCategoryEffects()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.util.List r0 = r0.getCollectEffects()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.common.utils.EffectUtils.setEffectField(r8, r7, r1, r0)     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.EffectConfiguration r0 = r4.mConfiguration     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.io.File r0 = r0.getEffectDir()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.lang.String r8 = r0.getAbsolutePath()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.lang.String r7 = r4.panel     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.lang.String r1 = r2.getRecId()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.effect.model.CategoryEffectModel r0 = r6.getCategoryEffects()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.util.List r0 = r0.getBindEffects()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.common.utils.EffectUtils.setEffectField(r8, r7, r1, r0)     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            int r1 = r4.requestStrategy     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            r0 = 2
            if (r1 != r0) goto L_0x00e8
            java.util.List r1 = r6.getUrl_prefix()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.effect.model.CategoryEffectModel r0 = r6.getCategoryEffects()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.util.List r0 = r0.getEffects()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.common.utils.EffectUtils.setUrlModel(r1, r0)     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.util.List r1 = r6.getUrl_prefix()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.effect.model.CategoryEffectModel r0 = r6.getCategoryEffects()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.util.List r0 = r0.getCollectEffects()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.common.utils.EffectUtils.setUrlModel(r1, r0)     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.util.List r1 = r6.getUrl_prefix()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.effect.model.CategoryEffectModel r0 = r6.getCategoryEffects()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.util.List r0 = r0.getBindEffects()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.common.utils.EffectUtils.setUrlModel(r1, r0)     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
        L_0x00e8:
            r4.saveEffectList(r2)     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            long r10 = java.lang.System.currentTimeMillis()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            com.ss.android.ugc.effectmanager.common.listener.IMonitorService r8 = r4.monitorService     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            if (r8 == 0) goto L_0x016f
            java.lang.String r7 = "category_list_success_rate"
            com.ss.android.ugc.effectmanager.common.utils.EventJsonBuilder r9 = com.ss.android.ugc.effectmanager.common.utils.EventJsonBuilder.newBuilder()     // Catch:{ Exception -> 0x017d, all -> 0x01a2 }
            java.lang.String r1 = "app_id"
            com.ss.android.ugc.effectmanager.EffectConfiguration r0 = r4.mConfiguration     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            java.lang.String r0 = r0.getAppID()     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            r9.addValuePair(r1, r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            java.lang.String r1 = "access_key"
            com.ss.android.ugc.effectmanager.EffectConfiguration r0 = r4.mConfiguration     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            java.lang.String r0 = r0.getAccessKey()     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            r9.addValuePair(r1, r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            java.lang.String r1 = "panel"
            java.lang.String r0 = r4.panel     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            r9.addValuePair(r1, r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            java.lang.String r1 = "category"
            java.lang.String r0 = r4.category     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            r9.addValuePair(r1, r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            java.lang.String r2 = "duration"
            long r0 = r10 - r14
            java.lang.Long r0 = java.lang.Long.valueOf(r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            r9.addValuePair(r2, r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            java.lang.String r2 = "network_time"
            long r0 = r16 - r14
            java.lang.Long r0 = java.lang.Long.valueOf(r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            r9.addValuePair(r2, r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            java.lang.String r2 = "json_time"
            long r0 = r12 - r16
            java.lang.Long r0 = java.lang.Long.valueOf(r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            r9.addValuePair(r2, r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            java.lang.String r1 = "io_time"
            long r10 = r10 - r12
            java.lang.Long r0 = java.lang.Long.valueOf(r10)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            r9.addValuePair(r1, r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            java.lang.String r2 = "size"
            long r0 = r4.size     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            java.lang.Long r0 = java.lang.Long.valueOf(r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            r9.addValuePair(r2, r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            java.lang.String r1 = "request_strategy"
            int r0 = r4.requestStrategy     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            java.lang.Integer r0 = java.lang.Integer.valueOf(r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            r9.addValuePair(r1, r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            java.lang.String r2 = "effect_platform_type"
            r1 = 0
            java.lang.Integer r0 = java.lang.Integer.valueOf(r1)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            r9.addValuePair(r2, r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            org.json.JSONObject r0 = r9.build()     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            r8.monitorStatusRate(r7, r1, r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
        L_0x016f:
            r2 = 21
            com.ss.android.ugc.effectmanager.effect.task.result.FetchCategoryEffectTaskResult r1 = new com.ss.android.ugc.effectmanager.effect.task.result.FetchCategoryEffectTaskResult     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            r0 = 0
            r1.<init>(r6, r0)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            r4.sendMessage(r2, r1)     // Catch:{ Exception -> 0x017b, all -> 0x01a2 }
            goto L_0x019e
        L_0x017b:
            r1 = move-exception
            goto L_0x0180
        L_0x017d:
            r1 = move-exception
            goto L_0x0180
        L_0x017f:
            r1 = move-exception
        L_0x0180:
            int r0 = r4.mCurCnt     // Catch:{ all -> 0x01a8 }
            if (r0 == 0) goto L_0x0188
            boolean r0 = r1 instanceof com.ss.android.ugc.effectmanager.common.exception.StatusCodeException     // Catch:{ all -> 0x01a8 }
            if (r0 == 0) goto L_0x0191
        L_0x0188:
            com.ss.android.ugc.effectmanager.common.task.ExceptionResult r0 = new com.ss.android.ugc.effectmanager.common.task.ExceptionResult     // Catch:{ all -> 0x01a8 }
            r0.<init>((java.lang.Exception) r1)     // Catch:{ all -> 0x01a8 }
            r4.onFail(r0)     // Catch:{ all -> 0x01a8 }
            goto L_0x01a4
        L_0x0191:
            com.ss.android.ugc.effectmanager.common.utils.CloseUtil.close(r3)
            goto L_0x000a
        L_0x0196:
            com.ss.android.ugc.effectmanager.common.utils.CloseUtil.close(r3)
            return
        L_0x019a:
            com.ss.android.ugc.effectmanager.common.utils.CloseUtil.close(r3)
            return
        L_0x019e:
            com.ss.android.ugc.effectmanager.common.utils.CloseUtil.close(r3)
            return
        L_0x01a2:
            r0 = move-exception
            goto L_0x01a9
        L_0x01a4:
            com.ss.android.ugc.effectmanager.common.utils.CloseUtil.close(r3)
            return
        L_0x01a8:
            r0 = move-exception
        L_0x01a9:
            com.ss.android.ugc.effectmanager.common.utils.CloseUtil.close(r3)
            throw r0
        L_0x01ad:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.effectmanager.effect.task.task.oldtask.FetchCategoryEffectTask.execute():void");
    }

    private void onFail(ExceptionResult exceptionResult) {
        exceptionResult.setTrackParams(this.mRequestedUrl, this.mSelectedHost, this.mRemoteIp);
        sendMessage(21, new FetchCategoryEffectTaskResult((CategoryPageModel) null, exceptionResult));
        IMonitorService iMonitorService = this.monitorService;
        if (iMonitorService != null) {
            EventJsonBuilder newBuilder = EventJsonBuilder.newBuilder();
            newBuilder.addValuePair("app_id", this.mConfiguration.getAppID());
            newBuilder.addValuePair("access_key", this.mConfiguration.getAccessKey());
            newBuilder.addValuePair("panel", this.panel);
            newBuilder.addValuePair("category", this.category);
            newBuilder.addValuePair("error_code", Integer.valueOf(exceptionResult.getErrorCode()));
            newBuilder.addValuePair("error_msg", exceptionResult.getMsg());
            newBuilder.addValuePair("download_url", this.mRequestedUrl);
            newBuilder.addValuePair("host_ip", this.mRemoteIp);
            newBuilder.addValuePair("effect_platform_type", 0);
            iMonitorService.monitorStatusRate("category_list_success_rate", 1, newBuilder.build());
        }
    }

    private void saveEffectList(CategoryEffectListResponse categoryEffectListResponse) {
        String generateCategoryEffectKey = EffectCacheKeyGenerator.generateCategoryEffectKey(this.panel, this.category, this.count, this.cursor, this.sortingPosition);
        try {
            this.size = this.mFileCache.save(generateCategoryEffectKey, this.mJsonConverter.convertObjToJson(categoryEffectListResponse)) / ((long) EffectConstants.KB);
        } catch (Exception e) {
            EPLog.e("FetchCategoryEffectTask", Log.getStackTraceString(e));
        }
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("version", categoryEffectListResponse.getData().getCategoryEffects().getVersion());
            jSONObject.put("cursor", categoryEffectListResponse.getData().getCategoryEffects().getCursor());
            jSONObject.put("sorting_position", categoryEffectListResponse.getData().getCategoryEffects().getSortingPosition());
            this.mFileCache.save(EffectCacheKeyGenerator.generateCategoryVersionKey(this.panel, this.category), jSONObject.toString());
        } catch (JSONException e2) {
            0HH.LIZ(e2);
        }
    }

    public FetchCategoryEffectTask(EffectContext effectContext, String str, String str2, String str3, int i, int i2, int i3, String str4, Handler handler) {
        super(handler, str2);
        this.panel = str;
        this.category = str3;
        this.count = i;
        this.cursor = i2;
        this.sortingPosition = i3;
        this.version = str4;
        this.mEffectContext = effectContext;
        EffectConfiguration effectConfiguration = effectContext.getEffectConfiguration();
        this.mConfiguration = effectConfiguration;
        this.mFileCache = effectConfiguration.getCache();
    }
}
