智能工厂.apk(点击下载) / a.java


package cn.jpush.android.k;

import android.app.Notification;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import androidx.core.view.MotionEventCompat;
import cn.jiguang.api.JCoreManager;
import cn.jiguang.internal.JConstants;
import cn.jpush.android.api.CallBackParams;
import cn.jpush.android.api.CustomMessage;
import cn.jpush.android.api.JPushInterface;
import cn.jpush.android.api.JThirdPlatFormInterface;
import cn.jpush.android.api.NotificationMessage;
import cn.jpush.android.cache.Key;
import cn.jpush.android.cache.Sp;
import cn.jpush.android.data.JPushLocalNotification;
import cn.jpush.android.helper.JCoreHelper;
import cn.jpush.android.helper.Logger;
import cn.jpush.android.helper.d;
import cn.jpush.android.helper.h;
import cn.jpush.android.local.JPushAction;
import cn.jpush.android.local.JPushConstants;
import cn.jpush.android.local.JPushResponse;
import cn.jpush.android.local.ProxyActivityAction;
import cn.jpush.android.p.f;
import cn.jpush.android.r.c;
import cn.jpush.android.r.e;
import cn.jpush.android.s.b;
import cn.jpush.android.service.JPushMessageReceiver;
import cn.jpush.android.service.SchedulerReceiver;
import cn.jpush.android.ups.UPSPushHelper;
import com.baidu.speech.utils.AsrError;
import com.nordnetab.chcp.main.config.ContentConfig;
import java.nio.ByteBuffer;
import java.util.LinkedList;
import java.util.Set;
import java.util.regex.Pattern;
import net.sourceforge.zbar.Symbol;
import org.json.JSONObject;

public class a extends JPushAction {
    private Boolean a;
    private Boolean b;
    private Context c;

    private static JSONObject a(ByteBuffer byteBuffer) {
        try {
            byteBuffer.getLong();
            byte[] bArr = new byte[byteBuffer.getShort()];
            byteBuffer.get(bArr);
            String str = new String(bArr, "UTF-8");
            Logger.d("JPushActionImpl", "parseBundle2Json content: " + str);
            return new JSONObject(str);
        } catch (Exception e) {
            Logger.w("JPushActionImpl", "parseBundle2Json exception:" + e.getMessage());
            return null;
        }
    }

    private static void a(Context context, int i, long j) {
        if (i != 10) {
            switch (i) {
                case MotionEventCompat.AXIS_SCROLL:
                    d.a().a(context, j, JPushInterface.ErrorCode.TIMEOUT);
                    return;
                case MotionEventCompat.AXIS_RELATIVE_X:
                    cn.jpush.android.t.a.a().b(context, j);
                    return;
                case MotionEventCompat.AXIS_RELATIVE_Y:
                case 29:
                    break;
                default:
                    return;
            }
        }
        cn.jpush.android.s.a.a(context, b.a().a(j), JPushInterface.ErrorCode.TIMEOUT, j);
    }

    private static void a(Context context, Bundle bundle) {
        if (bundle == null) {
            Logger.w("JPushActionImpl", "[setMaxNotificationNum] bundle is bull");
            return;
        }
        int i = bundle.getInt("num");
        Logger.dd("JPushActionImpl", "action:setMaxNotificationNum :" + i);
        int b2 = f.b();
        Logger.v("JPushActionImpl", "number in queue: " + b2);
        if (i < b2) {
            int i2 = b2 - i;
            Logger.v("JPushActionImpl", "decreaseNotification:" + i2);
            cn.jpush.android.p.b.c(context, i2);
        }
        cn.jpush.android.cache.a.c(context, i);
    }

    private static void a(Context context, JPushResponse jPushResponse) {
        Logger.dd("JPushActionImpl", "action:handleMsg:" + jPushResponse);
        int cmd = jPushResponse.getCmd();
        if (cmd != 3) {
            int i = 1;
            if (cmd != 10) {
                switch (cmd) {
                    case 25:
                        JSONObject a2 = a(jPushResponse.getBody());
                        if (a2 != null) {
                            switch (a2.optInt("cmd")) {
                                case 56:
                                    cn.jpush.android.b.d.a(context).a(a2);
                                    return;
                                case Symbol.PDF417 /*{ENCODED_INT: 57}*/:
                                    cn.jpush.android.m.b.a().a(context, a2);
                                    return;
                                case 58:
                                default:
                                    Logger.d("JPushActionImpl", "Unknown command for ctrl");
                                    return;
                                case 59:
                                    a(context, a2);
                                    return;
                                case 60:
                                    cn.jpush.android.p.b.a(context, 2, true);
                                    return;
                            }
                        } else {
                            return;
                        }
                    case MotionEventCompat.AXIS_SCROLL:
                        cn.jpush.android.r.a aVar = new cn.jpush.android.r.a(jPushResponse);
                        d.a().a(context, aVar.getRquestId(), aVar.a());
                        return;
                    case MotionEventCompat.AXIS_RELATIVE_X:
                        cn.jpush.android.r.a aVar2 = new cn.jpush.android.r.a(jPushResponse);
                        if (aVar2.a() == 0) {
                            cn.jpush.android.t.a.a().a(context, jPushResponse.getRquestId());
                            return;
                        } else {
                            cn.jpush.android.t.a.a().a(context, jPushResponse.getRquestId(), aVar2.a());
                            return;
                        }
                    case MotionEventCompat.AXIS_RELATIVE_Y:
                    case 29:
                        break;
                    default:
                        Logger.w("JPushActionImpl", "Unknown command for parsing inbound.");
                        return;
                }
            }
            String a3 = new e(jPushResponse).a();
            if (jPushResponse.getCmd() != 28) {
                i = 2;
            }
            cn.jpush.android.s.a.a(context, a3, i, jPushResponse.getRquestId());
            return;
        }
        c cVar = new c(jPushResponse);
        if (cn.jpush.android.cache.a.d(context)) {
            Logger.d("JPushActionImpl", "JPush was stoped");
            if (cVar.a() != 20) {
                return;
            }
        }
        cn.jpush.android.d.b.a(context, cVar);
    }

    private static void a(Context context, JSONObject jSONObject) {
        try {
            String optString = jSONObject.getJSONObject("content").optString("ids");
            if (!TextUtils.isEmpty(optString)) {
                Logger.d("JPushActionImpl", "dealCancelNotification ids=" + optString);
                String[] split = optString.split(",");
                LinkedList linkedList = new LinkedList();
                for (String str : split) {
                    if (!TextUtils.isEmpty(str)) {
                        if (cn.jpush.android.p.d.a(context, str)) {
                            int a2 = cn.jpush.android.p.b.a(str, 0);
                            Logger.d("JPushActionImpl", "message id:" + str + " is in local history ,try cancel notificationID : " + a2);
                            if (cn.jpush.android.p.b.a(context, a2)) {
                                cn.jpush.android.p.b.d(context, a2);
                                cn.jpush.android.helper.c.a(split.length == 2 ? split[1] : str, 1068, context);
                            }
                        } else if (!cn.jpush.android.p.d.a(context, str, null)) {
                            byte a3 = cn.jpush.android.t.c.a().a(context, str);
                            Logger.d("JPushActionImpl", "message id:" + str + " may be ospush channel,try cancel by sdkType: " + ((int) a3));
                            if (a3 != -1) {
                                cn.jpush.android.helper.c.a(str, "", a3, 1069, context);
                            }
                        } else {
                            Logger.d("JPushActionImpl", "dealCancelNotification , do nothing ");
                        }
                        linkedList.add(str);
                    }
                }
                cn.jpush.android.p.d.a(context, linkedList);
            }
        } catch (Throwable th) {
            Logger.w("JPushActionImpl", "dealCancelNotification e:" + th);
        }
    }

    private boolean a(Context context) {
        Boolean bool = this.a;
        if (bool != null) {
            return bool.booleanValue();
        }
        if (context == null) {
            Logger.ww("JPushActionImpl", "context is null");
            return false;
        }
        this.c = context.getApplicationContext();
        this.a = Boolean.valueOf(cn.jpush.android.u.a.g(context));
        return this.a.booleanValue();
    }

    private void b(Context context) {
        Logger.d("JPushActionImpl", "serviceInit...");
        try {
            if (this.b == null) {
                int i = 1;
                this.b = true;
                if (JPushConstants.SUPPORT_DY && JConstants.SDK_VERSION_INT >= 220) {
                    JCoreHelper.updateDy(context, 2);
                }
                cn.jpush.android.p.b.a(context, 0, true);
                c(context);
                Logger.d("JPushActionImpl", "google:false");
                int i2 = !TextUtils.isEmpty(JPushConstants.SDK_NAME) ? 2 : 0;
                if (JConstants.SDK_VERSION_INT < 220) {
                    i = 0;
                }
                if (cn.jpush.android.l.a.a != JPushConstants.SDK_VERSION_CODE) {
                    i = 2;
                }
                Logger.d("JPushActionImpl", "custom:" + i2 + ",dynamic:" + i);
                cn.jpush.android.p.e.a().a(context, null);
                JCoreHelper.reportSdkType(context, "push", i2, i, cn.jpush.android.l.a.a);
                if (JPushConstants.canGetLbsInBackGround(context)) {
                    cn.jpush.android.b.d.a(context).a();
                }
            }
        } catch (Throwable unused) {
        }
    }

    private static void b(Context context, Bundle bundle) {
        if (bundle == null) {
            Logger.w("JPushActionImpl", "[setSilenceTime] bundle is bull");
            return;
        }
        String string = bundle.getString("time");
        Logger.dd("JPushActionImpl", "action:setSilenceTime pushTime:" + string);
        cn.jpush.android.cache.a.c(context, string);
    }

    private void c(Context context) {
        try {
            Class.forName("cn.jpush.android.dy.JPushThirdDyManager").getDeclaredMethod(ContentConfig.JsonKeys.UPDATE, Context.class).invoke(null, context);
        } catch (Throwable unused) {
        }
    }

    private static void c(Context context, Bundle bundle) {
        if (bundle == null) {
            Logger.w("JPushActionImpl", "[setPushTime] bundle is bull");
            return;
        }
        cn.jpush.android.cache.a.b(context, true);
        String string = bundle.getString("time");
        if (Pattern.compile("([0-6]{0,7})_((" + "([0-9]|1[0-9]|2[0-3])\\^([0-9]|1[0-9]|2[0-3])" + ")|(" + "([0-9]|1[0-9]|2[0-3])\\^([0-9]|1[0-9]|2[0-3])" + "-)+(" + "([0-9]|1[0-9]|2[0-3])\\^([0-9]|1[0-9]|2[0-3])" + "))").matcher(string).matches()) {
            String g = cn.jpush.android.cache.a.g(context);
            if (string.equals(g)) {
                Logger.dd("JPushActionImpl", "Already SetPushTime, give up - " + g);
                return;
            }
            Logger.dd("JPushActionImpl", "action:setPushTime pushTime:" + string);
            cn.jpush.android.cache.a.b(context, string);
            return;
        }
        Logger.ee("JPushActionImpl", "Invalid time format - " + string);
    }

    @Override // cn.jpush.android.local.JPushAction
    public Object beforLogin(Context context, String str, int i, String str2) {
        String str3;
        String str4;
        a(context);
        if (context == null) {
            str3 = "JPushActionImpl";
            str4 = "context was null";
        } else if (TextUtils.isEmpty(str2)) {
            str3 = "JPushActionImpl";
            str4 = " filed name was empty";
        } else {
            if ("platformtype".equals(str2)) {
                if (i >= 16) {
                    return Byte.valueOf(cn.jpush.android.t.c.a().e(context));
                }
            } else if ("platformregid".equals(str2)) {
                return cn.jpush.android.t.c.a().f(context);
            }
            return null;
        }
        Logger.e(str3, str4);
        return null;
    }

    @Override // cn.jpush.android.local.JPushAction
    public ProxyActivityAction getPopWinActivity(Context context) {
        return new cn.jpush.android.ui.b();
    }

    @Override // cn.jpush.android.local.JPushAction
    public ProxyActivityAction getPushActivity(Context context) {
        return new cn.jpush.android.ui.c();
    }

    @Override // cn.jpush.android.local.JPushAction
    public String getSdkVersion(String str) {
        return cn.jpush.android.l.a.b;
    }

    @Override // cn.jpush.android.local.JPushAction
    public Object handleAction(Context context, String str, Object obj) {
        String str2;
        int i;
        String str3;
        Bundle bundle;
        Object[] objArr;
        int i2;
        Logger.d("JPushActionImpl", "handleAction:" + str);
        try {
            if (!a(context)) {
                return null;
            }
            if (context == null) {
                context = this.c;
            }
            if (TextUtils.isEmpty(str)) {
                Logger.w("JPushActionImpl", "action is empty");
                return null;
            }
            Bundle bundle2 = obj instanceof Bundle ? (Bundle) obj : null;
            if (str.equals("init")) {
                b(context);
            } else {
                if (str.equals("resume")) {
                    if (cn.jpush.android.cache.a.b(context, 0)) {
                        cn.jpush.android.p.b.b(context, AsrError.ERROR_NETWORK_FAIL_DATA_DOWN, 1, "set failed");
                        return null;
                    }
                    cn.jpush.android.p.b.b(context, AsrError.ERROR_NETWORK_FAIL_DATA_DOWN, 0, "set success");
                    cn.jpush.android.cache.a.a(context, 0);
                    str2 = JPushConstants.SDK_TYPE;
                    i = 1;
                    str3 = null;
                    bundle = null;
                    objArr = new Object[0];
                } else if (str.equals("stop")) {
                    if (cn.jpush.android.cache.a.b(context, 0)) {
                        cn.jpush.android.p.b.b(context, 2007, 1, "set failed");
                        return null;
                    }
                    Logger.dd("JPushActionImpl", "The service is stopped, it will give up all the actions until you call resumePush method to resume the service");
                    cn.jpush.android.p.b.b(context, 2007, 0, "set success");
                    cn.jpush.android.cache.a.a(context, 1);
                    str2 = JPushConstants.SDK_TYPE;
                    i = 0;
                    str3 = null;
                    bundle = null;
                    objArr = new Object[0];
                } else if (str.equals("clear_all_notify")) {
                    cn.jpush.android.p.b.a(context);
                } else if (str.equals("disable_push")) {
                    cn.jpush.android.cache.a.b(context, false);
                } else if (str.equals("geo_interval")) {
                    if (bundle2 != null) {
                        long j = bundle2.getLong("interval", -1);
                        if (j != -1) {
                            cn.jpush.android.b.d.a(context).a(j);
                        }
                    }
                } else if (str.equals("max_num")) {
                    a(context, bundle2);
                } else if (str.equals("set_mobile")) {
                    d.a().a(context, bundle2);
                } else if (str.equals("pushtime")) {
                    c(context, bundle2);
                } else if (str.equals("silenceTime")) {
                    b(context, bundle2);
                } else if (str.equals("geo_fence_max_num")) {
                    if (bundle2 != null && (i2 = bundle2.getInt("num", -1)) > 0) {
                        cn.jpush.android.b.d.a(context).a(i2);
                    }
                } else if (str.equals("enable_lbs")) {
                    if (bundle2 != null) {
                        boolean z = bundle2.getBoolean("enable", true);
                        cn.jpush.android.cache.a.c(context, z);
                        if (!z) {
                            Logger.dd("JPushActionImpl", "lbs is disabled,stop geo");
                            cn.jpush.android.b.d.a(context).b();
                        } else {
                            Logger.dd("JPushActionImpl", "lbs is enabled");
                            cn.jpush.android.b.d.a(context).a();
                        }
                    }
                } else if (str.equals("third_enable")) {
                    if (bundle2 != null) {
                        boolean z2 = bundle2.getBoolean("enable", true);
                        boolean a2 = cn.jpush.android.l.a.a();
                        if (!context.getPackageName().equals(cn.jpush.android.u.a.c(context))) {
                            Logger.dd("JPushActionImpl", "third enable:" + z2 + ",last :" + a2);
                        } else {
                            Logger.dd("JPushActionImpl", "third enable:" + z2);
                        }
                        try {
                            JPushConstants.THIRD_ENABLE = z2;
                        } catch (Throwable unused) {
                        }
                        if (z2) {
                            cn.jpush.android.t.c.a().i(context);
                        } else {
                            cn.jpush.android.t.c.a().g(context);
                        }
                    }
                } else if (str.equals("delete_geo_fence")) {
                    if (bundle2 != null) {
                        String string = bundle2.getString("id");
                        if (!TextUtils.isEmpty(string)) {
                            cn.jpush.android.b.d.a(context).a(string);
                        }
                    }
                } else if (str.equals("set_badge")) {
                    if (bundle2 != null) {
                        int i3 = bundle2.getInt("num");
                        Sp.set(context, Key.BadgeCurNum().set(Integer.valueOf(i3)));
                        cn.jpush.android.p.b.a(context, (Notification) null, i3, i3);
                    }
                } else if (str.equals("msg")) {
                    if (obj instanceof JPushResponse) {
                        a(context, (JPushResponse) obj);
                    }
                } else if (str.equals("msg_time_out")) {
                    if (bundle2 != null) {
                        a(context, bundle2.getInt("cmd", -1), bundle2.getLong("rid", -1));
                    }
                } else if (str.equals("tagalis")) {
                    cn.jpush.android.s.a.a(context, bundle2);
                } else if (str.equals("add_local_notify")) {
                    if (bundle2 != null) {
                        cn.jpush.android.n.a.a(context).a(context, (JPushLocalNotification) bundle2.getSerializable("local_notify"));
                    }
                } else if (str.equals("rm_local_notify")) {
                    if (bundle2 != null) {
                        cn.jpush.android.n.a.a(context).a(context, bundle2.getLong("local_notify_ID"));
                    }
                } else if (str.equals("clear_local_notify")) {
                    cn.jpush.android.n.a.a(context).b(context);
                } else if (str.equals("show_local_notify")) {
                    if (cn.jpush.android.cache.a.d(context)) {
                        Logger.dd("JPushActionImpl", "push has stoped");
                    } else if (bundle2 != null) {
                        String string2 = bundle2.getString("local_notify_msg");
                        if (!TextUtils.isEmpty(string2)) {
                            cn.jpush.android.d.d a3 = cn.jpush.android.d.d.a(string2, context.getPackageName(), JCoreHelper.getAppKey(context), 0);
                            if (a3 != null) {
                                a3.a(context);
                                cn.jpush.android.p.b.a(context, a3);
                            }
                        } else {
                            Logger.d("JPushActionImpl", "local message is empty");
                        }
                    }
                } else if (str.equals("set_custom_notify")) {
                    if (bundle2 != null) {
                        int i4 = bundle2.getInt("buidler_id", -1);
                        String string3 = bundle2.getString("buidler_string");
                        Logger.d("JPushActionImpl", "builderId:" + i4 + ",buildString:" + string3);
                        if (i4 >= 0 && !TextUtils.isEmpty(string3)) {
                            cn.jpush.android.cache.a.a(context, i4 + "", string3);
                        }
                    }
                } else if ("third_push_upload_regid".equals(str)) {
                    if (bundle2 != null) {
                        cn.jpush.android.t.c.a().a(context, bundle2);
                    }
                } else if (JThirdPlatFormInterface.ACTION_PLUGIN_PALTFORM_ON_MESSAGING.equals(str)) {
                    String string4 = bundle2.getString("appId");
                    String string5 = bundle2.getString("senderId");
                    String string6 = bundle2.getString("JMessageExtra");
                    byte b2 = bundle2.getByte(JThirdPlatFormInterface.KEY_PLATFORM);
                    Logger.d("JPushActionImpl", "appId:" + string4 + ",senderId:" + string5 + ",JMessageExtra:" + string6);
                    if (TextUtils.isEmpty(string6)) {
                        return null;
                    }
                    cn.jpush.android.d.b.a(context, 2, string6, TextUtils.isEmpty(string4) ? context.getPackageName() : string4, TextUtils.isEmpty(string5) ? JCoreHelper.getAppKey(context) : string5, 0, b2);
                } else if ("change_foreground".equals(str)) {
                    if (bundle2 != null) {
                        boolean z3 = bundle2.getBoolean("foreground");
                        if (JPushConstants.isForeGround == -1 && z3) {
                            Logger.d("JPushActionImpl", "first in foreground");
                            cn.jpush.android.b.d.a(context).a();
                        }
                        JPushConstants.isForeGround = z3 ? 0 : 1;
                        Logger.d("JPushActionImpl", "change foregroud:" + JPushConstants.isForeGround);
                        if (z3) {
                            cn.jpush.android.p.b.a(context, 1, false);
                        }
                    }
                } else if (str.equals("check_stop")) {
                    boolean d = cn.jpush.android.cache.a.d(context);
                    cn.jpush.android.p.b.b(context, AsrError.ERROR_NETWORK_FAIL_READ_UP, d ? 1 : 0, d ? "stopped" : "not stop");
                } else if (str.equals("get_connection")) {
                    boolean isTcpConnected = JPushConstants.isTcpConnected();
                    cn.jpush.android.p.b.b(context, AsrError.ERROR_NETWORK_FAIL_CONNECT_DOWN, !isTcpConnected ? 1 : 0, isTcpConnected ? "connected" : "not connect");
                } else if (str.equals("get_rid")) {
                    cn.jpush.android.p.b.b(context, AsrError.ERROR_NETWORK_FAIL_READ_DOWN, 0, JCoreHelper.getRegistrationID(context));
                } else if ("jcore_on_event".equals(str)) {
                    if (bundle2 != null) {
                        try {
                            int i5 = bundle2.getInt("type");
                            int i6 = bundle2.getInt("code");
                            String string7 = bundle2.getString("msg");
                            Logger.d("JPushActionImpl", "eventType:" + i5 + ",code:" + i6 + ",msg:" + string7);
                            if (!(i5 == -1 || i5 == 0 || i5 == 1 || i5 == 2000 || i5 == 2001)) {
                                if (i5 != 2002) {
                                    if (i5 == 19) {
                                        cn.jpush.android.n.a.a(context).d(context);
                                    }
                                }
                            }
                            if (i5 == 2000 || i5 == 2001 || i5 == 0 || i5 == 2002) {
                                if (i5 == 2000) {
                                    Sp.set(context, Key.UPSRegister().set(false));
                                    UPSPushHelper.upsCallBack(context, 0, "ups.unregister", i6, string7);
                                    return null;
                                }
                                Sp.set(context, Key.UPSRegister().set(true));
                                if ((i6 != 1 && i5 == 2001) || i5 == 2002) {
                                    UPSPushHelper.upsCallBack(context, 0, "ups.register", i6, string7);
                                    return null;
                                } else if (i5 == 0) {
                                    UPSPushHelper.upsCallBack(context, 0, "ups.register", i6, string7);
                                }
                            }
                            cn.jpush.android.p.b.b(context, i5, i6, string7);
                            if (i5 == 1) {
                                JPushConstants.setTcpConnected(true);
                                cn.jpush.android.t.c.a().h(context);
                            } else if (i5 == -1) {
                                JPushConstants.setTcpConnected(false);
                            }
                        } catch (Throwable th) {
                            Logger.w("JPushActionImpl", "onEvent failed:" + th.getMessage());
                        }
                    }
                } else if ("handle_msg".equals(str)) {
                    if (obj instanceof Intent) {
                        Intent intent = (Intent) obj;
                        String action = intent.getAction();
                        Logger.dd("JPushActionImpl", "handle third message:" + action);
                        if (JThirdPlatFormInterface.ACTION_PLUGIN_PALTFORM_REFRESSH_REGID.equals(action)) {
                            cn.jpush.android.t.c.a().b(context, intent != null ? intent.getExtras() : new Bundle());
                        }
                    }
                } else if ("third_init".equals(str)) {
                    cn.jpush.android.t.c.a().b(context);
                } else if ("third_resume".equals(str)) {
                    cn.jpush.android.t.c.a().c(context);
                } else if ("third_stop".equals(str)) {
                    cn.jpush.android.t.c.a().d(context);
                } else if ("third_action".equals(str)) {
                    if (bundle2 != null) {
                        cn.jpush.android.t.c.a().a(context, bundle2.getString("third_key_action"), bundle2);
                    }
                } else if (SchedulerReceiver.DELAY_NOTIFY.equals(str)) {
                    cn.jpush.android.p.e.a().a(context, null);
                } else if ("ups.turnOn".equals(str)) {
                    if (bundle2 != null) {
                        int i7 = bundle2.getInt(UPSPushHelper.KEY_RID);
                        if (cn.jpush.android.cache.a.b(context, 1)) {
                            UPSPushHelper.upsCallBack(context, i7, "ups.turnOn", 1, JCoreHelper.getRegistrationID(context));
                            return null;
                        }
                        UPSPushHelper.upsCallBack(context, i7, "ups.turnOn", 0, JCoreHelper.getRegistrationID(context));
                    }
                    cn.jpush.android.cache.a.a(context, true);
                    str2 = JPushConstants.SDK_TYPE;
                    i = 1;
                    str3 = null;
                    bundle = null;
                    objArr = new Object[0];
                } else if (!"ups.unregister".equals(str) && "ups.turnOff".equals(str)) {
                    if (bundle2 != null) {
                        int i8 = bundle2.getInt(UPSPushHelper.KEY_RID);
                        if (cn.jpush.android.cache.a.b(context, 1)) {
                            UPSPushHelper.upsCallBack(context, i8, "ups.turnOff", 1, JCoreHelper.getRegistrationID(context));
                            return null;
                        }
                        UPSPushHelper.upsCallBack(context, i8, "ups.turnOff", 0, JCoreHelper.getRegistrationID(context));
                    }
                    cn.jpush.android.cache.a.a(context, false);
                    str2 = JPushConstants.SDK_TYPE;
                    i = 0;
                    str3 = null;
                    bundle = null;
                    objArr = new Object[0];
                }
                JCoreManager.onEvent(context, str2, i, str3, bundle, objArr);
            }
            return null;
        } catch (Throwable th2) {
            Logger.e("JPushActionImpl", "handleAction failed:" + th2.getMessage());
        }
    }

    @Override // cn.jpush.android.local.JPushAction
    public void handleNotificationIntent(Context context, Intent intent) {
        cn.jpush.android.d.d a2 = cn.jpush.android.p.b.a(context, intent);
        Logger.i("JPushActionImpl", "handleNotificationIntent:" + a2);
        if (JPushInterface.ACTION_NOTIFICATION_OPENED.equals(intent.getAction()) && a2.k != 1) {
            if (a2.ab == 0) {
                cn.jpush.android.helper.c.a(a2.c, 1000, context);
            } else {
                JPushInterface.reportNotificationOpened(context, a2.c, a2.ab);
            }
            int c2 = cn.jpush.android.p.b.c(context, a2);
            Logger.d("JPushActionImpl", "is deep link:" + c2);
            if (c2 == 2) {
                if (h.b()) {
                    cn.jpush.android.p.b.b(context, a2);
                    return;
                }
                return;
            }
        }
        cn.jpush.android.p.b.a(context, intent.getAction(), a2, intent);
    }

    @Override // cn.jpush.android.local.JPushAction
    public void onJPushMessageReceive(Context context, JPushMessageReceiver jPushMessageReceiver, Intent intent) {
        cn.jpush.android.helper.a.a().a(context.getApplicationContext(), jPushMessageReceiver, intent);
    }

    @Override // cn.jpush.android.local.JPushAction
    public void onMessage(Context context, CustomMessage customMessage) {
        cn.jpush.android.helper.a.a(context, customMessage);
    }

    @Override // cn.jpush.android.local.JPushAction
    public void onMultiAction(Context context, Intent intent) {
        cn.jpush.android.helper.a.a(context, intent);
    }

    @Override // cn.jpush.android.local.JPushAction
    public void onNotifyMessageArrived(Context context, NotificationMessage notificationMessage) {
        cn.jpush.android.helper.a.a(context, notificationMessage, JPushInterface.ACTION_NOTIFICATION_RECEIVED);
    }

    @Override // cn.jpush.android.local.JPushAction
    public void onNotifyMessageOpened(Context context, NotificationMessage notificationMessage) {
        cn.jpush.android.helper.a.a(context, notificationMessage, JPushInterface.ACTION_NOTIFICATION_OPENED);
    }

    @Override // cn.jpush.android.local.JPushAction
    public void onTagAliasResponse(Context context, long j, int i, Intent intent) {
        cn.jpush.android.s.c.a().a(context.getApplicationContext(), j, i, intent);
    }

    @Override // cn.jpush.android.local.JPushAction
    public void setAliasAndTags(Context context, String str, Set<String> set, CallBackParams callBackParams) {
        cn.jpush.android.s.a.a(context, str, set, callBackParams);
    }
}