导航菜单

页面标题

页面副标题

Oolka v2.4.42 - SendOutwardSMSActivity.java 源代码

正在查看: Oolka v2.4.42 应用的 SendOutwardSMSActivity.java JAVA 源代码文件

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


package com.ybl.ypp.sdk;

import android.app.Dialog;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings;
import android.telephony.SmsManager;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.util.Base64;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.b;
import androidx.media3.common.util.g0;
import com.google.gson.JsonObject;
import com.singular.sdk.internal.Constants;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.List;
import kotlin.io.ConstantsKt;
import one.upswing.sdk.A2;
import one.upswing.sdk.O0;
import one.upswing.sdk.a4;
import one.upswing.sdk.b1;
import one.upswing.sdk.d;
import one.upswing.sdk.g5;
import one.upswing.sdk.i1;
import one.upswing.sdk.i2;
import one.upswing.sdk.j2;
import one.upswing.sdk.k;
import one.upswing.sdk.k2;
import one.upswing.sdk.o3;
import one.upswing.sdk.u3;
import one.upswing.sdk.w3;
import one.upswing.sdk.w6;
import one.upswing.sdk.y3;
import one.upswing.sdk.y6;
import org.apache.fontbox.ttf.OS2WindowsMetricsTable;

public class SendOutwardSMSActivity extends AppCompatActivity {
    public static final Uri G5 = Uri.parse("content://sms/sent");
    public d A2;
    public PendingIntent A3;
    public PendingIntent A4;
    public boolean A5;
    public boolean B5;
    public String C5;
    public A2 D5;
    public y6 E5;
    public boolean F5;
    public List G;
    public final O0 W2;
    public int c1;
    public SendOutwardSMSActivity y1;
    public boolean z5;
    public String H = "";
    public String I = "";
    public String c0 = "";
    public String A0 = "";
    public String C0 = "";
    public double p1 = 0.0d;
    public double x1 = 0.0d;
    public int A1 = 1;
    public final String C1 = "SMS_SENT_ACTION";
    public final String V1 = "SMS_DELIVERED_ACTION";
    public final int p2 = 1;
    public String x2 = "";
    public String y2 = "";
    public boolean V2 = true;

    public SendOutwardSMSActivity() {
        if (O0.b == null) {
            O0.b = new O0();
        }
        this.W2 = O0.b;
        this.z5 = false;
        this.A5 = false;
        this.B5 = false;
        this.C5 = "";
        this.F5 = false;
    }

    public static void p0(SendOutwardSMSActivity sendOutwardSMSActivity, SendOutwardSMSActivity sendOutwardSMSActivity2, Handler handler) {
        sendOutwardSMSActivity.getClass();
        JsonObject jsonObject = new JsonObject();
        JsonObject jsonObject2 = new JsonObject();
        jsonObject.addProperty("partnerReferenceNumber", sendOutwardSMSActivity.getIntent().getStringExtra("PartnerReferenceNumber"));
        jsonObject.addProperty("smsSentResultCode", sendOutwardSMSActivity.C5);
        jsonObject.addProperty("isSmsSent", sendOutwardSMSActivity.z5 + "");
        jsonObject.addProperty("isRead", sendOutwardSMSActivity.A5 + "");
        jsonObject.addProperty("isMsgSent", sendOutwardSMSActivity.B5 + "");
        try {
            byte[] bArr = new byte[16];
            SecureRandom.getInstance("SHA1PRNG").nextBytes(bArr);
            String c = g5.c(jsonObject.toString(), sendOutwardSMSActivity.getIntent().getStringExtra("encryptionkey"), bArr);
            if (c.equals("")) {
                sendOutwardSMSActivity.s0("Invalid encryption key passed", "DB117");
            } else {
                jsonObject2.addProperty("iv", Base64.encodeToString(bArr, 2));
                jsonObject2.addProperty("key", sendOutwardSMSActivity.getIntent().getStringExtra("key"));
                jsonObject2.addProperty("serviceName", sendOutwardSMSActivity.getIntent().getStringExtra("servicename"));
                jsonObject2.addProperty("body", c);
                u3.b(sendOutwardSMSActivity2, ((y3) u3.a(sendOutwardSMSActivity2).b(y3.class)).a(jsonObject2, "3.17"), new w6(sendOutwardSMSActivity, handler));
            }
        } catch (Exception e) {
            e.getMessage();
        }
    }

    public static void q0(SendOutwardSMSActivity sendOutwardSMSActivity, String str, SendOutwardSMSActivity sendOutwardSMSActivity2, int i, int i2, String str2) {
        sendOutwardSMSActivity.getClass();
        if (b.a(sendOutwardSMSActivity2, "android.permission.SEND_SMS") != 0) {
            return;
        }
        Handler handler = new Handler();
        try {
            y6 y6Var = sendOutwardSMSActivity.E5;
            if (y6Var != null) {
                sendOutwardSMSActivity2.unregisterReceiver(y6Var);
                sendOutwardSMSActivity.E5 = null;
            }
            A2 a2 = sendOutwardSMSActivity.D5;
            if (a2 != null) {
                sendOutwardSMSActivity2.unregisterReceiver(a2);
                sendOutwardSMSActivity.D5 = null;
            }
            sendOutwardSMSActivity.A3 = PendingIntent.getBroadcast(sendOutwardSMSActivity2, 100, new Intent(sendOutwardSMSActivity.C1), 67108864);
            sendOutwardSMSActivity.A4 = PendingIntent.getBroadcast(sendOutwardSMSActivity2, OS2WindowsMetricsTable.WEIGHT_CLASS_ULTRA_LIGHT, new Intent(sendOutwardSMSActivity.V1), 67108864);
            y6 y6Var2 = new y6(sendOutwardSMSActivity);
            sendOutwardSMSActivity.E5 = y6Var2;
            int i3 = Build.VERSION.SDK_INT;
            if (i3 > 33) {
                g0.a(sendOutwardSMSActivity2, y6Var2, new IntentFilter(sendOutwardSMSActivity.C1), 2);
            } else {
                sendOutwardSMSActivity2.registerReceiver(y6Var2, new IntentFilter(sendOutwardSMSActivity.C1));
            }
            A2 a22 = new A2();
            sendOutwardSMSActivity.D5 = a22;
            if (i3 > 33) {
                g0.a(sendOutwardSMSActivity2, a22, new IntentFilter(sendOutwardSMSActivity.V1), 2);
            } else {
                sendOutwardSMSActivity2.registerReceiver(a22, new IntentFilter(sendOutwardSMSActivity.V1));
            }
            SmsManager.getSmsManagerForSubscriptionId(sendOutwardSMSActivity.c1).sendTextMessage(str2, null, str, sendOutwardSMSActivity.A3, sendOutwardSMSActivity.A4);
            d dVar = new d(sendOutwardSMSActivity, sendOutwardSMSActivity2, handler, i, i2);
            sendOutwardSMSActivity.A2 = dVar;
            handler.postDelayed(dVar, i);
        } catch (Exception e) {
            e.getMessage();
            handler.removeCallbacks(sendOutwardSMSActivity.A2);
            sendOutwardSMSActivity.s0("Unknown Error - " + e.getMessage(), "DB011");
        }
    }

    public final void n0() {
        try {
            if (getIntent().hasExtra("isTalsecImported") && !getIntent().getStringExtra("isTalsecImported").equals("") && getIntent().getStringExtra("isTalsecImported").equals("true") && g5.d(this.y1)) {
                this.F5 = true;
            }
            if (getIntent().getStringExtra("key") == null) {
                s0("Please Provide partner key", "P006");
                return;
            }
            if (getIntent().getStringExtra("key").trim().equals("")) {
                s0("Please Provide partner key", "P006");
                return;
            }
            if (getIntent().getStringExtra("key").length() != 10) {
                s0("Please Provide correct partner key", "P006");
                return;
            }
            if (getIntent().getStringExtra("simslot") == null) {
                s0("Please Provide sim slot", "P006");
                return;
            }
            if (getIntent().getStringExtra("simslot").equals("")) {
                s0("Please Provide sim slot", "DB008");
                return;
            }
            if (getIntent().getStringExtra("PartnerReferenceNumber") == null) {
                s0("Please Provide partner reference number", "P006");
                return;
            }
            if (getIntent().getStringExtra("PartnerReferenceNumber").equals("")) {
                s0("Please Provide partner reference number", "P006");
                return;
            }
            if (getIntent().getStringExtra("mobileNumber") == null) {
                s0("Please Provide mobile number", "P006");
                return;
            }
            if (getIntent().getStringExtra("mobileNumber").equals("")) {
                s0("Please Provide mobile number", "P006");
                return;
            }
            if (getIntent().getStringExtra("mobileNumber").length() < 8 || getIntent().getStringExtra("mobileNumber").length() > 10) {
                s0("Please Provide correct mobile number", "P006");
                return;
            }
            if (getIntent().getStringExtra("encryptionkey") == null) {
                s0("Please Provide encryption key", "P006");
                return;
            }
            if (getIntent().getStringExtra("encryptionkey").equals("")) {
                s0("Please Provide encryption key", "P006");
                return;
            }
            if (getIntent().getStringExtra("servicename") == null) {
                s0("Please Provide service name", "P006");
                return;
            }
            if (getIntent().getStringExtra("servicename").equals("")) {
                s0("Please Provide service name", "P006");
                return;
            }
            if (i1.b(this.y1, this.F5)) {
                s0("Device not supported", "DB010");
                return;
            }
            try {
                if (b.a(getApplicationContext(), "android.permission.ACCESS_FINE_LOCATION") != 0) {
                    this.A0 = g5.b(this.y1);
                    this.H = "Android " + Build.VERSION.RELEASE;
                    this.c0 = g5.a();
                    if (this.A0.equals("")) {
                        s0("Unknown Error", "DB011");
                    } else if (this.I.equals("")) {
                        s0("Unknown Error", "DB011");
                    } else {
                        o0(this);
                    }
                } else {
                    this.A0 = g5.b(this.y1);
                    this.H = "Android " + Build.VERSION.RELEASE;
                    this.c0 = g5.a();
                    new Handler(Looper.getMainLooper()).postDelayed(new w3(this), 2000L);
                }
            } catch (Exception e) {
                e.getMessage();
                s0("Unknown Error - " + e.getMessage(), "DB011");
            }
        } catch (Exception e2) {
            s0("Unknown Error - " + e2.getMessage(), "DB011");
        }
    }

    public final void o0(Context context) {
        String str;
        String str2;
        String str3;
        String str4;
        if (Settings.System.getInt(getContentResolver(), "airplane_mode_on", 0) == 1) {
            s0("Phone is on flight mode", "DB105");
            return;
        }
        try {
            List a = k.a(context);
            this.G = a;
            if (a == null) {
                s0("Unable to send SMS due to issue detected with selected sim - send sim details empty", "DB116");
                return;
            }
            if (a.size() <= 0) {
                s0("SIM not present / SIM Disabled", "DB008");
                return;
            }
            SubscriptionManager subscriptionManager = (SubscriptionManager) context.getSystemService("telephony_subscription_service");
            if (this.G.size() == 1) {
                if (subscriptionManager.getActiveSubscriptionInfoForSimSlotIndex(((SubscriptionInfo) this.G.get(0)).getSimSlotIndex()) != null) {
                    this.C0 = g5.b(context) + String.valueOf(((SubscriptionInfo) this.G.get(0)).getSubscriptionId());
                    this.c1 = ((SubscriptionInfo) this.G.get(0)).getSubscriptionId();
                    str3 = String.valueOf(((SubscriptionInfo) this.G.get(0)).getCarrierName());
                    str4 = String.valueOf(((SubscriptionInfo) this.G.get(0)).getMcc()) + String.valueOf(((SubscriptionInfo) this.G.get(0)).getMnc());
                } else {
                    s0("Unable to send SMS due to issue detected with selected sim - infoSim empty", "DB116");
                    str3 = "";
                    str4 = str3;
                }
                if (this.C0.equals("")) {
                    s0("Unable to send SMS due to issue detected with selected sim - subscriptionId empty (single sim)", "DB116");
                    return;
                } else {
                    t0(this.C0, str3, str4);
                    return;
                }
            }
            if (getIntent().getStringExtra("simslot").equalsIgnoreCase("0")) {
                this.C0 = g5.b(context) + String.valueOf(((SubscriptionInfo) this.G.get(0)).getSubscriptionId());
                this.c1 = ((SubscriptionInfo) this.G.get(0)).getSubscriptionId();
                str = String.valueOf(((SubscriptionInfo) this.G.get(0)).getCarrierName());
                str2 = String.valueOf(((SubscriptionInfo) this.G.get(0)).getMcc()) + String.valueOf(((SubscriptionInfo) this.G.get(0)).getMnc());
            } else if (getIntent().getStringExtra("simslot").equalsIgnoreCase(Constants.SdidMigrationStatusCodes.ALREADY_SDID)) {
                this.C0 = g5.b(context) + String.valueOf(((SubscriptionInfo) this.G.get(1)).getSubscriptionId());
                this.c1 = ((SubscriptionInfo) this.G.get(1)).getSubscriptionId();
                str = String.valueOf(((SubscriptionInfo) this.G.get(1)).getCarrierName());
                str2 = String.valueOf(((SubscriptionInfo) this.G.get(1)).getMcc()) + String.valueOf(((SubscriptionInfo) this.G.get(1)).getMnc());
            } else {
                s0("Pass correct sim slot", "DB013");
                str = "";
                str2 = str;
            }
            if (this.C0.equals("")) {
                s0("Unable to send SMS due to issue detected with selected sim - subscriptionId empty (dual sim)", "DB116");
            } else {
                t0(this.C0, str, str2);
            }
        } catch (Exception e) {
            e.getMessage();
            s0("Unknown Sim Error - " + e.getMessage(), "DB011");
        }
    }

    public final void onCreate(Bundle bundle) {
        String str;
        super/*androidx.fragment.app.FragmentActivity*/.onCreate(bundle);
        if (Build.VERSION.SDK_INT != 26) {
            setRequestedOrientation(1);
        }
        getWindow().setFlags(8192, 8192);
        setContentView(i2.c);
        this.y1 = this;
        this.I = getApplicationContext().getPackageName();
        AppCompatActivity appCompatActivity = this.y1;
        try {
            String[] strArr = appCompatActivity.getPackageManager().getPackageInfo(appCompatActivity.getPackageName(), ConstantsKt.DEFAULT_BLOCK_SIZE).requestedPermissions;
            if (strArr != null) {
                for (String str2 : strArr) {
                    str2.contains(appCompatActivity.getResources().getString(k2.a));
                    if (str2.contains(appCompatActivity.getResources().getString(k2.b))) {
                        g5.a = true;
                    }
                }
            }
        } catch (Exception e) {
            e.getMessage();
        }
        String str3 = this.I;
        try {
            MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
            messageDigest.update(str3.getBytes());
            byte[] digest = messageDigest.digest();
            StringBuilder sb = new StringBuilder();
            for (byte b : digest) {
                sb.append(String.format("%02x", Integer.valueOf(b & 255)));
            }
            str = sb.toString();
        } catch (NoSuchAlgorithmException e2) {
            e2.getMessage();
            str = null;
        }
        if (g5.b.contains(str) && !g5.a) {
            s0("READ_SMS permission not added in application", "DB119");
        }
        if (getIntent().getStringExtra("showProgressDialog") == null) {
            this.W2.a(this.y1, j2.a);
        } else if (getIntent().getStringExtra("showProgressDialog").equalsIgnoreCase("true")) {
            this.W2.a(this.y1, j2.a);
        } else if (!getIntent().getStringExtra("showProgressDialog").equalsIgnoreCase("false")) {
            this.W2.a(this.y1, j2.a);
        }
        ((ConnectivityManager) getSystemService("connectivity")).getNetworkInfo(1);
        int a = b.a(this.y1, "android.permission.READ_PHONE_STATE");
        int a2 = b.a(this.y1, "android.permission.SEND_SMS");
        int a3 = b.a(this.y1, "android.permission.READ_SMS");
        if (a == 0 && a2 == 0 && (!g5.a || a3 == 0)) {
            g5.d(this.y1);
            n0();
        } else {
            androidx.core.app.b.w(this, g5.a ? new String[]{"android.permission.READ_PHONE_STATE", "android.permission.SEND_SMS", "android.permission.READ_SMS"} : new String[]{"android.permission.READ_PHONE_STATE", "android.permission.SEND_SMS"}, this.p2);
        }
    }

    public final void onDestroy() {
        BroadcastReceiver broadcastReceiver = this.E5;
        if (broadcastReceiver != null) {
            this.y1.unregisterReceiver(broadcastReceiver);
            this.E5 = null;
        }
        BroadcastReceiver broadcastReceiver2 = this.D5;
        if (broadcastReceiver2 != null) {
            this.y1.unregisterReceiver(broadcastReceiver2);
            this.D5 = null;
        }
        super.onDestroy();
    }

    public final void onPause() {
        super/*androidx.fragment.app.FragmentActivity*/.onPause();
    }

    public final void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        super/*androidx.fragment.app.FragmentActivity*/.onRequestPermissionsResult(i, strArr, iArr);
        if (i == 1) {
            int i2 = iArr[0];
            int i3 = iArr[1];
            int i4 = g5.a ? iArr[2] : 101;
            if (i2 == -1) {
                s0("READ_PHONE_STATE access denied", "DB017");
            }
            if (i3 == -1) {
                s0("SEND_SMS access denied", "DB018");
            }
            if (i4 == -1) {
                s0("READ_SMS access denied", "DB018");
            }
            if (!g5.a) {
                if (i2 == 0 && i3 == 0) {
                    n0();
                    return;
                }
                return;
            }
            if (i2 == 0 && i3 == 0 && i4 == 0) {
                n0();
            }
        }
    }

    public final void onStop() {
        super.onStop();
        if (this.V2) {
            u0();
        }
    }

    public final void r0(String str) {
        JsonObject jsonObject = new JsonObject();
        JsonObject jsonObject2 = new JsonObject();
        jsonObject.addProperty("deviceId", this.A0);
        jsonObject.addProperty("simId", str);
        jsonObject.addProperty("applicationPackageName", this.I);
        jsonObject.addProperty("deviceOS", this.H);
        jsonObject.addProperty("mobileNumber", getIntent().getStringExtra("mobileNumber"));
        jsonObject.addProperty("serviceName", getIntent().getStringExtra("servicename"));
        jsonObject.addProperty("deactivationReason", "TOGGLING_DETECTED");
        jsonObject.addProperty("udf1", this.x2);
        jsonObject.addProperty("udf2", "");
        jsonObject.addProperty("udf3", "");
        jsonObject.addProperty("udf4", "");
        try {
            byte[] bArr = new byte[16];
            SecureRandom.getInstance("SHA1PRNG").nextBytes(bArr);
            String c = g5.c(jsonObject.toString(), getIntent().getStringExtra("encryptionkey"), bArr);
            if (c.equals("")) {
                s0("Invalid encryption key passed", "DB117");
            } else {
                jsonObject2.addProperty("iv", Base64.encodeToString(bArr, 2));
                jsonObject2.addProperty("key", getIntent().getStringExtra("key"));
                jsonObject2.addProperty("serviceName", getIntent().getStringExtra("servicename"));
                jsonObject2.addProperty("body", c);
                u3.b(this.y1, ((y3) u3.a(this.y1).b(y3.class)).b(jsonObject2, "3.17"), new b1());
            }
        } catch (Exception e) {
            e.getMessage();
        }
    }

    public final void s0(String str, String str2) {
        this.V2 = false;
        O0 o0 = this.W2;
        Dialog dialog = o0.a;
        if (dialog != null) {
            dialog.dismiss();
            o0.a = null;
        }
        Intent intent = new Intent();
        intent.putExtra("status_code", str2);
        intent.putExtra("error_msg", str);
        setResult(0, intent);
        finish();
    }

    public final void t0(String str, String str2, String str3) {
        JsonObject jsonObject = new JsonObject();
        JsonObject jsonObject2 = new JsonObject();
        jsonObject.addProperty("partnerReferenceNumber", getIntent().getStringExtra("PartnerReferenceNumber"));
        jsonObject.addProperty("deviceId", this.A0);
        jsonObject.addProperty("simId", str);
        jsonObject.addProperty("applicationPackageName", this.I);
        jsonObject.addProperty("deviceOS", this.H);
        jsonObject.addProperty("requestedMobileNumber", getIntent().getStringExtra("mobileNumber"));
        jsonObject.addProperty("lat", this.p1 + "");
        jsonObject.addProperty("lon", this.x1 + "");
        jsonObject.addProperty("serviceName", getIntent().getStringExtra("servicename"));
        jsonObject.addProperty("udf1", "");
        jsonObject.addProperty("udf2", "");
        jsonObject.addProperty("udf3", "");
        jsonObject.addProperty("udf4", "");
        jsonObject.addProperty("deviceMake", this.c0);
        jsonObject.addProperty("operatorCode", str3);
        jsonObject.addProperty("operatorName", str2);
        try {
            byte[] bArr = new byte[16];
            SecureRandom.getInstance("SHA1PRNG").nextBytes(bArr);
            String c = g5.c(jsonObject.toString(), getIntent().getStringExtra("encryptionkey"), bArr);
            if (c.equals("")) {
                s0("Invalid encryption key passed", "DB117");
            } else {
                jsonObject2.addProperty("iv", Base64.encodeToString(bArr, 2));
                jsonObject2.addProperty("key", getIntent().getStringExtra("key"));
                jsonObject2.addProperty("serviceName", getIntent().getStringExtra("servicename"));
                jsonObject2.addProperty("body", c);
                u3.b(this.y1, ((y3) u3.a(this.y1).b(y3.class)).c(jsonObject2, "3.17"), new o3(this));
            }
        } catch (Exception e) {
            e.getMessage();
            s0("Unknown Error - " + e.getMessage(), "DB011");
        }
    }

    public final void u0() {
        if (this.x2.equals("")) {
            new Handler(Looper.getMainLooper()).postDelayed(new a4(this), 4000L);
        } else {
            r0(this.C0);
            s0("Unexpected user action detected, device registration terminated", "DB104");
        }
    }
}