大漢易經書院.apk(点击下载) / el.java


package com.xiaomi.push;

import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import com.meizu.cloud.pushsdk.constants.PushConstants;
import com.xiaomi.channel.commonutils.logger.b;
import com.xiaomi.push.service.l;

/* access modifiers changed from: package-private */
public class el implements eh {
    el() {
    }

    private void a(Service service, Intent intent) {
        if ("com.xiaomi.mipush.sdk.WAKEUP".equals(intent.getAction())) {
            String stringExtra = intent.getStringExtra("waker_pkgname");
            String stringExtra2 = intent.getStringExtra("awake_info");
            if (TextUtils.isEmpty(stringExtra)) {
                ea.a(service.getApplicationContext(), "service", 1007, "old version message");
            } else if (!TextUtils.isEmpty(stringExtra2)) {
                String b = dz.b(stringExtra2);
                boolean isEmpty = TextUtils.isEmpty(b);
                Context applicationContext = service.getApplicationContext();
                if (!isEmpty) {
                    ea.a(applicationContext, b, 1007, "old version message ");
                } else {
                    ea.a(applicationContext, "service", 1008, "B get a incorrect message");
                }
            } else {
                ea.a(service.getApplicationContext(), stringExtra, 1007, "play with service ");
            }
        }
    }

    private void a(Context context, String str, String str2, String str3) {
        if (context == null || TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
            if (TextUtils.isEmpty(str3)) {
                ea.a(context, "service", 1008, "argument error");
            } else {
                ea.a(context, str3, 1008, "argument error");
            }
        } else if (!l.a(context, str)) {
            ea.a(context, str3, 1003, "B is not ready");
        } else {
            ea.a(context, str3, PushConstants.PUSHSERVICE_INFO_SEND_MESSAGE_BY_NOTIFICATION_SERVICE_ERROR, "B is ready");
            ea.a(context, str3, 1004, "A is ready");
            try {
                Intent intent = new Intent();
                intent.setClassName(str, str2);
                intent.setAction("com.xiaomi.mipush.sdk.WAKEUP");
                intent.putExtra("waker_pkgname", context.getPackageName());
                intent.putExtra("awake_info", dz.a(str3));
                if (context.startService(intent) != null) {
                    ea.a(context, str3, 1005, "A is successful");
                    ea.a(context, str3, 1006, "The job is finished");
                    return;
                }
                ea.a(context, str3, 1008, "A is fail to help B's service");
            } catch (Exception e) {
                b.a(e);
                ea.a(context, str3, 1008, "A meet a exception when help B's service");
            }
        }
    }

    @Override // com.xiaomi.push.eh
    public void a(Context context, Intent intent, String str) {
        if (context != null && (context instanceof Service)) {
            a((Service) context, intent);
        }
    }

    @Override // com.xiaomi.push.eh
    public void a(Context context, ed edVar) {
        if (edVar != null) {
            a(context, edVar.m9311a(), edVar.c(), edVar.d());
        }
    }
}