com.sec.phone | What is com sec phone | How to fix

In this article, we will learn about com.sec.phone. Now the first question arise that what is com.sec.phone? We have seen many forum as well as community to know about this app. Finally, gossipfunda decided to collect all the data, and decided to write an article on it. We have found some eoor related to this app. So, how to fix com.sec.phone has stopped? Is it a virus or you get hacked. Let’s dive into deep.

What is com.sec.phone?

com sec phone” is a package name of system app already provided by the distributor. It’s a pre install app which can be easily seen by us. You can find it in the Samsung doc list. This package consists of some classes:

  • BootCompleteReceiver
  • C0000R
  • Manifest
  • RILConstants
  • SecPhoneService

Is com sec phone a virus?

No, this is not a virus, nor you get hacked by this app.

Don’t Miss: com.sec.epdg

How to uninstall com sec phone

Because its an inbuilt app, so it is not possible to remove the app from the phone. You can use rooting methods to uninstall or remove this app.

Package com->sec->phone

The app used the following class

1. BootCompleteReceiver Class

package com.sec.phone;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.SystemProperties;
import android.telephony.Rlog;

public class BootCompleteReceiver extends BroadcastReceiver {
    public static final String ACTION_CUSTOMER_TEST_RESPONSE = "com.samsung.intent.action.CUSTOMER_TEST_RESPONSE";
    public static final String ACTION_SENIOR_BOOT_COMPLETED = "android.intent.action.BOOT_COMPLETED";
    public static final String ACTION_SENIOR_FORCE_SLEEP = "com.samsung.intent.action.FORCE_SLEEP";
    private static final String TAG = "SecPhoneBootCompleteReceiver";

    public static boolean hasSecrilDaemon(int index) {
        String daemonName;
        if (index == 1) {
            daemonName = "init.svc.ril-daemon";
        } else {
            daemonName = "init.svc.ril-daemon" + index;
        }
        if ("running".equals(SystemProperties.get(daemonName, "stopped").toLowerCase())) {
            return true;
        }
        return false;
    }

    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if (action == null) {
            Rlog.d(TAG, "onReceive : intent is null");
        } else if (ACTION_SENIOR_BOOT_COMPLETED.equals(action)) {
            Rlog.d(TAG, "onReceive(): android.intent.action.BOOT_COMPLETED");
            if (hasSecrilDaemon(2)) {
                Rlog.d(TAG, "init.svc.ril-daemon2 running start SecPhoneService2");
                context.startService(new Intent(context, SecPhoneService2.class));
            }
            Rlog.d(TAG, "Starting RilInitTracker service");
            context.startService(new Intent(context, RilTracker.class));
        } else if (ACTION_SENIOR_FORCE_SLEEP.equals(action)) {
            context.startService(new Intent(context, SecPhoneService.class).putExtra("MODE", "FORCE_SLEEP"));
        } else if (ACTION_CUSTOMER_TEST_RESPONSE.equals(action)) {
            String command = intent.getStringExtra("command");
            String result = intent.getStringExtra("result");
            String bypassMode = intent.getStringExtra("mode");
            Rlog.d(TAG, "CUSTOMER_TEST_REQUEST 2: command : " + command + ", result : " + result + ", bypassMode : " + bypassMode);
            if ("bypass_ap_cp".equals(bypassMode)) {
                Rlog.d(TAG, "Not sending request to cp");
            } else {
                context.startService(new Intent(context, SecPhoneService.class).putExtra("MODE", "CUSTOMER_TEST_RESULT").putExtra("command", intent.getStringExtra("command")).putExtra("result", intent.getStringExtra("result")));
            }
        }
    }
}

2. SecPhoneService

package com.sec.phone;

import android.app.Service;
import android.content.Intent;
import android.net.LocalSocket;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.Messenger;
import android.os.Parcel;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.telephony.Rlog;
import android.util.Log;
import com.android.internal.telephony.ITelephony;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class SecPhoneService extends Service {
    static final int ACQUIRE_WAKE_LOCK_TIMEOUT = 150000;
    static final int ANTENNA_TYPE_DUAL = 3;
    static final int ANTENNA_TYPE_PRIMARY = 1;
    static final int ANTENNA_TYPE_SECONDARY = 2;
    static final int EVENT_SEND = 1;
    static final int EVENT_WAKE_LOCK_TIMEOUT = 2;
    static final int OEM_FUNCTION_ID_MISC = 17;
    static final int OEM_FUNCTION_ID_SDM_IMS_SETTINGS = 34;
    static final int OEM_MISC_GET_ANTENNA_TEST = 6;
    static final int OEM_MISC_SET_ANTENNA_TEST = 7;
    static final int OEM_SDM_IMS_GET_SETTINGS = 1;
    static final int OEM_SDM_IMS_SET_SETTINGS = 2;
    static final int OEM_SYSDUMP_FUNCTAG = 7;
    static final int OEM_TCPDUMP_START = 21;
    static final int OEM_TCPDUMP_STOP = 22;
    static final int RESPONSE_SOLICITED = 0;
    static final int RESPONSE_UNSOLICITED = 1;
    static final int RIL_MAX_COMMAND_BYTES = 8192;
    static final int SOCKET_OPEN_RETRY_MILLIS = 4000;
    static final int WAKE_LOCK_TIMEOUT = 120000;
    public String LOG_TAG;
    public String RilSocketName;
    private final boolean SHIP_BUILD;
    private final Handler mHandler;
    private final Messenger mMessenger;
    ArrayList<Message> mQueuingMsg;
    RILReceiver mReceiver;
    Thread mReceiverThread;
    Map<String, Message> mRegisteredSender;
    int mRequestMessagesPending;
    ArrayList<RILRequest> mRequestsList;
    RILSender mSender;
    HandlerThread mSenderThread;
    LocalSocket mSocket;
    boolean mSupportUnsolicitedMsg;
    PowerManager.WakeLock mWakeLock;
    public SecPhoneService sInstance;

    public SecPhoneService() {
        this.LOG_TAG = "RILS";
        this.sInstance = null;
        this.RilSocketName = "Multiclient";
        this.mSocket = new LocalSocket();
        this.mSupportUnsolicitedMsg = false;
        this.mRequestsList = new ArrayList<>();
        this.mQueuingMsg = new ArrayList<>();
        this.SHIP_BUILD = SystemProperties.getBoolean("ro.product_ship", false);
        this.mRegisteredSender = new HashMap();
        this.mHandler = new Handler() {
            public void handleMessage(Message msg) {
                String str = SecPhoneService.this.LOG_TAG;
                Rlog.d(str, "handleMessage(): " + msg);
                Message reply = Message.obtain();
                reply.copyFrom(msg);
                if (SecPhoneService.this.mSocket == null) {
                    Rlog.e(SecPhoneService.this.LOG_TAG, "socket connection is broken");
                } else if (!SecPhoneService.this.mSocket.isConnected()) {
                    String str2 = SecPhoneService.this.LOG_TAG;
                    Rlog.d(str2, "Queuing Message : " + msg);
                    SecPhoneService.this.mQueuingMsg.add(reply);
                } else {
                    String action = msg.getData().getString("Action");
                    if (action != null) {
                        String str3 = SecPhoneService.this.LOG_TAG;
                        Rlog.i(str3, "Messenger Name : " + action);
                        if (SecPhoneService.this.mRegisteredSender.get(action) == null) {
                            SecPhoneService.this.mRegisteredSender.put(action, reply);
                            return;
                        }
                        Rlog.i(SecPhoneService.this.LOG_TAG, "action is already exist. data will be updated");
                        SecPhoneService.this.mRegisteredSender.remove(action);
                        SecPhoneService.this.mRegisteredSender.put(action, reply);
                        return;
                    }
                    SecPhoneService.this.invokeOemRilRequestRaw(reply);
                }
            }
        };
        this.mMessenger = new Messenger(this.mHandler);
        this.sInstance = this;
    }

    /* access modifiers changed from: private */
    public void SendQueuingMsg() {
        if (this.mQueuingMsg.size() > 0) {
            for (int i = 0; i < this.mQueuingMsg.size(); i++) {
                String str = this.LOG_TAG;
                Rlog.e(str, "SendQueuingMsg : " + i);
                Message queuingMsg = this.mQueuingMsg.get(i);
                if (queuingMsg.replyTo != null) {
                    String action = queuingMsg.getData().getString("Action");
                    if (action != null) {
                        String str2 = this.LOG_TAG;
                        Rlog.i(str2, "Messenger Name : " + action);
                        if (this.mRegisteredSender.get(action) == null) {
                            this.mRegisteredSender.put(action, queuingMsg);
                        } else {
                            Rlog.i(this.LOG_TAG, "action is already exist. data will be updated");
                            this.mRegisteredSender.remove(action);
                            this.mRegisteredSender.put(action, queuingMsg);
                        }
                    } else {
                        invokeOemRilRequestRaw(queuingMsg);
                    }
                } else {
                    RILRequest rr = RILRequest.obtain(59, (Message) null);
                    Bundle req = queuingMsg.getData();
                    rr.f0mp.writeByteArray(req.getByteArray("request"));
                    send(rr);
                    String str3 = this.LOG_TAG;
                    Log.d(str3, rr.serialString() + "> " + requestToString(rr.mRequest) + "[" + bytesToHexString(req.getByteArray("request")) + "]");
                }
            }
        }
        this.mQueuingMsg.clear();
    }

    public void onCreate() {
        this.mWakeLock = ((PowerManager) getSystemService("power")).newWakeLock(1, this.LOG_TAG);
        this.mWakeLock.setReferenceCounted(false);
        this.mRequestMessagesPending = 0;
        checkSupportUnsolicitedMsg();
        this.mSenderThread = new HandlerThread("RILSender");
        this.mSenderThread.start();
        this.mSender = new RILSender(this.mSenderThread.getLooper());
        this.mReceiver = new RILReceiver();
        this.mReceiverThread = new Thread(this.mReceiver, "RILReceiver");
        this.mReceiverThread.start();
    }

    private void checkSupportUnsolicitedMsg() {
        if (BootCompleteReceiver.hasSecrilDaemon(1)) {
            Rlog.d(this.LOG_TAG, "support Unsolicited message");
            this.mSupportUnsolicitedMsg = true;
        }
    }

    private boolean isSupportUnsolicitedMsg() {
        return this.mSupportUnsolicitedMsg;
    }

    public IBinder onBind(Intent intent) {
        Rlog.i(this.LOG_TAG, "onBind()");
        return this.mMessenger.getBinder();
    }

    public int onStartCommand(Intent intent, int flags, int startId) {
        Rlog.i(this.LOG_TAG, "onStartCommand()");
        if (intent == null) {
            return 2;
        }
        String mode = intent.getStringExtra("MODE");
        if ("FORCE_SLEEP".equals(mode)) {
            Rlog.i(this.LOG_TAG, "FORCE_SLEEP mode");
            this.mRequestMessagesPending = 0;
            synchronized (this.mRequestsList) {
                this.mRequestsList.clear();
            }
            releaseWakeLockIfDone();
            return 2;
        } else if (!"CUSTOMER_TEST_RESULT".equals(mode)) {
            return 2;
        } else {
            Rlog.i(this.LOG_TAG, "CUSTOMER_TEST_RESULT");
            SendCustomerTestResult(intent);
            return 2;
        }
    }

    public void SendCustomerTestResult(Intent intent) {
        String result = intent.getStringExtra("result");
        String str = this.LOG_TAG;
        Rlog.d(str, "result : " + result);
        if (result != null) {
            RILRequest rr = RILRequest.obtain(59, (Message) null);
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            DataOutputStream dos = new DataOutputStream(bos);
            try {
                dos.writeByte(17);
                dos.writeByte(97);
                dos.writeShort(result.length() + 4 + 1);
                dos.writeBytes(result);
                dos.writeByte(0);
                byte[] data = bos.toByteArray();
                LocalSocket localSocket = this.mSocket;
                if (localSocket == null || localSocket.isConnected()) {
                    rr.f0mp.writeByteArray(data);
                    send(rr);
                    String str2 = this.LOG_TAG;
                    Log.d(str2, rr.serialString() + "> " + requestToString(rr.mRequest) + "[" + bytesToHexString(data) + "]");
                    return;
                }
                Message msg = Message.obtain();
                Bundle req = msg.getData();
                req.putByteArray("request", data);
                msg.setData(req);
                this.mQueuingMsg.add(msg);
            } catch (IOException e) {
                Rlog.e(this.LOG_TAG, "IOException in CP_BYPASS!!!");
            }
        }
    }

    public void onDestroy() {
        Rlog.e(this.LOG_TAG, "onDestroy start");
        this.mSenderThread.quit();
        this.mReceiverThread.interrupt();
        try {
            if (this.mSocket != null) {
                this.mSocket.shutdownInput();
            } else {
                Rlog.e(this.LOG_TAG, "socket connection is broken");
            }
        } catch (IOException ex) {
            Rlog.e(this.LOG_TAG, "Uncaught exception during shutdownInput", ex);
        }
        releaseWakeLock();
        super.onDestroy();
        Rlog.e(this.LOG_TAG, "onDestroy finish");
    }

    class RILSender extends Handler implements Runnable {
        byte[] dataLength = new byte[4];

        public RILSender(Looper looper) {
            super(looper);
        }

        public void run() {
        }

        /* Debug info: failed to restart local var, previous not found, register: 11 */
        public void handleMessage(Message msg) {
            RILRequest rr = (RILRequest) msg.obj;
            int i = msg.what;
            if (i == 1) {
                boolean alreadySubtracted = false;
                try {
                    LocalSocket s = SecPhoneService.this.mSocket;
                    if (s == null) {
                        rr.onError(1, (Object) null);
                        rr.release();
                        if (SecPhoneService.this.mRequestMessagesPending > 0) {
                            SecPhoneService.this.mRequestMessagesPending--;
                        }
                        return;
                    }
                    synchronized (SecPhoneService.this.mRequestsList) {
                        SecPhoneService.this.mRequestsList.add(rr);
                    }
                    if (SecPhoneService.this.mRequestMessagesPending > 0) {
                        SecPhoneService.this.mRequestMessagesPending--;
                    }
                    alreadySubtracted = true;
                    byte[] data = rr.f0mp.marshall();
                    rr.f0mp.recycle();
                    rr.f0mp = null;
                    if (data.length <= SecPhoneService.RIL_MAX_COMMAND_BYTES) {
                        byte[] bArr = this.dataLength;
                        this.dataLength[1] = 0;
                        bArr[0] = 0;
                        this.dataLength[2] = (byte) ((data.length >> 8) & 255);
                        this.dataLength[3] = (byte) (data.length & 255);
                        s.getOutputStream().write(this.dataLength);
                        s.getOutputStream().write(data);
                        if (!alreadySubtracted && SecPhoneService.this.mRequestMessagesPending > 0) {
                            SecPhoneService.this.mRequestMessagesPending--;
                            return;
                        }
                        return;
                    }
                    throw new RuntimeException("Parcel larger than max bytes allowed! " + data.length);
                } catch (IOException ex) {
                    Rlog.e(SecPhoneService.this.LOG_TAG, "IOException ", ex);
                    if (SecPhoneService.this.findAndRemoveRequestFromList(rr.mSerial) != null || 0 == 0) {
                        rr.onError(1, (Object) null);
                        rr.release();
                    }
                } catch (RuntimeException exc) {
                    Rlog.e(SecPhoneService.this.LOG_TAG, "Uncaught exception ", exc);
                    if (SecPhoneService.this.findAndRemoveRequestFromList(rr.mSerial) != null || 0 == 0) {
                        rr.onError(2, (Object) null);
                        rr.release();
                    }
                }
            } else if (i == 2) {
                synchronized (SecPhoneService.this.mWakeLock) {
                    if (SecPhoneService.this.mWakeLock.isHeld()) {
                        synchronized (SecPhoneService.this.mRequestsList) {
                            int count = SecPhoneService.this.mRequestsList.size();
                            Rlog.d(SecPhoneService.this.LOG_TAG, "WAKE_LOCK_TIMEOUT  mReqPending=" + SecPhoneService.this.mRequestMessagesPending + " mRequestList=" + count);
                            for (int i2 = 0; i2 < count; i2++) {
                                RILRequest rr2 = SecPhoneService.this.mRequestsList.get(i2);
                                Rlog.d(SecPhoneService.this.LOG_TAG, i2 + ": [" + rr2.mSerial + "] " + SecPhoneService.requestToString(rr2.mRequest));
                            }
                        }
                        SecPhoneService.this.mWakeLock.release();
                    }
                }
            } else {
                throw new RuntimeException("Unrecognized event: " + msg.what);
            }
        }
    }

    /* access modifiers changed from: private */
    public static int readRilMessage(String LOG_TAG2, InputStream is, byte[] buffer) throws IOException {
        int offset = 0;
        int remaining = 4;
        do {
            int countRead = is.read(buffer, offset, remaining);
            if (countRead < 0) {
                Rlog.e(LOG_TAG2, "Hit EOS reading message length");
                return -1;
            }
            offset += countRead;
            remaining -= countRead;
        } while (remaining > 0);
        int messageLength = ((buffer[0] & 255) << 24) | ((buffer[1] & 255) << 16) | ((buffer[2] & 255) << 8) | (buffer[3] & 255);
        int offset2 = 0;
        int remaining2 = messageLength;
        do {
            int countRead2 = is.read(buffer, offset2, remaining2);
            if (countRead2 < 0) {
                Rlog.e(LOG_TAG2, "Hit EOS reading message.  messageLength=" + messageLength + " remaining=" + remaining2);
                return -1;
            }
            offset2 += countRead2;
            remaining2 -= countRead2;
        } while (remaining2 > 0);
        return messageLength;
    }

    class RILReceiver implements Runnable {
        byte[] buffer = new byte[SecPhoneService.RIL_MAX_COMMAND_BYTES];

        RILReceiver() {
        }

        public void WaitForSecRilReady() {
            String version;
            int retryCount = 40;
            while (retryCount > 0) {
                if ("wifi-only".equals(SystemProperties.get("ro.carrier", ""))) {
                    version = SystemProperties.get("ril.ldu", "NONE");
                    Rlog.i(SecPhoneService.this.LOG_TAG, "ril.ldu : " + version);
                } else {
                    version = SystemProperties.get("ril.sw_ver", "NONE");
                    Rlog.i(SecPhoneService.this.LOG_TAG, "swVer : " + version);
                }
                if ("NONE".equals(version)) {
                    try {
                        Thread.sleep(500);
                    } catch (InterruptedException e) {
                        Rlog.e(SecPhoneService.this.LOG_TAG, "Thread interrupted...start to exit - " + SecPhoneService.this.RilSocketName + ", TID: " + SecPhoneService.this.mReceiverThread.getId());
                    }
                    retryCount--;
                } else {
                    retryCount = 0;
                }
            }
            Rlog.i(SecPhoneService.this.LOG_TAG, "Secril is ready");
        }

        /* Debug info: failed to restart local var, previous not found, register: 9 */
        /* JADX WARNING: Code restructure failed: missing block: B:56:?, code lost:
            r4 = r9.this$0.LOG_TAG;
            android.telephony.Rlog.e(r4, "Thread interrupted...start to exit - " + r9.this$0.RilSocketName + ", TID: " + r9.this$0.mReceiverThread.getId());
         */
        /* JADX WARNING: Code restructure failed: missing block: B:59:0x01fb, code lost:
            r1 = move-exception;
         */
        /* JADX WARNING: Code restructure failed: missing block: B:60:0x01fc, code lost:
            android.telephony.Rlog.e(r9.this$0.LOG_TAG, "Uncaught exception ", r1);
         */
        /* JADX WARNING: Code restructure failed: missing block: B:69:?, code lost:
            return;
         */
        /* JADX WARNING: Code restructure failed: missing block: B:71:?, code lost:
            return;
         */
        /* JADX WARNING: Failed to process nested try/catch */
        /* JADX WARNING: Removed duplicated region for block: B:59:0x01fb A[ExcHandler: all (r1v1 'tr' java.lang.Throwable A[CUSTOM_DECLARE]), Splitter:B:1:0x0001] */
        /* Code decompiled incorrectly, please refer to instructions dump. */
        public void run() {
            /*
                r9 = this;
                r0 = 0
            L_0x0001:
                boolean r1 = java.lang.Thread.interrupted()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                if (r1 != 0) goto L_0x01c9
                r9.WaitForSecRilReady()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r1 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r1 = r1.LOG_TAG     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.StringBuilder r2 = new java.lang.StringBuilder     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r2.<init>()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r3 = "start connect to '"
                r2.append(r3)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r3 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r3 = r3.RilSocketName     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r2.append(r3)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r3 = "' socket, TID: "
                r2.append(r3)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r3 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.Thread r3 = r3.mReceiverThread     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                long r3 = r3.getId()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r2.append(r3)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r2 = r2.toString()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                android.telephony.Rlog.i(r1, r2)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                android.net.LocalSocketAddress r1 = new android.net.LocalSocketAddress     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r2 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r2 = r2.RilSocketName     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r1.<init>(r2)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r2 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                android.net.LocalSocket r2 = r2.mSocket     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                if (r2 != 0) goto L_0x004e
                com.sec.phone.SecPhoneService r2 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                android.net.LocalSocket r3 = new android.net.LocalSocket     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r3.<init>()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r2.mSocket = r3     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
            L_0x004e:
                com.sec.phone.SecPhoneService r2 = com.sec.phone.SecPhoneService.this     // Catch:{ IOException -> 0x0136 }
                android.net.LocalSocket r2 = r2.mSocket     // Catch:{ IOException -> 0x0136 }
                r2.connect(r1)     // Catch:{ IOException -> 0x0136 }
                r0 = 0
                com.sec.phone.SecPhoneService r2 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r2.SendQueuingMsg()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r2 = 0
                com.sec.phone.SecPhoneService r3 = com.sec.phone.SecPhoneService.this     // Catch:{ IOException -> 0x00b0, all -> 0x008a }
                android.net.LocalSocket r3 = r3.mSocket     // Catch:{ IOException -> 0x00b0, all -> 0x008a }
                java.io.InputStream r3 = r3.getInputStream()     // Catch:{ IOException -> 0x00b0, all -> 0x008a }
            L_0x0065:
                com.sec.phone.SecPhoneService r4 = com.sec.phone.SecPhoneService.this     // Catch:{ IOException -> 0x00b0, all -> 0x008a }
                java.lang.String r4 = r4.LOG_TAG     // Catch:{ IOException -> 0x00b0, all -> 0x008a }
                byte[] r5 = r9.buffer     // Catch:{ IOException -> 0x00b0, all -> 0x008a }
                int r4 = com.sec.phone.SecPhoneService.readRilMessage(r4, r3, r5)     // Catch:{ IOException -> 0x00b0, all -> 0x008a }
                r2 = r4
                if (r2 >= 0) goto L_0x0074
                goto L_0x00d3
            L_0x0074:
                android.os.Parcel r4 = android.os.Parcel.obtain()     // Catch:{ IOException -> 0x00b0, all -> 0x008a }
                byte[] r5 = r9.buffer     // Catch:{ IOException -> 0x00b0, all -> 0x008a }
                r6 = 0
                r4.unmarshall(r5, r6, r2)     // Catch:{ IOException -> 0x00b0, all -> 0x008a }
                r4.setDataPosition(r6)     // Catch:{ IOException -> 0x00b0, all -> 0x008a }
                com.sec.phone.SecPhoneService r5 = com.sec.phone.SecPhoneService.this     // Catch:{ IOException -> 0x00b0, all -> 0x008a }
                r5.processResponse(r4)     // Catch:{ IOException -> 0x00b0, all -> 0x008a }
                r4.recycle()     // Catch:{ IOException -> 0x00b0, all -> 0x008a }
                goto L_0x0065
            L_0x008a:
                r3 = move-exception
                com.sec.phone.SecPhoneService r4 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r4 = r4.LOG_TAG     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.StringBuilder r5 = new java.lang.StringBuilder     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r5.<init>()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r6 = "Uncaught exception read length="
                r5.append(r6)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r5.append(r2)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r6 = ", Exception:"
                r5.append(r6)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r6 = r3.toString()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r5.append(r6)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r5 = r5.toString()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                android.telephony.Rlog.e(r4, r5, r3)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                goto L_0x00d3
            L_0x00b0:
                r3 = move-exception
                com.sec.phone.SecPhoneService r4 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r4 = r4.LOG_TAG     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.StringBuilder r5 = new java.lang.StringBuilder     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r5.<init>()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r6 = "'"
                r5.append(r6)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r6 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r6 = r6.RilSocketName     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r5.append(r6)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r6 = "' socket closed, "
                r5.append(r6)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r5 = r5.toString()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                android.telephony.Rlog.e(r4, r5, r3)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
            L_0x00d3:
                com.sec.phone.SecPhoneService r3 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r3 = r3.LOG_TAG     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.StringBuilder r4 = new java.lang.StringBuilder     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r4.<init>()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r5 = "Disconnected from '"
                r4.append(r5)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r5 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r5 = r5.RilSocketName     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r4.append(r5)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r5 = "' socket"
                r4.append(r5)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r4 = r4.toString()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                android.telephony.Rlog.i(r3, r4)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r3 = com.sec.phone.SecPhoneService.this     // Catch:{ IOException -> 0x00fc }
                android.net.LocalSocket r3 = r3.mSocket     // Catch:{ IOException -> 0x00fc }
                r3.close()     // Catch:{ IOException -> 0x00fc }
                goto L_0x00fd
            L_0x00fc:
                r3 = move-exception
            L_0x00fd:
                com.sec.phone.SecPhoneService r3 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r4 = 0
                r3.mSocket = r4     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.RILRequest.resetSerial()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r3 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.util.ArrayList<com.sec.phone.RILRequest> r3 = r3.mRequestsList     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                monitor-enter(r3)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r5 = 0
                com.sec.phone.SecPhoneService r6 = com.sec.phone.SecPhoneService.this     // Catch:{ all -> 0x0133 }
                java.util.ArrayList<com.sec.phone.RILRequest> r6 = r6.mRequestsList     // Catch:{ all -> 0x0133 }
                int r6 = r6.size()     // Catch:{ all -> 0x0133 }
            L_0x0113:
                if (r5 >= r6) goto L_0x0129
                com.sec.phone.SecPhoneService r7 = com.sec.phone.SecPhoneService.this     // Catch:{ all -> 0x0133 }
                java.util.ArrayList<com.sec.phone.RILRequest> r7 = r7.mRequestsList     // Catch:{ all -> 0x0133 }
                java.lang.Object r7 = r7.get(r5)     // Catch:{ all -> 0x0133 }
                com.sec.phone.RILRequest r7 = (com.sec.phone.RILRequest) r7     // Catch:{ all -> 0x0133 }
                r8 = 1
                r7.onError(r8, r4)     // Catch:{ all -> 0x0133 }
                r7.release()     // Catch:{ all -> 0x0133 }
                int r5 = r5 + 1
                goto L_0x0113
            L_0x0129:
                com.sec.phone.SecPhoneService r4 = com.sec.phone.SecPhoneService.this     // Catch:{ all -> 0x0133 }
                java.util.ArrayList<com.sec.phone.RILRequest> r4 = r4.mRequestsList     // Catch:{ all -> 0x0133 }
                r4.clear()     // Catch:{ all -> 0x0133 }
                monitor-exit(r3)     // Catch:{ all -> 0x0133 }
                goto L_0x0001
            L_0x0133:
                r4 = move-exception
                monitor-exit(r3)     // Catch:{ all -> 0x0133 }
                throw r4     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
            L_0x0136:
                r2 = move-exception
                com.sec.phone.SecPhoneService r3 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                android.net.LocalSocket r3 = r3.mSocket     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r3.isConnected()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r3 = 8
                if (r0 != r3) goto L_0x016c
                com.sec.phone.SecPhoneService r3 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r3 = r3.LOG_TAG     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.StringBuilder r4 = new java.lang.StringBuilder     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r4.<init>()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r5 = "Couldn't find '"
                r4.append(r5)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r5 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r5 = r5.RilSocketName     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r4.append(r5)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r5 = "' socket after "
                r4.append(r5)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r4.append(r0)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r5 = " times, continuing to retry silently"
                r4.append(r5)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r4 = r4.toString()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                android.telephony.Rlog.e(r3, r4)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                goto L_0x0191
            L_0x016c:
                if (r0 <= 0) goto L_0x0191
                if (r0 >= r3) goto L_0x0191
                com.sec.phone.SecPhoneService r3 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r3 = r3.LOG_TAG     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.StringBuilder r4 = new java.lang.StringBuilder     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r4.<init>()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r5 = "Couldn't find '"
                r4.append(r5)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r5 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r5 = r5.RilSocketName     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r4.append(r5)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r5 = "' socket; retrying after timeout"
                r4.append(r5)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r4 = r4.toString()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                android.telephony.Rlog.i(r3, r4)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
            L_0x0191:
                r3 = 4000(0xfa0, double:1.9763E-320)
                java.lang.Thread.sleep(r3)     // Catch:{ InterruptedException -> 0x019b, all -> 0x01fb }
                int r0 = r0 + 1
                goto L_0x0001
            L_0x019b:
                r3 = move-exception
                com.sec.phone.SecPhoneService r4 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r4 = r4.LOG_TAG     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.StringBuilder r5 = new java.lang.StringBuilder     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r5.<init>()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r6 = "Thread interrupted...start to exit - "
                r5.append(r6)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r6 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r6 = r6.RilSocketName     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r5.append(r6)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r6 = ", TID: "
                r5.append(r6)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r6 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.Thread r6 = r6.mReceiverThread     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                long r6 = r6.getId()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r5.append(r6)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r5 = r5.toString()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                android.telephony.Rlog.e(r4, r5)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                goto L_0x0210
            L_0x01c9:
                com.sec.phone.SecPhoneService r1 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r1 = r1.LOG_TAG     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.StringBuilder r2 = new java.lang.StringBuilder     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r2.<init>()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r3 = "Thread interrupted...start to exit - "
                r2.append(r3)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r3 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r3 = r3.RilSocketName     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r2.append(r3)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r3 = ", TID: "
                r2.append(r3)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                com.sec.phone.SecPhoneService r3 = com.sec.phone.SecPhoneService.this     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.Thread r3 = r3.mReceiverThread     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                long r3 = r3.getId()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r2.append(r3)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.String r2 = r2.toString()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                android.telephony.Rlog.e(r1, r2)     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                java.lang.InterruptedException r1 = new java.lang.InterruptedException     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                r1.<init>()     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
                throw r1     // Catch:{ InterruptedException -> 0x0206, all -> 0x01fb }
            L_0x01fb:
                r1 = move-exception
                com.sec.phone.SecPhoneService r2 = com.sec.phone.SecPhoneService.this
                java.lang.String r2 = r2.LOG_TAG
                java.lang.String r3 = "Uncaught exception "
                android.telephony.Rlog.e(r2, r3, r1)
                goto L_0x0211
            L_0x0206:
                r1 = move-exception
                com.sec.phone.SecPhoneService r2 = com.sec.phone.SecPhoneService.this
                java.lang.String r2 = r2.LOG_TAG
                java.lang.String r3 = "Thread is terminated by InterruptedException"
                android.telephony.Rlog.e(r2, r3)
            L_0x0210:
            L_0x0211:
                return
            */
            throw new UnsupportedOperationException("Method not decompiled: com.sec.phone.SecPhoneService.RILReceiver.run():void");
        }
    }

    private ITelephony getTelephonyService() {
        ITelephony telephonyService = ITelephony.Stub.asInterface(ServiceManager.checkService("phone"));
        if (telephonyService == null) {
            Rlog.w(this.LOG_TAG, "Unable to find ITelephony interface.");
        }
        return telephonyService;
    }

    private Method routeDataToITelephony(byte[] data) {
        if (data == null || data.length < 4) {
            return null;
        }
        try {
            ITelephony phoneServ = getTelephonyService();
            if (phoneServ == null) {
                return null;
            }
            Method oemHookMethod = phoneServ.getClass().getDeclaredMethod("sendOemRilRequestRaw", new Class[]{byte[].class, byte[].class});
            byte b = data[0];
            if (b == 6 || b == 7) {
                return null;
            }
            if (b != 17) {
                if (b != 34) {
                    return null;
                }
                if (data[1] == 1 || data[1] == 2) {
                    return oemHookMethod;
                }
                return null;
            } else if (data[1] == 6 || data[1] == 7) {
                return oemHookMethod;
            } else {
                return null;
            }
        } catch (NoSuchMethodException e) {
            return null;
        }
    }

    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r9v0, resolved type: java.lang.Object[]} */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public void invokeOemRilRequestRaw(android.os.Message r11) {
        /*
            r10 = this;
            java.lang.String r0 = "error"
            android.os.Bundle r1 = r11.getData()
            java.lang.String r2 = "request"
            byte[] r1 = r1.getByteArray(r2)
            java.lang.reflect.Method r2 = r10.routeDataToITelephony(r1)
            r3 = 1
            r4 = 0
            if (r2 != 0) goto L_0x006e
            r0 = 59
            com.sec.phone.RILRequest r0 = com.sec.phone.RILRequest.obtain(r0, r11)
            java.lang.String r5 = r10.LOG_TAG
            java.lang.StringBuilder r6 = new java.lang.StringBuilder
            r6.<init>()
            java.lang.String r7 = r0.serialString()
            r6.append(r7)
            java.lang.String r7 = "> "
            r6.append(r7)
            int r7 = r0.mRequest
            java.lang.String r7 = requestToString(r7)
            r6.append(r7)
            java.lang.String r7 = "["
            r6.append(r7)
            java.lang.String r7 = bytesToHexString(r1)
            r6.append(r7)
            java.lang.String r7 = "]"
            r6.append(r7)
            java.lang.String r6 = r6.toString()
            android.telephony.Rlog.d(r5, r6)
            java.lang.String r5 = "ril.dumpstate"
            boolean r4 = android.os.SystemProperties.getBoolean(r5, r4)
            if (r4 == 0) goto L_0x0065
            java.lang.String r5 = r10.LOG_TAG
            java.lang.String r6 = "Can not process Ril Request during CP dump"
            android.telephony.Rlog.e(r5, r6)
            r5 = 0
            r0.onError(r3, r5)
            r0.release()
            goto L_0x006d
        L_0x0065:
            android.os.Parcel r3 = r0.f0mp
            r3.writeByteArray(r1)
            r10.send(r0)
        L_0x006d:
            goto L_0x00c3
        L_0x006e:
            r5 = 200(0xc8, float:2.8E-43)
            byte[] r5 = new byte[r5]
            android.os.Message r6 = android.os.Message.obtain()
            r6.copyFrom(r11)
            r7 = 2
            com.android.internal.telephony.ITelephony r8 = r10.getTelephonyService()     // Catch:{ IllegalAccessException -> 0x00b3, InvocationTargetException -> 0x00aa }
            java.lang.Object[] r9 = new java.lang.Object[r7]     // Catch:{ IllegalAccessException -> 0x00b3, InvocationTargetException -> 0x00aa }
            r9[r4] = r1     // Catch:{ IllegalAccessException -> 0x00b3, InvocationTargetException -> 0x00aa }
            r9[r3] = r5     // Catch:{ IllegalAccessException -> 0x00b3, InvocationTargetException -> 0x00aa }
            java.lang.Object r3 = r2.invoke(r8, r9)     // Catch:{ IllegalAccessException -> 0x00b3, InvocationTargetException -> 0x00aa }
            java.lang.Integer r3 = (java.lang.Integer) r3     // Catch:{ IllegalAccessException -> 0x00b3, InvocationTargetException -> 0x00aa }
            int r3 = r3.intValue()     // Catch:{ IllegalAccessException -> 0x00b3, InvocationTargetException -> 0x00aa }
            android.os.Bundle r8 = r6.getData()     // Catch:{ IllegalAccessException -> 0x00b3, InvocationTargetException -> 0x00aa }
            if (r3 < 0) goto L_0x0096
            r9 = r4
            goto L_0x0097
        L_0x0096:
            r9 = r3
        L_0x0097:
            r8.putInt(r0, r9)     // Catch:{ IllegalAccessException -> 0x00b3, InvocationTargetException -> 0x00aa }
            if (r3 <= 0) goto L_0x00bb
            android.os.Bundle r8 = r6.getData()     // Catch:{ IllegalAccessException -> 0x00b3, InvocationTargetException -> 0x00aa }
            java.lang.String r9 = "response"
            byte[] r4 = java.util.Arrays.copyOfRange(r5, r4, r3)     // Catch:{ IllegalAccessException -> 0x00b3, InvocationTargetException -> 0x00aa }
            r8.putByteArray(r9, r4)     // Catch:{ IllegalAccessException -> 0x00b3, InvocationTargetException -> 0x00aa }
            goto L_0x00bb
        L_0x00aa:
            r3 = move-exception
            android.os.Bundle r4 = r6.getData()
            r4.putInt(r0, r7)
            goto L_0x00bc
        L_0x00b3:
            r3 = move-exception
            android.os.Bundle r4 = r6.getData()
            r4.putInt(r0, r7)
        L_0x00bb:
        L_0x00bc:
            android.os.Messenger r0 = r11.replyTo     // Catch:{ RemoteException -> 0x00c2 }
            r0.send(r6)     // Catch:{ RemoteException -> 0x00c2 }
            goto L_0x00c3
        L_0x00c2:
            r0 = move-exception
        L_0x00c3:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.sec.phone.SecPhoneService.invokeOemRilRequestRaw(android.os.Message):void");
    }

    static String requestToString(int request) {
        if (request == 59) {
            return "OEM_HOOK_RAW";
        }
        if (request == 60) {
            return "OEM_HOOK_STRINGS";
        }
        if (request == 10013) {
            return "USIM_PB_CAPA";
        }
        if (request == 10014) {
            return "LOCK_INFO";
        }
        switch (request) {
            case RILConstants.RIL_REQUEST_GET_PHONEBOOK_STORAGE_INFO:
                return "GET_PHONEBOOK_STORAGE_INFO";
            case RILConstants.RIL_REQUEST_GET_PHONEBOOK_ENTRY:
                return "GET_PHONEBOOK_ENTRY";
            case RILConstants.RIL_REQUEST_ACCESS_PHONEBOOK_ENTRY:
                return "ACCESS_PHONEBOOK_ENTRY";
            default:
                return "<unknown request>";
        }
    }

    static String responseToString(int request) {
        if (request == 1028) {
            return "UNSOL_OEM_HOOK_RAW";
        }
        if (request == 11000) {
            return "RIL_UNSOL_RESPONSE_NEW_CB_MSG";
        }
        if (request != 11008) {
            return "<unknown reponse>";
        }
        return "UNSOL_DEVICE_READY_NOTI";
    }

    private void acquireWakeLock() {
        synchronized (this.mWakeLock) {
            this.mWakeLock.acquire(150000);
            this.mRequestMessagesPending++;
            this.mSender.removeMessages(2);
            this.mSender.sendMessageDelayed(this.mSender.obtainMessage(2), 120000);
        }
    }

    /* Debug info: failed to restart local var, previous not found, register: 4 */
    private void releaseWakeLockIfDone() {
        synchronized (this.mWakeLock) {
            if (this.mWakeLock.isHeld()) {
                synchronized (this.mRequestsList) {
                    if (this.mRequestMessagesPending == 0 && this.mRequestsList.size() == 0) {
                        this.mSender.removeMessages(2);
                        this.mWakeLock.release();
                    }
                }
            }
        }
    }

    private void releaseWakeLock() {
        synchronized (this.mWakeLock) {
            this.mRequestMessagesPending = 0;
            this.mWakeLock.release();
        }
    }

    private void send(RILRequest rr) {
        Message msg = this.mSender.obtainMessage(1, rr);
        acquireWakeLock();
        msg.sendToTarget();
    }

    /* access modifiers changed from: private */
    public void processResponse(Parcel p) {
        int type = p.readInt();
        if (type == 1 && isSupportUnsolicitedMsg()) {
            processUnsolicited(p);
        } else if (type == 0) {
            processSolicited(p);
        }
        releaseWakeLockIfDone();
    }

    /* access modifiers changed from: private */
    public RILRequest findAndRemoveRequestFromList(int serial) {
        synchronized (this.mRequestsList) {
            int s = this.mRequestsList.size();
            for (int i = 0; i < s; i++) {
                RILRequest rr = this.mRequestsList.get(i);
                if (rr.mSerial == serial) {
                    this.mRequestsList.remove(i);
                    return rr;
                }
            }
            return null;
        }
    }

    /* Debug info: failed to restart local var, previous not found, register: 10 */
    private void processSolicited(Parcel p) {
        int serial = p.readInt();
        int error = p.readInt();
        RILRequest rr = findAndRemoveRequestFromList(serial);
        if (rr == null) {
            String str = this.LOG_TAG;
            Rlog.w(str, "Unexpected solicited response! sn: " + serial + " error: " + error);
            return;
        }
        String str2 = this.LOG_TAG;
        Rlog.d(str2, "processSolicited(): mResult - " + rr.mResult);
        Message reply = Message.obtain();
        if (rr.mResult != null) {
            reply.copyFrom(rr.mResult);
        }
        String str3 = this.LOG_TAG;
        Rlog.d(str3, "processSolicited(): reply - " + reply);
        if (error == 0 || p.dataAvail() > 0) {
            try {
                if (rr.mRequest == 59) {
                    responseRaw(p, reply);
                } else {
                    throw new RuntimeException("Unrecognized solicited response: " + rr.mRequest);
                }
            } catch (Throwable tr) {
                String str4 = this.LOG_TAG;
                Rlog.w(str4, rr.serialString() + "< " + requestToString(rr.mRequest) + " exception, possible invalid RIL response", tr);
                rr.onError(-1, (Object) null);
                rr.release();
                return;
            }
        }
        if (error != 0) {
            rr.onError(error, (Object) null);
            rr.release();
            return;
        }
        String str5 = this.LOG_TAG;
        Rlog.d(str5, rr.serialString() + "< " + requestToString(rr.mRequest) + " " + retToString(rr.mRequest, reply));
        if (rr.mResult != null) {
            try {
                rr.mResult.replyTo.send(reply);
            } catch (RemoteException e) {
            }
        }
        rr.release();
    }

    private String retToString(int req, Object ret) {
        if (ret == null || req == 11 || req == 38 || req == 39) {
            return "";
        }
        if (ret instanceof int[]) {
            int[] intArray = (int[]) ret;
            int length = intArray.length;
            StringBuilder sb = new StringBuilder("{");
            if (length > 0) {
                sb.append(intArray[0]);
                for (int i = 0 + 1; i < length; i++) {
                    sb.append(", ");
                    sb.append(intArray[i]);
                }
            }
            sb.append("}");
            return sb.toString();
        } else if (!(ret instanceof String[])) {
            return ret.toString();
        } else {
            String[] strings = (String[]) ret;
            int length2 = strings.length;
            StringBuilder sb2 = new StringBuilder("{");
            if (length2 > 0) {
                sb2.append(strings[0]);
                for (int i2 = 0 + 1; i2 < length2; i2++) {
                    sb2.append(", ");
                    sb2.append(strings[i2]);
                }
            }
            sb2.append("}");
            return sb2.toString();
        }
    }

    /* Debug info: failed to restart local var, previous not found, register: 8 */
    private void processUnsolicited(Parcel p) {
        int response = p.readInt();
        String str = this.LOG_TAG;
        Rlog.d(str, "processUnsolicited : " + response);
        switch (response) {
            case RILConstants.RIL_UNSOL_RMTUIM_NEED_APDU:
            case RILConstants.RIL_UNSOL_RMTUIM_CONNECT:
            case RILConstants.RIL_UNSOL_RMTUIM_DISCONNECT:
            case RILConstants.RIL_UNSOL_RMTUIM_CARD_POWER_UP:
            case RILConstants.RIL_UNSOL_RMTUIM_CARD_POWER_DOWN:
            case RILConstants.RIL_UNSOL_RMTUIM_CARD_RESET:
                break;
            case RILConstants.RIL_UNSOL_OEM_RSSI_DATA_NOTI:
                if (this.SHIP_BUILD) {
                    Rlog.d(this.LOG_TAG, "RSSI_DATA is not for this model");
                    return;
                }
                break;
            default:
                try {
                    throw new RuntimeException("Unrecognized unsol response: " + response);
                } catch (Throwable th) {
                    return;
                }
        }
        switch (response) {
            case RILConstants.RIL_UNSOL_RMTUIM_NEED_APDU:
            case RILConstants.RIL_UNSOL_RMTUIM_CONNECT:
            case RILConstants.RIL_UNSOL_RMTUIM_DISCONNECT:
            case RILConstants.RIL_UNSOL_RMTUIM_CARD_POWER_UP:
            case RILConstants.RIL_UNSOL_RMTUIM_CARD_POWER_DOWN:
            case RILConstants.RIL_UNSOL_RMTUIM_CARD_RESET:
                String str2 = this.LOG_TAG;
                Rlog.d(str2, "processUnsolicited RMTUIM : " + response);
                Message registeredMessenger = getRmtuimRegistrant(response);
                if (registeredMessenger == null) {
                    Rlog.d(this.LOG_TAG, "processUnsolicited RMTUIM why null");
                    return;
                }
                Message reply = registeredMessenger;
                responseRaw(p, reply);
                try {
                    registeredMessenger.replyTo.send(reply);
                    return;
                } catch (RemoteException e) {
                    String str3 = this.LOG_TAG;
                    Rlog.d(str3, "Exception Unsol RMTUIM id :" + response);
                    return;
                }
            case RILConstants.RIL_UNSOL_OEM_RSSI_DATA_NOTI:
                String str4 = this.LOG_TAG;
                Rlog.d(str4, "processUnsolicited RSSI: " + response);
                Map<String, Message> map = this.mRegisteredSender;
                if (map == null) {
                    Rlog.d(this.LOG_TAG, "RegisteredSender is null");
                    return;
                }
                Message registeredMessenger2 = map.get("RSSI_DATA");
                if (registeredMessenger2 == null) {
                    Rlog.d(this.LOG_TAG, "RSSI action is not registered");
                    return;
                }
                Message reply2 = registeredMessenger2;
                responseRaw(p, reply2);
                try {
                    registeredMessenger2.replyTo.send(reply2);
                    return;
                } catch (RemoteException e2) {
                    String str5 = this.LOG_TAG;
                    Rlog.d(str5, "Exception Unsol RSSI Data: " + response);
                    return;
                }
            default:
                return;
        }
    }

    private Message getRmtuimRegistrant(int id) {
        Map<String, Message> map = this.mRegisteredSender;
        if (map == null) {
            return null;
        }
        switch (id) {
            case RILConstants.RIL_UNSOL_RMTUIM_NEED_APDU:
                return map.get("RMTUIM_REQUEST_APDU");
            case RILConstants.RIL_UNSOL_RMTUIM_CONNECT:
                return map.get("RMTUIM_CONNECT");
            case RILConstants.RIL_UNSOL_RMTUIM_DISCONNECT:
                return map.get("RMTUIM_DISCONNECT");
            case RILConstants.RIL_UNSOL_RMTUIM_CARD_POWER_UP:
                return map.get("RMTUIM_CARD_POWER_UP");
            case RILConstants.RIL_UNSOL_RMTUIM_CARD_POWER_DOWN:
                return map.get("RMTUIM_CARD_POWER_DOWN");
            case RILConstants.RIL_UNSOL_RMTUIM_CARD_RESET:
                return map.get("RMTUIM_CARD_RESET");
            default:
                return null;
        }
    }

    public String GetActionFromRilResponse(String[] Args) {
        for (int i = 0; i < Args.length; i++) {
            if ("-a".equals(Args[i])) {
                return Args[i + 1];
            }
        }
        return "";
    }

    private void responseRaw(Parcel p, Message reply) {
        reply.getData().putByteArray("response", p.createByteArray());
    }

    private Object responseString(Parcel p) {
        return p.readString();
    }

    public static String bytesToHexString(byte[] bytes) {
        if (bytes == null) {
            return null;
        }
        StringBuilder ret = new StringBuilder(bytes.length * 2);
        for (int i = 0; i < bytes.length; i++) {
            ret.append("0123456789abcdef".charAt((bytes[i] >> 4) & 15));
            ret.append("0123456789abcdef".charAt(bytes[i] & 15));
        }
        return ret.toString();
    }
}

How to fix com.sec.phone

If you find any error in com.sec.phone or it get stopped then follow the steps:

  1. Open setting-> Apps-> Show system App->com.sec.phone
com.sec.phone
com.sec.phone
  1. Next click on Storage
How to fix com.sec.phone
  1. Tap on clear cache then, clear data
clear cache and data
  1. Recheck the app, if not fixed then click on force stop.
force stop com.sec.phone
  1. Restart the app, your error of com.sec.phone has stopped will fixed.

Conclusion

In conclusion, we can say that com sec phone is a package name, inbuilt in your android phone. It is not a virus. And we can not uninstall it. All the required code is provided by us. What thought you have about this post, you feed back will help us to improve. If you find this post resourceful, then please share and comment.