package ir.devixor.app.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import ir.devixor.app.service.ForegroundService;
import o.AbstractC1692kh0;
import o.AbstractC1903ms;
import o.C0336Mz;
import o.C2468sq;
import o.C80;
import o.ExecutorC1232fq;
import o.F3;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class SmsRestartReceiver extends BroadcastReceiver {
    @Override // android.content.BroadcastReceiver
    public final void onReceive(Context context, Intent intent) {
        intent.getAction();
        if (F3.c(intent.getAction(), "android.provider.Telephony.SMS_RECEIVED")) {
            if (ForegroundService.w) {
                C2468sq c2468sq = AbstractC1903ms.a;
                AbstractC1692kh0.C(C80.e(ExecutorC1232fq.m), null, new C0336Mz(2, null, 1), 3);
            } else {
                try {
                    Intent intent2 = new Intent(context, (Class<?>) ForegroundService.class);
                    if (Build.VERSION.SDK_INT >= 26) {
                        context.startForegroundService(intent2);
                    } else {
                        context.startService(intent2);
                    }
                } catch (Exception unused) {
                }
            }
        }
    }
}
