LINE.apk(点击下载) / TimelineRebootResetWorker.java


package com.linecorp.line.timeline.reboot.task;

import android.content.Context;
import androidx.work.ListenableWorker;
import androidx.work.Worker;
import androidx.work.WorkerParameters;
import em3.q;
import im1.a;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import kotlin.Metadata;
import org.json.JSONObject;
import sm3.b;
import zq0.c;

@Metadata(bv = {}, d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u00002\u00020\u0001B\u0017\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\u0006\u0010\u0005\u001a\u00020\u0004¢\u0006\u0004\b\u0006\u0010\u0007¨\u0006\b"}, d2 = {"Lcom/linecorp/line/timeline/reboot/task/TimelineRebootResetWorker;", "Landroidx/work/Worker;", "Landroid/content/Context;", "context", "Landroidx/work/WorkerParameters;", "workerParams", "<init>", "(Landroid/content/Context;Landroidx/work/WorkerParameters;)V", "timeline-feature_release"}, k = 1, mv = {1, 6, 0})
public final class TimelineRebootResetWorker extends Worker {
    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public TimelineRebootResetWorker(Context context, WorkerParameters workerParameters) {
        super(context, workerParameters);
        q.f(context, "context");
        q.f(workerParameters, "workerParams");
    }

    @Override // androidx.work.Worker
    public ListenableWorker.a doWork() {
        try {
            URLConnection openConnection = new URL("http://timeline-reboot-status-api.line-apps-beta.com/internal/v1/reboot/resetAllStatus").openConnection();
            if (openConnection != null) {
                HttpURLConnection httpURLConnection = (HttpURLConnection) openConnection;
                httpURLConnection.setRequestMethod("POST");
                httpURLConnection.setRequestProperty("Content-Type", "application/json");
                httpURLConnection.setDoOutput(true);
                httpURLConnection.setDoInput(true);
                JSONObject jSONObject = new JSONObject();
                jSONObject.put(c.QUERY_KEY_MID, a.r().k().f44910b);
                OutputStream outputStream = httpURLConnection.getOutputStream();
                String jSONObject2 = jSONObject.toString();
                q.e(jSONObject2, "requestObject.toString()");
                byte[] bytes = jSONObject2.getBytes(b.f143620b);
                q.e(bytes, "this as java.lang.String).getBytes(charset)");
                outputStream.write(bytes);
                outputStream.flush();
                outputStream.close();
                if (httpURLConnection.getResponseCode() == 200) {
                    return new ListenableWorker.a.c();
                }
                return new ListenableWorker.a.C0120a();
            }
            throw new NullPointerException("null cannot be cast to non-null type java.net.HttpURLConnection");
        } catch (Exception unused) {
            return new ListenableWorker.a.C0120a();
        }
    }
}