package com.benq.platform.test;

import android.annotation.SuppressLint;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.IBinder;
import android.util.Log;

/* JADX INFO: loaded from: classes.dex */
public final class TestService extends Service {
    private static final String ACTION_INVOKE_API = "com.benq.platform.action.INVOKE_API";
    public static final Companion Companion = new Companion(null);
    private final TestService$mTestReceiver$1 mTestReceiver = new BroadcastReceiver() { // from class: com.benq.platform.test.TestService$mTestReceiver$1
        @Override // android.content.BroadcastReceiver
        @SuppressLint({"WrongConstant"})
        public void onReceive(Context context, Intent intent) {
            kotlin.jvm.internal.l.e(context, "context");
            kotlin.jvm.internal.l.e(intent, "intent");
            Y0.c.h("BenQIFPSys", "onReceive:" + intent.getAction());
            if (kotlin.jvm.internal.l.a(intent.getAction(), "com.benq.platform.action.INVOKE_API")) {
                this.this$0.invokeApi(context, intent);
            }
        }
    };

    public static final class Companion {
        public /* synthetic */ Companion(kotlin.jvm.internal.g gVar) {
            this();
        }

        private Companion() {
        }
    }

    private final Object convertStringToObject(String str, Class<?> cls) {
        return ParameterConverter.INSTANCE.convertStringToObject(str, cls);
    }

    /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
    private final Class<?> getPrimitiveClass(String str) throws ClassNotFoundException {
        switch (str.hashCode()) {
            case -1325958191:
                if (str.equals("double")) {
                    return Double.TYPE;
                }
                break;
            case 104431:
                if (str.equals("int")) {
                    return Integer.TYPE;
                }
                break;
            case 3327612:
                if (str.equals("long")) {
                    return Long.TYPE;
                }
                break;
            case 64711720:
                if (str.equals("boolean")) {
                    return Boolean.TYPE;
                }
                break;
            case 97526364:
                if (str.equals("float")) {
                    return Float.TYPE;
                }
                break;
            case 1195259493:
                if (str.equals("java.lang.String")) {
                    return String.class;
                }
                break;
        }
        Class<?> cls = Class.forName(str);
        kotlin.jvm.internal.l.d(cls, "forName(...)");
        return cls;
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Removed duplicated region for block: B:30:0x00c1 A[Catch: Exception -> 0x00b4, TryCatch #0 {Exception -> 0x00b4, blocks: (B:23:0x009b, B:25:0x00a5, B:28:0x00b7, B:31:0x00c3, B:33:0x00d9, B:35:0x00df, B:36:0x00f0, B:38:0x00f6, B:39:0x0113, B:42:0x011d, B:41:0x011b, B:30:0x00c1), top: B:48:0x009b }] */
    /* JADX WARN: Removed duplicated region for block: B:41:0x011b A[Catch: Exception -> 0x00b4, TryCatch #0 {Exception -> 0x00b4, blocks: (B:23:0x009b, B:25:0x00a5, B:28:0x00b7, B:31:0x00c3, B:33:0x00d9, B:35:0x00df, B:36:0x00f0, B:38:0x00f6, B:39:0x0113, B:42:0x011d, B:41:0x011b, B:30:0x00c1), top: B:48:0x009b }] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void invokeApi(android.content.Context r14, android.content.Intent r15) {
        /*
            Method dump skipped, instruction units count: 362
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: com.benq.platform.test.TestService.invokeApi(android.content.Context, android.content.Intent):void");
    }

    @Override // android.app.Service
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override // android.app.Service
    public void onCreate() {
        super.onCreate();
        if (com.seewo.vcommons.data.d.j()) {
            IntentFilter intentFilter = new IntentFilter(ACTION_INVOKE_API);
            if (Build.VERSION.SDK_INT >= 33) {
                com.seewo.hiddenapi.c.b(this, this.mTestReceiver, com.seewo.hiddenapi.g.f3341a, intentFilter, null, null, 2);
            } else {
                com.seewo.hiddenapi.c.a(this, this.mTestReceiver, com.seewo.hiddenapi.g.f3341a, intentFilter, null, null);
            }
            Log.d("BenQIFPSys", "TestService onCreate");
        }
    }

    @Override // android.app.Service
    public void onDestroy() {
        super.onDestroy();
        if (com.seewo.vcommons.data.d.j()) {
            try {
                unregisterReceiver(this.mTestReceiver);
            } catch (Exception unused) {
            }
            Log.d("BenQIFPSys", "TestService onDestroy");
        }
    }
}
