翰林优商.apk(点击下载) / APKStatusBroadcastReceiver.java


package com.sigmob.sdk.nativead;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import com.czhj.sdk.common.utils.Preconditions;
import com.sigmob.sdk.base.common.BaseBroadcastReceiver;
import com.sigmob.sdk.base.common.k;
import com.sigmob.sdk.base.models.IntentActions;

public class APKStatusBroadcastReceiver extends BaseBroadcastReceiver {
    k.a a;
    IntentFilter b;

    public APKStatusBroadcastReceiver(k.a aVar, String str) {
        super(str);
        this.a = aVar;
    }

    @Override // com.sigmob.sdk.base.common.BaseBroadcastReceiver
    public IntentFilter a() {
        if (this.b == null) {
            IntentFilter intentFilter = new IntentFilter();
            this.b = intentFilter;
            intentFilter.addAction(IntentActions.ACTION_INTERSTITIAL_DOWNLOAD_START);
            this.b.addAction(IntentActions.ACTION_INTERSTITIAL_DOWNLOAD_END);
            this.b.addAction(IntentActions.ACTION_INTERSTITIAL_INSTALL_START);
            this.b.addAction(IntentActions.ACTION_INTERSTITIAL_INSTALL_END);
        }
        return this.b;
    }

    @Override // com.sigmob.sdk.base.common.BaseBroadcastReceiver
    public void b(BroadcastReceiver broadcastReceiver) {
        super.b(broadcastReceiver);
        this.a = null;
    }

    public void onReceive(Context context, Intent intent) {
        Preconditions.NoThrow.checkNotNull(context);
        Preconditions.NoThrow.checkNotNull(intent);
        if (this.a != null && a(intent)) {
            String action = intent.getAction();
            boolean equalsIgnoreCase = "1".equalsIgnoreCase(intent.getStringExtra("result"));
            long longExtra = intent.getLongExtra("downloadId", -1);
            action.hashCode();
            char c = 65535;
            switch (action.hashCode()) {
                case -1616853332:
                    if (action.equals(IntentActions.ACTION_INTERSTITIAL_INSTALL_END)) {
                        c = 0;
                        break;
                    }
                    break;
                case -845837224:
                    if (action.equals(IntentActions.ACTION_INTERSTITIAL_DOWNLOAD_START)) {
                        c = 1;
                        break;
                    }
                    break;
                case 535418449:
                    if (action.equals(IntentActions.ACTION_INTERSTITIAL_DOWNLOAD_END)) {
                        c = 2;
                        break;
                    }
                    break;
                case 995217907:
                    if (action.equals(IntentActions.ACTION_INTERSTITIAL_INSTALL_START)) {
                        c = 3;
                        break;
                    }
                    break;
            }
            switch (c) {
                case 0:
                    this.a.b(equalsIgnoreCase);
                    return;
                case 1:
                    this.a.a(equalsIgnoreCase, longExtra);
                    return;
                case 2:
                    this.a.b(equalsIgnoreCase, longExtra);
                    return;
                case 3:
                    this.a.a(equalsIgnoreCase);
                    return;
                default:
                    return;
            }
        }
    }
}