package com.dowse.base;

import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;

/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/IRemote.class */
public interface IRemote extends IInterface {
    boolean callFun(int i, int i2, int i3, String str) throws RemoteException;

    String callAIGetRegCode(String str) throws RemoteException;

    boolean callAISetKey(String str, String str2) throws RemoteException;

    String callFromRemote(String str, String str2, String str3) throws RemoteException;

    /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/IRemote$Default.class */
    public static class Default implements IRemote {
        @Override // com.dowse.base.IRemote
        public boolean callFun(int functionId, int channel, int media_type, String call) throws RemoteException {
            return false;
        }

        @Override // com.dowse.base.IRemote
        public String callAIGetRegCode(String call) throws RemoteException {
            return null;
        }

        @Override // com.dowse.base.IRemote
        public boolean callAISetKey(String key, String call) throws RemoteException {
            return false;
        }

        @Override // com.dowse.base.IRemote
        public String callFromRemote(String type, String param, String callFrom) throws RemoteException {
            return null;
        }

        @Override // android.os.IInterface
        public IBinder asBinder() {
            return null;
        }
    }

    /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/IRemote$Stub.class */
    public static abstract class Stub extends Binder implements IRemote {
        private static final String DESCRIPTOR = "com.dowse.base.IRemote";
        static final int TRANSACTION_callFun = 1;
        static final int TRANSACTION_callAIGetRegCode = 2;
        static final int TRANSACTION_callAISetKey = 3;
        static final int TRANSACTION_callFromRemote = 4;

        public Stub() {
            attachInterface(this, DESCRIPTOR);
        }

        public static IRemote asInterface(IBinder obj) {
            if (obj == null) {
                return null;
            }
            IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
            if (iin != null && (iin instanceof IRemote)) {
                return (IRemote) iin;
            }
            return new Proxy(obj);
        }

        @Override // android.os.IInterface
        public IBinder asBinder() {
            return this;
        }

        @Override // android.os.Binder
        public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
            switch (code) {
                case 1:
                    data.enforceInterface(DESCRIPTOR);
                    int _arg0 = data.readInt();
                    int _arg1 = data.readInt();
                    int _arg2 = data.readInt();
                    String _arg3 = data.readString();
                    boolean _result = callFun(_arg0, _arg1, _arg2, _arg3);
                    reply.writeNoException();
                    reply.writeInt(_result ? 1 : 0);
                    return true;
                case 2:
                    data.enforceInterface(DESCRIPTOR);
                    String _arg02 = data.readString();
                    String _result2 = callAIGetRegCode(_arg02);
                    reply.writeNoException();
                    reply.writeString(_result2);
                    return true;
                case 3:
                    data.enforceInterface(DESCRIPTOR);
                    String _arg03 = data.readString();
                    String _arg12 = data.readString();
                    boolean _result3 = callAISetKey(_arg03, _arg12);
                    reply.writeNoException();
                    reply.writeInt(_result3 ? 1 : 0);
                    return true;
                case TRANSACTION_callFromRemote /* 4 */:
                    data.enforceInterface(DESCRIPTOR);
                    String _arg04 = data.readString();
                    String _arg13 = data.readString();
                    String _arg22 = data.readString();
                    String _result4 = callFromRemote(_arg04, _arg13, _arg22);
                    reply.writeNoException();
                    reply.writeString(_result4);
                    return true;
                case 1598968902:
                    reply.writeString(DESCRIPTOR);
                    return true;
                default:
                    return super.onTransact(code, data, reply, flags);
            }
        }

        /* JADX INFO: Access modifiers changed from: private */
        /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/IRemote$Stub$Proxy.class */
        public static class Proxy implements IRemote {
            private IBinder mRemote;
            public static IRemote sDefaultImpl;

            Proxy(IBinder remote) {
                this.mRemote = remote;
            }

            @Override // android.os.IInterface
            public IBinder asBinder() {
                return this.mRemote;
            }

            public String getInterfaceDescriptor() {
                return Stub.DESCRIPTOR;
            }

            @Override // com.dowse.base.IRemote
            public boolean callFun(int functionId, int channel, int media_type, String call) throws RemoteException {
                Parcel _data = Parcel.obtain();
                Parcel _reply = Parcel.obtain();
                try {
                    _data.writeInterfaceToken(Stub.DESCRIPTOR);
                    _data.writeInt(functionId);
                    _data.writeInt(channel);
                    _data.writeInt(media_type);
                    _data.writeString(call);
                    boolean _status = this.mRemote.transact(1, _data, _reply, 0);
                    if (!_status && Stub.getDefaultImpl() != null) {
                        boolean callFun = Stub.getDefaultImpl().callFun(functionId, channel, media_type, call);
                        _reply.recycle();
                        _data.recycle();
                        return callFun;
                    }
                    _reply.readException();
                    boolean _result = 0 != _reply.readInt();
                    return _result;
                } finally {
                    _reply.recycle();
                    _data.recycle();
                }
            }

            @Override // com.dowse.base.IRemote
            public String callAIGetRegCode(String call) throws RemoteException {
                Parcel _data = Parcel.obtain();
                Parcel _reply = Parcel.obtain();
                try {
                    _data.writeInterfaceToken(Stub.DESCRIPTOR);
                    _data.writeString(call);
                    boolean _status = this.mRemote.transact(2, _data, _reply, 0);
                    if (!_status && Stub.getDefaultImpl() != null) {
                        String callAIGetRegCode = Stub.getDefaultImpl().callAIGetRegCode(call);
                        _reply.recycle();
                        _data.recycle();
                        return callAIGetRegCode;
                    }
                    _reply.readException();
                    String _result = _reply.readString();
                    _reply.recycle();
                    _data.recycle();
                    return _result;
                } catch (Throwable th) {
                    _reply.recycle();
                    _data.recycle();
                    throw th;
                }
            }

            @Override // com.dowse.base.IRemote
            public boolean callAISetKey(String key, String call) throws RemoteException {
                Parcel _data = Parcel.obtain();
                Parcel _reply = Parcel.obtain();
                try {
                    _data.writeInterfaceToken(Stub.DESCRIPTOR);
                    _data.writeString(key);
                    _data.writeString(call);
                    boolean _status = this.mRemote.transact(3, _data, _reply, 0);
                    if (!_status && Stub.getDefaultImpl() != null) {
                        boolean callAISetKey = Stub.getDefaultImpl().callAISetKey(key, call);
                        _reply.recycle();
                        _data.recycle();
                        return callAISetKey;
                    }
                    _reply.readException();
                    boolean _result = 0 != _reply.readInt();
                    return _result;
                } finally {
                    _reply.recycle();
                    _data.recycle();
                }
            }

            @Override // com.dowse.base.IRemote
            public String callFromRemote(String type, String param, String callFrom) throws RemoteException {
                Parcel _data = Parcel.obtain();
                Parcel _reply = Parcel.obtain();
                try {
                    _data.writeInterfaceToken(Stub.DESCRIPTOR);
                    _data.writeString(type);
                    _data.writeString(param);
                    _data.writeString(callFrom);
                    boolean _status = this.mRemote.transact(Stub.TRANSACTION_callFromRemote, _data, _reply, 0);
                    if (!_status && Stub.getDefaultImpl() != null) {
                        String callFromRemote = Stub.getDefaultImpl().callFromRemote(type, param, callFrom);
                        _reply.recycle();
                        _data.recycle();
                        return callFromRemote;
                    }
                    _reply.readException();
                    String _result = _reply.readString();
                    _reply.recycle();
                    _data.recycle();
                    return _result;
                } catch (Throwable th) {
                    _reply.recycle();
                    _data.recycle();
                    throw th;
                }
            }
        }

        public static boolean setDefaultImpl(IRemote impl) {
            if (Proxy.sDefaultImpl != null) {
                throw new IllegalStateException("setDefaultImpl() called twice");
            }
            if (impl != null) {
                Proxy.sDefaultImpl = impl;
                return true;
            }
            return false;
        }

        public static IRemote getDefaultImpl() {
            return Proxy.sDefaultImpl;
        }
    }
}
