导航菜单

页面标题

页面副标题

Housing v14.7.8 - MessageReceiver.java 源代码

正在查看: Housing v14.7.8 应用的 MessageReceiver.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.gspl.leegalitysdk;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class MessageReceiver extends BroadcastReceiver {
    private static e messageListener;

    public static void a(Leegality leegality) {
        messageListener = leegality;
    }

    @Override
    public final void onReceive(Context context, Intent intent) {
        Bundle extras;
        if (!"android.provider.Telephony.SMS_RECEIVED".equals(intent.getAction()) || (extras = intent.getExtras()) == null) {
            return;
        }
        try {
            Object[] objArr = (Object[]) extras.get("pdus");
            if (objArr != null) {
                int length = objArr.length;
                SmsMessage[] smsMessageArr = new SmsMessage[length];
                for (int i = 0; i < length; i++) {
                    SmsMessage createFromPdu = SmsMessage.createFromPdu((byte[]) objArr[i]);
                    smsMessageArr[i] = createFromPdu;
                    String originatingAddress = createFromPdu.getOriginatingAddress();
                    String messageBody = smsMessageArr[i].getMessageBody();
                    if (Pattern.compile(".*LEGLTY$").matcher(originatingAddress).find()) {
                        Matcher matcher = Pattern.compile("[0-9]{6}").matcher(messageBody);
                        if (matcher.find()) {
                            ((Leegality) messageListener).n(matcher.group(), f.SELF);
                        }
                    } else if (Pattern.compile(".*ADHAAR$").matcher(originatingAddress).find()) {
                        Matcher matcher2 = Pattern.compile("[0-9]{6}").matcher(messageBody);
                        if (matcher2.find()) {
                            ((Leegality) messageListener).n(matcher2.group(), f.AADHAAR);
                        }
                    }
                }
            }
        } catch (Exception unused) {
        }
    }
}