public k a(Intent intent) { k kVar = null; String action = intent.getAction(); c.a("receive an intent from server, action=" + action); if ("com.xiaomi.mipush.RECEIVE_MESSAGE".equals(action)) { byte[] byteArrayExtra = intent.getByteArrayExtra("mipush_payload"); boolean booleanExtra = intent.getBooleanExtra("mipush_notified", false); if (byteArrayExtra == null) { c.c("receiving an empty message, drop"); } else { C1112s c1112s = new C1112s(); try { S.a(c1112s, byteArrayExtra); m a = m.a(this.b); if (!(c1112s.a() != C1094a.SendMessage || c1112s.m() == null || a.l() || booleanExtra)) { a(c1112s); } if (!a.i() && c1112s.a != C1094a.Registration) { c.c("receive message without registration. need unregister or re-register!"); } else if (!a.i() || !a.n()) { kVar = a(c1112s, booleanExtra, byteArrayExtra); } else if (c1112s.a == C1094a.UnRegistration) { a.h(); f.d(this.b); PushMessageHandler.a(); } else { f.g(this.b); } } catch (Throwable e) { c.a(e); } catch (Throwable e2) { c.a(e2); } } } else if ("com.xiaomi.mipush.ERROR".equals(action)) { kVar = new i(); Object c1112s2 = new C1112s(); try { byte[] byteArrayExtra2 = intent.getByteArrayExtra("mipush_payload"); if (byteArrayExtra2 != null) { S.a(c1112s2, byteArrayExtra2); } } catch (f e3) { } kVar.a(String.valueOf(c1112s2.a())); kVar.a((long) intent.getIntExtra("mipush_error_code", 0)); kVar.b(intent.getStringExtra("mipush_error_msg")); c.c( "receive a error message. code = " + intent.getIntExtra("mipush_error_code", 0) + ", msg= " + intent.getStringExtra("mipush_error_msg")); } return kVar; }