package com.kakao.util.apicompatibility;

import android.content.Intent;
import android.provider.Telephony;
import android.telephony.SmsMessage;
import com.bytedance.covode.number.Covode;
import com.kakao.util.helper.log.Logger;

public class APILevel19Compatibility extends APILevel9Compatibility {
    static {
        Covode.recordClassIndex(45983);
    }

    public String getSmsMessage(Intent intent) {
        SmsMessage[] messagesFromIntent = Telephony.Sms.Intents.getMessagesFromIntent(intent);
        int length = messagesFromIntent.length;
        String str = null;
        int i = 0;
        while (true) {
            if (i >= length) {
                break;
            }
            SmsMessage smsMessage = messagesFromIntent[i];
            Logger.d("KitKat or newer");
            if (smsMessage == null) {
                Logger.e("SMS message is null -- ABORT");
                break;
            }
            str = smsMessage.getDisplayMessageBody();
            i++;
        }
        return str;
    }
}
