package epson.common;

import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Environment;


import android.view.KeyEvent;
import android.widget.TextView;
import epson.print.CommonDefine;
import epson.print.Util.EPLog;
import epson.print.widgets.CustomTitleAlertDialogBuilder;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Locale;
import java.util.UUID;

public class Utils {
    private static String TAG = "epson.common.Utils";

    private Utils() {
    }

    public static void savePref(Context context, String str, String str2, int i) {
        SharedPreferences.Editor edit = context.getSharedPreferences(str, 0).edit();
        edit.putInt(str2, i);
        edit.commit();
    }

    public static void savePref(Context context, String str, String str2, String str3) {
        SharedPreferences.Editor edit = context.getSharedPreferences(str, 0).edit();
        edit.putString(str2, str3);
        edit.commit();
    }

    public static void savePref(Context context, String str, String str2, boolean z) {
        SharedPreferences.Editor edit = context.getSharedPreferences(str, 0).edit();
        edit.putBoolean(str2, z);
        edit.commit();
    }

    public static String getPrefString(Context context, String str, String str2) {
        return context.getSharedPreferences(str, 0).getString(str2, "");
    }

    public static int getPrefInt(Context context, String str, String str2) {
        return context.getSharedPreferences(str, 0).getInt(str2, 0);
    }

    public static boolean getPrefBoolean(Context context, String str, String str2) {
        return context.getSharedPreferences(str, 0).getBoolean(str2, false);
    }

    public static Bitmap decodeFile(File file, int i, boolean z) throws FileNotFoundException, OutOfMemoryError, IOException {
        return decodeFile(file, i);
    }

    /* JADX WARNING: Removed duplicated region for block: B:22:0x0041  */
    /* JADX WARNING: Removed duplicated region for block: B:24:0x0046  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public static void copyFile(java.io.File r9, java.io.File r10) throws java.io.IOException {
        /*
            boolean r0 = r10.exists()
            if (r0 != 0) goto L_0x0009
            r10.createNewFile()
        L_0x0009:
            r0 = 0
            java.io.FileInputStream r1 = new java.io.FileInputStream     // Catch:{ all -> 0x003d }
            r1.<init>(r9)     // Catch:{ all -> 0x003d }
            java.nio.channels.FileChannel r9 = r1.getChannel()     // Catch:{ all -> 0x003d }
            java.io.FileOutputStream r1 = new java.io.FileOutputStream     // Catch:{ all -> 0x0037 }
            r1.<init>(r10)     // Catch:{ all -> 0x0037 }
            java.nio.channels.FileChannel r10 = r1.getChannel()     // Catch:{ all -> 0x0037 }
            r4 = 0
            long r6 = r9.size()     // Catch:{ all -> 0x0032 }
            r2 = r10
            r3 = r9
            r2.transferFrom(r3, r4, r6)     // Catch:{ all -> 0x0032 }
            if (r9 == 0) goto L_0x002c
            r9.close()
        L_0x002c:
            if (r10 == 0) goto L_0x0031
            r10.close()
        L_0x0031:
            return
        L_0x0032:
            r0 = move-exception
            r8 = r0
            r0 = r9
            r9 = r8
            goto L_0x003f
        L_0x0037:
            r10 = move-exception
            r8 = r0
            r0 = r9
            r9 = r10
            r10 = r8
            goto L_0x003f
        L_0x003d:
            r9 = move-exception
            r10 = r0
        L_0x003f:
            if (r0 == 0) goto L_0x0044
            r0.close()
        L_0x0044:
            if (r10 == 0) goto L_0x0049
            r10.close()
        L_0x0049:
            throw r9
        */
        throw new UnsupportedOperationException("Method not decompiled: epson.common.Utils.copyFile(java.io.File, java.io.File):void");
    }

    public static Bitmap decodeFile(File file, int i) throws FileNotFoundException, OutOfMemoryError {
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        BitmapFactory.decodeFile(file.getAbsolutePath(), options);
        int max = Math.max((options.outWidth / i) + 1, (options.outHeight / i) + 1);
        if (max < 1) {
            max = 1;
        }
        options.inJustDecodeBounds = false;
        options.inSampleSize = max;
        return BitmapFactory.decodeFile(file.getAbsolutePath(), options);
    }

    public static Bitmap decodeFileByScale(File file, int i) throws FileNotFoundException, OutOfMemoryError {
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inSampleSize = i;
        return BitmapFactory.decodeStream(new FileInputStream(file), (Rect) null, options);
    }

    public static Bitmap decodeFileBySample(File file, BitmapFactory.Options options) throws FileNotFoundException, OutOfMemoryError {
        return BitmapFactory.decodeStream(new FileInputStream(file), (Rect) null, options);
    }

    public static void deleteTempFile(String str) {
        File file = new File(str);
        if (file.exists() && file.isFile()) {
            file.delete();
        }
    }

    public static boolean isOnline(Context context) {
        NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
        return activeNetworkInfo != null && activeNetworkInfo.isConnected();
    }

    public static boolean isConnecting(@NonNull Context context) {
        NetworkInfo activeNetworkInfo;
        ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
        if (connectivityManager == null || (activeNetworkInfo = connectivityManager.getActiveNetworkInfo()) == null) {
            return false;
        }
        return activeNetworkInfo.isConnectedOrConnecting();
    }

    public static boolean isConnectedWifi(Context context) {
        NetworkInfo networkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getNetworkInfo(1);
        if (networkInfo == null || networkInfo.getType() != 1 || !networkInfo.isConnected()) {
            return false;
        }
        return true;
    }

    public static boolean isEnableMobileData(Context context) {
        ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
        NetworkInfo networkInfo = connectivityManager.getNetworkInfo(0);
        boolean isAvailable = networkInfo != null ? networkInfo.isAvailable() : false;
        if (isAvailable) {
            try {
                isAvailable = Boolean.TRUE.equals(connectivityManager.getClass().getMethod("getMobileDataEnabled", new Class[0]).invoke(connectivityManager, new Object[0]));
                String str = TAG;
                EPLog.m313i(str, "getMobileDataEnabled :" + Boolean.valueOf(isAvailable).toString());
            } catch (Exception unused) {
                EPLog.m307e(TAG, "getMobileDataEnabled : Error");
            }
        }
        String str2 = TAG;
        EPLog.m313i(str2, "isEnableMobileData :" + Boolean.valueOf(isAvailable).toString());
        return isAvailable;
    }

    public static String getSSID(Context context) {
        try {
            return ((WifiManager) context.getSystemService(Service.WIFI_SERVICE)).getConnectionInfo().getSSID();
        } catch (SecurityException e) {
            e.printStackTrace();
            return null;
        }
    }

    public static AlertDialog makeMessageBox(Context context, String str, String str2) {
        AlertDialog.Builder makeMassageBoxInternal = makeMassageBoxInternal(context, str2);
        makeMassageBoxInternal.setTitle((CharSequence) null);
        makeMassageBoxInternal.setMessage(str);
        return makeMassageBoxInternal.create();
    }

    public static AlertDialog makeMessageBox(Context context, String str, String str2, String str3) {
        AlertDialog.Builder makeMassageBoxInternal = makeMassageBoxInternal(context, str3);
        makeMassageBoxInternal.setTitle(str);
        makeMassageBoxInternal.setMessage(str2);
        return makeMassageBoxInternal.create();
    }

    private static AlertDialog.Builder makeMassageBoxInternal(Context context, String str) {
        CustomTitleAlertDialogBuilder customTitleAlertDialogBuilder = new CustomTitleAlertDialogBuilder(context);
        customTitleAlertDialogBuilder.setCancelable(false);
        customTitleAlertDialogBuilder.setOnKeyListener(new DialogInterface.OnKeyListener() {
            public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
                return keyEvent.getKeyCode() == 84;
            }
        });
        customTitleAlertDialogBuilder.setPositiveButton(str, new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialogInterface, int i) {
                dialogInterface.dismiss();
            }
        });
        return customTitleAlertDialogBuilder;
    }

    public static CustomTitleAlertDialogBuilder getCustomTitleDialogBuilder(Context context) {
        CustomTitleAlertDialogBuilder customTitleAlertDialogBuilder = new CustomTitleAlertDialogBuilder(context);
        customTitleAlertDialogBuilder.setCancelable(false);
        customTitleAlertDialogBuilder.setOnKeyListener(new DialogInterface.OnKeyListener() {
            public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
                return keyEvent.getKeyCode() == 84;
            }
        });
        return customTitleAlertDialogBuilder;
    }

    public void deleteTempFoler(String str) {
        File file = new File(str);
        File[] listFiles = file.listFiles();
        if (listFiles != null) {
            for (int i = 0; i < listFiles.length; i++) {
                if (listFiles[i].isFile()) {
                    listFiles[i].delete();
                } else if (listFiles[i].isDirectory()) {
                    deleteTempFoler(listFiles[i].toString());
                }
            }
        }
        if (file.exists() && file.isFile()) {
            file.delete();
        }
    }

    public static String getPreffix(String str) {
        if (str == null) {
            return null;
        }
        int lastIndexOf = str.lastIndexOf(CommonDefine.DOT);
        return (lastIndexOf == -1 || lastIndexOf == 0) ? str : str.substring(0, lastIndexOf);
    }

    public static String getSuffix(String str) {
        int lastIndexOf;
        if (str == null || (lastIndexOf = str.lastIndexOf(CommonDefine.DOT)) == -1 || lastIndexOf == 0) {
            return null;
        }
        return str.substring(lastIndexOf + 1);
    }

    @Nullable
    public static String getMimeType(@Nullable String str) {
        if (str == null) {
            return null;
        }
        return getExtType(getExtention(new File(str).getName()));
    }

    public static String getExtention(String str) {
        String suffix = getSuffix(str);
        if (suffix == null) {
            return null;
        }
        return CommonDefine.DOT + suffix;
    }

    public static String getMimeExt(String str) {
        if (str == null) {
            return null;
        }
        switch (MimeType.toMimeType(str)) {
            case PDF_TYPE:
                return CommonDefine.FileType_PDF;
            case DOC_TYPE_1:
                return CommonDefine.FileType_WORD_1;
            case DOCX_TYPE_2:
                return CommonDefine.FileType_WORD_2;
            case EXCEL_TYPE_1:
                return CommonDefine.FileType_EXCEL_1;
            case EXCEL_TYPE_2:
                return CommonDefine.FileType_EXCEL_2;
            case POWERPOINT_TYPE_1:
                return CommonDefine.FileType_POWERPOINT_1;
            case POWERPOINT_TYPE_2:
                return CommonDefine.FileType_POWERPOINT_2;
            case TEXT_TYPE:
                return CommonDefine.FileType_TXT;
            case RTF_TYPE:
                return CommonDefine.FileType_RTF;
            case CSV_TYPE:
                return CommonDefine.FileType_CSV;
            case HTML_TYPE:
                return CommonDefine.FileType_HTML_1;
            case IMAGE_TYPE:
                return ".jpg";
            case IMAGE_TYPE_PNG:
                return ".png";
            case IMAGE_TYPE_BMP:
                return ".bmp";
            case IMAGE_TYPE_HEIF:
                return CommonDefine.FileType_HEIF;
            default:
                char c = 65535;
                if (str.hashCode() == -1004747228 && str.equals(CommonDefine.CSV_TYPE)) {
                    c = 0;
                }
                if (c != 0) {
                    return null;
                }
                return CommonDefine.FileType_CSV;
        }
    }

    public static String getExtType(String str) {
        if (str == null) {
            return null;
        }
        String lowerCase = str.toLowerCase(Locale.ENGLISH);
        switch (ExtType.toExtType(lowerCase)) {
            case FileType_PDF:
                return "application/pdf";
            case FileType_WORD_1:
                return CommonDefine.DOC_TYPE_1;
            case FileType_WORD_2:
                return CommonDefine.DOCX_TYPE_2;
            case FileType_EXCEL_1:
                return CommonDefine.EXCEL_TYPE_1;
            case FileType_EXCEL_2:
                return CommonDefine.EXCEL_TYPE_2;
            case FileType_POWERPOINT_1:
                return CommonDefine.POWERPOINT_TYPE_1;
            case FileType_POWERPOINT_2:
                return CommonDefine.POWERPOINT_TYPE_2;
            case FileType_TXT:
                return CommonDefine.TEXT_TYPE;
            case FileType_RTF:
                return CommonDefine.RTF_TYPE;
            case FileType_CSV:
                return CommonDefine.CSV_TYPE;
            case FileType_HTML_1:
                return CommonDefine.HTML_TYPE;
            case FileType_HTML_2:
                return CommonDefine.HTML_TYPE;
            case FileType_JPG:
            case FileType_JPEG:
                return "image/jpeg";
            case FileType_PNG:
                return "image/png";
            case FileType_BMP:
                return CommonDefine.IMAGE_TYPE_BMP;
            case FileType_HEIF:
                return CommonDefine.IMAGE_TYPE_HEIF;
            default:
                return null;
        }
    }

    public static boolean isGConvertFile(String str) {
        String extention;
        if (str == null || (extention = getExtention(str)) == null) {
            return false;
        }
        String lowerCase = extention.toLowerCase(Locale.ENGLISH);
        switch (ExtType.toExtType(lowerCase)) {
            case FileType_WORD_1:
            case FileType_WORD_2:
            case FileType_EXCEL_1:
            case FileType_EXCEL_2:
            case FileType_POWERPOINT_1:
            case FileType_POWERPOINT_2:
            case FileType_TXT:
            case FileType_RTF:
            case FileType_CSV:
            case FileType_HTML_1:
            case FileType_HTML_2:
                return true;
            default:
                return false;
        }
    }

    public static boolean isPhotoFile(String str) {
        String extention;
        if (str == null || (extention = getExtention(str)) == null || getExtType(extention) == null) {
            return false;
        }
        switch (MimeType.toMimeType(r3)) {
            case IMAGE_TYPE:
            case IMAGE_TYPE_PNG:
            case IMAGE_TYPE_BMP:
                return true;
            case IMAGE_TYPE_HEIF:
                if (Build.VERSION.SDK_INT >= 28) {
                    return true;
                }
                return false;
            default:
                return false;
        }
    }

    public static String makeTempFileName(String str) throws FileNotFoundException {
        String valueOf = String.valueOf(System.currentTimeMillis());
        String mimeExt = getMimeExt(str);
        if (mimeExt != null) {
            return valueOf + mimeExt;
        }
        throw new FileNotFoundException();
    }

    public static boolean isECConvertFile(String str) {
        String extention;
        if (str == null || (extention = getExtention(str)) == null) {
            return false;
        }
        String lowerCase = extention.toLowerCase(Locale.ENGLISH);
        switch (ExtType.toExtType(lowerCase)) {
            case FileType_WORD_1:
            case FileType_WORD_2:
            case FileType_EXCEL_1:
            case FileType_EXCEL_2:
            case FileType_POWERPOINT_1:
            case FileType_POWERPOINT_2:
                return true;
            default:
                return false;
        }
    }

    public static boolean checkMimeType(String str, String str2) {
        return str2 != null && str2.equalsIgnoreCase(getExtType(getExtention(str)));
    }

    public static String getRealMimeType(String str) {
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        BitmapFactory.decodeFile(str, options);
        return options.outMimeType;
    }

    public static String getRemoteOperationUUID(Context context) {
        String prefString = getPrefString(context, CommonDefine.DEVICE_INFO, CommonDefine.REMOTE_OPERATION_UUID);
        if (!"".equals(prefString)) {
            return prefString;
        }
        String str = "urn:uuid:" + UUID.randomUUID().toString();
        savePref(context, CommonDefine.DEVICE_INFO, CommonDefine.REMOTE_OPERATION_UUID, str);
        return str;
    }

    public static boolean isMediaMounted() {
        return "mounted".equals(Environment.getExternalStorageState());
    }

    @TargetApi(11)
    public static void setFInishOnTOuchOutside(Activity activity, boolean z) {
        if (Build.VERSION.SDK_INT >= 11) {
            activity.setFinishOnTouchOutside(z);
        }
    }

    public static void setDrawble2TextView(Context context, TextView textView, int i) {
        Drawable drawable = context.getResources().getDrawable(i);
        int textSize = (int) (textView.getTextSize() * 1.5f);
        drawable.setBounds(0, 0, textSize, textSize);
        textView.setCompoundDrawables(drawable, (Drawable) null, (Drawable) null, (Drawable) null);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:11:0x002e, code lost:
        if (r4 == null) goto L_0x004f;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:14:?, code lost:
        r4.close();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:29:0x004c, code lost:
        if (r4 == null) goto L_0x004f;
     */
    /* JADX WARNING: Removed duplicated region for block: B:27:0x0049 A[SYNTHETIC, Splitter:B:27:0x0049] */
    /* JADX WARNING: Removed duplicated region for block: B:36:0x0057 A[SYNTHETIC, Splitter:B:36:0x0057] */
    /* JADX WARNING: Removed duplicated region for block: B:40:0x005c A[SYNTHETIC, Splitter:B:40:0x005c] */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public static java.lang.String getAssetsFileContents(android.content.Context r4, java.lang.String r5) {
        /*
            java.lang.StringBuffer r0 = new java.lang.StringBuffer
            r0.<init>()
            r1 = 255(0xff, float:3.57E-43)
            byte[] r1 = new byte[r1]
            r1 = 0
            android.content.res.AssetManager r4 = r4.getAssets()     // Catch:{ IOException -> 0x0041, all -> 0x003e }
            java.io.InputStream r4 = r4.open(r5)     // Catch:{ IOException -> 0x0041, all -> 0x003e }
            java.io.BufferedReader r5 = new java.io.BufferedReader     // Catch:{ IOException -> 0x003c }
            java.io.InputStreamReader r2 = new java.io.InputStreamReader     // Catch:{ IOException -> 0x003c }
            r2.<init>(r4)     // Catch:{ IOException -> 0x003c }
            r5.<init>(r2)     // Catch:{ IOException -> 0x003c }
        L_0x001c:
            java.lang.String r1 = r5.readLine()     // Catch:{ IOException -> 0x0037, all -> 0x0034 }
            if (r1 == 0) goto L_0x002b
            r0.append(r1)     // Catch:{ IOException -> 0x0037, all -> 0x0034 }
            java.lang.String r1 = "\n"
            r0.append(r1)     // Catch:{ IOException -> 0x0037, all -> 0x0034 }
            goto L_0x001c
        L_0x002b:
            r5.close()     // Catch:{ IOException -> 0x002e }
        L_0x002e:
            if (r4 == 0) goto L_0x004f
        L_0x0030:
            r4.close()     // Catch:{ IOException -> 0x004f }
            goto L_0x004f
        L_0x0034:
            r0 = move-exception
            r1 = r5
            goto L_0x0055
        L_0x0037:
            r1 = move-exception
            r3 = r1
            r1 = r5
            r5 = r3
            goto L_0x0044
        L_0x003c:
            r5 = move-exception
            goto L_0x0044
        L_0x003e:
            r0 = move-exception
            r4 = r1
            goto L_0x0055
        L_0x0041:
            r4 = move-exception
            r5 = r4
            r4 = r1
        L_0x0044:
            r5.printStackTrace()     // Catch:{ all -> 0x0054 }
            if (r1 == 0) goto L_0x004c
            r1.close()     // Catch:{ IOException -> 0x004c }
        L_0x004c:
            if (r4 == 0) goto L_0x004f
            goto L_0x0030
        L_0x004f:
            java.lang.String r4 = r0.toString()
            return r4
        L_0x0054:
            r0 = move-exception
        L_0x0055:
            if (r1 == 0) goto L_0x005a
            r1.close()     // Catch:{ IOException -> 0x005a }
        L_0x005a:
            if (r4 == 0) goto L_0x005f
            r4.close()     // Catch:{ IOException -> 0x005f }
        L_0x005f:
            throw r0
        */
        throw new UnsupportedOperationException("Method not decompiled: epson.common.Utils.getAssetsFileContents(android.content.Context, java.lang.String):java.lang.String");
    }

    /* JADX WARNING: Removed duplicated region for block: B:19:0x00fc  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public static java.lang.String[] replaceMessage(java.lang.Integer[] r5, int r6, android.content.Context r7) {
        /*
            java.lang.StringBuilder r0 = new java.lang.StringBuilder
            r0.<init>()
            java.lang.String r1 = " currentError = "
            r0.append(r1)
            r0.append(r6)
            java.lang.String r0 = r0.toString()
            com.epson.mobilephone.common.EpLog.m69d(r0)
            r0 = 3
            java.lang.Integer[] r0 = new java.lang.Integer[r0]
            r1 = 0
            r2 = r5[r1]
            r0[r1] = r2
            r2 = 1
            r3 = r5[r2]
            r0[r2] = r3
            r3 = 2
            r5 = r5[r3]
            r0[r3] = r5
            r5 = -11005(0xffffffffffffd503, float:NaN)
            if (r6 == r5) goto L_0x00c7
            r5 = 59
            if (r6 == r5) goto L_0x005b
            switch(r6) {
                case 6: goto L_0x0047;
                case 7: goto L_0x0033;
                default: goto L_0x0031;
            }
        L_0x0031:
            goto L_0x00d9
        L_0x0033:
            r5 = 2131624436(0x7f0e01f4, float:1.8876052E38)
            java.lang.Integer r5 = java.lang.Integer.valueOf(r5)
            r0[r2] = r5
            r5 = 2131624435(0x7f0e01f3, float:1.887605E38)
            java.lang.Integer r5 = java.lang.Integer.valueOf(r5)
            r0[r1] = r5
            goto L_0x00d9
        L_0x0047:
            r5 = 2131624398(0x7f0e01ce, float:1.8875975E38)
            java.lang.Integer r5 = java.lang.Integer.valueOf(r5)
            r0[r2] = r5
            r5 = 2131624397(0x7f0e01cd, float:1.8875973E38)
            java.lang.Integer r5 = java.lang.Integer.valueOf(r5)
            r0[r1] = r5
            goto L_0x00d9
        L_0x005b:
            com.epson.mobilephone.common.escpr.EscprLib r5 = com.epson.mobilephone.common.escpr.EscprLib.getInstance()
            com.epson.mobilephone.common.escpr.EPS_REDYINKINFO r6 = new com.epson.mobilephone.common.escpr.EPS_REDYINKINFO
            r6.<init>()
            int r5 = r5.epsGetReadyPrintStatus(r6)
            r4 = 2131625264(0x7f0e0530, float:1.8877731E38)
            java.lang.Integer r4 = java.lang.Integer.valueOf(r4)
            r0[r2] = r4
            r4 = 2131625265(0x7f0e0531, float:1.8877733E38)
            java.lang.Integer r4 = java.lang.Integer.valueOf(r4)
            r0[r1] = r4
            if (r5 != 0) goto L_0x00c4
            int r5 = r6.subscriptionError
            switch(r5) {
                case 1: goto L_0x00b1;
                case 2: goto L_0x009e;
                default: goto L_0x0081;
            }
        L_0x0081:
            java.lang.StringBuilder r5 = new java.lang.StringBuilder
            r5.<init>()
            java.lang.String r4 = " code = "
            r5.append(r4)
            int r4 = r6.subscriptionErrorCode
            r5.append(r4)
            java.lang.String r5 = r5.toString()
            com.epson.mobilephone.common.EpLog.m77i(r5)
            int r5 = r6.subscriptionErrorCode
            java.lang.String r5 = java.lang.String.valueOf(r5)
            goto L_0x00da
        L_0x009e:
            r5 = 2131625262(0x7f0e052e, float:1.8877727E38)
            java.lang.Integer r5 = java.lang.Integer.valueOf(r5)
            r0[r2] = r5
            r5 = 2131625263(0x7f0e052f, float:1.887773E38)
            java.lang.Integer r5 = java.lang.Integer.valueOf(r5)
            r0[r1] = r5
            goto L_0x00d9
        L_0x00b1:
            r5 = 2131625260(0x7f0e052c, float:1.8877723E38)
            java.lang.Integer r5 = java.lang.Integer.valueOf(r5)
            r0[r2] = r5
            r5 = 2131625261(0x7f0e052d, float:1.8877725E38)
            java.lang.Integer r5 = java.lang.Integer.valueOf(r5)
            r0[r1] = r5
            goto L_0x00d9
        L_0x00c4:
            java.lang.String r5 = "unknown"
            goto L_0x00da
        L_0x00c7:
            r5 = 2131624364(0x7f0e01ac, float:1.8875906E38)
            java.lang.Integer r5 = java.lang.Integer.valueOf(r5)
            r0[r2] = r5
            r5 = 2131624367(0x7f0e01af, float:1.8875912E38)
            java.lang.Integer r5 = java.lang.Integer.valueOf(r5)
            r0[r1] = r5
        L_0x00d9:
            r5 = 0
        L_0x00da:
            java.lang.String[] r6 = new java.lang.String[r3]
            r3 = r0[r1]
            int r3 = r3.intValue()
            java.lang.String r3 = r7.getString(r3)
            r6[r1] = r3
            java.lang.StringBuilder r1 = new java.lang.StringBuilder
            r1.<init>()
            r0 = r0[r2]
            int r0 = r0.intValue()
            java.lang.String r7 = r7.getString(r0)
            r1.append(r7)
            if (r5 != 0) goto L_0x00fe
            java.lang.String r5 = ""
        L_0x00fe:
            r1.append(r5)
            java.lang.String r5 = r1.toString()
            r6[r2] = r5
            return r6
        */
        throw new UnsupportedOperationException("Method not decompiled: epson.common.Utils.replaceMessage(java.lang.Integer[], int, android.content.Context):java.lang.String[]");
    }
}
