package ඓ.ඓ.K.ῲ;

import com.mexico.inloancash.activity.IndiaLaunchActivity;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import org.json.JSONException;
import org.json.JSONObject;
import ඓ.ඓ.K.䁗.C0707;

/* renamed from: ඓ.ඓ.K.ῲ.㿎  reason: contains not printable characters */
/* compiled from: IndiaLaunchActivity */
public class RunnableC0646 implements Runnable {
    public RunnableC0646(IndiaLaunchActivity indiaLaunchActivity) {
    }

    public void run() {
        C0707.f3718 = "";
        try {
            HttpURLConnection httpURLConnection = (HttpURLConnection) new URL("http://pv.sohu.com/cityjson?ie=utf-8").openConnection();
            if (httpURLConnection.getResponseCode() == 200) {
                InputStream inputStream = httpURLConnection.getInputStream();
                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, "utf-8"));
                StringBuilder sb = new StringBuilder();
                while (true) {
                    String readLine = bufferedReader.readLine();
                    C0707.f3718 = readLine;
                    if (readLine == null) {
                        break;
                    }
                    sb.append(C0707.f3718 + "\n");
                }
                inputStream.close();
                String substring = sb.substring(sb.indexOf("{"), sb.indexOf("}") + 1);
                if (substring != null) {
                    try {
                        C0707.f3718 = new JSONObject(substring).optString("cip");
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }
}
