导航菜单

页面标题

页面副标题

Housing v14.7.8 - HousingCallReceiver.java 源代码

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

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


package com.locon.reactapp.seller;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import androidx.core.content.ContextCompat;
import com.google.firebase.crashlytics.FirebaseCrashlytics;
import com.google.firebase.perf.network.FirebasePerfOkHttpClient;
import com.locon.reactapp.BuildConfig;
import com.newrelic.agent.android.api.v2.TraceFieldInterface;
import com.newrelic.agent.android.instrumentation.AsyncTaskInstrumentation;
import com.newrelic.agent.android.instrumentation.Instrumented;
import com.newrelic.agent.android.instrumentation.okhttp3.OkHttp3Instrumentation;
import com.newrelic.agent.android.tracing.Trace;
import com.newrelic.agent.android.tracing.TraceMachine;
import com.newrelic.agent.android.util.SafeJsonPrimitive;
import com.ringlerr.callplus.n;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.json.JSONException;
import org.json.JSONObject;

@Instrumented
public class HousingCallReceiver extends BroadcastReceiver {

    @Instrumented
    public static class a extends AsyncTask implements TraceFieldInterface {
        public Trace _nr_trace;
        private String authToken;
        private String callerNum;
        private Context mContext;
        private String userNum;

        public a(Context context, String str, String str2, String str3) {
            this.mContext = context;
            this.callerNum = str;
            this.authToken = str2;
            this.userNum = str3;
        }

        @Override
        public final void _nr_setTrace(Trace trace) {
            try {
                this._nr_trace = trace;
            } catch (Exception unused) {
            }
        }

        public final void a(String str, String str2) {
            try {
                JSONObject jSONObject = new JSONObject(str);
                if (Boolean.parseBoolean(jSONObject.getString("lead_within_six_months"))) {
                    n.b(new JSONObject().put(com.facebook.react.bridge.a.RINGLER_PHONE_FROM_KEY, str2.substring(3)).put(com.facebook.react.bridge.a.RINGLER_MSG_ID_KEY, com.facebook.react.bridge.a.RINGLER_MSG_ID).put(com.facebook.react.bridge.a.RINGLER_REC_NAME_KEY, com.facebook.react.bridge.a.RINGLER_RECEIVER_NAME).put("message", com.facebook.react.bridge.a.RINGLER_CARD_MSG).put(com.facebook.react.bridge.a.RINGLER_PHONE_TO_KEY, this.userNum).put(com.facebook.react.bridge.a.RINGLER_BANNER_URL_KEY, "").put(com.facebook.react.bridge.a.RINGLER_CVC_KEY, "").put("type", "call").put(com.facebook.react.bridge.a.RINGLER_BUS_NAME_KEY, com.facebook.react.bridge.a.RINGLER_BUSINESS_NAME).put(com.facebook.react.bridge.a.RINGLER_CALLER_NAME_KEY, jSONObject.getString("name")).put("key", BuildConfig.RINGLERR_SDK_KEY_ANDROID), this.mContext);
                }
            } catch (JSONException e) {
                e.printStackTrace();
                FirebaseCrashlytics.getInstance().recordException(e);
            }
        }

        @Override
        public final Object doInBackground(Object[] objArr) {
            String string;
            try {
                TraceMachine.enterMethod(this._nr_trace, "HousingCallReceiver$RinglerDialogTask#doInBackground", null);
            } catch (NoSuchFieldError unused) {
                TraceMachine.enterMethod(null, "HousingCallReceiver$RinglerDialogTask#doInBackground", null);
            }
            OkHttpClient okHttpClient = new OkHttpClient();
            HttpUrl.Builder newBuilder = HttpUrl.parse(com.facebook.react.bridge.a.FETCH_NUMBER_LEAD_DETAILS_API).newBuilder();
            newBuilder.addQueryParameter(com.facebook.react.bridge.a.PHONE_NUMBER_KEY, this.callerNum.substring(3));
            Request.Builder addHeader = new Request.Builder().url(newBuilder.build().toString()).addHeader(com.facebook.react.bridge.a.LOGIN_AUTH_TOKEN, this.authToken);
            try {
                Response execute = FirebasePerfOkHttpClient.execute(OkHttp3Instrumentation.newCall(okHttpClient, addHeader == null ? addHeader.build() : OkHttp3Instrumentation.build(addHeader)));
                if (execute != null && execute.isSuccessful() && execute.body() != null && (string = execute.body().string()) != null) {
                    a(string, this.callerNum);
                }
            } catch (Exception e) {
                FirebaseCrashlytics.getInstance().recordException(e);
            }
            TraceMachine.exitMethod();
            return null;
        }
    }

    @Override
    public final void onReceive(Context context, Intent intent) {
        SharedPreferences sharedPreferences;
        String stringExtra = intent.getStringExtra("state");
        if (stringExtra == null || !stringExtra.equals(TelephonyManager.EXTRA_STATE_RINGING)) {
            return;
        }
        String stringExtra2 = intent.getStringExtra("incoming_number");
        new com.facebook.react.bridge.c();
        boolean z = ContextCompat.checkSelfPermission(context, "android.permission.READ_PHONE_STATE") == 0;
        boolean z2 = ContextCompat.checkSelfPermission(context, "android.permission.READ_CALL_LOG") == 0;
        boolean canDrawOverlays = Settings.canDrawOverlays(context);
        if (!z || !z2 || !canDrawOverlays || stringExtra2 == null || TextUtils.isEmpty(stringExtra2) || stringExtra2.equals(SafeJsonPrimitive.NULL_STRING)) {
            return;
        }
        if (context != null) {
            try {
                sharedPreferences = context.getSharedPreferences("prefFile", 0);
            } catch (Exception e) {
                e.printStackTrace();
                FirebaseCrashlytics.getInstance().recordException(e);
                return;
            }
        } else {
            sharedPreferences = null;
        }
        String str = "";
        String string = sharedPreferences == null ? "" : sharedPreferences.getString(com.facebook.react.bridge.a.AUTH_TOKEN_KEY, "");
        SharedPreferences sharedPreferences2 = context != null ? context.getSharedPreferences("prefFile", 0) : null;
        String string2 = sharedPreferences2 == null ? "" : sharedPreferences2.getString(com.facebook.react.bridge.a.COUNTRY_CODE_KEY, "");
        SharedPreferences sharedPreferences3 = context != null ? context.getSharedPreferences("prefFile", 0) : null;
        if (sharedPreferences3 != null) {
            str = sharedPreferences3.getString(com.facebook.react.bridge.a.USER_NUMBER_KEY, "");
        }
        SharedPreferences sharedPreferences4 = context != null ? context.getSharedPreferences("prefFile", 0) : null;
        boolean z3 = sharedPreferences4 == null ? false : sharedPreferences4.getBoolean(com.facebook.react.bridge.a.IS_RINGLER_ENABLED_KEY, false);
        if (string2 == null) {
            if (!TextUtils.isEmpty(string2)) {
            }
            if (context != null || !z3 || string == null || TextUtils.isEmpty(string) || str == null || TextUtils.isEmpty(str)) {
                return;
            }
            AsyncTaskInstrumentation.execute(new a(context, stringExtra2, string, str), new Void[0]);
            return;
        }
        str = string2.concat(str);
        if (context != null) {
        }
    }
}