package com.igexin.getuiext.service; import android.content.Intent; import android.os.Handler; import android.os.Looper; import android.os.Message; import asmack.org.jivesoftware.smackx.Form; import com.igexin.getuiext.data.Consts; import com.igexin.getuiext.data.a.b; import com.igexin.getuiext.util.c; import com.igexin.getuiext.util.d; import com.igexin.getuiext.util.g; import java.util.ArrayList; import org.json.JSONException; import org.json.JSONObject; public class i extends Handler { /* renamed from: a reason: collision with root package name */ final /* synthetic */ GetuiExtService f7204a; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public i(GetuiExtService getuiExtService, Looper looper) { super(looper); this.f7204a = getuiExtService; } private boolean a(String str) { String str2; ArrayList a2 = a.a(str); if (a2 != null && a2.size() > 0) { StringBuffer stringBuffer = new StringBuffer(); int size = a2.size(); for (int i = 0; i < size; i++) { if (i > 0) { stringBuffer.append("\n"); } stringBuffer.append(((b) a2.get(i)).f7172b); } String str3 = null; try { JSONObject jSONObject = new JSONObject(); jSONObject.put("action", "upload_BI"); jSONObject.put("BIType", str); jSONObject.put("cid", Consts.CID); jSONObject.put("BIData", new String(d.a(stringBuffer.toString().getBytes(), 0), "UTF-8")); str2 = c.a("http://sdk.open.phone.igexin.com/api.php?format=json&t=1", g.a(jSONObject.toString().getBytes()), Consts.DEFAULT_RETRY_TIMES); } catch (Exception unused) { str2 = null; } if (str2 != null) { try { str3 = new JSONObject(str2).getString(Form.TYPE_RESULT); } catch (JSONException unused2) { } return str3 != null && str3.equals("ok"); } } } public void a(String str, int i) { a.a(str, i); if (a("2")) { a.b("2"); } if (a("3")) { a.b("3"); } if (a("13")) { a.b("13"); } } public void handleMessage(Message message) { Intent intent; if (message.what == 11002 && (intent = (Intent) message.obj) != null) { a(intent.getStringExtra("BIData"), Integer.valueOf(intent.getStringExtra("BIType")).intValue()); } } }